Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

FM 'HR_INFOTYPE_OPERATION' throws error for Infotype 0021 modification

former_member300568
Participant
1,856

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
8 REPLIES 8

former_member186746
Active Contributor
295

Hi,

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

Kind regards, Rob Dielemans

0 Kudos
295

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.

Former Member
0 Kudos
295

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

0 Kudos
295

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 Kudos
295

Horrible advice!

rajkumarnarasimman
Active Contributor
0 Kudos
295

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

0 Kudos
295

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 Kudos
295

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