cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing BADI - HRPAD00INFTY

Former Member
0 Kudos

Hi Experts,

I am new to BADI (though I know the general steps for implementation - se18 and se19) and would like to know how to implement the method IN_UPDATE from the BADI - HRPAD00INFTY. I am not able to figure out what the parameters IPSPAR, OLD_IMAGE, NEW_IMAGE, OLD_PREF_IMAGE, NEW_PREF_IMAGE are for and how they can be used in coding (am looking for info in addition to what is in the documentation). According to the requirement I need to fill the supervisor ID field P0001–MSTBR and display it when the user saves the infotype record. Any sample code for implementing this method would be very helpful.

Thanks

Sri

Edited by: Sri Maddineni on Mar 12, 2008 5:57 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Sri,

i am not sure about the method IN_UPDATE , but why dont you try the method AFTER_INPUT in the same badi.It should solve your requirement . Infact you can go for the userexit PBAS0001 .

data : i0001 type p0001.

CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn

EXPORTING

prelp = innnn

IMPORTING

pnnnn = i0001.

Move supervisorarea to i0001-MSTBR.

CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp

EXPORTING

pnnnn = i0001

IMPORTING

prelp = innnn.

Former Member
0 Kudos

Should the code you sent me be written in the method AFTER_INPUT? But I am not able to find the required paramter MSTBR even in this module. Could you please elaborate what you meant?

Thanks

Former Member
0 Kudos

Hi Sri ,

Forget the badi , do your coding in the userexit PBAS0001 AFTER INPUT. this function module(EXIT_SAPFP50M_002) has an input parameter INNNN (both import & export) .

The method cl_hr_pnnnn_type_cast=>prelp_to_pnnnn maps INNNN to your infotype structure which is i0001( i0001 like p0001 )

Now you can modify i0001( i0001 will have MSTBR field) according to your requirement and export your changes using the method

cl_hr_pnnnn_type_cast=>pnnnn_to_prelp

Former Member
0 Kudos

Thanks a lot Balaji. You saved my day. I really appreciate your time and effort.

Former Member
0 Kudos

When you do the move to i0001, it fills in the data area that you declared above. Because i0001 is of type p0001, all of the fields of infotype 1 are in i0001. You do your changing to i0001-mstbr.

Former Member
0 Kudos

Thanks for the reply Kerschke.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Experts,

I am hoping somebody would help me out. I am struck in a new issue. None of the parameters of IN_UPDATE method in HRPAD00INFTY BADI have the field MSTBR which I need to update. Could you please suggest me how to work around this?

Thanks

Former Member
0 Kudos

I agree with Balaji that you should use AFTER_INPUT instead of IN_UPDATE.

You'll need to define a data area like this:

DATA i0001 TYPE p0001.

You will need to make sure you are in this method for infotype 1 with a case statement:

CASE new_innnn-infty.

When '0001'.

Then you move your new_innnn to your work area:

move new_innnn to i0001.

If you only want to do this on Save, you can check sy-ucomm = 'UPD' in your case statement before performing any logic.