Spend Management Blogs by SAP
Stay current on SAP Ariba for direct and indirect spend, SAP Fieldglass for workforce management, and SAP Concur for travel and expense with blog posts by SAP.
cancel
Showing results for 
Search instead for 
Did you mean: 
joedutra
Advisor
Advisor

Overview


SAP ECC and S/4 Invoice have a concept of Invoicing Party when creating an MM Invoice.

The Ariba Network and Ariba Purchasing and Invoicing (P2P, Invoice Pro) has a similar concept, but it is called Remit To ID.

On a scenario where a customer has multiple Invoice Parties (addresses) for a single Vendor, we want the integrated SAP ERP and Ariba solution to handle as the following:

If the Invoice Party is selected on the SAP ERP PO, the Invoice should use that Invoice Party on the Invoice.

If the SAP ERP PO does not contain the Invoicing Party, the Supplier should have the option of informing the Remit to Address (Invoicing Party to be used).

This scenario can be different for other customers, where the IP selected by the supplier may take precedence on what is informed on the PO. Or we can use use SAP Ariba Invoice Management (aka Invoice Pro) to select the correct Invoicing Party during Invoice Reconciliation.

The solution described bellow can be altered to support such scenarios.

 

How it works on SAP ERP (ECC or S/4)


We can maintain 1 or more Invoicing Parties - as Partner Function "IP - Invoice presented by" - on the Vendor Master / Partner Function area [tr. XK02].



 

When creating a Purchase Order for a Vendor that has more than 1 Invoicing Party on the Vendor Master Data, by default the system will prompt the buyer to select an Invoicing Party on the PO.

The buyer may or not select the IP on the PO [tr. ME21N].



 

When creating a PO Invoice document, by default the system will use the Invoicing Party defined on the PO. If no Invoicing Party is defined on the PO, the system will use the Vendor ID as the Invoicing Party. [tr. MIRO]



 

How it works on Ariba Network


On the Ariba Network, the Supplier can inform the Remit to ID as a free text field or select if from a predefined drop-down list of values.

The drop-down lit of values is maintained on the Ariba Network Supplier Account, on menu path: Company Settings -> Remittances.

The Supplier can maintain several Remit to addresses.



And for each address can maintain 1 Remit to ID for each Buyer that has trading relationships with on the Ariba Network.



 

Drop-down list




 


Free text entry




Alternatively, customers may use Ariba Invoice Management (aka Invoice Pro) to select the appropriate Remit to address, and if using the BSAO adapter to transmit invoices from the Ariba Network to SAP ERP, use the solution bellow to handle the Invoicing Party mapping.

 

How it works on the BSAO Adapter


By default the BSAO Adapter uses the Invoice Vendor ID as the Invoicing Party on ECC.

The Configuration table bellow is used to maintain manually maintain the Invoicing Party per Vendor ID and Sold to name Name attribute. That configuration works if we have a static Invoicing Party for each vendor, but if the IP can be different based on some criteria, the configuration is not sufficient.

SPRO path: Integration with Other SAP Components -> SAP Business Suite Integration Component for Ariba -> Application-Specific Settings -> SAP ERP Integration Component for Ariba -> Integration for Buyers -> Define Mapping Settings for Invoices -> Incoming Invoice: Map cXML Partner to ERP Invoicing Party



 

Please note that this is also true for the S/4 HANA Native Integration for Ariba Network. And the same code snippet should work there.

 

BSAO Customization


You can use the following code snippet in the mapping BADI ARBERP_INBOUND_MAPPING, method INVC_INV_PARTY_DETERMINATION, to map the correct Invoicing Party on incoming Invoices from the Ariba Network.

The snippet bellow does the following:

  1. If the PO has the Invoicing Party partner function informed, use it as the Invoicing Party ID

  2. Else, use the Remit to ID on the Invoice document from Ariba Network

  3. If both values are not found, the Invoicing Party will be:

    1. The value maintained on BSAO Invoicing Party configuration table

    2. Or the Vendor ID




 
  method IF_ARBERP_BADI_INB_MAP~INVC_INV_PARTY_DETERMINATION.

data: ls_invoice_part type ARBERP_XINVC_S_INVOICE_PARTNER,
ls_inv_det_ord type ARBERP_XINVC_S_DTL_ORDER,
lc_po TYPE EBELN,
lt_po_part TYPE TABLE OF BAPIEKKOP,
ls_po_part TYPE BAPIEKKOP.

*--------------------------------------------------------------------*
* Get the Invoice Party from the PO document
*--------------------------------------------------------------------*
LOOP AT IS_CXML_INVC-INVOICE_DETAIL_ORDER INTO ls_inv_det_ord.
IF ls_inv_det_ord-INVOICE_DETAIL_ORDER_INFO-ORDER_REFERENCE-ORDER_ID IS NOT INITIAL.
lc_po = ls_inv_det_ord-INVOICE_DETAIL_ORDER_INFO-ORDER_REFERENCE-ORDER_ID.
CALL FUNCTION 'BAPI_PO_GETDETAIL1'
EXPORTING
PURCHASEORDER = lc_po
TABLES
POPARTNER = lt_po_part.
READ TABLE lt_po_part WITH KEY PARTNERDESC = 'IP'
DELETE_IND = space
INTO ls_po_part.
IF ls_po_part-BUSPARTNO IS NOT INITIAL.
CV_INV_PARTY = ls_po_part-BUSPARTNO.
exit.
ENDIF.
ENDIF.
clear: ls_inv_det_ord.
ENDLOOP.
*--------------------------------------------------------------------*
* If there is no Invoice Party on the PO, or if it is a Non-PO Invoice
* Get the Remit to AddressID on the Invoice cXML as the Invoice Party
*--------------------------------------------------------------------*
IF ls_po_part-BUSPARTNO IS INITIAL.
READ TABLE IS_CXML_INVC-INVOICE_DETAIL_REQUEST_HEADER-INVOICE_PARTNER WITH KEY CONTACT-ROLE = 'remitTo'
INTO ls_invoice_part.
IF ls_invoice_part-CONTACT-ADDRESS_ID IS NOT INITIAL.
CV_INV_PARTY = ls_invoice_part-CONTACT-ADDRESS_ID.
ENDIF.
ENDIF.

endmethod.
3 Comments