Symptom
- In a sales document, by default, Incoterms are always determined from the sold-to party and not from the ship-to party.
- In some cases, it is expected to have the Incoterms derived from the ship-to party.
Environment
SAP S/4HANA Cloud 2202
Cause
The business logic for this system behavior is that Incoterms are part of a sales agreement with the sold-to party as opposed to the ship-to party. The Incoterms are determined from the sold-to party, as they are purchasing the material, whereas the ship-to party is only a recipient of the goods.
An enhancement was delivered in release CE2202. With this feature, you can now set or change the following fields by implementing custom logic in the Business Add-Ins (BAdIs) Sales Header Business Data Modification and Sales Item Business Data Modification:
- Incoterms version
- Incoterms classification
- Incoterms location 1
- Incoterms location 2
Resolution
For Incoterms to be derived from the ship-to party when creating the sales document, you need to implement your own custom logic.
You can implement these two BAdIs in the Custom Logic app using the business contexts Sales: Sales Document and Sales: Sales Document Item.
Here you can find two examples of custom logic implementation:
1. Header Level (SD_SLS_MODIFY_HEAD_BUSINESS):
MOVE-CORRESPONDING salesdocument to salesdocument_businessdata.
data: ls_customersalesarea type i_customersalesarea.
read table salesdocumentpartners WITH KEY partnerfunction = 'WE' INTO data(lv_shipto).
Select single incotermsclassification, incotermsversion, incotermslocation1, incotermslocation2
from I_CustomerSalesArea into CORRESPONDING FIELDS OF @ls_customersalesarea
where customer = @lv_shipto-customer and
salesorganization = @salesdocument-salesorganization and
distributionchannel = @salesdocument-distributionchannel and
division = @salesdocument-organizationdivision.
salesdocument_businessdata-incotermsversion = ls_customersalesarea-incotermsversion.
salesdocument_businessdata-incotermsclassification = ls_customersalesarea-incotermsclassification.
salesdocument_businessdata-incotermslocation1 = ls_customersalesarea-incotermslocation1.
salesdocument_businessdata-incotermslocation2 = ls_customersalesarea-incotermslocation2.
2. Item Level (SD_SLS_MODIFY_ITEM_BUSINESS):
MOVE-CORRESPONDING salesdocumentitem to salesdocumentitem_businessdata.
data: ls_customersalesarea type i_customersalesarea.
if line_exists( salesdocumentitempartners[ salesdocumentitem = salesdocumentitem-salesdocumentitem partnerfunction = 'WE' ] ).
read table salesdocumentitempartners WITH KEY partnerfunction = 'WE' salesdocumentitem = salesdocumentitem-salesdocumentitem INTO data(ls_shipto).
Select single incotermsclassification, incotermslocation1, incotermslocation2
from I_CustomerSalesArea into CORRESPONDING FIELDS OF @ls_customersalesarea
where customer = @ls_shipto-customer and
salesorganization = @salesdocument-salesorganization and
distributionchannel = @salesdocument-distributionchannel and
division = @salesdocument-organizationdivision.
salesdocumentitem_businessdata-incotermsclassification = ls_customersalesarea-incotermsclassification.
salesdocumentitem_businessdata-incotermslocation1 = ls_customersalesarea-incotermslocation1.
salesdocumentitem_businessdata-incotermslocation2 = ls_customersalesarea-incotermslocation2.
endif.
See Also
Use Custom Logic to Set Incoterms in Sales Documents
https://blogs.sap.com/2022/03/03/how-to-use-custom-logic-to-set-incoterms-in-sales-documents/
Keywords
ship-to-party, incoterms, sold-to, ship-to, sold to, ship to, incoterm, sales orders, sales order, sold-to-party, Incoterms version, Incoterms classification, Incoterms location 1, Incoterms location 2, incotermsclassification, incotermslocation1, incotermslocation2, incotermsversion, VBKD-INCOV, VBKD-INCO1, VBKD-INCO2_L, VBKD-INCO3_L, badi, SD_SLS_MODIFY_HEAD_BUSINESS, SD_SLS_MODIFY_ITEM_BUSINESS, extensibility, custom logic , KBA , SD-SLS-EXT , Extensibility , SD-SLS , Sales , SD-SLS-EXT-2CL , Extensibility (Public Cloud) , How To