Archive for December, 2013

ABAP – Reading a feature with return value

In ABAP we can read a FEATURE and can return the value from the feature using the below function Module HR_FEATURE_BACKFIELD. I have showed here fetching the value WERKS from the feature VEBZU. CALL FUNCTION 'HR_FEATURE_BACKFIELD' EXPORTING FEATURE                     = 'VEBZU' STRUC_CONTENT               = pme01 *     KIND_OF_ERROR               = IMPORTING BACK                        = l_werks EXCEPTIONS DUMMY                       = 1 ERROR_OPERATION             = 2 NO_BACKVALUE                = 3 FEATURE_NOT_GENERATED       = 4 INVALID_SIGN_IN_FUNID       = 5 FIELD_IN_REPORT_TAB_IN_PE03 = 6 OTHERS                      = 7.   IF SY-SUBRC <> 0. * Implement suitable error handling here ENDIF.   After executing this functional module the return value from the feature will stored in the variable l_werks.

. Read More →

ABAP – Function module for hire and fire date

In ABAP for getting the hire and fire date of an employee we can use the function module RP_HIRE_FIRE. rp_provide_from_last p0000 space pn-begda  pn-endda. rp_provide_from_last p0001  space pn-begda pn-endda.   CALL FUNCTION 'RP_HIRE_FIRE' EXPORTING beg       = begda end       = endda IMPORTING hire_date = hire_date fire_date = fire_date TABLES pp0000    = p0000 pp0001    = p0001 pphifi    = phifi.   The variables hire_date and fire_date will give the hire and fire date respectively.

. Read More →

ABAP – Getting leaving date or termination date of an employee

In ABAP for getting the leaving date or termination date of an employee we can use the function module  HR_LEAVING_DATE. CALL FUNCTION 'HR_LEAVING_DATE' EXPORTING PERSNR                 = pernr-pernr IMPORTING LEAVINGDATE            = l_fire_date EXCEPTIONS LEAVING_DATE_NOT_FOUND = 1 PERNR_NOT_ASSIGNED     = 2 OTHERS                 = 3.   IF SY-SUBRC <> 0. * Implement suitable error handling here ENDIF. After passing the PERNR ane executing the function module we will get the fire date or termination date in the variable l_fire_date.  

. Read More →

ABAP – Getting the Entry date or hiring date of an employee

In ABAP for getting the hired date or entry date of an employee we can use the below function module HR_ENTRY_DATE.   CALL FUNCTION 'HR_ENTRY_DATE' EXPORTING PERSNR               = pernr-pernr IMPORTING ENTRYDATE            = l_hire_date EXCEPTIONS ENTRY_DATE_NOT_FOUND = 1 PERNR_NOT_ASSIGNED   = 2 OTHERS               = 3.   IF SY-SUBRC <> 0. * Implement suitable error handling here ENDIF. After passing the PERNR and executing the function module,we will get the hire_date in the variable l_hire_date.  

. Read More →

SAP ABAP – Getting wage type from Infotype 0008

For getting wage type from the Infotype 0008 you can use the function RP_FILL_WAGE_TYPE_TABLE_EXT. You can use the function module as follows: DATA: it_p0001 TYPE STANDARD TABLE OF p0001, it_p0007 TYPE STANDARD TABLE OF p0007, it_pbwla TYPE STANDARD TABLE OF PBWLA, it_p0008 TYPE STANDARD TABLE OF p0008, wa_pbwla TYPE PBWLA. rp-provide-from-last from P0008 space pn-begda pn-endda CALL FUNCTION ...

. Read More →