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

function module to update infotype 015

Former Member
5,473

Can we use HR_MAINTAIN_MASTERDATA to upload data into infotype 015? If possible can you give simple examaple stating the usage of that?

3 REPLIES 3
Read only

Former Member
0 Likes
2,101

Hi sruthy,

1. HR_INFOTYPE_OPERATION

Its recommended to use this FM

for infotype updation thru abap code.

regards,

amit m.

Read only

Former Member
0 Likes
2,101

Hi Sruthy,

For uploading/updating data in any infotype, you can use HR_INFOTYPE_OPERATION.

If you want further info, Plz tell.

*****Do not forget to reward points for useful replies

Read only

0 Likes
2,101

Hi Sruthy,

You can use the function module HR_INFOTYPE_OPERATION as suggeted above. Just remember to lock & unlock the employee before and after the function call. You can take a look at the following piece of code for reference.


* Enqueue personnel number
                call function 'BAPI_EMPLOYEE_ENQUEUE'
                  exporting
                    number = pernr
                  importing
                    return = return.
                if not return is initial.
                  message id return-id type return-type number return-number
                            with return-message_v1 return-message_v2
                                 return-message_v3 return-message_v4.
                  raise action_stopped.
                endif.
                p0015-pernr = pernr.
                p0015-begda = sy-datum.
                p0015-lgart = '3351'.
                p0015-betrg = '100.00'.
* create a 0015 for the amount
                call function 'HR_INFOTYPE_OPERATION'
                  exporting
                    infty         = '0015'
                    subtype       = '3351'
                    number        = pernr
                    validitybegin = sy-datum
                    record        = p0015
                    operation     = 'INS'
                    dialog_mode   = '0'
                  importing
                    return        = return.
                if not return is initial.
                  message id return-id type return-type number return-number
                            with return-message_v1 return-message_v2
                                 return-message_v3 return-message_v4.
                  raise action_stopped.
                endif.
* Dequeue personnel number
                call function 'BAPI_EMPLOYEE_DEQUEUE'
                  exporting
                    number = pernr
                  importing
                    return = return.
                if not return is initial.
                  message id return-id type return-type number return-number
                            with return-message_v1 return-message_v2
                                 return-message_v3 return-message_v4.
                  raise action_stopped.
                endif.

Regards,

Suresh Datti