BAPI_VENDOR_GETDETAIL — Read Vendor Master Data via BAPI
BAPI_VENDOR_GETDETAIL is a read-only BAPI that returns vendor master data equivalent to the XK03/FK03/MK03 display screens: general data, company code segment, purchasing organization segment and bank details. It does not commit anything. The recurring integration bug is code that ignores the RETURN structure and treats blank company or purchasing data as a data problem when it is actually a missing input parameter or a vendor not extended to that organizational level.
This page covers what BAPI_VENDOR_GETDETAIL retrieves, which import parameters actually drive which output blocks, and why RETURN handling is the most common source of silent failures in interfaces built on this call. It also addresses ownership between functional and technical teams and where this BAPI sits relative to S/4HANA's business partner model.
Reviewed by an ERPClimb SAP consultant on 16 Sept 2026· 1,037 words
What it does
BAPI_VENDOR_GETDETAIL reads a single vendor master record and returns it in the same shape a user would see running XK03, FK03 or MK03 depending on which segments are requested. It pulls general data (address, tax numbers, control data), the company code segment (reconciliation account, payment terms, dunning data) if a company code is passed, the purchasing organization segment (order currency, incoterms, purchasing block) if a purchasing org is passed, and bank details. It changes nothing in the database. It is typically embedded in vendor lookup screens, master data comparison reports, middleware that syncs vendor data to a downstream system, and pre-checks before building a purchase order or posting an invoice for a vendor whose extension status is uncertain.
Important parameters
- VENDOR_NO - import, the vendor account number whose master record is being read
- COMPANY_CODE - import, optional; if left blank the company code segment is not returned even if the vendor is extended there
- PURCHASING_ORGANIZATION - import, optional; if left blank the purchasing segment is not returned
- GENERALDATA - export structure carrying address, search terms, tax numbers and other client-independent LFA1-level fields
- COMPANYDATA - export structure carrying company-code-dependent fields such as reconciliation account and payment terms; empty unless COMPANY_CODE was supplied and the vendor is actually extended to it
- PURCHASINGDATA - export structure carrying purchasing-org-dependent fields such as order currency and purchasing block; empty unless PURCHASING_ORGANIZATION was supplied and the extension exists
- BANKDATA - export table of vendor bank detail records
- RETURN - export structure carrying messages, message type, and message number for the call
Commit behaviour
There is nothing to commit. The BAPI reads and returns data, it does not update any table, so BAPI_TRANSACTION_COMMIT is not required after the call and calling it anyway is a harmless no-op that wastes a database round trip. Interfaces that wrap this call in a commit block are not wrong, just doing unnecessary work. If the caller forgets a commit, nothing is lost, because there was never anything pending to save. This is a genuine point of difference from the create and change BAPIs in the same vendor family, and confusing the two patterns is a common source of unnecessary commit calls scattered through integration code that was copied from a change scenario.
Return handling
The single biggest defect pattern with this BAPI is treating a successful function call as proof the data is complete. RETURN can carry an error message while the export structures are still returned in an initialized, blank state rather than raising a dump. A vendor that exists generally but was never extended to the company code passed in COMPANY_CODE will come back with an empty COMPANYDATA structure and a RETURN entry explaining why, but code that only checks 'did the call throw an exception' will treat the blanks as valid zero-value data: payment terms read as blank, reconciliation account read as blank, and downstream logic silently proceeds as if the vendor has no payment terms rather than flagging that the extension is missing. The correct pattern checks RETURN message type before touching any export structure, and separately validates that COMPANYDATA or PURCHASINGDATA is genuinely non-empty when the corresponding input parameter was passed, since a vendor not found at all produces the same blank pattern as a vendor found but not extended, and only the RETURN text distinguishes the two.
ECC vs S/4HANA
The BAPI remains callable on S/4HANA and no formally released successor specific to this read pattern has replaced it. Newer builds increasingly favor released APIs or CDS-based services for business partner data, reflecting that the vendor master in S/4HANA is technically a business partner with a vendor role rather than a standalone LFA1 record. Where business partner synchronization between the classic vendor tables and the business partner tables is incomplete or delayed, this BAPI can return data that lags what a business partner-centric transaction shows, which is worth checking before assuming the BAPI itself is wrong.
Common pitfalls
- COMPANYDATA returned blank because COMPANY_CODE was omitted, not because the vendor lacks company code data
- PURCHASINGDATA returned blank because PURCHASING_ORGANIZATION was omitted or the vendor was simply never extended to that purchasing org
- One-time vendor accounts return mostly blank company segment fields by design, which integration code sometimes misreads as a broken master record
- Vendor posting block or purchasing block is not surfaced prominently through RETURN; the block flags sit inside COMPANYDATA and PURCHASINGDATA and must be checked explicitly rather than inferred from call success
- Leading zeros stripped from the vendor number by an external system or spreadsheet import causing a lookup on the wrong or nonexistent vendor
- Deleted-flag vendors still return general data successfully, so a call succeeding is not confirmation the vendor is usable for new transactions
Whose problem this is
Functional consultants own the first check: confirm in the display transaction that the vendor is actually extended to the company code or purchasing org being requested, and that it is not a one-time or blocked account. Developers own the second check: confirm COMPANY_CODE and PURCHASING_ORGANIZATION were actually passed and that RETURN was inspected before the export structures were used. Evidence to exchange is the exact input parameters logged against a screenshot of the vendor's extension status.
Related SAP objects
Reviewed pages this object connects to in the ERPClimb knowledge graph.
Source: ERPClimb — https://erpclimb.com/sap-bapis/bapi-vendor-getdetailERPClimb is an independent platform and is not affiliated with SAP SE. Reference pages are written and reviewed by SAP consultants for learning and troubleshooting.