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 use the BAPI_PERSDATA_CHANGE BAPI

Former Member
0 Likes
991

I want to use the BAPI_PERSDATA_CHANGE using the se37 transaction.

If i use without the BAPI_EMPLOYEE_ENQUEUE i get the error message

Employye/applicant is not locked yet

If i use the with BAPI_EMPLOYEE_ENQUEUE ,then it gives me message

"make an entry in all required fields".

I just want to change the "marital status" of the person.

Now what are the required fileds i should fill for this.

Best Regards

Manoj

6 REPLIES 6
Read only

Former Member
0 Likes
859

Hi,

You cannot use BAPI_PERSDATA_CHANGE from SE37 becz you need to use bapi_commit_transaction after using the BAPI.

Read only

Former Member
0 Likes
859

Hi,

You can also use BAPI_INFOTYPE_OPERATION for this purpose.


          CALL FUNCTION 'HR_INFOTYPE_OPERATION'
            EXPORTING
              infty         = '0002'
              number        = g_pernr  "Personnel number
              validitybegin = p_dol_dt
              record        = gt_p0015   "Record should be of type p0002 and fetch and fill all the data in existing record.
              operation     = 'MOD'
            IMPORTING
              return        = gs_return.

  

But anyhow both the FMs can not be used for testing in SE37 as it wont update any data.Instead u have to write a sample code in SE38.

Edited by: Vimal V on Aug 12, 2009 7:28 PM

Read only

0 Likes
859

Hi,

thanks for the response.

but waht are the required fields that i need to lrovide to the BAPI to avoid the error mkessage

"make entry in all required fields"

Best Regards

Manoj

Read only

0 Likes
859

Just fetch all the fields from the record you want to Modify from PA0002.

Pass it in the records importing parameter of the FM.

and for other fields just follow the code snippet i pasted in my prvious post.Tell me if any issues.

Regards,

Vimal.

Read only

0 Likes
859

Hi Vimal,

I am sorry but i did not get ur answer.

The BAPI PERS_DATA_CHANGE

gives me an error asking me to fill the

"Make an entry in all required fields".

how should i coem to know which field are required.

Can you help me in this.

best Regards

Manoj

Read only

0 Likes
859

In BAPI_PERSDATA_CHANGE BAPI, following fields are mandatory EMPLOYEENUMBER SUBTYPE OBJECTID LOCKINDICATOR VALIDITYBEGIN VALIDITYEND RECORDNUMBER You should goto the import tab and check the optional column, if it is not ticked means the field is required field. Regards, Radhika.