Ansicht
Dokumentation

OHIGBPBS010101 - Interface Data Derivation Amendments

OHIGBPBS010101 - Interface Data Derivation Amendments

CL_GUI_FRONTEND_SERVICES - Frontend Services   rdisp/max_wprun_time - Maximum work process run time  
This documentation is copyright by SAP AG.
SAP E-Book

In this step you can develop and activate your own specific requirements as to how information is derived in the class interface.

The CLASS system needs specific information. Due to the adaptable nature of your SAP system, clients can store CLASS information in a vaiety of places. The standard places are defined in the documentation. Any other derivation is NOT supported by the standard SAP interface program. The standard derivation can be changed using the Customer Exit provided, EXIT_RPUCLSG0_001.

The client's requirement stipulates that field "KEY3" MUST contain the employee's Payroll Accounting Area.

Loop at P_P0001 where begda LE p_endda

and endda GE p_begda.

EXIT.

Endloop.

*

* Overwrite The Third Key Field with Payroll Accounting Area

*

P_EXTRACT-KEY3 = P_P0001-ABKRS.

P_EXTRACT will ALREADY have been filled using SAP standard derivation.

The standard layout of the interface function is as follows;

CALL CUSTOMER-FUNCTION '001'

EXPORTING

p_pernr = p_pernr

p_begda = p_begda

p_endda = p_endda

TABLES

p_p0000 = p0000

p_p0001 = p0001

p_p0002 = p0002

p_p0003 = p0003

p_p0006 = p0006

p_p0007 = p0007

p_p0041 = p0041

p_p0069 = p0069

p_p0071 = p0071

p_rt = rt

p_crt = crt

CHANGING

p_extract = p_extract

EXCEPTIONS

error = 1

warning = 2.

Enter the code in the include ZXP08P1U01 that will satify your specific needs.

Below is some code that could be included if required;

* *

* This user exit has been added to derive the employee start date *

* from p0016-begda (contract start date) and overwrite the original *

* employee start date that has been populated in p_result-djemp. *

* *

* infotype 0016 has not been read so far and so was not available in *

* the table parameters of the customer exit. HR_READ_INFOTYPE is *

* used to read the information at the snapshot date and pass back *

* the internal table infty_tab with the information required. *

* *

*----------------------------------------------------------------------*

* The following code is designed to provide the above requirement *

*----------------------------------------------------------------------*

* Start Of Example 1 *

*----------------------------------------------------------------------*

* *

* DATA: I0016 LIKE P0016 OCCURS 0 WITH HEADER LINE, *

* VALUE1 LIKE SY-MSGV1 VALUE '0016', *

* VALUE2 LIKE SY-MSGV2, *

* VALUE3 LIKE SY-MSGV3 VALUE SPACE, *

* VALUE4 LIKE SY-MSGV4 VALUE SPACE. *

* *

* CALL FUNCTION 'HR_READ_INFOTYPE' *

* EXPORTING *

* TCLAS = 'A' *

* PERNR = P_EXTRACT-PERNR *

* INFTY = '0016' *

* BEGDA = P_BEGDA *

* ENDDA = P_ENDDA *

* * IMPORTING *

* * SUBRC = *

* TABLES *

* INFTY_TAB = I0016 *

* EXCEPTIONS *

* INFTY_NOT_FOUND = 1 *

* OTHERS = 2. *

* *

* VALUE2 = SNAPSHOT_DATE. *

* *

* IF SY-SUBRC <> 0. *

* IF SY-SUBRC = 1. *

* * e001(zz) = 'Infotype &1 does not exist on the database' *

* * message e001(zz) with value1 value2 value3 value4 *

* * raising error. *

* RAISE ERROR. *

* ENDIF. *

* ELSE. *

* LOOP AT I0016. *

* * overwrite the original p_extract-djemp. *

* P_EXTRACT-DJEMP = I0016-BEGDA. *

* EXIT. *

* ENDLOOP. *

* IF SY-DBCNT = 0. *

* * w002(zz) = 'Infotype &1 has no records at &2' *

* * message w002(zz) with value1 value2 value3 value4 *

* * raising warning. *

* RAISE WARNING. *

* ENDIF. *

