Technical Articles
Create Inbound Delivery in the Warehouse for Purchase Order Items via Mobile App
Introduction
In an ideal scenario within the SAP S/4HANA environment, suppliers should create Inbound Deliveries before goods arrive at the warehouse, enabling warehouse staff to post Goods Receipts. However, the suppliers do not always complete this step for some reasons, resulting in goods that only have Purchase Order (PO) details – not Inbound Delivery information. This requires manual data entry of multiple PO Items and Handling Units (HUs) to create Inbound Deliveries in the warehouse, leading to possible delays and a higher risk of errors due to the complex nature of this task.
This article will discuss how a mobile application can make Inbound Delivery creation easier through QR code scanning, leading to a more streamlined process and the immediate printing of labels. You will assess the manual method against this advanced approach and delve into the technical details of the mobile solution.
Manual Inbound Delivery Creation
A standard process for manually creating Inbound Delivery in SAP S/4HANA involves:
- Collect PO Items data from QR codes on the goods
- Filter PO Items
Purchasing Documents - Select PO items
VL31N Purchasing Documents - Entering data like Delivery Quantity
Inbound Delivery Create: Overview - Select HUs
Processing of Handling Units for Inbound Delivery
This method is time-consuming and demands significant manual effort. Now, you will see how a React Native application can transform this procedure.
Streamlined Inbound Delivery Creation

Warehouse staff scans QR codes on delivered items using the custom mobile app. The scan triggers a beep and flash, instantly collecting item data and letting the app print HU labels. After repeating the first and second steps, the staff just needs to tap the ‘Save’ button to create Inbound Delivery. Let’s compare this with the manual process.
Comparing the two ways

Overall, the custom mobile app outperforms the traditional manual procedure in SAP S/4HANA. The app, with its user-friendly UI and UX, saves the workers time and ensures labels are printed immediately after scanning. This avoids the common mistakes associated with mass printing and labeling that typically occurs after creating HUs in SAP S/4HANA. As a result, this approach prevents the Inbound Delivery creation from being bottlenecks and improves warehouse operations.
App Architecture

Data Structure
Each PO has related PO Items, which are its child elements. These PO Items include details like the Order Quantity. From these, Scanned Items are grouped into a list.
When creating Inbound Delivery using IDoc, each Scanned Item is linked to a specific HU. These HUs are then associated with an Inbound Delivery Item grouped by the PO and PO Item. While it’s possible to make Inbound Delivery Items that are not grouped, organizing them – for instance, according to PO and PO Item – is recommended for better and long term management.
The Inbound Delivery follows the same structure as the PO, where its Items are the child elements of an Inbound Delivery.

Functional Components
1. Scan QR Code
By scanning, it is obtained that QR code information like ‘4500001738/4901411011530/1’ representing the PO number, the EAN, and the item quantity respectively. With this scanned information, the app locates PO items with the EAN ‘4901411011530’, categorized as ‘Carton’ unit of ‘Kirin Nodogoshi Nama Beer’, within PO ‘4500001738’.
To get PO Items having specific Unit of Measure in a single PO, the process starts by fetching PO items, filtered by EAN:

Once the response is received, it includes detailed information about the PO items, such as the Order Quantity. To determine the Available Order quantity, subtract the Delivered Quantity from the Order Quantity. For instance, if a PO Item shows an order for 20 cartons and 16 have already been delivered, 4 cartons are still available. The Delivered Quantity is taken by querying Inbound Delivery Items, filtered by PO and EAN:
After obtaining the Delivered Quantity, create the Serial Shipping Container Code (SSCC) for each item; this involves calculating the check digit for error detection. The SSCC structure consists of the Package ID,External HUID, and Check Digit ID.

Moreover, to accurately determine the Available Order, also subtract the Scanned Orders.

If the Available Order is insufficient for any PO Item, the scanning process should be stopped and an error triggered, indicating Insufficient Available Order Quantity for the product.

