Vb.Net How to create form skin
Bagaimana membuat form terlihat cantik seperti ini ? dengan cara membuat sendiri form skin untuk program yang kita buat yang akan mempercantik aplikasi yang kita buat dengan VB.NET.
Kita mulai yuk...
Wednesday, July 1, 2015
Friday, June 19, 2015
How can I get Payroll results when I run the Payroll in Simulation mode
SAP - How can I get Payroll results when I run the Payroll in Simulation mode
Follow this link -> http://scn.sap.com/thread/1830478 but it's for Canada Payroll
i'v modified for indonesia payroll below.
1. Include in main program
Follow this link -> http://scn.sap.com/thread/1830478 but it's for Canada Payroll
i'v modified for indonesia payroll below.
1. Include in main program
Monday, June 15, 2015
VB.NET - Datagridview image and text in one cell
VB.NET - Datagridview image and text in one cell
How to icon or image in one cell datagridview ?
Step 1 : Create Column "Change"
'Set Column name
Datagridview1.Columns.Add("qsymbol", "Symbol")
Datagridview1.Columns.Add("qdate", "Date")
Datagridview1.Columns.Add("qopen", "Open")
Datagridview1.Columns.Add("qhigh", "High")
Datagridview1.Columns.Add("qlow", "Low")
Datagridview1.Columns.Add("qclose", "Close")
Datagridview1.Columns.Add("qvolume", "Volume")
How to icon or image in one cell datagridview ?
Step 1 : Create Column "Change"
'Set Column name
Datagridview1.Columns.Add("qsymbol", "Symbol")
Datagridview1.Columns.Add("qdate", "Date")
Datagridview1.Columns.Add("qopen", "Open")
Datagridview1.Columns.Add("qhigh", "High")
Datagridview1.Columns.Add("qlow", "Low")
Datagridview1.Columns.Add("qclose", "Close")
Datagridview1.Columns.Add("qvolume", "Volume")
ABAP - Function to Upload Huge/Big Excel file Using alsm_excel_to_internal_table
ABAP - Function to Upload Huge/Big Excel file Using alsm_excel_to_internal_table
reference link : *
* source http://zevolving.com/2013/04/abap-upload-excel-file-using-alsm_excel_to_internal_table/
* http://scn.sap.com/thread/1436772
Step: 1 - Declare Internal Table ( See zuplbpjs_top. )
REPORT zuplbpjs MESSAGE-ID zhrmsg.
INCLUDE zuplbpjs_top. "Data Declaration
INCLUDE zuplbpjs_sel. "Selection Screen
INCLUDE zuplbpjs_xls. "Upload Excel Functions
INCLUDE zuplbpjs_alv. "Alv Functions
INCLUDE zuplbpjs_msg. "Show Message Function
INCLUDE zuplbpjs_f01. "Process Functions
INCLUDE zuplbpjs_main. "Main Include
reference link : *
* source http://zevolving.com/2013/04/abap-upload-excel-file-using-alsm_excel_to_internal_table/
* http://scn.sap.com/thread/1436772
Step: 1 - Declare Internal Table ( See zuplbpjs_top. )
REPORT zuplbpjs MESSAGE-ID zhrmsg.
INCLUDE zuplbpjs_top. "Data Declaration
INCLUDE zuplbpjs_sel. "Selection Screen
INCLUDE zuplbpjs_xls. "Upload Excel Functions
INCLUDE zuplbpjs_alv. "Alv Functions
INCLUDE zuplbpjs_msg. "Show Message Function
INCLUDE zuplbpjs_f01. "Process Functions
INCLUDE zuplbpjs_main. "Main Include
ABAP - Function ALV with Dynamic Catalog Fields Internal Table
ABAP - Function ALV with Dynamic Catalog Fields Internal Table
------------------------------------------------------------------------
This code is to view internal table in ALV with dynamic internal table fields.
Step 1 : Create Main program
REPORT zuplbpjs MESSAGE-ID zhrmsg.
INCLUDE zuplbpjs_top. "Data Declaration
INCLUDE zuplbpjs_sel. "Selection Screen
INCLUDE zuplbpjs_xls. "Upload Excel Functions
INCLUDE zuplbpjs_alv. "Alv Functions
INCLUDE zuplbpjs_msg. "Show Message Function
INCLUDE zuplbpjs_f01. "Process Functions
INCLUDE zuplbpjs_main. "Main Include
------------------------------------------------------------------------
This code is to view internal table in ALV with dynamic internal table fields.
Step 1 : Create Main program
REPORT zuplbpjs MESSAGE-ID zhrmsg.
INCLUDE zuplbpjs_top. "Data Declaration
INCLUDE zuplbpjs_sel. "Selection Screen
INCLUDE zuplbpjs_xls. "Upload Excel Functions
INCLUDE zuplbpjs_alv. "Alv Functions
INCLUDE zuplbpjs_msg. "Show Message Function
INCLUDE zuplbpjs_f01. "Process Functions
INCLUDE zuplbpjs_main. "Main Include
ABAP - Sample Program Function to Download Data to Excel
ABAP - Sample Program Function to Download Data to Excel
Step 1 : Create Report program
INCLUDE zhrictr_top. "Data Declaration
INCLUDE zhrictr_sel. "Selection Screen
INCLUDE zhrictr_f01. "Common Fuction Include
INCLUDE zhrictr_f02. "Report Function Include
INCLUDE zhrictr_alv. "Display ALV Functions Include
INCLUDE zhrictr_xls. "Download XLS Functions Include
INCLUDE zhrictr_mai. "Main Include
Step 3 : Create Include zhrictr_top
*----------------------------------------------------------------------*
* INCLUDE ZHRICTR_TOP *
*----------------------------------------------------------------------*
Step 1 : Create Report program
INCLUDE zhrictr_top. "Data Declaration
INCLUDE zhrictr_sel. "Selection Screen
INCLUDE zhrictr_f01. "Common Fuction Include
INCLUDE zhrictr_f02. "Report Function Include
INCLUDE zhrictr_alv. "Display ALV Functions Include
INCLUDE zhrictr_xls. "Download XLS Functions Include
INCLUDE zhrictr_mai. "Main Include
Step 3 : Create Include zhrictr_top
*----------------------------------------------------------------------*
* INCLUDE ZHRICTR_TOP *
*----------------------------------------------------------------------*
ABAP - My Common Function SAP HR
ABAP - My Common Function SAP HR
Step 1 : Put in Main program as Include
REPORT zhrictr MESSAGE-ID zhrmsg.
INCLUDE zhrictr_top. "Data Declaration
INCLUDE zhrictr_sel. "Selection Screen
INCLUDE zhrictr_f01. "Common Fuction Include
INCLUDE zhrictr_f02. "Report Function Include
INCLUDE zhrictr_alv. "Display ALV Functions Include
INCLUDE zhrictr_xls. "Download XLS Functions Include
INCLUDE zhrictr_mai. "Main Include
Step 1 : Put in Main program as Include
REPORT zhrictr MESSAGE-ID zhrmsg.
INCLUDE zhrictr_top. "Data Declaration
INCLUDE zhrictr_sel. "Selection Screen
INCLUDE zhrictr_f01. "Common Fuction Include
INCLUDE zhrictr_f02. "Report Function Include
INCLUDE zhrictr_alv. "Display ALV Functions Include
INCLUDE zhrictr_xls. "Download XLS Functions Include
INCLUDE zhrictr_mai. "Main Include
ABAP - BPJS Kesehatan Premium Calculation Report
ABAP - BPJS Kesehatan Premium Calculation Report
Modified from SAP NOTE 2107672 BPJS Kesehatan Premium Calculation Report for SAP release 4.6D
Step 1 : Create Report ZHIDCHCR0
*&---------------------------------------------------------------------*
*& Report HIDCHCR0
*&
*&---------------------------------------------------------------------*
*& Indonesia BPJS Health Care Report
*&---------------------------------------------------------------------*
REPORT ZHIDCHCR0 MESSAGE-ID 3D.
INCLUDE zhidchcr0_top. "Data Declaration
INCLUDE zpy_simulation. "Payroll Simulation
INCLUDE zhr_gen_excel_ver1. "Excel function
INCLUDE zhidcbmr0_alv. "Popup ALV
INCLUDE zhidchcr0_sel. "Selection Screen
INCLUDE zhidchcr0_f01. "Main Functions
INCLUDE zhidchcr0_f02. "Other Functions
INCLUDE zhidchcr0_mai. "Main Include
Step 2 : Create Include programs ( See Below for details )
Step 3 : Create Excel Template and put it in tcode OAOR
That's it....
Modified from SAP NOTE 2107672 BPJS Kesehatan Premium Calculation Report for SAP release 4.6D
Step 1 : Create Report ZHIDCHCR0
*&---------------------------------------------------------------------*
*& Report HIDCHCR0
*&
*&---------------------------------------------------------------------*
*& Indonesia BPJS Health Care Report
*&---------------------------------------------------------------------*
REPORT ZHIDCHCR0 MESSAGE-ID 3D.
INCLUDE zhidchcr0_top. "Data Declaration
INCLUDE zpy_simulation. "Payroll Simulation
INCLUDE zhr_gen_excel_ver1. "Excel function
INCLUDE zhidcbmr0_alv. "Popup ALV
INCLUDE zhidchcr0_sel. "Selection Screen
INCLUDE zhidchcr0_f01. "Main Functions
INCLUDE zhidchcr0_f02. "Other Functions
INCLUDE zhidchcr0_mai. "Main Include
Step 2 : Create Include programs ( See Below for details )
Step 3 : Create Excel Template and put it in tcode OAOR
That's it....
VB.NET Function for display Icon in cell Datagridview
VB.NET Function for display Icon in cell Datagridview
Step 1 : Create Column Datagridview
'set column name
datagridview1.Columns.Add("qsymbol", "Symbol")
datagridview1.Columns.Add("qname", "Name")
datagridview1.Columns.Add("qprevclose", "Prev. Close")
datagridview1.Columns.Add("qopen", "Open")
datagridview1.Columns.Add("qdhigh", "High")
datagridview1.Columns.Add("qdlow", "Low")
CreateImgColumn(datagridview1, "Sign", 12)
datagridview1.Columns.Add("qchange", "Change")
Step 1 : Create Column Datagridview
'set column name
datagridview1.Columns.Add("qsymbol", "Symbol")
datagridview1.Columns.Add("qname", "Name")
datagridview1.Columns.Add("qprevclose", "Prev. Close")
datagridview1.Columns.Add("qopen", "Open")
datagridview1.Columns.Add("qdhigh", "High")
datagridview1.Columns.Add("qdlow", "Low")
CreateImgColumn(datagridview1, "Sign", 12)
datagridview1.Columns.Add("qchange", "Change")
Internet Tips - How to Unblock accessing certain address
Internet Tips - How to Unblock accessing certain address
Step 1 : Download PSIPHONE
http://psiphon.id.uptodown.com/android for android
http://psiphon.id.uptodown.com/ for windows
Step 2 : Run PSIPHONE and minimize it
now you can access any address
Internet Tips - Displaying Stocks Chart from yahoo
Internet Tips - Displaying Stocks Chart from yahoo
source : http://blog.hao909.com/how-to-add-stock-chart-and-quote-from-yahoo/
1 day: http://ichart.yahoo.com/t?s=EK
5 days: http://ichart.yahoo.com/v?s=EK
1 year: http://ichart.finance.yahoo.com/c/bb/m/EK
URL’s to bigger charts …
1 day: http://ichart.finance.yahoo.com/b?s=EK
5 days: http://ichart.finance.yahoo.com/w?s=EK
3 months: http://chart.finance.yahoo.com/c/3m/EK
6 months: http://chart.finance.yahoo.com/c/6m/EK
1 year: http://chart.finance.yahoo.com/c/1y/EK
2 years: http://chart.finance.yahoo.com/c/2y/EK
5 years: http://chart.finance.yahoo.com/c/5y/EK
Max: http://chart.finance.yahoo.com/c/my/EK
VB.Net - Function Evaluate Formula in String
VB.Net - Function Evaluate Formula in String
This function will evaluate formula, example : vString = "( 4 + 5 ) * 2"
Dim xValue as Integer = 0
Dim xFormula as string = "( 4 + 5 ) * 2"
xValue = MyEval(xFormula)
Step 1 : Add Reference in your VB
c:\windows\sysem32\msscript.ocx
This function will evaluate formula, example : vString = "( 4 + 5 ) * 2"
Dim xValue as Integer = 0
Dim xFormula as string = "( 4 + 5 ) * 2"
xValue = MyEval(xFormula)
Step 1 : Add Reference in your VB
c:\windows\sysem32\msscript.ocx
SAHAM - Teknikal analisis
SAHAM - Teknikal analisis
1. Moving Average (MA)
Cara membacanya adalah
1. Moving Average (MA)
Cara membacanya adalah
- jika kurva aktual menembus kurva MA dari bawah ke atas dengan volume perdagangan yang cukup tinggi, hal tersebut memberi sinyal saat yang tepat untuk membeli saham. Sebaliknya jika kurva aktual menembus kurva MA dengan volume perdagangan tingg dari atas ke bawah, hal tersebut memberi sinyal untuk jual. Pergerakan harga saham berupa kenaikan harga diikuti dengan volume perdagangan yang tinggi ditafsirkan sebagai sinyal pasar akan membaik (bullish). Sedangkan perubahan harga berupa penurunan harga yang diikuti volume perdagangan yang tinggi ditafsirkan sebagai sinyal pasar akan memburuk (bearish).
Saham - Manajemen Modal
Saham - Manajemen Modal
Bagaimanapun, manajemen modal ini perlu dilakukan secara otomatis, dan harus Anda patuhi kalau Anda ingin terus berada di pasar modal untuk waktu yang lama.
Anda harus mengetahui dua aturan sakral ini.
1. Aturan 2%
Aturan 2% bunyinya begini: Anda tidak boleh mengambil resiko dalam satu posisi melebihi 2% dari modal Anda.
Bagaimanapun, manajemen modal ini perlu dilakukan secara otomatis, dan harus Anda patuhi kalau Anda ingin terus berada di pasar modal untuk waktu yang lama.
Anda harus mengetahui dua aturan sakral ini.
1. Aturan 2%
Aturan 2% bunyinya begini: Anda tidak boleh mengambil resiko dalam satu posisi melebihi 2% dari modal Anda.
Example Input Month and Year on selection screen
Example Input Month and Year on selection screen
Step 1 : Define Variable
DATA: iexw(6) TYPE c.
DATA: zret LIKE isellist-month.
DATA: l_code LIKE sy-subrc.
Step 1 : Define Variable
DATA: iexw(6) TYPE c.
DATA: zret LIKE isellist-month.
DATA: l_code LIKE sy-subrc.
PHP - Mengaplikasikan Flexigrid untuk saham
Membuat program aplikasi untuk bermain saham menggunakan PHP dan flexigrid yang lumayan bagus dari sisi tampilannya dan enak dalam sistem CRUD(Create, Read, Update and Delete tables) nya.
Membuat program aplikasi untuk bermain saham menggunakan PHP dan flexigrid yang lumayan bagus dari sisi tampilannya dan enak dalam sistem CRUD(Create, Read, Update and Delete tables) nya.
ABAP - Usefull Abap Program
ABAP - Usefull Abap Program
Useful programs for Schemas and PCRs
RPUCTF00 Change Attributes for Schemas and PCRs (change owner)
RPUCTI00 Lists Subschemas not called up in any other schema
RPUCTJ00 Lists Personnel Calculation Rules which are not called up
RPUCCOSE Source text search in PC rules
RPUCTX00 Copy Personnel Calculation Rules from client 000 to other clients
RPUSCD10 Schema directory – useful after LCP to see changed schemas, also shows who changed it last and when
RPUCTC00 Displays PCRs full source text
Useful programs for Schemas and PCRs
RPUCTF00 Change Attributes for Schemas and PCRs (change owner)
RPUCTI00 Lists Subschemas not called up in any other schema
RPUCTJ00 Lists Personnel Calculation Rules which are not called up
RPUCCOSE Source text search in PC rules
RPUCTX00 Copy Personnel Calculation Rules from client 000 to other clients
RPUSCD10 Schema directory – useful after LCP to see changed schemas, also shows who changed it last and when
RPUCTC00 Displays PCRs full source text
Uploading multiple multitab Excel sheets or Ranges from Front end to SAP
Uploading multiple multitab Excel sheets or Ranges from Front end to SAP
Please refer to
http://www.sap-img.com/abap/abap-object-oriented-spreadsheet-with-unlimited-power.htm
Visit
http://help.sap.com/saphelp_47x200/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm
and
http://help.sap.com/saphelp_47x200/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm
You need some basic idea of range object in excel.
You need to create XLS with named ranges or create ranges dynamically.
This could be a neat way to upload XLS the OO way!
Please refer to
http://www.sap-img.com/abap/abap-object-oriented-spreadsheet-with-unlimited-power.htm
Visit
http://help.sap.com/saphelp_47x200/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm
and
http://help.sap.com/saphelp_47x200/helpdata/en/e9/0be775408e11d1893b0000e8323c4f/frameset.htm
You need some basic idea of range object in excel.
You need to create XLS with named ranges or create ranges dynamically.
This could be a neat way to upload XLS the OO way!
SAP ABAP Function Module to Get Month Names
SAP ABAP Function Module to Get Month Names
To get the month names you can use the following function module.
MONTH_NAMES_GET
Please find the program below.
To get the month names you can use the following function module.
MONTH_NAMES_GET
Please find the program below.
Save Report Output to a PDF File
Save Report Output to a PDF File
This report takes another report as input, and captures the output of that report. The output is then converted to PDF and saved to a local file. This shows how to use some of the PDF function modules, as well as an easy way to create PDF files.
One thing I am not thrilled about is how the spool number is retrieved. If anyone has any better method, please let me know! Until I actually have a production use for a program like this, I will not try to find a better way.
This report takes another report as input, and captures the output of that report. The output is then converted to PDF and saved to a local file. This shows how to use some of the PDF function modules, as well as an easy way to create PDF files.
One thing I am not thrilled about is how the spool number is retrieved. If anyone has any better method, please let me know! Until I actually have a production use for a program like this, I will not try to find a better way.
Passing data from one ABAP program to another
Passing data from one ABAP program to another
1. You have to define an internal table ITAB in program AAA.
2. In the program AAA you export your ITAB to the memory.
EXPORT ITAB TO MEMORY ID 'TD' (ID is the name of memory, you don't need to create it ).
3. In program BBB you have to declare The same table (same table's name and same fields).
4. In BBB you can import ITAB :
IMPORT ITAB FROM MEMORY ID 'TD'
5. Now you can export it to AAA after modifications.
EXPORT ITAB TO MEMORY ID 'TD'
6. In AAA :
IMPORT ITAB FROM MEMORY ID 'TD'
This solution is independant to SUBMIT.
1. You have to define an internal table ITAB in program AAA.
2. In the program AAA you export your ITAB to the memory.
EXPORT ITAB TO MEMORY ID 'TD' (ID is the name of memory, you don't need to create it ).
3. In program BBB you have to declare The same table (same table's name and same fields).
4. In BBB you can import ITAB :
IMPORT ITAB FROM MEMORY ID 'TD'
5. Now you can export it to AAA after modifications.
EXPORT ITAB TO MEMORY ID 'TD'
6. In AAA :
IMPORT ITAB FROM MEMORY ID 'TD'
This solution is independant to SUBMIT.
Output List Manipulation
Output List Manipulation
Here is an example of manipulating lists (the output of a report) in several different ways. It includes saving the list in various formats (HTML, DAT (tab delimited, good for sending to spreadsheet/database programs), ASCII, or RTF (good for sending to word processors).
Source Code Listing
Here is an example of manipulating lists (the output of a report) in several different ways. It includes saving the list in various formats (HTML, DAT (tab delimited, good for sending to spreadsheet/database programs), ASCII, or RTF (good for sending to word processors).
Source Code Listing
Function to return next business day
Function to return next business day
A function that will return next business day, based on the country.
This function will allow users to specify e.g. 10 business days from now.
Here is the code.
Code:
REPORT ZRM_TEST .
PARAMETERS: DATE_1 LIKE SY-DATUM DEFAULT SY-DATUM,
BIZ_DAYS TYPE I DEFAULT 2,
FACCALID LIKE SCAL-FCALID DEFAULT 'US'.
A function that will return next business day, based on the country.
This function will allow users to specify e.g. 10 business days from now.
Here is the code.
Code:
REPORT ZRM_TEST .
PARAMETERS: DATE_1 LIKE SY-DATUM DEFAULT SY-DATUM,
BIZ_DAYS TYPE I DEFAULT 2,
FACCALID LIKE SCAL-FCALID DEFAULT 'US'.
Finding the list of HR module Tables
Finding the list of HR module Tables
Is anybody is having a complete list of HR module tables?
All personnel administration tables start with PA and the infotype number behind it.
All personnel development/OM tables start with HRP and infotype (e.g. 1000) behind it.
All recruitment tables start with PB and infotype number behind it.
There also are HR tables that start with HRA, HPD, HRT, etc. The easy way to get a list is to use SAP's 'Application Hierarchy', transaction SE81 (select all HR modes in the tree that you are want a list of tables for, click on the 'Information System' button, under Abap Dictionary --> Basic Objs, double click on 'database tables', increase your 'maximun no. of hits' and execute).
Is anybody is having a complete list of HR module tables?
All personnel administration tables start with PA and the infotype number behind it.
All personnel development/OM tables start with HRP and infotype (e.g. 1000) behind it.
All recruitment tables start with PB and infotype number behind it.
There also are HR tables that start with HRA, HPD, HRT, etc. The easy way to get a list is to use SAP's 'Application Hierarchy', transaction SE81 (select all HR modes in the tree that you are want a list of tables for, click on the 'Information System' button, under Abap Dictionary --> Basic Objs, double click on 'database tables', increase your 'maximun no. of hits' and execute).
ABAP - Program to list user profile
ABAP - Program to list user profile
REPORT z_list_user_profiles.
*---------------------------------------------------------------------*
* This program lists the user's auth. profiles.
*---------------------------------------------------------------------*
TABLES : ust04,
usr10.
TYPE-POOLS: slis.
SELECTION-SCREEN : BEGIN OF LINE, COMMENT 20(10) v_1 FOR FIELD s_bname.
SELECT-OPTIONS s_bname FOR ust04-bname.
SELECTION-SCREEN END OF LINE.
REPORT z_list_user_profiles.
*---------------------------------------------------------------------*
* This program lists the user's auth. profiles.
*---------------------------------------------------------------------*
TABLES : ust04,
usr10.
TYPE-POOLS: slis.
SELECTION-SCREEN : BEGIN OF LINE, COMMENT 20(10) v_1 FOR FIELD s_bname.
SELECT-OPTIONS s_bname FOR ust04-bname.
SELECTION-SCREEN END OF LINE.
ABAP - Get the time results for a payroll period. (provided by Francois Henrotte)
ABAP - Get the time results for a payroll period. (provided by Francois Henrotte)
Example:
DATA: IT_T549Q TYPE T549Q OCCURS 0 WITH HEADER LINE,
IT_ZL TYPE PC2BF OCCURS 0 WITH HEADER LINE.
W_BEGDA = '20010101'.
W_PERNR = '00000001'.
Example:
DATA: IT_T549Q TYPE T549Q OCCURS 0 WITH HEADER LINE,
IT_ZL TYPE PC2BF OCCURS 0 WITH HEADER LINE.
W_BEGDA = '20010101'.
W_PERNR = '00000001'.
ABAP - Function module HR_INFOTYPE_OPERATION
ABAP - Function module HR_INFOTYPE_OPERATION
objectid - object id from infotype
number - Personnel number
validityend - validity end date
validitybegin - validity begin date
record - infotype record values to be updated, inserted etc (will be structure of infortyoe you are updating)
recordnumber - sequence nunber from infotype record you are updating
Operation - describes what operation is to be performed
COP = Copy
DEL = Delete
DIS = Display
EDQ = Lock/unlock
INS = Create
LIS9 = Delimit
MOD = Change
INSS = Create for Actions is not converted to Change
nocommit - commit yes('X') / no(' ')
dialog_mode - dialog mode or not, default is '0'
Example coding for MOD operation
CONSTANTS: change TYPE pspar-actio VALUE 'MOD'.
"This code is requred and locks the record ready for modification
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
number = p_pernr.
"loop at p0071 into p_p0071. "added to put code in context
validitybegin = p_record-begda.
validityend = p_record-endda.
p_record-endda = pn-begda - 1.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0071'
subtype = p_record-subty
objectid = P_record-objps
number = p_record-pernr "employeenumber
validityend = validityend
validitybegin = validitybegin
record = p_record
recordnumber = p_record-SEQNR
operation = change
nocommit = nocommit
dialog_mode = '0'
IMPORTING
return = return_struct
key = personaldatakey
EXCEPTIONS
OTHERS = 0.
"endloop.
"unlock record after modification
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
number = p_pernr.
Example coding for INS operation
CONSTANTS: insert TYPE pspar-actio VALUE 'INS'.
"This code is requred and locks the record ready for modification
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
number = p_pernr.
validitybegin = p_record-begda.
validityend = p_record-endda.
p_record-pernr = p_pernr
p_record-begda = pn-begda.
p_record-endda = validityend.
p_record-subty = p_SUBTY. "subtype of new entry
p_record-SCREF = p_SUBTY. "subtype of new entry
"plus populate any other fields you need to update
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0071'
subtype = p_record-subty
number = p_record-pernr "employeenumber
validityend = validityend
validitybegin = validitybegin
record = p_record
operation = insert
nocommit = nocommit
dialog_mode = '0'
IMPORTING
return = return_struct
key = personaldatakey
EXCEPTIONS
OTHERS = 0.
"unlock record after modification
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
number = p_pernr.
objectid - object id from infotype
number - Personnel number
validityend - validity end date
validitybegin - validity begin date
record - infotype record values to be updated, inserted etc (will be structure of infortyoe you are updating)
recordnumber - sequence nunber from infotype record you are updating
Operation - describes what operation is to be performed
COP = Copy
DEL = Delete
DIS = Display
EDQ = Lock/unlock
INS = Create
LIS9 = Delimit
MOD = Change
INSS = Create for Actions is not converted to Change
nocommit - commit yes('X') / no(' ')
dialog_mode - dialog mode or not, default is '0'
Example coding for MOD operation
CONSTANTS: change TYPE pspar-actio VALUE 'MOD'.
"This code is requred and locks the record ready for modification
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
number = p_pernr.
"loop at p0071 into p_p0071. "added to put code in context
validitybegin = p_record-begda.
validityend = p_record-endda.
p_record-endda = pn-begda - 1.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0071'
subtype = p_record-subty
objectid = P_record-objps
number = p_record-pernr "employeenumber
validityend = validityend
validitybegin = validitybegin
record = p_record
recordnumber = p_record-SEQNR
operation = change
nocommit = nocommit
dialog_mode = '0'
IMPORTING
return = return_struct
key = personaldatakey
EXCEPTIONS
OTHERS = 0.
"endloop.
"unlock record after modification
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
number = p_pernr.
Example coding for INS operation
CONSTANTS: insert TYPE pspar-actio VALUE 'INS'.
"This code is requred and locks the record ready for modification
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
number = p_pernr.
validitybegin = p_record-begda.
validityend = p_record-endda.
p_record-pernr = p_pernr
p_record-begda = pn-begda.
p_record-endda = validityend.
p_record-subty = p_SUBTY. "subtype of new entry
p_record-SCREF = p_SUBTY. "subtype of new entry
"plus populate any other fields you need to update
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0071'
subtype = p_record-subty
number = p_record-pernr "employeenumber
validityend = validityend
validitybegin = validitybegin
record = p_record
operation = insert
nocommit = nocommit
dialog_mode = '0'
IMPORTING
return = return_struct
key = personaldatakey
EXCEPTIONS
OTHERS = 0.
"unlock record after modification
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
number = p_pernr.
HR ABAP
HR ABAP
--------------------------------------------------------------------------------
Database Tables in HR
· Personnel Administration (PA) - master and time data infotype tables (transparent tables).
PAnnnn: e.g. PA0001 for infotype 0001
· Personnel Development (PD) - Org Unit, Job, Position, etc. (transparent tables).
HRPnnnn: e.g. HRP1000 for infotype 1000
· Time/Travel expense/Payroll/Applicant Tracking data/HR work areas/Documents (cluster
PCLn: e.g. PCL2 for time/payroll results.
--------------------------------------------------------------------------------
Database Tables in HR
· Personnel Administration (PA) - master and time data infotype tables (transparent tables).
PAnnnn: e.g. PA0001 for infotype 0001
· Personnel Development (PD) - Org Unit, Job, Position, etc. (transparent tables).
HRPnnnn: e.g. HRP1000 for infotype 1000
· Time/Travel expense/Payroll/Applicant Tracking data/HR work areas/Documents (cluster
PCLn: e.g. PCL2 for time/payroll results.
HR ABAP LDB - Logical Database
HR ABAP LDB - Logical Database
-------------------------------------------------------------------------------
Logical database
A logical database is a special ABAP/4 program which combines the contents of certain database tables. Using logical databases facilitates the process of reading database tables.
HR Logical Database is PNP
Main Functions of the logical database PNP:
Standard Selection screen
Data Retrieval
Authorization check
To use logical database PNP in your program, specify in your program attributes.
Standard Selection Screen
Date selection
Date selection delimits the time period for which data is evaluated. GET PERNR retrieves all records of the relevant infotypes from the database. When you enter a date selection period, the PROVIDE loop retrieves the infotype records whose validity period overlaps with at least one day of this period.
Person selection
Person selection is the 'true' selection of choosing a group of employees for whom the report is to run.
Sorting Data
· The standard sort sequence lists personnel numbers in ascending order.
· SORT function allows you to sort the report data otherwise. All the sorting fields are from infotype 0001.
Report Class
· You can suppress input fields which are not used on the selection screen by assigning a report class to your program.
· If SAP standard delivered report classes do not satisfy your requirements, you can create your own report class through the IMG.
Data Retrieval from LDB
1. Create data structures for infotypes.
INFOTYPES: 0001, "ORG ASSIGNMENT
0002, "PERSONAL DATA
0008. "BASIC PAY
2. Fill data structures with the infotype records.
Start-of-selection.
GET PERNR.
End-0f-selection.
Read Master Data
Infotype structures (after GET PERNR) are internal tables loaded with data.
The infotype records (selected within the period) are processed sequentially by the PROVIDE - ENDPROVIDE loop.
GET PERNR.
PROVIDE * FROM Pnnnn BETWEEN PN/BEGDA AND PN/ENDDA
If Pnnnn-XXXX = ' '. write:/ Pnnnn-XXXX. endif.
ENDPROVIDE.
Period-Related Data
All infotype records are time stamped.
IT0006 (Address infotype)
01/01/1990 12/31/9999 present
Which record to be read depends on the date selection period specified on the
selection screen. PN/BEGDA PN/ENDDA.
Current Data
IT0006 Address - 01/01/1990 12/31/9999 present
RP-PROVIDE-FROM-LAST retrieves the record which is valid in the data selection period.
For example, pn/begda = '19990931' pn/endda = '99991231'
IT0006 subtype 1 is resident address
RP-PROVIDE-FROM-LAST P0006 1 PN/BEGDA PN/ENDDA.
-------------------------------------------------------------------------------
Logical database
A logical database is a special ABAP/4 program which combines the contents of certain database tables. Using logical databases facilitates the process of reading database tables.
HR Logical Database is PNP
Main Functions of the logical database PNP:
Standard Selection screen
Data Retrieval
Authorization check
To use logical database PNP in your program, specify in your program attributes.
Standard Selection Screen
Date selection
Date selection delimits the time period for which data is evaluated. GET PERNR retrieves all records of the relevant infotypes from the database. When you enter a date selection period, the PROVIDE loop retrieves the infotype records whose validity period overlaps with at least one day of this period.
Person selection
Person selection is the 'true' selection of choosing a group of employees for whom the report is to run.
Sorting Data
· The standard sort sequence lists personnel numbers in ascending order.
· SORT function allows you to sort the report data otherwise. All the sorting fields are from infotype 0001.
Report Class
· You can suppress input fields which are not used on the selection screen by assigning a report class to your program.
· If SAP standard delivered report classes do not satisfy your requirements, you can create your own report class through the IMG.
Data Retrieval from LDB
1. Create data structures for infotypes.
INFOTYPES: 0001, "ORG ASSIGNMENT
0002, "PERSONAL DATA
0008. "BASIC PAY
2. Fill data structures with the infotype records.
Start-of-selection.
GET PERNR.
End-0f-selection.
Read Master Data
Infotype structures (after GET PERNR) are internal tables loaded with data.
The infotype records (selected within the period) are processed sequentially by the PROVIDE - ENDPROVIDE loop.
GET PERNR.
PROVIDE * FROM Pnnnn BETWEEN PN/BEGDA AND PN/ENDDA
If Pnnnn-XXXX = ' '. write:/ Pnnnn-XXXX. endif.
ENDPROVIDE.
Period-Related Data
All infotype records are time stamped.
IT0006 (Address infotype)
01/01/1990 12/31/9999 present
Which record to be read depends on the date selection period specified on the
selection screen. PN/BEGDA PN/ENDDA.
Current Data
IT0006 Address - 01/01/1990 12/31/9999 present
RP-PROVIDE-FROM-LAST retrieves the record which is valid in the data selection period.
For example, pn/begda = '19990931' pn/endda = '99991231'
IT0006 subtype 1 is resident address
RP-PROVIDE-FROM-LAST P0006 1 PN/BEGDA PN/ENDDA.
ABAP Infotypes
ABAP Infotypes
--------------------------------------------------------------------------------
Process Infotypes
RMAC Modules - RMAC module as referred to Macro, is a special construct of ABAP/4 codes. Normally, the program code of these modules is stored in table 'TRMAC'. The table key combines the program code under a given name. It can also be defined in programs.The RMAC defined in the TRMAC can be used in all Reports. When an RMAC is changed, the report has to be regenerated manually to reflect the change.
Reading Infotypes - by using RMAC (macro) RP-READ-INFOTYPE
REPORT ZHR00001.
INFOTYPE: 0002.
PARAMETERS: PERNR LIKE P0002-PERNR.
RP-READ-INFOTYPE PERNR 0002 P0002 .
PROVIDE * FROM P0002
if ... then ...endif.
ENDPROVIDE.
Changing Infotypes - by using RMAC (macro) RP-READ-INFOTYPE.
· Three steps are involved in changing infotypes:
1. Select the infotype records to be changed;
2. Make the required changes and store the records in an alternative table;
3. Save this table to the database;
The RP-UPDATE macro updates the database. The parameters of this macro are the OLD internal table containing the unchanged records and the NEW internal table containing the changed records. You cannot create or delete data. Only modification is possible.
INFOTYPES: Pnnnn NAME OLD,
Pnnnn NAME NEW.
GET PERNR.
PROVIDE * FROM OLD
WHERE .... = ... "Change old record
*Save old record in alternate table
NEW = OLD.
ENDPROVIDE.
RP-UPDATE OLD NEW. "Update changed record
Infotype with repeat structures
· How to identify repeat structures.
a. On infotype entry screen, data is entered in table form.
IT0005, IT0008, IT0041, etc.
b. In the infotype structure, fields are grouped by the same name followed by sequence number.
P0005-UARnn P0005-UANnn P0005-UBEnn
P0005-UENnn P0005-UABnn
Repeat Structures
· Data is entered on the infotype screen in table format but stored on the database in a linear
structure.
· Each row of the table is stored in the same record on the database.
· When evaluating a repeat structure, you must define the starting point, the increment and the
work area which contains the complete field group definition.
Repeat Structures Evaluation (I)
· To evaluate the repeat structures
a. Define work area.
The work area is a field string. Its structure is identical to that of the field group.
b. Use a DO LOOP to divide the repeat structure into segments and make it available for
processing in the work area, one field group (block) at a time.
Repeat Structures Evaluation(II)
* Define work area
DATA: BEGIN OF VACATION,
UAR LIKE P0005-UAR01, "Leave type
UAN LIKE P0005-UAN01, "Leave entitlement
UBE LIKE P0005-UBE01, "Start date
UEN LIKE P0005-UEN01, "End date
UAB LIKE P0005-UAB01, "Leave accounted
END OF VACATION.
GET PERNR.
RP-PROVIDE-FROM-LAST P0005 SPACE PN/BEGDA PN/ENDDA.
DO 6 TIMES VARYING VACATION
FROM P0005-UAR01 "Starting point
NEXT P0005-UAR02. "Increment
If p0005-xyz then ... endif.
ENDDO.
--------------------------------------------------------------------------------
Process Infotypes
RMAC Modules - RMAC module as referred to Macro, is a special construct of ABAP/4 codes. Normally, the program code of these modules is stored in table 'TRMAC'. The table key combines the program code under a given name. It can also be defined in programs.The RMAC defined in the TRMAC can be used in all Reports. When an RMAC is changed, the report has to be regenerated manually to reflect the change.
Reading Infotypes - by using RMAC (macro) RP-READ-INFOTYPE
REPORT ZHR00001.
INFOTYPE: 0002.
PARAMETERS: PERNR LIKE P0002-PERNR.
RP-READ-INFOTYPE PERNR 0002 P0002 .
PROVIDE * FROM P0002
if ... then ...endif.
ENDPROVIDE.
Changing Infotypes - by using RMAC (macro) RP-READ-INFOTYPE.
· Three steps are involved in changing infotypes:
1. Select the infotype records to be changed;
2. Make the required changes and store the records in an alternative table;
3. Save this table to the database;
The RP-UPDATE macro updates the database. The parameters of this macro are the OLD internal table containing the unchanged records and the NEW internal table containing the changed records. You cannot create or delete data. Only modification is possible.
INFOTYPES: Pnnnn NAME OLD,
Pnnnn NAME NEW.
GET PERNR.
PROVIDE * FROM OLD
WHERE .... = ... "Change old record
*Save old record in alternate table
NEW = OLD.
ENDPROVIDE.
RP-UPDATE OLD NEW. "Update changed record
Infotype with repeat structures
· How to identify repeat structures.
a. On infotype entry screen, data is entered in table form.
IT0005, IT0008, IT0041, etc.
b. In the infotype structure, fields are grouped by the same name followed by sequence number.
P0005-UARnn P0005-UANnn P0005-UBEnn
P0005-UENnn P0005-UABnn
Repeat Structures
· Data is entered on the infotype screen in table format but stored on the database in a linear
structure.
· Each row of the table is stored in the same record on the database.
· When evaluating a repeat structure, you must define the starting point, the increment and the
work area which contains the complete field group definition.
Repeat Structures Evaluation (I)
· To evaluate the repeat structures
a. Define work area.
The work area is a field string. Its structure is identical to that of the field group.
b. Use a DO LOOP to divide the repeat structure into segments and make it available for
processing in the work area, one field group (block) at a time.
Repeat Structures Evaluation(II)
* Define work area
DATA: BEGIN OF VACATION,
UAR LIKE P0005-UAR01, "Leave type
UAN LIKE P0005-UAN01, "Leave entitlement
UBE LIKE P0005-UBE01, "Start date
UEN LIKE P0005-UEN01, "End date
UAB LIKE P0005-UAB01, "Leave accounted
END OF VACATION.
GET PERNR.
RP-PROVIDE-FROM-LAST P0005 SPACE PN/BEGDA PN/ENDDA.
DO 6 TIMES VARYING VACATION
FROM P0005-UAR01 "Starting point
NEXT P0005-UAR02. "Increment
If p0005-xyz then ... endif.
ENDDO.
ABAP: How to create a dynamic internal table and work area
ABAP: How to create a dynamic internal table and work area
FIELD-SYMBOLS: TYPE STANDARD TABLE, TYPE ANY. DATA: table_ref TYPE REF TO data, wa_ref TYPE REF TO data. DATA: l_structure TYPE dd02l-tabname value 'VBAP'.
CREATE DATA table_ref TYPE STANDARD TABLE OF (l_structure).
ASSIGN table_ref->* TO .
CREATE DATA wa_ref LIKE LINE OF .
ASSIGN wa_ref->* TO .
Now you have the table and the work area for it .
FIELD-SYMBOLS: TYPE STANDARD TABLE, TYPE ANY. DATA: table_ref TYPE REF TO data, wa_ref TYPE REF TO data. DATA: l_structure TYPE dd02l-tabname value 'VBAP'.
CREATE DATA table_ref TYPE STANDARD TABLE OF (l_structure).
ASSIGN table_ref->* TO .
CREATE DATA wa_ref LIKE LINE OF .
ASSIGN wa_ref->* TO .
Now you have the table and the work area for it .
Create a Dynamic Iinternal Table
Create a Dynamic Iinternal Table
REPORT ZCLUST1 .
*
* Example: how to create a dynamic internal table
*
* The dynamic internal table stucture
DATA: BEGIN OF STRUCT OCCURS 10,
FILDNAME(8) TYPE C,
ABPTYPE TYPE C,
LENGTH TYPE I,
END OF STRUCT.
REPORT ZCLUST1 .
*
* Example: how to create a dynamic internal table
*
* The dynamic internal table stucture
DATA: BEGIN OF STRUCT OCCURS 10,
FILDNAME(8) TYPE C,
ABPTYPE TYPE C,
LENGTH TYPE I,
END OF STRUCT.
Sample Coding For Converting Into PDF Format
Sample Coding For Converting Into PDF Format
ERP SAP Modules ==> ABAP
By: Jacob Charles S.
ERP SAP Modules ==> ABAP
By: Jacob Charles S.
data: cparam type ssfctrlop, outop type ssfcompop, fm_name type rs38l_fnam. DATA : tab_otf_data TYPE ssfcrescl, * pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE, tab_otf_final TYPE itcoo OCCURS 0 WITH HEADER LINE, file_size TYPE i, bin_filesize TYPE i, FILE_NAME type string, File_path type string, FULL_PATH type string. outop-tddest = 'LP01'. cparam-no_dialog = 'X'. cparam-preview = SPACE. cparam-getotf = 'X'.
ABAP - Using Macros In HR ABAP Report Program.
ABAP - Using Macros In HR ABAP Report Program.
Macro means presenting programs in modular form.
Customer-specific RMAC modules should begin with a special character.
The macros defined in table TRMAC can be used by all reports.
When you change a RMAC macro in the table TRMAC, the reports that use this
macro are not regenerated automatically. You must regenerate them manually.
Marcos in personnel administration.
RP_PROVIDE_FROM_LAST Pnnnn SPACE PN-BEGDA PN-ENDDA.
or
RP_PROVIDE_FROM_FIRST Pnnnn SPACE PN-BEGDA PN-ENDDA.
Macro means presenting programs in modular form.
Customer-specific RMAC modules should begin with a special character.
The macros defined in table TRMAC can be used by all reports.
When you change a RMAC macro in the table TRMAC, the reports that use this
macro are not regenerated automatically. You must regenerate them manually.
Marcos in personnel administration.
RP_PROVIDE_FROM_LAST Pnnnn SPACE PN-BEGDA PN-ENDDA.
or
RP_PROVIDE_FROM_FIRST Pnnnn SPACE PN-BEGDA PN-ENDDA.
ABAP - Fetch HR Data Or Records From HR Database Tables
ABAP - Fetch HR Data Or Records From HR Database Tables.
There are 3 methods in fetching the data from HR database tables .
1. Using Select Statements .
This is the simple method for the selection of data from the hr tables(pannnn). in the HR data time is the major component , in the where condition we should include the date parameters for fetching the data .see this example
There are 3 methods in fetching the data from HR database tables .
1. Using Select Statements .
This is the simple method for the selection of data from the hr tables(pannnn). in the HR data time is the major component , in the where condition we should include the date parameters for fetching the data .see this example
ABAP - ALV Pop Up To Select The Options Display Them
ABAP - ALV Pop Up To Select The Options & Display Them
report zalv_sample . tables vbak. data it_vbak like vbak occurs 0 with header line. selection-screen begin of block b1 with frame. parameters: alv1 radiobutton group alv, "REUSE_ALV_LIST_DISPLAY alv2 radiobutton group alv, "REUSE_ALV_POPUP_TO_SELECT alv3 radiobutton group alv, "REUSE_ALV_GRID_DISPLAY alv4 radiobutton group alv. " NORMAL DISPLAY selection-screen end of block b1.
SAP - Background Job
SAP - Background Job
1. Definition
Background jobs are a means of running reports without having to wait for the report to finish.
Background jobs can be scheduled to run immediately or at specific times or the day or night.
Background jobs can be scheduled to run automatically on a periodic basis (eg daily, weekly, monthly etc)
A background job can consist of one or more reports. Each report is run in sequence.
1. Definition
Background jobs are a means of running reports without having to wait for the report to finish.
Background jobs can be scheduled to run immediately or at specific times or the day or night.
Background jobs can be scheduled to run automatically on a periodic basis (eg daily, weekly, monthly etc)
A background job can consist of one or more reports. Each report is run in sequence.
ABAP - System Information
ABAP - System Information
Information About the Current R/3 System
SY-DBSYS
Central database system (such as INFORMIX or ORACLE)
SY-HOST
Application server (such as HS0333, PAWDF087 …)
SY-OPSYS
Operating system of the application server (such as HP-UX, SINIX)
SY-SAPRL
R/3 Release in use (such as 30D, 46A, …)
Information About the Current R/3 System
SY-DBSYS
Central database system (such as INFORMIX or ORACLE)
SY-HOST
Application server (such as HS0333, PAWDF087 …)
SY-OPSYS
Operating system of the application server (such as HP-UX, SINIX)
SY-SAPRL
R/3 Release in use (such as 30D, 46A, …)
ABAP function to convert Number to Words
ABAP function to convert Number to Words
*
* Converting Number to Words
*
* This function comes handy mostly for the Finance module as they need to print out check
* for the vendors. The function allows you to covert easily from numbers to words.
*
* Written by : SAP Basis ABAP Programming and Other IMG Stuff
* http://www.sap-img.com
*
*
* Converting Number to Words
*
* This function comes handy mostly for the Finance module as they need to print out check
* for the vendors. The function allows you to covert easily from numbers to words.
*
* Written by : SAP Basis ABAP Programming and Other IMG Stuff
* http://www.sap-img.com
*
REPORT ZSPELL. TABLES SPELL. DATA : T_SPELL LIKE SPELL OCCURS 0 WITH HEADER LINE. DATA : PAMOUNT LIKE SPELL-NUMBER VALUE '1234510'. SY-TITLE = 'SPELLING NUMBER'. PERFORM SPELL_AMOUNT USING PAMOUNT 'USD'. WRITE: 'NUMBERS', T_SPELL-WORD, 'DECIMALS ', T_SPELL-DECWORD.
A Short Tutorial on User Exits
A Short Tutorial on User Exits
Content Author: Abhishek
User exits
1. Introduction
2. How to find user exits
3. Using Project management of SAP Enhancements
1. Introduction
User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a functionmodule. The code for the function module is writeen by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module.
The naming standard of function modules for functionmodule exits is:
Content Author: Abhishek
User exits
1. Introduction
2. How to find user exits
3. Using Project management of SAP Enhancements
1. Introduction
User exits (Function module exits) are exits developed by SAP. The exit is implementerd as a call to a functionmodule. The code for the function module is writeen by the developer. You are not writing the code directly in the function module, but in the include that is implemented in the function module.
The naming standard of function modules for functionmodule exits is:
VB.Net - VB Net dengan menggunakan Database MySql
VB.Net - VB Net dengan menggunakan Database MySql
Step 1 : Download MySql Connector
ADO.NET Driver for MySQL (Connector/NET)
Link untuk download https://www.mysql.com/products/connector/ kemudian install
Step 2 : Add Reference Mysql Connector Pada VB.Net
Step 1 : Download MySql Connector
ADO.NET Driver for MySQL (Connector/NET)
Link untuk download https://www.mysql.com/products/connector/ kemudian install
Step 2 : Add Reference Mysql Connector Pada VB.Net
Subscribe to:
Posts (Atom)