on 08-17-2018 10:29 AM
Hello there.
I want to create or update an employee record in SAP HCM system with the below details:
First, Middle and Last Name, DOB, Email, Org ID, Position, Vendor ID, Personnel Area, Start Date and End Date.
Any idea about any BAPI?
Regards.
Use Function Module 'HR_MAINTAIN_MASTERDATA' to create/update employee record.
CALL FUNCTION 'HR_MAINTAIN_MASTERDATA'
EXPORTING
massn = 'ZS'
actio = 'INS'
tclas = 'A'
begda = i_input_data-startdate
werks = lv_persa
persg = 'E'
persk = '51'
plans = i_input_data-positionno
IMPORTING
return1 = e_message
TABLES
proposed_values = lt_values
modified_keys = lt_modified_keys.
The infotypes which you want to update can be passed in proposed_values.
See below code example:
* Action type - Hiring non-payroll
ls_values-infty = '0000'.
ls_values-fname = 'P0000-MASSN'.
ls_values-fval = 'ZS'.
APPEND ls_values TO lt_values.
CLEAR ls_values.
* Action Reason
ls_values-infty = '0000'.
ls_values-fname = 'P0000-MASSG'.
ls_values-fval = '51'.
APPEND ls_values TO lt_values.
CLEAR ls_values.
* Action type - Termination non-payroll
ls_values-infty = '0000'.
ls_values-fname = 'Q0000-MASSN'.
ls_values-fval = 'ZU'.
APPEND ls_values TO lt_values.
CLEAR ls_values.
ls_values-infty = '0001'.
ls_values-fname = 'P0001-BTRTL'.
ls_values-fval = i_input_data-location.
APPEND ls_values TO lt_values.
CLEAR ls_values.
ls_values-infty = '0002'.
ls_values-fname = 'P0002-ANRED'.
ls_values-fval = i_input_data-title.
APPEND ls_values TO lt_values.
CLEAR ls_values.
ls_values-infty = '0002'.
ls_values-fname = 'P0002-NACHN'.
ls_values-fval = i_input_data-lname.
APPEND ls_values TO lt_values.
CLEAR ls_values.
ls_values-infty = '0002'.
ls_values-fname = 'P0002-VORNA'.
ls_values-fval = i_input_data-fname.
APPEND ls_values TO lt_values.
CLEAR ls_values.
ls_values-infty = '0002'.
ls_values-fname = 'P0002-MIDNM'.
ls_values-fval = i_input_data-mname.
APPEND ls_values TO lt_values.
CLEAR ls_values.
ls_values-infty = '0002'.
ls_values-fname = 'P0002-RUFNM'.
ls_values-fval = i_input_data-pname.
APPEND ls_values TO lt_values.
CLEAR ls_values.
ls_values-infty = '0002'.
ls_values-fname = 'P0002-GBDAT'.
ls_values-fval = i_input_data-birthdate.
APPEND ls_values TO lt_values.
CLEAR ls_values.
* Termination date
ls_values-infty = '0019'.
ls_values-fname = 'P0019-TERMN'.
ls_values-fval = i_input_data-enddate.
APPEND ls_values TO lt_values.
CLEAR ls_values.
ls_values-infty = '0315'.
ls_values-fname = 'P0315-ENDDA'.
ls_values-fval = i_input_data-enddate.
APPEND ls_values TO lt_values.
CLEAR ls_values.
ls_values-infty = '0315'.
ls_values-fname = 'P0315-LIFNR'.
ls_values-fval = i_input_data-vendor_id.
APPEND ls_values TO lt_values.
CLEAR ls_values.
ls_values-infty = '0105'.
ls_values-fname = 'P0105-SUBTY'.
ls_values-fval = '0010'.
APPEND ls_values TO lt_values.
CLEAR ls_values.
ls_values-infty = '0105'.
ls_values-fname = 'P0105-USRID_LONG'.
ls_values-fval = i_input_data-email.
APPEND ls_values TO lt_values.
CLEAR ls_values.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First off, do you understand what BAPIs actually are and what "business objects" are? Second, do you understand functions, remote functions, and interfaces?.....if you answered "yes" to those questions....Have you even attempted to look?....Uhm...transaction BAPI? And then under Personnel Management - > Personnel Administration there are a TON of "employee" business objects. There is even documentation on each one. I suggest you go look there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see you still got it, this pleases me a lot 😄
Thanks for kind suggestion, Christopher.
First off. i do understand BAPIs, Business Objects, Functions, remote functions and interfaces. and i did attempt to look for that. I did not find any BAPI but found certain FMs which by using in combination could solve my problem but i wanted to check if someone have handled the same requirement and knew any FM or BAPI ( a remote enabled FM registered in Business object) which could be used to update different infotypes in one call.
Yes, all is well. Fiori is fun indeed but I had my share of "crying in the corner" because the sh*t doesn't work or I didn't know javascript anymore. Still better than FPM and Proc. and Forms, am I right? 😉
User | Count |
---|---|
95 | |
9 | |
8 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.