2017 May 09 9:00 PM
Hi all,
I am using the FM 'HR_INFOTYPE_OPERATION' to modify the data in pa0021.
LOOP AT T_P0021 ASSIGNING <Wa_p0021>.CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0021'
NUMBER = <wa_p0021>-pernr
SUBTYPE = <Wa_p0021>-subty
VALIDITYEND = <wa_p0021>-endda
VALIDITYBEGIN = <wa_p0021>-begda
RECORD = <Wa_p0021>
OPERATION = 'MOD'
DIALOG_MODE = '2'
VIEW_IDENTIFIER = '07'
IMPORTING
RETURN = return.
ENDLOOP.
I get an error saying 'No data stored for 0021 in the selected period'. Yes the pa0021 has different dates for the pernr and subty, however i am trying to modify that record with the new dates that i am passing through the function module.
Please help
2017 May 10 10:23 AM
Hi,
If you're using new BEGDA and ENDDA then you should use an insert or a copy.
Kind regards, Rob Dielemans
2017 May 10 4:11 PM
Hi Rob,
Thanks, even when i try with INS , i get an error saying '009No data stored for 0003 in the selected period' .
I am trying to update the pa0021 table for the employee with new dates , but i am not able to do it.
2017 May 11 7:03 AM
Hi,
You can change existing record's begda and endda by deleting the existing record only.
1. Delete existing record
2. Create a new record with new begda and new endda.
Thanks and Regards,
Chandra
2017 May 11 2:31 PM
So should i call the function module twice with 'DEl' operation once and with 'INS' operation again?
But in p10021 table i see many records for the same pernr with different dates ? why am i not able to insert new one?
2017 May 11 4:22 PM
2017 May 11 3:23 PM
Hi Divya,
Kindly check by updating the particular employee(infotype 21) information manually in transaction PA30, Hope the same error will trigger during manual update.
Regards
Rajkumar Narasimman
2017 May 11 3:26 PM
Hi Rajkumar,
I tried through modify statement and i was able to add a record for the same pernr with same subtype just with different dates, however when i do through the function module wither with INS or MOD operation i am not able to. I am even locking the employee before the update.
2017 May 11 4:53 PM
Hi Dhivya,
Modify statement updates the value directly in database table without checking any condition. (We should not use this method, it should be avoided).
HR_INFOTYPE_OPERATION validates all the conditions before updating the data in database table. For example Time Constraints.
Kindly check and update the infotype 0021 manually using transaction PA30 manually for the problematic customer.
Regards
Rajkumar Narasimman