* ENDIF. *

*----------------------------------------------------------------------*

* End Of Example 1 *

*----------------------------------------------------------------------*

*----------------------------------------------------------------------*

* Start Of Example 2 *

**---------------------------------------------------------------------*

** Requirement 1: The Field Pensionable Remuneration should be the

** Pensionable Gross for this month multiplied by 12.

** This only applies to Part-time Employees

**---------------------------------------------------------------------*

**

** The Wage Type '/SAL' contains the Pensionable Gross this month

** multiplied by twelve.

**

**if P_EXTRACT-ptind = 'Y'.

** loop at p_rt.

** check p_rt-lgart = '/SAL'.

** format the amount to the interface standard

** perform conv_to_lfz_c11(rpuclsg0) using p_rt-betrg

** p_extreact-apenc.

** only take the first occurence.

** exit.

** endloop.

**endif.

*

**----------------------------------

**------------------------------------*

** Requirement 2: The Payroll Period End Date should be stored in the

** Service Break Start Date field (!!).

**----------------------------------

**------------------------------------*

**

** overwrite Service Break Start Date with Payroll Period End Date.

**

*P_EXTRACT-S1SDT(2) = P_ENDDA+6(2).

*P_EXTRACT-S1SDT+2(2) = P_ENDDA+4(2).

*P_EXTRACT-S1SDT+4(4) = P_ENDDA(4).

**

**---------------------------------------------------------------------*

** Requirement 3: The Payroll Accounting Area should be stored in the

** Third Key field.

**---------------------------------------------------------------------*

**

** overwrite The Third Key Field with Payroll Accounting Area

**

*P_EXTRACT-KEY3 = P_P0001-ABKRS.

*

**---------------------------------------------------------------------*

** Requirement 4: The Amount Dates should be derived differently

** DMEMC = 3103YYYY

** DSTRC = Not used

** DNICC = 0504YYYY

** DACTC = 3103YYYY

** DPENC = 3103YYYY

** DSIX = Not used

**---------------------------------------------------------------------*

*

** If the Payroll Period End Date's Day and Month are after 31 03 then

** use the Payroll Period End Date's Year + 1 as YYYY.

**

*DATA: TEST_DATE TYPE P_ENDDA "YYYYMMDD date format

* TEST_YEAR TYPE I,

* TEST_YEAR_4C(4) TYPE C.

*

*TEST_YEAR = P_endda.

*WRITE TEST_YEAR TO TEST_YEAR_4C.

*

*CONCATENATE TEST_YEAR_4C '0331' INTO

* TEST_DATE. "YYYYMMDD date format

*

*IF P_SNAP_EDT > TEST_DATE.

* TEST_YEAR = TEST_YEAR + 1.

* WRITE TEST_YEAR TO TEST_DATE(4).

* "YYYYMMDD date format

* TEST_YEAR = TEST_YEAR - 1.

*ENDIF.

*

*P_EXTRACT-DPENC(2) = TEST_DATE+6(2).

*P_EXTRACT-DPENC+2(2) = TEST_DATE+4(2).

*P_EXTRACT-DPENC+4(4) = TEST_DATE(4).

*P_EXTRACT-DMEMC = P_EXTRACT-DACTC = P_EXTRACT-DPENC.

*

** If the Payroll Period End Date's Day and Month are after 05 04 then

** use the Payroll Period End Date's Year + 1 as YYYY.

**

*

*CONCATENATE TEST_YEAR_4C '0405' INTO

* TEST_DATE. "YYYYMMDD date format

*

*IF P_ENNDA = TEST_DATE.

* TEST_YEAR = TEST_YEAR + 1.

* WRITE TEST_YEAR TO TEST_DATE(4).

* "YYYYMMDD date format

*ENDIF.

*

*P_EXTRACT-DNICC(2) = TEST_DATE+6(2).

*P_EXTRACT-DNICC+2(2) = TEST_DATE+4(2).

*P_EXTRACT-DNICC+4(4) = TEST_DATE(4).

**

**

************************************************************************

** NEW REQUIREMENTS 6 MONTHS AFTER ORIGINAL ONES ABOVE !!!!!!!!!!!

************************************************************************

**---------------------------------------------------------------------*

