Easy way to default position details in IT0000 screen through PA40, if EG/ESG/PERSA is changed at the OM side.
When someone changes position level details like Employee Group(EG), Employee Sub-Group(ESG), or Personnel Area(PERSA) at the OM level, the same does not get reflected when we run the PA40 actions automatically. And, I didn’t find any standard way to reflect the same at the PA side.
So, to populate the updated field values in the Action(0000) screen, there is an easy fix, which I want to share with everybody through this blog post.
Please check the below section for the details.
We have 2 important includes in SAP HCM namely ZXPADU01 & ZXPADU02 respectively.
The first one: ZXPADU01 is called when an infotype is called & the second one: ZXPADU02 is called when an action is performed on an infotype.
We have to write a few lines of ABAP codes to achieve the above-mentioned functionality in the include ZXPADU01.
- Fetch the latest employee group/subgroup details from the OM infotype: 1013(Employee Group/Subgroup) using the FM: RH_READ_INFTY and store it in a work area/variable.
- Fetch the latest personnel area details from OM infotype 1008(Acct. Assignment Features) using the same FM: RH_READ_INFTY and store it in a work area/variable.
Note: A simple perform will suffice the need of fetching both the infotype details. If created, we have to write the logic of the perform in the includes having similar names like ZXPADFXX. XX is the number of the include.
- Declare 3 field symbols.
- Assign the screen fields to the 3 field symbols respectively declared earlier in the same fashion provided below.
‘(MP000000)PSPAR-PERSG’ -> Employee Group
‘(MP000000)PSPAR-PERSK’ -> Employee Subgroup
‘(MP000000)PSPAR-WERKS’ -> Personnel Area
ASSIGN ('(MP000000)PSPAR-PERSG') TO <fs_tmp1>. ASSIGN ('(MP000000)PSPAR-PERSK') TO <fs_tmp2>. ASSIGN ('(MP000000)PSPAR-WERKS') TO <fs_tmp3>.
- Lastly, assign the latest values of EG/ESG/PERSA to the respective field symbols.
Note: I am using the ABAP 7.4 syntax to avoid the creation of workareas. Creating workareas/variables & using the same to perform the assignment operation will create no issues.
try. <fs_tmp1> = lt_p1013[ 1 ]-persg. <fs_tmp2> = lt_p1013[ 1 ]-persk. <fs_tmp3> = lt_p1008[ 1 ]-persa. CATCH cx_sy_itab_line_not_found. "Do Nothing ENDTRY.
Now, everything is done. Just activate & use it. 🙂
The latest values of the EG/ESG/PERSA will get reflected in the IT0000 screen when a PA action is run through PA40.
As this is my first SAP-related blog post, please share your thoughts regarding the same.
Good information. Keep it up good work. 🙂
Though this is a rare scenario..still it is a good idea to fulfill client's requirement..