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: 

Preoblem in HR_INFOTYPE_OPERATION

former_member212705
Active Participant
0 Kudos

Hi Experts,

I am facing one problem related to HR FM 'HR_INFOTYPE_OPERATION'. I will explain step by step:

1- I have to upload one record in inoftype from ouye excel file that is :

Personal Number #     Last Name      First Name         deduction   Start Date     End Date          Wage Type         Amt               PA

   000001                    ABACD              PQRS                 R          20121001         20130207          U162             0                    U2

2- and currently infotype 00014 is having two records:

Wage Type    Begin Date     End Date       Amount

U162             2012/10/01    2012/12/31    22.50

U162             2013/01/01    9999/12/31    21.25

3- We call the FM 'HR_INFOTYPE_Operation' to delete first record that is (using DEL operation)


Wage Type    Begin Date     End Date       Amount

U162             2012/10/01    2012/12/31    22.50

so only one record remains that is ::

U162  2013/01/01 9999/12/31 21.25

4- Now we have to call again that FM to insert the file record that has to be uploaded


Personal Number #     Last Name      First Name         deduction   Start Date     End Date          Wage Type         Amt               PA

   000001                    ABACD              PQRS                 R          20121001         20130207          U162             0                    U2

5- But  after applying FM 'HR_INFOTYPE_OPERATION' with 'INS' Operation
the records refected are:

Records as coming after insert
Wage Type  Begin Date        End Date                Amount
U162           2013/02/08       9999/12/31               21.25
U162           2012/10/01       2013/02/07                22.50 

6- BUT As per requirement records should be :

Wage Type Begin Date End Date Amount


U162                        2012/10/01               2012/12/31             22.50
U162                        2013/01/01              2013/02/07             21.25 

This FM is inserting one record of the file but again creating one other from the next start date 2013/02/08 - 9999/12/31
How to avoid that and create the record as per requirement.

Please help.

Regards,

Ashish

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ashish,

Check your "VALIDITYEND" should be pass some value or not , if not the FM "HR_INFOTYPE_OPERATION"  inside call another FM "HR_MAINTAIN_MASTERDATA" and in this FM "ENDDA"  Default value is '99991231' .  so check your field mapping correctly or not with "HR_INFOTYPE_OPERATION" particular field  "VALIDITYEND"

.

Regard's

Smruti

25 REPLIES 25

JonathanM
Contributor
0 Kudos

Hi Ashish,

Did you check the Time contraint of the subtype? Here the subty is the wagetype, so this is in table V_T512Z.

Did you check the data you pass in HR_INFOTYPE_OPERATION as BEGDA/ENDDA in the parameters but also the BEGDA/ENDDA in the RECORD input parameter structure?

Best regards,

Jonathan

0 Kudos

Hi jon,

Yes i checked, while passing into FM we have begda = 2012/10/01 and endda = 2013/02/07 (same as in the input file ) and amount = 22.50.  (Time constraint is 'T' ) And one record that is present in infotype already after deleting operation is ---

U162    2013/01/01    9999/12/31       21.25

NOw after exceuting FM records are::

U162    2013/02/08       9999/12/31         21.25 

U162    2012/10/01       2013/02/07         22.50           ----- currently inserted

BUT this should be ::

U162    2012/10/01          2012/12/31     22.50

U162    2013/01/01          2013/02/07     21.25

This is what user needed.

0 Kudos

Hi Ashish,

This is because the of the time constraint in table V_T512Z (checked on "once") that allow only one record on the same period.

As the new record begins before the other, the system is setting it before the existing record.

What you should do in that case is to work in steps. Check what's already in the system, read the records, if the existing records are overlapping your new record, then first modify the existing record and then upload your new record.

Best regards,

Jonathan

0 Kudos

Hi Jon,

But in this case how i will do that. I mean how  to maintain correct entry.

Wage type    begda                  endda            amount

U162             2012/10/01          2012/12/31     22.50

U162             2013/01/01          2013/02/07     21.25

Rather than this

U162    2013/02/08       9999/12/31         21.25 

U162    2012/10/01       2013/02/07         22.50

can you plz explain. As i am new to ABAP HR.