** Requirement 1: The Location (Personnel Subarea Text)

** should be stored in the Third Key field.

**---------------------------------------------------------------------*

**

** overwrite KEY3 Field with what is in LOCAT field.

**

*P_EXTRACT-KEY3 = P_EXTRACT-LOCAT.

**---------------------------------------------------------------------*

** Requirement 2: The Location should be '00001' for all employees.

**---------------------------------------------------------------------*

**

** overwrite KEY3 Field with what is in LOCAT field.

**

*P_EXTRACT-LOCAT = '00001'.

**---------------------------------------------------------------------*

** Requirement 3: The dates, DJFUN, DJPEN & DOSER should ALL

** be like DJEMP.

**---------------------------------------------------------------------*

**

** overwrite fields DJFUN, DJPEN, DOSER with what is in DJEMP field.

**

*P_EXTRACT-DJFUN = P_EXTRACT-DJEMP.

*P_EXTRACT-DSPEN = P_EXTRACT-DJEMP.

*P_EXTRACT-DOSER = P_EXTRACT-DJEMP.

**---------------------------------------------------------------------*

** Requirement 4: The Pensionable Pay for Part Time staff is no longer

** coming from a customised Infotype /SAL, but is being

** interfaced as it's the normal value from RT

**---------------------------------------------------------------------*

**

** Comment out lines 770 to 850

**

**---------------------------------------------------------------------*

** Requirement 5: The part time flag and part time % should be derived

** as follows;

** 1) If P0007-WOSTD < T510I-TRWAZ then PT FLAG is 'Y'.

** 2) If PT FLAG is 'Y'. PT % is

** P0007-WOSTD / ( T510I-TRWAZ ) * 100.

**---------------------------------------------------------------------*

* TABLES: T503, T510I.

**

* DATA: C_TRWAZ TYPE CHAR5,

* L_DECIMAL_PLACE TYPE C VALUE '.',

* P_TRWAZ LIKE P0007-WOSTD.

*

* DATA: INT_PART TYPE I,

* DEC_PART TYPE I,

* L_WOSTD_100 TYPE I.

**

* DATA: I0008 LIKE P0008 OCCURS 0 WITH HEADER LINE.

**

* DATA: L_TRFKZ LIKE T503-TRFKZ,

* L_TRWAZ LIKE T510I-TRWAZ.

*

**

* CLEAR I0008. REFRESH I0008.

**

* CALL FUNCTION 'HR_READ_INFOTYPE'

* EXPORTING

* TCLAS = 'A'

* PERNR = P_EXTRACT-PERNR

* INFTY = '0008'

* BEGDA = P_EXTRACT_DATE

* ENDDA = P_EXTRACT_DATE

* TABLES

* INFTY_TAB = I0008

* EXCEPTIONS

* INFTY_NOT_FOUND = 1.

**

*IF SY-SUBRC NE 0.

* RAISE ERROR.

*ENDIF.

*LOOP AT I0008.

* EXIT.

*ENDLOOP.

**

*IF SY-SUBRC NE 0.

* RAISE ERROR.

*ELSE.

* SELECT SINGLE TRFKZ INTO L_TRFKZ FROM T503

* WHERE PERSG = P_P0001-PERSG

* AND PERSK = P_P0001-PERSK.

* IF SY-SUBRC NE 0.

* RAISE ERROR.

* ELSE.

* SELECT TRWAZ INTO L_TRWAZ FROM T510I UP TO 1 ROWS

* WHERE MOLGA = '08'

* AND TRFAR = I0008-TRFAR

* AND TRFGB = I0008-TRFGB

* AND TRFKZ = L_TRFKZ

* AND BEGDA LE P_EXTRACT_DATE

* AND ENDDA GE P_EXTRACT_DATE.

* ENDSELECT.

* ENDIF.

*ENDIF.

**

*CONCATENATE L_TRWAZ(2) L_DECIMAL_PLACE L_TRWAZ+2(2) into C_TRWAZ.

*MOVE C_TRWAZ TO P_TRWAZ.

**

*IF P_P0007-WOSTD LT P_TRWAZ.

**

* MOVE 'Y' TO P_EXTRACT-PTIND.

**

