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: 

HR_INFOTYPE_OPERATION

Former Member
0 Kudos

Hi All,

I have requirement that whenever i create infotype 8, its should create infotype 14 for wages available in a Z table. I modified the exit EXIT_SAPFP50M_002 and call function HR_INFOTYPE_OPERATION to create infotype when saving infotype 8. But its giving me error message. Please let me know if i am using the right exit or there is some thing else i am doing wrong.

Thanks

Piyush

8 REPLIES 8

abhijitzope
Active Participant
0 Kudos

Hi Pisush,

you are writting code in correct user exit include.if you post your code then it is possible to see what is going wrong in it.I am sending you the sample code.Please check.

REPORT z_copy_9111_to_9222.

TABLES: pernr.

NODES: peras.

INFOTYPES: 9111.

CONSTANTS: gc_9222 TYPE infty VALUE '9222'.

DATA: gs_9222 TYPE p9222,

gs_return TYPE bapireturn1,

gs_key TYPE bapipakey.

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

number = peras-pernr

IMPORTING

return = gs_return.

IF gs_return IS INITIAL.

LOOP AT p9111.

MOVE-CORRESPONDING: p9111 TO gs_9222.

gs_9222-infty = gc_9222.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

infty = gc_9222

number = peras-pernr

subtype = p9111-subty

objectid = p9111-objps

lockindicator = p9111-sprps

validityend = p9111-begda

validitybegin = p9111-endda

recordnumber = p9111-seqnr

record = gs_9222

operation = 'INS'

tclas = 'A'

dialog_mode = '0'

IMPORTING

return = gs_return

key = gs_key.

ENDLOOP.

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

EXPORTING

number = peras-pernr.

ENDIF.

<b>Please rewards the points if helpful.</b>

Regards,

Abhijit

0 Kudos

Hi Abhijit,

I am pasing the same piece of code. When i execute the code from a Z program its update the infotype for wages but when i call the code from user-exit. its shows the error. I am firing the code when we are creating infotype 0008 and saving the details of 0008 we are calling HR_INFOTYPE_OPERATION function to create infotype 0014. I am not sure whether its possible to create another infotype while we are in process of creating other infotype.

Please correct me i am wrong.

Thanks

Piyush

0 Kudos

Hi

Infotype 8 is generally changed while doing some action in pa40 like change in pay or on similar grounds. Why dont you check with functional people and add a dynamic action to set the value in IT14.

Regards

Navneet

0 Kudos

Hi Navneet

I create a routine for Dynamic Action to create infotype 0014 while saving infotype 008. But when i create infotype 008, it not create infotype 0014. I put hard code break-pint in my subroutine but it did not stop. Please let me know is there any way to debug the dynamic action subroutine. I also put the error message but it not stop.

I also update entries inV_T588Z for Subroutine like this

6 F 1 Routine name (include)

Thanks

Piyush

0 Kudos

Hi,

It has to stop if you put a hard coded break point. May be your dynamic action is not getting triggered. Check once the entry in V_T588Z and correct it if some thing is wrong.

Reward if helpful.

Thnx,

RSS.

0 Kudos

It should be

6 1 F subroutine(include).

Please check this once.

Thnx,

RSS.

0 Kudos

Hi Piyush,

Can you post the error it is showing !!! you can check the RETURN parameter of the FM HR_INFOTYPE_OPERATION in debug mode.also post the code if possible.

Regards,

Abhijit

0 Kudos

Hi All,

Thanks for your input. Actually i was maintaing View V_T588z likes below

6 1 F ROUTINE " 6 for create and change

But it should be like this.

2 1 F ROUTINE " 2 for change

4 1 F ROUTINE " 4 for create i.e. i have to maintain above toe entries.

Now i am able to debug my dynamic action routine. But i have another problem. When i call the HR_INFOTYPE_OPERATION function it not updates the records in database.

Please find below piece of code . For testing purpose i am passing hard code values.

IT_P0014-PERNR = '1000005'.

IT_P0014-ENDDA = '99991231'.

IT_P0014-BEGDA = '20071111'.

IT_P0014-LGART = '1003'.

IT_P0014-BETRG = 1003.

CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'

EXPORTING

NUMBER = '1000005'

IMPORTING

RETURN = RETURN.

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

EXPORTING

INFTY = '0014'

NUMBER = '1000005'

VALIDITYEND = '99991231'

VALIDITYBEGIN = '20071111'

RECORD = IT_P0014

OPERATION = 'INS'

LOCKINDICATOR = ''

NOCOMMIT = ''

TCLAS = 'A'

IMPORTING

RETURN = RETURN

EXCEPTIONS

OTHERS = 0.

COMMIT WORK.

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

EXPORTING

NUMBER = '1000005'.

But when i call above code from a zprogtam it will update the database.

Please let me know if i have to maintain some thing else while calling in subroutine.

Thanks