on 2024 Dec 04 9:35 AM
Hello,
I am looking for a way to create customers and vendors from ABAP code, and assign to Company Code, in a legacy EPR system (not S4), and BP concept is not activated.
I guess inserting records in LFA1/LFB1 and KNA1/KNB1 is not a good approach.
Is there an ABAP function to do that? I cannot find anything in Google.
Thanks, ILIAN
Request clarification before answering.
Are the VMD_EI_API and CMD_EI_API classes already available in your version (?)
Else look at LSMW
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply. It seems the proper way to do it. It seems you have to ask for the next available number (lifnr/kunnr) - https://community.sap.com/t5/enterprise-resource-planning-q-a/problem-creating-vendor-with-vmd-ei-ap... - the functionality does not get it for you.
I also found this approach - https://gist.github.com/weiserman/8414651 - seems nice.
Have you tried API classes?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You’re absolutely right — directly inserting records into tables like LFA1, LFB1, KNA1, and KNB1 is strongly discouraged because SAP enforces a variety of validations and dependencies that ensure data consistency and integrity. Instead, you should use standard BAPIs or FMs that handle this process while maintaining the necessary checks.
Use the following BAPIs to create or update vendors:
Use the following BAPIs to create or update customers:
For legacy systems without the BP concept, this method is unavailable. Instead, you must rely on:
The VMD_EI_API=>MAINTAIN_BAPI method is a class-based API introduced to simplify vendor master data handling. However, it’s part of the Vendor Master Data (VMD) API framework and primarily used in S/4HANA environments. Since your system doesn't support the BP concept and you’re working in a legacy system, this might not be applicable.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 18 | |
| 7 | |
| 6 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.