| Status | Revision in progress |
|---|---|
| Owner | HALL-ext, Simon |
| Stakeholders | Sara Loddo / Yamna Hammacha / Tonya Van Aarde / Francine Palmer |
| Jira Request ID | ERP-1158 - Getting issue details... STATUS |
| Jira Development ID | ERP-1370 - Getting issue details... STATUS |
High- Level Specification
| Parameter | Value |
|---|---|
| Application System | S/4 HANA ROW & S/4 HANA China |
| Business Process Reference | 02.04.02.01. Manage Standard Sales Order |
Functional Overview
For the fulfilment of intercompany consignment fill-ups, the line item storage location must be determined in the fill-up (and not the subsequent delivery as per SAP standard) to ensure:
The stock passes through the correct storage location as defined by the finance and tax requirements - in this case, a virtual customer specific location specifically for intercompany consignment fill-ups will be used.
The subsequent intercompany purchase order can be correctly triggered.
Therefore this development requires:
- The creation of a custom table in SAP where the storage location can be defined by a combination of sales org, plant, ship-to party & material.
- When creating a line item or changing the plant in a consignment fill-up, the custom table is checked on save and the line item storage location is updated.
The set up of entries in this custom table will be the trigger for the consignment fill-up to be fulfilled using an intercompany STO. If no entries exist in this table then the consignment fill-up will be fulfilled using the standard non-intercompany process from the default plant and storage location combination.
Scope and Objectives
The scope of this development will cover all consignment fill-ups created in SAP S/4 - both China and RoW instances.
Part 1 - Custom table
- All fields to be defined are standard SAP fields as below:
- Sales org (VKORG)
- Plant (WERKS)
- Ship-to party (KUNNR)
- Material (MATNR)
- Storage location (LGORT)
Part 2 - Storage location determination
- If sales document type (VBAK-AUART) = 'KB' or 'KBB' then each time document created or the plant is changed read custom table from part 1 and update sales order line item with the defined storage location (VBAP-LGORT).
- To determine the ship-to party use sales order no from VBAK-VBELN then get the ship-to party from VBPA (Partner function PARVW = 'SH')
- Save the updated changes.
Process Flow Diagram
This system enhancement is only applicable for the highlighted L5 step below:
The following SAP applications and transaction codes are in scope for this enhancement:
SAP Fiori
Manage Sales Orders – Version 2 (app ID - F3893)
Create Sales Orders
Change Sales Orders
SAP GUI
Sales Orders
VA01 – Create Sales Order
VA02 – Change Sales Order
Assumptions
This development is designed for the expected consignment fill-up types of 'KB' & 'KBB' - in the unlikely scenario that new consignment fill-up types added then these need to be added into the logic above. The only practical option is to use document type as there are no other indicators that a sales document is for consignment purposes (such as doc category). In theory the movement type associated with the schedule line type could be used - as this is unique for consignment - but this may slow down the speed of the update.
Dependencies
Definition of the relevant storage locations and plant assignment.
Security, Integrity and Controls
An additional transaction code needs to be created to allow maintenance of the custom table for storage location determination defined above.
This table must be defined as master data in order that the specified user can update - it should be included within the Customer Representative role.
Configuration Requirements
n/a
Language Requirements
n/a
Special Requirements
n/a
Design Rationale
Functional Requirements
Part 1 - Define a custom table as below using the attributes of the standard SAP object (e.g. VKORG, WERKS etc) as specified
- Sales org (VKORG)
- Plant (WERKS)
- Ship-to party (KUNNR)
- Material (MATNR)
- Storage location (LGORT)
Part 2 - Determine Storage location at sales order item level
- If sales document type (VBAK-AUART) = 'KB' or 'KBB' then on the initial creation or if plant is changed in the line item read custom table from part 1 and update sales order line item with the defined storage location (VBAP-LGORT).
- To determine the ship-to party use sales order no from VBAK-VBELN then get the ship-to party from VBPA (Partner function PARVW = 'SH')
- Report error message if no entries found in the custom table.
- Save the updated changes.
Rational for why standard SAP not sufficient
The process defined in part 1 and part 2 must be used as standard SAP only allows the determination of the storage location within the delivery document rather than the sales order. Therefore, if no enhancement implemented each time an intercompany consignment fill-up is created, the user would need to know that this specific ship-to / material combination should be supplied from a cross-company plant and make the necessary updates manually in the line item storage location field. Additionally, any consignment fill-ups created automatically (e.g. from EDI) would need to be manually updated.
Proposed Technology to Use
User exit - USEREXIT_SAVE_DOCUMENT_PREPARE within standard SAP S/4 program MV45AFZZ.
Data Source Considerations
n/a
Data Validation Considerations
n/a
Custom Tables
| Table | Field | Description |
|---|---|---|
| Z ... | VKORG | Sales Org |
| Z ... | WERKS | Plant |
| Z ... | KUNNR | Ship-to Party |
| Z ... | MATNR | Material No |
| Z ... | LGORT | Storage Location |
Processing Logic
Before saving the sales order:
- Check if document type (VBAK-AUART) = 'KB' or 'KBB'
- If true then check custom table above with parameters below to retrieve storage location (LGORT)
- VBAK-VKORG
- VBAP-WERKS
- Ship-to party - identify by using the sales order no from VBAK-VBELN then get the ship-to party from VBPA (Partner function PARVW = 'SH')
- Insert storage location (LGORT) into VBAP-LGORT.
Volumetrics
Approx 600 consignment fill-ups per year across all GBUs will be intercompany consignment.
Performance Considerations
n/a
Error Handling
The custom table should validate the entries as per standard SAP object rules - e.g. a sales org entered should be a valid sales org in the system. If not, standard SAP error message 'Entry XXXX does not exist' should be displayed.
Additionally:
- Ship-to party must be set up in sales org entered. If not then should display standard error message 'Ship-to party XXXX not set up in sales organisation XXXX' (checking master data table KNVV)
- Material must be set up in both plant and sales org entered. If not then should display standard error message 'Material XXXX not set up in plant XXXX / sales organisation XXXX' (checking master data tables MARC & MVKE)
- Storage location entered must be set in the plant entered. If not then should display standard error message 'Storage location XXXX does not exist in plant XXXX' (checking master data table MARD)
Testing
How to Test
Test Conditions and Expected Results for Part 1 - Custom Table
| ID | Condition | Expected Result |
|---|---|---|
| 1 | Define the storage location by a relevant sales org / plant / ship-to party and material no. | Storage location assigned to the plant can be entered |
| 2 | Enter storage location that has not been assigned to the plant. | Error message displayed. |
| 3 | Enter sales org, plant, ship-to, material or storage location that does not exist. | Error message displayed. |
| 4 | Enter ship-to party not set up in relevant sales org. | Error message displayed. |
| 5 | Enter material not set up in relevant plant and sales org. | Error message displayed. |
Test Conditions and Expected Results for Part 2 - Storage location definition
| ID | Condition | Expected Result |
|---|---|---|
| 1 | Set up a valid storage location determination in the custom table then create a consignment fill-up for intercompany then save. | On save of sales order the storage location defined in the custom table is added into the line item storage location field. |
| 2 | Create a consignment fill-up for a non-intercompany scenario then save. Set up a valid intercompany storage location determination in the custom table then change the plant in the fill-up to trigger the auto storage location determination and save. | On save of sales order the storage location defined in the custom table is added into the line item storage location field. |
| 3 | Set up a valid storage location determination in the custom table then create a consignment fill-up for for the ship-to and material specified in the custom table but not the plant then save. | On save of the sales order, no storage location is determined. |
Test Considerations/Dependencies
Relevant intercompany storage locations must already be set up against the relevant plants.
Other Information
Development Details
Package
| Package Name | Parent Package |
|---|---|
Enhancement Implementation
| Enhancement Type | Standard Definition Name | Custom Implementation Name | Design Rationale Reference |
|---|---|---|---|
Other Development Objects
| Object Type | Object Name | Purpose/High Level Logic | Design Rationale Reference |
|---|---|---|---|
Appendix
Custom Authorization Group Naming Convention
This table is based on the Syensqo development standards document. It provides the naming conventions for authorization groups to associated with custom reports and tables to comply with security requirements.
ABAP | ZFI | ZMM | ZPS | ZCO | ZSD | ZBC | ZFI | ZCA |
|---|---|---|---|---|---|---|---|---|
| TABLES | ZFIT | ZMMT | ZPST | ZCOT | ZSDT | ZBCT | ZFIT | ZCAT |