Insufficient Available Order Quantity Error
2. Create IDoc
You use the IDoc protocol to associate PO items with HUs for the creation of Inbound Deliveries.
http://{host}:{port}/sap/bc/idoc_xml
<?xml version="1.0" encoding="UTF-8"?>
<DELVRY05>
<IDOC BEGIN="1">
<EDI_DC40 SEGMENT="1">
<!-- Name of Table Structure -->
<TABNAM>EDI_DC40</TABNAM>
<!-- Client -->
<MANDT>100</MANDT>
<!-- IDoc number -->
<DOCNUM>61011</DOCNUM>
<!-- SAP Release for IDoc -->
<DOCREL>757</DOCREL>
<!-- Status of IDoc -->
<STATUS>52</STATUS>
<!-- Direction: 1 is Outbound, 2 is Inbound -->
<DIRECT>2</DIRECT>
<!-- Name of basic type -->
<IDOCTYP>DELVRY05</IDOCTYP>
<!-- Message type -->
<MESTYP>DESADV</MESTYP>
<!-- Sender port (SAP System, external subsystem) -->
<SNDPOR>SAPS4H</SNDPOR>
<!-- Partner type of sender -->
<SNDPRT>LS</SNDPRT>
<!-- Partner Number of Sender -->
<SNDPRN>S4HCLNT100</SNDPRN>
<!-- Receiver port -->
<RCVPOR>SAPS4H</RCVPOR>
<!-- Partner Type of Receiver -->
<RCVPRT>LS</RCVPRT>
<!-- Partner Number of Receiver -->
<RCVPRN>S4LOCAL</RCVPRN>
</EDI_DC40>
<!-- Delivery Header -->
<E1EDL20 SEGMENT="1">
<!-- Shipping Point / Receiving Point -->
<VSTEL>1710</VSTEL>
<!-- External Identification of Delivery Note -->
<LIFEX>34A93516-F296-4510-3D5F-5FC8D9881FC7</LIFEX>
<!-- Controlling (Delivery) -->
<E1EDL18 SEGMENT="1">
<!-- Qualifier for external release number -->
<QUALF>ORI</QUALF>
</E1EDL18>
<!-- IDoc: Deadline -->
<E1EDT13 SEGMENT="1">
<!-- IDOC Qualifier: Dates -->
<QUALF>007</QUALF>
<!-- Constraint for activity start -->
<NTANF>20231114</NTANF>
</E1EDT13>
<!-- Delivery Item -->
<E1EDL24 SEGMENT="1">
<!-- Item number of the SD document -->
<POSNR>10</POSNR>
<!-- Plant -->
<WERKS>1710</WERKS>
<!-- Storage Location -->
<LGORT>171S</LGORT>
<!-- Material belonging to the customer -->
<KDMAT>000000000000002222</KDMAT>
<!-- Actual quantity delivered (in sales units) -->
<LFIMG>5</LFIMG>
<!-- Sales Unit: You can check it 'ISO Code' in Units of Measurement. TCode: CUNI -->
<VRKME>CT</VRKME>
<!-- Reference data ordering party -->
<E1EDL41 SEGMENT="1">
<!-- Qualifier for Reference Data of Ordering Party -->
<QUALI>001</QUALI>
<!-- Customer Reference -->
<BSTNR>4500001738</BSTNR>
<!-- Item Number of the Underlying Purchase Order -->
<POSEX>10</POSEX>
</E1EDL41>
</E1EDL24>
<!-- Handling unit header -->
<E1EDL37 SEGMENT="1">
<!-- External Handling Unit Identification (SSCC) -->
<EXIDV>49132018100030015</EXIDV>
<!-- Material belonging to the customer -->
<VHILM_KU>EWMS4-CAR00</VHILM_KU>
<!-- Handling Unit Item -->
<E1EDL44 SEGMENT="1">
<!-- Item number of the SD document -->
<POSNR>10</POSNR>
<!-- Base Quantity Packed in the Handling Unit Item -->
<VEMNG>24</VEMNG>
<!-- Base Unit of Measure of the Quantity to be Packed (VEMNG) -->
<VEMEH>PCE</VEMEH>
<!-- Customer Material -->
<KDMAT>000000000000002222</KDMAT>
<!-- Plant -->
<WERKS>1710</WERKS>
<!-- Storage Location -->
<LGORT>171S</LGORT>
</E1EDL44>
</E1EDL37>
<!-- ↑E1EDL37 × 5 with own EXIDV POSNR -->
<E1EDL24 SEGMENT="1">
<POSNR>20</POSNR>
<WERKS>1710</WERKS>
<LGORT>171S</LGORT>
<KDMAT>000000000000002222</KDMAT>
<LFIMG>1</LFIMG>
<VRKME>CT</VRKME>
<E1EDL41 SEGMENT="1">
<QUALI>001</QUALI>
<BSTNR>4500001738</BSTNR>
<POSEX>10</POSEX>
</E1EDL41>
</E1EDL24>
<E1EDL37 SEGMENT="1">
<EXIDV>49132018100030077</EXIDV>
<VHILM_KU>EWMS4-CAR00</VHILM_KU>
<E1EDL44 SEGMENT="1">
<POSNR>10</POSNR>
<VEMNG>24</VEMNG>
<VEMEH>PCE</VEMEH>
<KDMAT>000000000000002222</KDMAT>
<WERKS>1710</WERKS>
<LGORT>171S</LGORT>
</E1EDL44>
</E1EDL37>
<E1EDL24 SEGMENT="1">
<POSNR>10</POSNR>
<WERKS>1710</WERKS>
<LGORT>171S</LGORT>
<KDMAT>000000000000002234</KDMAT>
<LFIMG>1</LFIMG>
<VRKME>CT</VRKME>
<E1EDL41 SEGMENT="1">
<QUALI>001</QUALI>
<BSTNR>4500001739</BSTNR>
<POSEX>10</POSEX>
</E1EDL41>
</E1EDL24>
<E1EDL37 SEGMENT="1">
<EXIDV>49132018100030084</EXIDV>
<VHILM_KU>EWMS4-CAR00</VHILM_KU>
<E1EDL44 SEGMENT="1">
<POSNR>10</POSNR>
<VEMNG>24</VEMNG>
<VEMEH>PCE</VEMEH>
<KDMAT>000000000000002234</KDMAT>
<WERKS>1710</WERKS>
<LGORT>171S</LGORT>
</E1EDL44>
</E1EDL37>
</E1EDL20>
</IDOC>
</DELVRY05>

3. Fetch Inbound Delivery
Lastly, to display the newly created Inbound Delivery filtered by the UUID:

Amazing prototype, Ryutaro!
Thanks, Jonas!
Very well written!
Happy to hear!
I have a question. Does this APP have to use iPhone ? thank you
You can use both of iPhone and Android devices since the app is made by React-Native which is a cross platform tool.