Skip to Content
0

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

May 03, 2017 at 09:03 AM

187

avatar image
Former Member

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.
*
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

6 Answers

Best Answer
antoine foucault May 03, 2017 at 10:20 AM
0

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?

Share
10 |10000 characters needed characters left characters exceeded
Volker Binder May 03, 2017 at 09:10 AM
0

NEW_IMAGE-OPERA

I - insert

U - update

M - modify

J - insert by delimit

Share
10 |10000 characters needed characters left characters exceeded
antoine foucault May 03, 2017 at 09:10 AM
0

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'.
Share
10 |10000 characters needed characters left characters exceeded
antoine foucault May 03, 2017 at 09:10 AM
0

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'.
Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member May 03, 2017 at 10:10 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member May 03, 2017 at 11:47 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded