Skip to Content
0

FM 'HR_INFOTYPE_OPERATION' throws error for Infotype 0021 modification

May 09, 2017 at 08:00 PM

397

avatar image

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

3 Answers

Rob Dielemans May 10, 2017 at 09:23 AM
0

Hi,

If you're using new BEGDA and ENDDA then you should use an insert or a copy.

Kind regards, Rob Dielemans

Show 1 Share
10 |10000 characters needed characters left characters exceeded

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.

0
avatar image
Former Member May 11, 2017 at 06:03 AM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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?

0

Horrible advice!

0
Rajkumar Narasimman May 11, 2017 at 02:23 PM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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.

0

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.

  1. If Manual update worked well, then the issue with FM HR_INFOTYPE_OPERATION
  2. If Manual update fails, then we need to check with functional consultant.

Regards

Rajkumar Narasimman

0