Symptom
Custom logic implemented in BAdI LOG_EDI_MM_INVOICE_CE_MAP (Business Context: Procurement: Supplier Invoice) is not executing when creating invoices via certain API interfaces. The BAdI appears to be "skipped" even though the invoice is successfully posted in the system.
Environment
SAP S/4HANA Cloud Public Edition
Reproducing the Issue
- Create an invoice from Ariba via CIG using standard integration and observe that BAdI LOG_EDI_MM_INVOICE_CE_MAP is invoked.
- Create an invoice via a custom route using the supplierinvoices4request_in API and observe that BAdI LOG_EDI_MM_INVOICE_CE_MAP is not invoked.
Cause
In SAP S/4HANA Cloud, BAdIs are strictly bound to specific service interfaces. LOG_EDI_MM_INVOICE_CE_MAP is designed as a mapping BAdI specifically for the SOAP-based Invoice Request service.
- Supported API: InvoiceRequest_In (Standard EDI/Ariba integration path).
- Unsupported API: supplierinvoices4request_in. This is a separate technical interface used for high-volume or specific standard scenarios that does not trigger the LOG_EDI_MM_INVOICE_CE_MAP extension point.
Resolution
To ensure that custom BAdI logic is executed for inbound invoices, the integration must be configured to use the correct service interface.
1. Service Selection:
Verify the Communication Arrangement and the API being called. To utilize this specific BAdI, the integration must use the following service:
- Service Name: InvoiceRequest_In
- Communication Scenario: SAP_COM_0222 (or equivalent EDI scenarios)
2. Interface Redirection:
If the current integration is using supplierinvoices4request_in, it must be redirected to InvoiceRequest_In.
- Note: While both APIs create supplier invoices, they have different underlying processing classes. Only the latter includes the hook for the LOG_EDI_MM enhancement spots.
3. Testing Verification:
After switching to the InvoiceRequest_In service:
- Send a test payload.
- Check the Trace in the Custom Logic app (if enabled) to confirm the BAdI execution.
- Verify that the target fields in the SAP Supplier Invoice reflect the custom logic.
Keywords
LOG_EDI_MM_INVOICE_CE_MAP, InvoiceRequest_In, supplierinvoices4request_in, CIG, Ariba, custom integration, supplier invoice API, BAdI not invoked, invoice mapping, S/4HANA Cloud Public Edition, public cloud BAPI, electronic invoicing, API routing, middleware payload, invoice request , KBA , MM-IV-LIV-BAPI-2CL , BAPI (Public Cloud) , Problem
SAP Knowledge Base Article - Public