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

Infotype 2 upload program

former_member205363
Contributor
0 Likes
677

Hi Friends,

I have upload program to upload the infotype 2 Master Data to SAP, following FMs I am using,

I would like to modify the data if the record is already existing with Pernr, start date and end date.

If the Record is not available, I want to create new record.

BAPI_EMPLOYEE_ENQUEUE

CALL FUNCTION 'HR_INFOTYPE_OPERATION'

           EXPORTING

             infty             = '0002'

             number         = ls_infotype0002-pernr

             subtype        = ''

             record          = ls_infotype0002

             operation      = 'MOD'

             nocommit     = ''

             tclas            = 'A'

             dialog_mode = '0'

           IMPORTING

             return           = ls_return.


BAPI_EMPLOYEE_DEQUEUE

Above code is not working for updating the existing record.

Thanks,

Prasad.

1 ACCEPTED SOLUTION
Read only

venkateswaran_k
Active Contributor
0 Likes
646

Hi Prasad,

In case of modification, you need to provide the complete key for that record.

In this case, you have to pass BEGDA and ENDDA as a key value along with PERNR.

Pass the BEGDA to VAlidityStart Date and ENDDA to validity end date parameters.

Also, let me know what is the error value it shows in ls_return (in your error case )

Regards,

Venkat

4 REPLIES 4
Read only

venkateswaran_k
Active Contributor
0 Likes
647

Hi Prasad,

In case of modification, you need to provide the complete key for that record.

In this case, you have to pass BEGDA and ENDDA as a key value along with PERNR.

Pass the BEGDA to VAlidityStart Date and ENDDA to validity end date parameters.

Also, let me know what is the error value it shows in ls_return (in your error case )

Regards,

Venkat

Read only

0 Likes
646

Hi Venkat,

Thank you, I was passing begda and endda in the record parameter.

Regards,

Prasad.

Read only

0 Likes
646

Hi,

Try and change the dialogue mode = 2 and see where the error is coming, and then try to pass the correct data,

Hope this helps.

Read only

venkateswaran_k
Active Contributor
0 Likes
646

Dear Prasad,

Your discussion is marked as Answered.  If so, can you please update the solution.

If not, let me know what it the value in ls_return parameter you get.

Regards,

Venkat