06-01-2015 8:26 AM
Hi experts!
We need delete all records of a customer infotype 9003. For this reason we have developed a program to do this function but it doesn't work by the date. In the debugger we can see the content of the returned value (l_return):
TYPE | E |
ID | S5 |
NUMBER | 11 |
MESSAGE | Date . . contains invalid characters |
LOG_NO | |
LOG_MSG_NO | 0 |
MESSAGE_V1 | . . |
I have tried changing the code of v_ini and v_ffin formatting the date in different formats but no one works.
The code is similar to:
...
v_fini = wa_p9003-begda.
v_ffin = wa_p9003-endda.
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = wa_p9003-pernr
IMPORTING
return = l_return.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = lv_infty
number = wa_p9003-pernr
subtype = wa_p9003-subty
validityend = v_ffin
validitybegin = v_fini
recordnumber = wa_p9003-seqnr
record = wa_p9003
operation = 'DEL'
nocommit = ''
IMPORTING
return = l_return. "dialog_mode = '1'
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = wa_p9003-pernr
IMPORTING
return = l_return.
...
Why is not possible delete the infotype records programmatically?
Anyone knows another option to delete all the records of a customer infotype?
Kind regards,
Julian.
06-01-2015 8:36 AM
Hi
Date required in format of 'yyyymmdd' for validity end and begin. Also it should be in same format for dates in structure wa_P9003. Check this first. are all dates in structure are correct?
Check the data which you want to delete, is the data valid? I mean are you able to delete the same data from PA30. Sometimes the records created in infotype through programs may have invalid date format because of direct table update, in this case, system may not allow you delete the record.
Regards
Ajay
06-01-2015 8:36 AM
Hi
Date required in format of 'yyyymmdd' for validity end and begin. Also it should be in same format for dates in structure wa_P9003. Check this first. are all dates in structure are correct?
Check the data which you want to delete, is the data valid? I mean are you able to delete the same data from PA30. Sometimes the records created in infotype through programs may have invalid date format because of direct table update, in this case, system may not allow you delete the record.
Regards
Ajay
06-03-2015 7:57 AM
Hi Ajay,
I've fixed the error.
The problem was due to a new date field added to the infotype 9003 (table PA9003).
When the report is executed to delete all the records it fails in the new field because all are empty.
To avoid problems in the PRO enviroment I have to run first the report to delete all records and later pass the modifications to the table an infotype.
Kind regards,
Julian.
06-03-2015 9:01 AM
Hi Julian,
Could you please close the thread.
Have a nice day!
Regards
Ajay