0 Kudos

Hi Ashish,

I am not sure, but is there CHANGE option also along with INS and DEL. If so try with that.

Try with these two options:

MOD Change

INSS Create for Actions is not converted to Change

Regards,

Swarna

Former Member
0 Kudos

Hi Ashish,

Check your "VALIDITYEND" should be pass some value or not , if not the FM "HR_INFOTYPE_OPERATION"  inside call another FM "HR_MAINTAIN_MASTERDATA" and in this FM "ENDDA"  Default value is '99991231' .  so check your field mapping correctly or not with "HR_INFOTYPE_OPERATION" particular field  "VALIDITYEND"

.

Regard's

Smruti

0 Kudos

Hi smruti,

I have checked. The VALIDITYEND is passed with 2013/02/07 .But as one record is currently present in 0014 as -

Wage Type           Begin Date             End Date               Amount

U162                    2013/01/01            9999/12/31              21.25

And i am inserting this record ::

Start Date         End Date          Wage Type

20121001         20130207          U162

and after inserting it is creating one extra record :

Wage Type    Begin Date           End Date                Amount

U162            2013/02/08           9999/12/31               21.25

So finally table has two records:

Wage Type            Begin Date                   End Date                Amount

U162                       2013/02/08              9999/12/31               21.25

U162                       2012/10/01             2013/02/07                22.50

BUT user is needed as maintain as::

Wage Type               Begin Date                    End Date              Amount

U162                        2012/10/01                    2012/12/31              22.50

U162                        2013/01/01                    2013/02/07             21.25

0 Kudos

Can you provide Your Code , or debug your code check some where this field value refresh or clear "VALIDITYEND" .

Regard's

Smruti

0 Kudos

After Deleting the Record Using "DEL"  Operation  , then you use "INS" for Inserting New record , by default this FM take Default value is '99991231' when you use Operation is 'INS" , so my point of view Once New record is Insert then Call FM once again using Operation is "MOD" for that Particular Field Only .i.e. VALIDITYEND  and modify Your End Date .

Example Steps:

1 : using DEL operation for delete record.

2:  using INS  Operation Insert New record

3:   using MOD Operation Modify " Validity End Date".


Regard's

Smruti

0 Kudos

Thanks Smruti,

One more thing suppose i have a record with end date 9999/12/31 and i want to modify it with   2013/02/07 then how to do that. as it is throwing an error "No data stored for 0014 in the selected period". I mean how to pass dates so that 9999/12/31 would be changed to desired date. Please help as this HR is going over my head .

Regards,

Ashish

0 Kudos

    CALL FUNCTION 'HR_INFOTYPE_OPERATION'

      EXPORTING

        INFTY                         = '0014'

        NUMBER                    = P0014-PERNR          "Existing value

        VALIDITYEND              = P0014-ENDDA                            " with New date what u want

        VALIDITYBEGIN           = P0014-BEGDA          "Existing value

        RECORDNUMBER       = P0014-SEQNR         

        RECORD                     = P0014

        OPERATION                = 'MOD'

        DIALOG_MODE           = '1'

      IMPORTING

        RETURN                 = RETURN_STRUC

        KEY                    = RECORD_KEY.

Regard's

Smruti

0 Kudos

also Check this for Supporting purpose ...

Note 615511 - Long runtimes with 'HR_MAINTAIN_MASTERDATA' for HR infotypes

Regard's

Smruti

0 Kudos

No not working

suppose i have this record

Now i have written this code

      gt_p0014-infty = '0014'.
    gt_p0014-pernr = 00000028.
    gt_p0014-begda = '20140928'.     "existing date

  gt_p0014-endda = '20150928'.       "New date , as i want to change 9999/12/31
    gt_p0014-subty = 'MDD0'.
    gt_p0014-betrg = '700'.

   CALL FUNCTION 'HR_INFOTYPE_OPERATION'
  EXPORTING
    infty                  = '0014'
    number                 = gt_p0014-pernr
   SUBTYPE                = gt_p0014-subty
