cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Create Customers and vendors

ILIAN_Grigorov
Contributor
0 Kudos
303

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

View Entire Topic
raymond_giuseppi
Active Contributor

Are the VMD_EI_API and CMD_EI_API classes already available in your version (?)

Else look at LSMW

  • objects 0040 and 0050 (report to create BDC)
  • Reorded Batch input
  • IDOC CREMAS, DEBMAS (+ADRMAS)
ILIAN_Grigorov
Contributor

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.

raymond_giuseppi
Active Contributor
0 Kudos
There is a metho to get next number: e.g. CMD_EI_API=>GET_NUMBER (once no error in test mode)