* L_WOSTD_100 = P_P0007-WOSTD * 100.

* INT_PART = L_WOSTD_100 DIV P_TRWAZ.

* DEC_PART = ( ( L_WOSTD_100 / P_TRWAZ ) - INT_PART ) * 1000000.

**

* MOVE '000000000' TO P_EXTRACT-PTPER.

* WRITE INT_PART TO P_EXTRACT-PTPER+1(2).

* WRITE DEC_PART TO P_EXTRACT-PTPER+3(6).

**

*ELSE.

* MOVE SPACE TO P_EXTRACT-PTIND.

* MOVE '000000000' TO P_EXTRACT-PTPER.

*ENDIF.

*----------------------------------------------------------------------*

* End of Example 2

*----------------------------------------------------------------------*

*----------------------------------------------------------------------*

* Requirement 1: The Field Pensionable Remuneration should be the

* Pensionable Gross for this month multiplied by 12.

* This only applies to Part-time Employees

*--------------------------------------------------------------------------*

*

* The Wage Type '/SAL' contains the Pensionable Gross this month

* multiplied by twelve.

*

IF p_extract-ptind = 'Y'.

LOOP AT p_rt.

CHECK p_rt-lgart = '/SAL'.

* format the amount to the interface standard.

PERFORM conv_to_lfz_c11(SAPLHRGPBS_CLASS)

USING p_rt-betrg p_currency

CHANGING p_extract-apenc.

* only take the first occurence.

EXIT.

ENDLOOP.

ENDIF.

*----------------------------------------------------------------------*

* Requirement 2: The Payroll Period End Date should be stored in the

* Service Break Start Date field (!!).

*----------------------------------------------------------------------*

*

* overwrite Service Break Start Date with Payroll Period End Date.

*

p_extract-s1sdt(2) = p_endda+6(2).

p_extract-s1sdt+2(2) = p_endda+4(2).

p_extract-s1sdt+4(4) = p_endda(4).

*----------------------------------------------------------------------*

* Requirement 3: The Payroll Accounting Area should be stored in the

* Third Key field.

*----------------------------------------------------------------------*

*

* overwrite The Third Key Field with Payroll Accounting Area

*

p_extract-key3 = p_p0001-abkrs.

*----------------------------------------------------------------------*

* Requirement 4: The Amount Dates should be derived differently

* DMEMC = 3103YYYY

* DSTRC = Not used

* DNICC = 0504YYYY

* DACTC = 3103YYYY

* DPENC = 3103YYYY

* DSIX = Not used

*----------------------------------------------------------------------*

* If the Payroll Period End Date's Day and Month are after 31 03 then

* use the Payroll Period End Date's Year + 1 as YYYY.

*

DATA: test_date TYPE datum, "YYYYMMDD date format

test_year TYPE i,

test_year_4c(4) TYPE c.

test_year = p_endda(4).

WRITE test_year TO test_year_4c.

CONCATENATE test_year_4c '0331' INTO test_date. "YYYYMMDD date format

IF p_endda > test_date.

test_year = test_year + 1.

WRITE test_year TO test_date(4). "YYYYMMDD date format

test_year = test_year - 1.

ENDIF.

p_extract-dpenc(2) = test_date+6(2).

p_extract-dpenc+2(2) = test_date+4(2).

p_extract-dpenc+4(4) = test_date(4).

p_extract-dmemc = p_extract-dactc = p_extract-dpenc.

* If the Payroll Period End Date's Day and Month are after 05 04 then

* use the Payroll Period End Date's Year + 1 as YYYY.

*

CONCATENATE test_year_4c '0405' INTO test_date. "YYYYMMDD date format

IF p_endda > test_date.

test_year = test_year + 1.

WRITE test_year TO test_date(4). "YYYYMMDD date format

ENDIF.

p_extract-dnicc(2) = test_date+6(2).

p_extract-dnicc+2(2) = test_date+4(2).

p_extract-dnicc+4(4) = test_date(4).






Fill RESBD Structure from EBP Component Structure   ROGBILLS - Synchronize billing plans  
This documentation is copyright by SAP AG.

Length: 22152 Date: 20240523 Time: 170447     sap01-206 ( 226 ms )