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: 

Issue with user exit ZXPADU01 and ZXPADU02

Former Member
0 Kudos

Hi,

I am trying to change the existing record for the info type 0015 for an employee in Pa30 transaction.

my requirement is i need old value and new value when i am changing the existing record in info type 0015.

When i kept break point in user exit ZXPADU01 it is not triggering it is triggering only when we creating the record.

i tried with user exit ZXPADU02 it is not working as per my requirement.

My requirement is :whenever i am changing the existing record(modifying record) i need old value and new value.

Anybody can suggest me how to fix this issue.

Thanks,

Maheedhar

1 ACCEPTED SOLUTION

MarcinPciak
Active Contributor
0 Kudos

Alternatively what Raymond has suggested you can use PAI user exit (ZXPADU02) like this


data i0015 like p0015.

if IPSYST-IOPER = 'MOD'.  "record in change mode
    if INNNN-INFTY = '0015'. 
         call method CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN
          exporting
            PRELP = INNNN
          importing
            PNNNN = I0015.  "here you have record which is being changed

      "now do necessary changes in I0015 structure
     
      "and cast it back like this
        call method CL_HR_PNNNN_TYPE_CAST=>PNNNN_TO_PRELP
          exporting
            PNNNN = I0015
          importing
            PRELP = INNNN.
    endif.
endif.

Regards

Marcin

7 REPLIES 7

Former Member
0 Kudos

Hi,

This are the list of user exit

HRPC0001

HRRPAI01

PARA0001

PARA0002

PBAS0001

PBAS0002

PBASRP01

HRPBAS01

Hope it helps.

Regards

Hiren K.Chitalia

raymond_giuseppi
Active Contributor
0 Kudos

The user exits dont fit your requirement

ZXPADU01- EXIT_SAPFP50M_001 - Customer Default Values for Personnel Administration and Recruitment - proposal of default values, called only once before a creation

ZXPADU02 - EXIT_SAPFP50M_002 - Customer Checks for Personnel Administration and Recruitment - check on new values - you have to store yourself the old values

You may have better chances with the BADI definition of [HRPAD00INFTY|https://forums.sdn.sap.com/search.jspa?objID=c42&q=HRPAD00INFTY] which has interface for BEFORE_OUTPUT, AFTER_INPUT and IN_UPDATE. The last two have parameters with old and new image. Suggestion : Use BEFORE_OUTPUT to change some values and IN_UPDATE to change other database tables. (to insure that the BEFORE_OUTPUT will be executed, you may force a redisplay in the AFTER_INPUT if you detect that changes are to be performed)

Regards,

Raymond

MarcinPciak
Active Contributor
0 Kudos

Alternatively what Raymond has suggested you can use PAI user exit (ZXPADU02) like this


data i0015 like p0015.

if IPSYST-IOPER = 'MOD'.  "record in change mode
    if INNNN-INFTY = '0015'. 
         call method CL_HR_PNNNN_TYPE_CAST=>PRELP_TO_PNNNN
          exporting
            PRELP = INNNN
          importing
            PNNNN = I0015.  "here you have record which is being changed

      "now do necessary changes in I0015 structure
     
      "and cast it back like this
        call method CL_HR_PNNNN_TYPE_CAST=>PNNNN_TO_PRELP
          exporting
            PNNNN = I0015
          importing
            PRELP = INNNN.
    endif.
endif.

Regards

Marcin

0 Kudos

Hi Marcin,

when we changing existing record in PA30 transaction when i click change mode break point is not triggering in ZXPADU02.

can you suggest me how to approach.

thanks,

maheedhar

0 Kudos

Do you have an enhacement activated?

- go to CMOD

- from menu select GoTo->Find

- in Enhancement field type PBAS0001

- run

- if you have it in any of your projects you will get which one

- navigate to it by double click

- select Components

- function EXIT_SAPFP50M_002 must be activated, if not do so in change mode

- now should be working

Note!

Setting session breakpoint might not work here. If you want to be sure that this code is executed just place statement BREAK-POINT. directly in place you want. This way you will be sure that this is not break point issue.

Regards

Marcin

0 Kudos

Issue is solved.

Thanks Marcin....

I have full points to your answer.

Thanks,

Maheedhar

Former Member
0 Kudos

Dear Maheedhar,

The best way to achieve this requirement is to use the PAI user exit ZXPADU02 import parameter PSAVE. The PSAVE parameter contains the PBO original / initial record, before any changes take place.

The INNNN parameter contains the current PAI record as usual, in order to be used for customer check and new values. Thus, you've got both the old and the new record in place, and you can make your comparison according to the business requirements: