Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP HR - Populating fields on Infotype screen

Former Member
0 Kudos

Hi

I have the foll. requirement.

In Infotype 8 when an employee enters the ANSAL field ie. the value for Annual Salary all the wage types should get populated on their own in the wage type table control in the screen based on the following calulations :

basic pay = 40% of ANSAL

HRA = 30% of basic. etc.

Please tell me where exactly I should write the code for this calculation and how.

1 ACCEPTED SOLUTION

shafiq_rehman3
Active Contributor
0 Kudos

You need to implement use exit EXIT_SAPFP50M_001, (cmod/smod thing)

and code something like this inside:


IF innnn-infty = '0008'.
    call method cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
      exporting
        prelp = innnn
      importing
        pnnnn = wa_p0008.
* Assign the values/calculations here
*  wa_p0008-yourfield = whatever_you_want.   "Change this line
*  wa_p0008-yourfield = whatever_you_want.   "Change this line
*  etc.
*  etc.

    call method cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
      exporting
        pnnnn = wa_p0008
      importing
        prelp = innnn.

7 REPLIES 7

Former Member
0 Kudos

Hi Mrunal,

search for user-exit or BADIs for the transaction PA30.

EXIT_SAPFP50M_001

EXIT_SAPFP50M_002

EXIT_SAPMP50A_001

Regards,

Amit R.

shafiq_rehman3
Active Contributor
0 Kudos

You need to implement use exit EXIT_SAPFP50M_001, (cmod/smod thing)

and code something like this inside:


IF innnn-infty = '0008'.
    call method cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
      exporting
        prelp = innnn
      importing
        pnnnn = wa_p0008.
* Assign the values/calculations here
*  wa_p0008-yourfield = whatever_you_want.   "Change this line
*  wa_p0008-yourfield = whatever_you_want.   "Change this line
*  etc.
*  etc.

    call method cl_hr_pnnnn_type_cast=>pnnnn_to_prelp
      exporting
        pnnnn = wa_p0008
      importing
        prelp = innnn.

0 Kudos

Hi Thanks all,

I made the suggested changes in ZXPADU02,whcich is the user exit program. But the problem now is I want to populate the changes into the table control available in infotype 0008 for displaying salary breakup, how do i do that ?

0 Kudos

I have a different problem. I can access some of the screen fields. But I cannot access AMOUNT field. If anyone knows, please help me out...I want to put a value into that AMOUNT field after some calculation.

0 Kudos

If you are in ECC 6, the best way is using BADI HRPAD00INFTY. There are 3 events, PBO, PAI and IN_UPDATE and you have access to the PA0008 structure, so you can change the fields LGA01, ANZ01, etc within the PAI event.

Former Member
0 Kudos

Hi

Maybe u can see the exit ZXPADU02

Regards

Gregory

Former Member
0 Kudos

Hi Experts,

I have a requirement where in when an action 'Create trip ' is triggered and when all the fields are filled for a custom infotype 9051 and the "save' is clicked a record has to inserted into the it2001 with the begda nad endda of 9051. To achieve this I using the exit ZXPADU02. Will that be helpul and how can go about the code. Plz provide poinetrs.

TIA