Application Development and Automation 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: 
Read only

How to create infotype while creating another infotype

Former Member
0 Likes
488

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 et 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'

LOCKINDICATOR = 'X'

NOCOMMIT = 'X'

TCLAS = 'A'

IMPORTING

RETURN = RETURN

EXCEPTIONS

OTHERS = 0.

BREAK-POINT.

COMMIT WORK AND WAIT.

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

EXPORTING

NUMBER = '1000005'.

Please let me know if i am missing any thing.

Thanks

Piyush

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 et 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'

LOCKINDICATOR = 'X'

NOCOMMIT = 'X'

TCLAS = 'A'

IMPORTING

RETURN = RETURN

EXCEPTIONS

OTHERS = 0.

BREAK-POINT.

COMMIT WORK AND WAIT.

CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'

EXPORTING

NUMBER = '1000005'.

Please let me know if i am missing any thing.

Thanks

Piyush

2 REPLIES 2
Read only

amit_khare
Active Contributor
0 Likes
461

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

Regards,

Amit

Reward all helpful replie.

<b>P.S. Do not duplicate the thread.</b>

Read only

0 Likes
461

Hi Amit,

I thing this will be not a good idea to update database directly as its a application document data which might be update no of tables. PLease le me know if there are any other way.

Thanks

Piyush