*   OBJECTID               = OBJECTID
*   LOCKINDICATOR          = LOCKINDICATOR
   VALIDITYEND            = gt_p0014-begda
   VALIDITYBEGIN          = gt_p0014-endda
   RECORDNUMBER           = gt_p0014-seqnr
    record                 = gt_p0014
    operation              = 'MOD'
*   TCLAS                  = 'A'
   DIALOG_MODE            = '1'
*   NOCOMMIT               = NOCOMMIT
*   VIEW_IDENTIFIER        = VIEW_IDENTIFIER
*   SECONDARY_RECORD       = SECONDARY_RECORD
IMPORTING
   RETURN                 = RETURN
   KEY                    = KEY
          .

Now i am getting this error ::

I am unabale to understand why??

0 Kudos

After Inserting Operation done Successfully then call FM"BAPI_TRANSACTION_COMMIT "

then Call FM "HR_INFOTYPE_OPERATION" for Modification then Finally call FM"BAPI_TRANSACTION_COMMIT "

Regard's

Smruti


0 Kudos

Hi,

if you want to chang KEY values (e.g. BEGDA ENDDA) of an existing records, you must nevertheless use the EXISTING values in the identifying fields:

    infty                  = '0014'

    number                 = gt_p0014-pernr

   SUBTYPE                = gt_p0014-subty

*   OBJECTID               = OBJECTID

*   LOCKINDICATOR          = LOCKINDICATOR

   VALIDITYEND            = gt_p0014-begda

   VALIDITYBEGIN          = gt_p0014-endda

   RECORDNUMBER           = gt_p0014-seqnr

The NEW values are passed in the new record (gt_p0014).

regards.

Tom

0 Kudos

Check this Discussion helpful to you "UPDATE INFO TYPE P0014 | SCN" .

Regard's

Smruti

0 Kudos

I got . able to change the date now . Thank you so much. Thank you for following my thread so long time. May be i would be needing some more help tomorrow.

0 Kudos

Hi Thomas,

I got your point. Thank you so much for your help.

Former Member
0 Kudos

Dear Ashish,

I think Last entry would be like that .

U162                        2012/10/01               2012/12/31             22.50
U162                        2013/01/01              2013/02/07             21.25

U162                       2013/02/08             9999/12/31               21.25

because SAP Provided or taken the last valdity Date means ENDDA - 9999/12/31. So You Can Replace

this line

U162                        2013/01/01              2013/02/07             21.25

to

U162                        2013/01/01             9999/12/31             21.25 .

It will work.

Ram Shanker

0 Kudos

Hi Ram,

The last entry in the table is ::

Wage Type    Begin Date     End Date       Amount

U162             2013/02/08    9999/12/31    21.25

U162             2012/10/01   2013/02/07    22.50 

Not This one.

U162                        2012/10/01               2012/12/31             22.50
U162                        2013/01/01              2013/02/07             21.25

U162                        2013/02/08             9999/12/31               21.25

Reagards,

Ashish

0 Kudos

Hi Ram,

The last entry in the table is ::

Wage Type    Begin Date     End Date       Amount

U162             2013/02/08    9999/12/31    21.25

U162             2012/10/01   2013/02/07    22.50 

Not This one.

U162                        2012/10/01               2012/12/31             22.50
U162                        2013/01/01              2013/02/07             21.25

U162                        2013/02/08             9999/12/31               21.25

Reagards,

Ashish

0 Kudos

Hi Ashish,

Last entry should be like this. So Please make changes in data because ENDDA = 

9999/12/31  (As Per my understanding ,Last Entry of Validate Date in SAP )

U162                        2013/01/01             9999/12/31               21.25

Ram

0 Kudos

HI Ram,

One thing i wanna ask:

suppose i have a record with end date 9999/12/31 and i want to modify this it with   2013/02/07 then how to do that. as it is throwing an error "No data stored for 0014 in the selected period". I mean how to pass dates so that 9999/12/31 would be changed to desired date..

Please reply

0 Kudos

Thank you Ram for helping me over this issue.

0 Kudos

Hi,

have you already tried HR_PSBUFFER_INITIALIZE. Might be that there is a buffer problem

1. Load File

2. process delete.

3. HR_PSBUFFER_INITIALIZE

4. process insert.

regards