07-23-2008 3:29 PM
Hey All,
I am trying to write a report to fix some corrupted HR address data(IT0006) using FM HR_INFOTYPE_OPERATION. I know how to use the FM in INS and MOD mode, but this time I am trying to use the delimit operation.
Due to error we have a lot of records with subtype 'Blank', Instead of deleting the corrupted records, I am trying to delemit the records to a older date so that it doesnt show up at the top.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0006'
number = wa_p0006-pernr
subtype = wa_p0006-subty
objectid = wa_p0006-objps
lockindicator = wa_p0006-sprps
validityend = wa_p0006-endda
validitybegin = wa_p0006-begda
recordnumber = wa_p0006-seqnr
record = wa_p0006
operation = 'LIS9'
tclas = 'A'
dialog_mode = '0'
IMPORTING
return = wa_bapiret1.
When i try to change the enddate so that it delimits the record to that date, it gives me a complex application error.
Any input is higly appreciated.
Thanks
07-23-2008 3:55 PM
Hi Aparna,
try using the operation 'MOD' with e_p0006 having the modified date
chechk this
e_p0006 = wa_p0006.
e_p0006-endda = 'Delimit date'.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0006'
number = wa_p0006-pernr
subtype = wa_p0006-subty
objectid = wa_p0006-objps
lockindicator = wa_p0006-sprps
validityend = wa_p0006-endda
validitybegin = wa_p0006-begda
recordnumber = wa_p0006-seqnr
record = e_p0006
operation = 'MOD'
tclas = 'A'
dialog_mode = '0'
IMPORTING
return = wa_bapiret1.
Edited by: Jacks M on Jul 23, 2008 8:25 PM
07-23-2008 3:55 PM
Hi Aparna,
try using the operation 'MOD' with e_p0006 having the modified date
chechk this
e_p0006 = wa_p0006.
e_p0006-endda = 'Delimit date'.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0006'
number = wa_p0006-pernr
subtype = wa_p0006-subty
objectid = wa_p0006-objps
lockindicator = wa_p0006-sprps
validityend = wa_p0006-endda
validitybegin = wa_p0006-begda
recordnumber = wa_p0006-seqnr
record = e_p0006
operation = 'MOD'
tclas = 'A'
dialog_mode = '0'
IMPORTING
return = wa_bapiret1.
Edited by: Jacks M on Jul 23, 2008 8:25 PM
07-23-2008 4:09 PM
I had given that a try, but if i change the endda using MOD operation it always gave me an error:
EPG 009 No data stored for 0006 in the selected period.
It doesnt change the endda.
Any inputs??
07-23-2008 4:33 PM
infty = '0006'
number = wa_p0006-pernr
subtype = wa_p0006-subty
objectid = wa_p0006-objps
lockindicator = wa_p0006-sprps
validityend = wa_p0006-endda
validitybegin = wa_p0006-begda
recordnumber = wa_p0006-seqnr
these are the parameters using which it searches the record in database you have to pass the all the parameters with old values to identify the record .. you are missing something for which it is throwing the error
what ever changes will be done on
record = wa_p0006..
the structure will be having the modified date so that it does the operation through MOD..
07-23-2008 4:42 PM
Chnage your code..
DATA : w_enddate TYPE sy-datum.
w_enddate = wa_p0006-endda.
wa_p0006-endda = 'Delimit date'.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = '0006'
number = wa_p0006-pernr
subtype = wa_p0006-subty
objectid = wa_p0006-objps
lockindicator = wa_p0006-sprps
validityend = w_enddate
validitybegin = wa_p0006-begda
recordnumber = wa_p0006-seqnr
record = e_p0006
operation = 'MOD'
tclas = 'A'
dialog_mode = '0'
IMPORTING
return = wa_bapiret1.
07-23-2008 5:30 PM
Hi Aparna,
since LIS9 ist the function-code for LIST-DELIMIT, user interaction is required to select the records to be delimited.
Just try
operation = 'DLIM'
instead. If your specification fits but one record, this should do the trick.
Regards
07-23-2008 5:41 PM
Thank you Jeorg for your reply.
I tried DLIM but it is not properly defined in the T589A table.
It gives me the error No entry in table T589A for P DLIM, as the indicator in case od DLIM is Z instead of P in the table. Dont know why.
Previously suggested MOD operations by Jacks is changing the date, So I guess that would do the trick.
Thanks for the replies.