on 05-03-2006 5:39 PM
Good day, everyone.
I am writing an ABAP program to load legacy address information into SAP (infotype 0006). I'll be reading in text files of legacy address data to do this.
I was looking for a function or BAPI to assist in adding employee address records, and I came across BAPI_ADDRESSEMP_CREATE. Aside from needing to call BAPI_EMPLOYEE_ENQUEUE before and BAPI_EMPLOYEE_DEQUEUE after, I think this is the BAPI I need to use.
Here's the quirk: We've added a few custom fields to infotype 0006. Obviously, the BAPI as is will not populate these new fields.
1. Is this the best method available to add address records, or is there a better BAPI or function out there that I might've missed that you'd recommend over BAPI_ADDRESSEMP_CREATE?
2. I've heard of making "z-versions" of SAP components; in my case, do I need to create a "z-version" of BAPI_ADDRESSEMP_CREATE and add code to populate the new custom fields? Is there anything else I need to be aware of when I do this?
Thanks so much! As always, points awarded to all helpful answers!
Try with:
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = p2006-infty
number = pernr-pernr
subtype = p2006-subty
validityend = p2006-endda
validitybegin = p2006-begda
record = p2006
operation = 'MOD' " 'INS' 'DEL'
nocommit = 'X'
IMPORTING
return = l_return
key = l_key.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Dave,
I suggest you to go with the 2nd approach..
U can create a "ZBAPI..." and copy paste the code from the standard BAPI..
U can then add the custom code to populate data in the Ztables n Zfields..
Reason:
If u r using the first approach and if there is a COMMIT in the standard BAPi, the first part gets stored.. now if there is a problem in populating Zfields, u would want to roll back.. but that would b dificult in case u have run a batch program for 1000s of records..
Its better to go with ur 2nd approach and COMMIT all together..
So, "U get all or u get nothin"..(Atomicity)
Regards,
Tanveer.
Please mark helpful answers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dave,
You are on the right track.. Just copy the bapi BAPI_ADDRESSEMP_CREATE & add your custom fields.. that should work.. as far as I know there is nothing else that meeds to be done..
Regards,
Suresh Datti
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.