Symptom
You want to Create a Dynamic Action.
The following wiki page describes a way to update entires in Infotype 0041 – Date Specifications infotype whenever an unpaid leave is created, changed or deleted via 2001 – Absences infotype.
Environment
Both of the following dates are maintained in IT0041:
- 01 – Legal entry date
- 02 – Base date used for seniority calculation
Cause
Whenever the employee takes an unpaid leave, the base date for seniority calculation is shifted by the absence days (as the days on absence leave are non-working days for the employee, they should not be counted in seniority calculation). Likewise, when the unpaid leave is deleted or changed, the date for seniority calculation will be shifted accordingly. Dynamic actions configuration will be used to provide this automation.
0120 – Unpaid Absence is the subtype of infotype 2001.
Solution
To create the Dynamic Action, you must follow the below steps which are divided in two major sections: create the report and edit view V_T588Z.
1. Create a program via SE38 as follows :
REPORT ZSENIORITY. INCLUDE : MPPDAT00. TYPE-POOLS HRQTA. TABLES: RP50D, P2001, PA2001, PA0041. FORM GET_DATE_CREATE. SELECT * FROM PA0041 WHERE ENDDA EQ '99991231' AND PERNR EQ P2001-PERNR. * Whenever an unpaid leave is created, the seniority date is increased by the absence days RP50D-DATE1 = PA0041-DAT02 + P2001-ABWTG. ENDSELECT. ENDFORM. FORM GET_DATE_DELETE. SELECT * FROM PA0041 WHERE ENDDA EQ '99991231' AND PERNR EQ P2001-PERNR. * Whenever an unpaid leave is deleted, the seniority date is decreased by the absence days RP50D-DATE1 = PA0041-DAT02 - P2001-ABWTG. ENDSELECT. ENDFORM. FORM GET_DATE_CHANGE. DATA : L_ABWTG TYPE ABWTG. SELECT * FROM PA0041 WHERE ENDDA EQ '99991231' AND PERNR EQ P2001-PERNR. CLEAR : L_ABWTG. SELECT * FROM PA2001 WHERE SUBTY EQ '0120' AND PERNR EQ P2001-PERNR AND BEGDA GE PA0041-DAT01. *Total of unpaid absence days the employee used. L_ABWTG = L_ABWTG + P2001-ABWTG. ENDSELECT. * Whenever an unpaid leave is changed, the seniority date is calculated from scratch via all unpaid leave entries in PA2001. RP50D-DATE1 = PA0041-DAT01 + L_ABWTG. ENDSELECT. ENDFORM. |
2. Edit V_T588Z – Dynamic Actions table via SM31 as follows :
Add the following entries :
Stype Field N FC No S Var.Func.Part
0120 02 01 ** UPDATE 0041 WHEN 2001-0120 IS CHANGED **
0120 02 02 P T001P-MOLGA=’47’ — SPECIFY YOUR OWN COUNTRY GR.
0120 02 03 F GET_DATE_CHANGE(ZSENIORITY)
0120 02 04 I MOD,0041/D
0120 02 05 W P0041-DAR02=’02’
0120 02 06 W P0041-DAT02=RP50D-DATE1
Stype Field N FC No S Var.Func.Part
0120 04 07 ** UPDATE 0041 WHEN 2001-0120 IS CREATED **
0120 04 08 P T001P-MOLGA=’47’ — SPECIFY YOUR OWN COUNTRY GR.
0120 04 09 F GET_DATE_CREATE(ZSENIORITY)
0120 04 10 I MOD,0041/D
0120 04 11 W P0041-DAR02=’02’
0120 04 12 W P0041-DAT02=RP50D-DATE1
Stype Field N FC No S Var.Func.Part
0120 08 07 ** UPDATE 0041 WHEN 2001-0120 IS DELETED **
0120 08 08 P T001P-MOLGA=’47’ — SPECIFY YOUR OWN COUNTRY GR.
0120 08 09 F GET_DATE_DELETE(ZSENIORITY)
0120 08 10 I MOD,0041/D
0120 08 11 W P0041-DAR02=’02’
0120 08 12 W P0041-DAT02=RP50D-DATE1
Leave A Comment?
You must be logged in to post a comment.