cancel
Showing results for 
Search instead for 
Did you mean: 

HRPAD00INFTY - in_update operation - how to get the correct ipspar-actio code

timo_ehl3
Participant
0 Kudos

Hi out there,

i'm using in_update mthod of BADI HRPAD00INFTY.

when i come out from dynpro overview, my Action is ALWAYS LIS1. Even if am deleting data out of it.

I Need to have my method callod only if there is INS, MOD or COP. Any idea?

 DATA:
 ls_old_image TYPE psoper,
 ls_prelp_new TYPE prelp,
 ls_prelp_old TYPE prelp,
 ls_p0000_new TYPE p0000,
 ls_p0000_old TYPE p0000,
 l_subrc like sy-subrc.

 FIELD-SYMBOLS <ls_new_image> TYPE psoper.
 FIELD-SYMBOLS <ls_prelp> TYPE prelp.


 LOOP AT old_image into ls_p0000_old.
 MOVE-CORRESPONDING ls_p0000_old TO ls_prelp_old.
 CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
 EXPORTING
 prelp = ls_prelp_old
 IMPORTING
 pnnnn = ls_p0000_old.
 endloop.




 LOOP AT new_image ASSIGNING <ls_new_image>.
 IF <ls_new_image>-infty = '0000'.
 CASE ipspar-actio.

 WHEN 'INS' OR 'MOD' OR 'COP'. " For Action Insert
 MOVE-CORRESPONDING <ls_new_image> TO ls_prelp_new.
 CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
 EXPORTING
 prelp = ls_prelp_new
 IMPORTING
 pnnnn = ls_p0000_new.
*

Accepted Solutions (1)

Accepted Solutions (1)

antoine_foucault
Active Contributor
0 Kudos

I think you can compare with your old_image tables... can you? anyhow, if you are in PA30 I think you can make an expectation to only process your logic once per employee.... otherwise check the aedtm field maybe? only process record modified by current user at current date?

Answers (5)

Answers (5)

timo_ehl3
Participant
0 Kudos

yes. i will do with aedat and sy-uname and maybe some other workarround. thanks...or maybe i will go to boring t588z 🙂

timo_ehl3
Participant
0 Kudos

Hi! Thank you. I will try.

why ther are multiple lines in the new_image table.I just want to use this snippet to update another infotype once a time.

in new_image there are f.e. 2 lines with opera "I". the new one and the delimitted old_one.

When im Loop int new_image my funtion is called twice....so...any best practice?

Thank you in advance

former_member226519
Active Contributor
0 Kudos

NEW_IMAGE-OPERA

I - insert

U - update

M - modify

J - insert by delimit

antoine_foucault
Active Contributor
0 Kudos

Could it be an option for you if you could maybe review the last field "OPERA" in the new_image table to get the operation carried out for each record?

I think you can have those values:

* CONSTANTS --------------------------------------------------------- *   

CONSTANTS: co_opera_delete           TYPE hropera        VALUE 'D'.   

CONSTANTS: co_opera_insert           TYPE hropera        VALUE 'I'.   

CONSTANTS: co_opera_modift           TYPE hropera        VALUE 'M'.   

CONSTANTS: co_opera_update           TYPE hropera        VALUE 'U'.
antoine_foucault
Active Contributor
0 Kudos

Could it be an option for you if you could maybe review the last field "OPERA" in the new_image table to get the operation carried out for each record?

I think you can have those values:

* CONSTANTS --------------------------------------------------------- *   

CONSTANTS: co_opera_delete           TYPE hropera        VALUE 'D'.   

CONSTANTS: co_opera_insert           TYPE hropera        VALUE 'I'.   

CONSTANTS: co_opera_modift           TYPE hropera        VALUE 'M'.   

CONSTANTS: co_opera_update           TYPE hropera        VALUE 'U'.