SAP BAPI for vendor creation and editing

Silvano Bini picture Silvano Bini · Aug 3, 2015 · Viewed 6.9k times · Source

Has anyone ever created a BAPI to create or edit a vendor in SAP R/3 4.6c in the background? I found two BAPIs: BAPI_VENDOR_CREATE and BAPI_VENDOR_EDIT, but both only work online (they call transactions XK01 and XK02).

Basically I need a way to call a function module that would do the same work as transactions XK01 and XK02 but don't need to be called online.

Looking on the SAP community forums, I found a lot of people with the same needs as me, but the answer was never complete.

Could someone give me a suggestion?

Answer

mjturner picture mjturner · Aug 4, 2015

As you have discovered, SAP doesn't provide BAPIs for vendor creation/change that can be called in the background (this is, unfortunately, still the case in newer releases).

You have a few possible options:

  1. Create your own BAPI, using (unreleased) SAP function modules for the vendor update.
  2. Create your own BAPI, creating/changing the vendor via a BDC session.

I'd go with option 2. No, BDCs are never ideal and they have a lot of downsides but even a lot of SAP standard function modules for vendor creation seem to go that route and you'll at least be certain that the data in your system is consistent, unlike if you use something like function module VENDOR_INSERT, which does direct table updates without application validation.

Check if the standard vendor data transfer program (RFBIKR00) is in your system - it uses batch input so could be a very useful starting point for your BDC.