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: 

How to create infotype while creating another infotype

piyush_mathur
Active Participant
0 Kudos

Hi All,

I have below requirement...

Whenever user create infotype 0008, infotype 0014 should be created for the wages available in a Z table.

I created a dynamic action and call function HR_INFOTYPE_OPERATION. When i debug the routine function successfully executed with sy-subrc eq 0. But when i check the database table, there will be no data for infotype 0014. I am writing the below piece of code, i put the hard code value for testing purpose...if you have any idea please let me know

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'

TCLAS = 'A'

IMPORTING

RETURN = RETURN

EXCEPTIONS

OTHERS = 0.

COMMIT WORK AND WAIT.

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

EXPORTING

NUMBER = '1000005'.

Please let me know if i am missing any thing.

1 REPLY 1

amit_khare
Active Contributor
0 Kudos

Use INSERT command instead of HR_INFOTYPE_OPERATION.It has some issues while calling from Dynamic Actions.