Learn about an enhancement in SAP Supply Network Collaboration (SNC) that performs the automatic packing of products. It is done at the time of advanced shipping notification (ASN) creation by the supplier through a file upload and is based on specifications defined in the system.
Key Concept
Packing the goods into handling units is an important step during the inbound process when the goods duly packed are shipped from the supplier and received at the plant.
Across all major industries the normal business practice is to have goods properly packed during delivery stages from the receipt of raw materials to the issue of finished goods. Often, the goods received from a supplier are packed physically. However, the information obtained through a business-to-business (B2B) or Web interface often doesn’t provide an easy way to adapt this packing information into the inbound business process.
Consider SAP Supply Network Collaboration (SNC), in which the packing functionality is not supported during the file upload. Suppliers use file uploads primarily to create a huge number of advanced shipping notifications (ASNs) for informing the business of the upcoming shipment. Although the option is available for users to perform the packing on an SNC Web user interface (UI), it’s often tedious and involves multiple clicks per item to perform either the manual or automatic packing operation.
In industries such as high-tech and pharmaceuticals, we have observed that suppliers play a pivotal role and that collaboration is critical. At the same time, the supplier collaboration needs to be easy on either side for the benefit of both parties. We have come across use cases in which suppliers declined to perform the packing operation on the SNC Web UI, considering the time it takes (including UI screen navigation, button clicks, and publishing) when dealing with multiple ASNs. Therefore, the company has to perform this operation upon receiving the shipment. This can be severely taxing on the company’s employees when dealing with a huge number of ASNs. Hence, there is a need to automate this process.
Note
This article requires an understanding of the basic concepts and the standard processes of purchase orders (PO), goods receipt, and ASN creation.
The Standard Process
Figure 1 shows the standard manual inbound process running across multiple systems (e.g., SNC, ERP Central Component [ECC]), and extended Warehouse Management [EWM]). We have worked across multiple customer sites in which such a landscape exists. Many businesses adopted this approach to implement best practices across supplier collaboration and warehouse management practices to boost productivity.

Figure 1
Options of performing packing in a standard inbound process using SNC, ECC, and EWM
There are primarily two ways of performing the inbound process with packing:
- Packing to be performed by the supplier in an SNC Web UI
- Packing to be performed by the business in EWM
Both the approaches have cons, considering either the supplier or the business has to manually perform the packing operation.
How to Automate the Process
We have automated this process at multiple high-tech companies with a small enhancement in the file upload process for ASN creation. Figure 2 shows the updated process flow. Note that the system performs the packing operation at the time of the file upload, thus avoiding any requirement for the supplier or business to perform the packing operation at a later stage.

Figure 2
New process flow automating inbound packing using SNC, ECC, and EWM
Implementation Overview
We used the enhancement spot /SCA/FTR_FILE_ASNDLPD and created an implementation for enhancement implementation ZPACKING. Provided the details of custom Business Add-In (BAdI) name (ZPACKING_BADI) and custom implementing class (ZPACKING_CL) while creating this implementation.
Note
This sample implementation is for illustration only. You need to adjust it to your specific needs and technical environment.
The above method is called after parsing the data of the uploaded file and after populating the data into the ASN structure. This structure, however, does not have the packing information, as the packing process is not supported in the standard file upload process. The modified code is shown in Figure 3.
Custom code under the method
‘/SCA/IF_FTR_FILE_ASNDLPD~AFTER_MAP_BADI_TO_APP’ under the custom class ‘ZPACKING_CL’
method /SCA/IF_FTR_FILE_ASNDLPD~AFTER_MAP_BADI_TO_APP.
* The following code shall perform the packing during SNC ASN creation through file up-load process
* Data Declaration
DATA:
l_uuid_x16 TYPE sysuuid_x16,
lv_buyerid TYPE BU_PARTNER_GUID,
lv_supplierid TYPE BU_PARTNER_GUID,
party type /SCMB/DM_PARTY_TAB,
ls_party LIKE LINE OF party,
ls_hu TYPE /SCMB/DM_DELVRY_HU_STR,
lt_hu TYPE /SCMB/DM_DELVRY_HU_TAB,
ls_shu TYPE /SCMB/DM_DELVRY_INCL_HU_STR,
lt_shu TYPE /SCMB/DM_DELVRY_INCL_HU_TAB,
ls_del_item type /SCMB/DM_DELVRY_INCL_ITM_STR,
lt_del_item type /SCMB/DM_DELVRY_INCL_ITM_TAB,
ls_item type /SCMB/DM_DELVRY_ITM_STR,
lt_item type /SCMB/DM_DELVRY_ITM_TAB,
ls_content_query TYPE /SCWM/S_PS_CONTENT_QUERY,
t_ps_id TYPE /SCWM/TT_PS_HEADER_KEY,
ls_ps_id LIKE LINE OF t_ps_id,
lv_severity TYPE BAPI_MTYPE,
lt_bapireturn TYPE BAPIRETTAB,
ls_mat_tab TYPE /SCMB/MDL_MATID_STR,
lt_mat_tab TYPE /SCMB/MDL_MATID_TAB,
ls_flags TYPE /SCWM/S_PS_PARM_FG_READ,
t_ps TYPE /SCWM/TT_PS_OBJECT,
lt_pack TYPE /SCWM/TT_PACKITEM,
ls_pack TYPE /SCWM/S_PACKITEM,
lt_huhdr TYPE /SCWM/TT_HUHDR_INT,
lt_huhdrf TYPE /SCWM/TT_HUHDR_INT,
ls_huhdr LIKE LINE OF lt_huhdr,
ls_huhdr1 LIKE LINE OF lt_huhdr,
lt_huitm TYPE /SCWM/TT_HUITM_INT,
ls_huitm LIKE LINE OF lt_huitm,
lv_bsktd TYPE /SCMB/VMI_BSTKD,
lo_pack_ref TYPE REF TO /SCWM/IF_PACK_BAS.
FIELD-SYMBOLS:
<fs_hu> TYPE /SCMB/DM_DELVRY_HU_TAB,
<fs_item> LIKE LINE OF lt_item.
party = cs_delivery-party.
* Capturing the GUID of the buyer party
READ TABLE party INTO ls_party WITH KEY type = '00002'.
lv_buyerid = ls_party-guid.
CLEAR ls_party.
* Capturing the GUID of the supplier party
READ TABLE party INTO ls_party WITH KEY type = '00002'.
lv_supplierid = ls_party-guid.
CLEAR ls_party.
ASSIGN cs_delivery-handling_unit TO <fs_hu>.
CLEAR lt_hu.
* Start of loop, where relevant items of ASN are packed one by one in sequence
LOOP AT cs_delivery-item ASSIGNING <fs_item>.
ls_mat_tab-matid = <fs_item>-product-GUID.
APPEND ls_mat_tab to lt_mat_tab.
ls_content_query-matid = lt_mat_tab.
CLEAR : ls_mat_tab, lt_mat_tab.
* Retrieving the packaging specification id for the item
CALL FUNCTION '/SCWM/API_PACKSPEC_GETLIST'
EXPORTING
is_content_query = ls_content_query
IMPORTING
et_ps_keys = t_ps_id
ev_severity = lv_severity
et_return = lt_bapireturn.
CLEAR : lt_bapireturn, lv_severity, ls_content_query.
* Retrievingthe details of the packaging specification id derived in earlier step.
CALL FUNCTION '/SCWM/API_PACKSPEC_READ'
EXPORTING
is_flags = ls_flags
it_ps_id = t_ps_id
IMPORTING
et_object = t_ps
et_return = lt_bapireturn.
CLEAR : lt_bapireturn, lv_severity, ls_flags.
* Since it is a new ASN creation through file upload, a new guid_stock is required and the following
section refers to that.
CALL 'RFCControl'
ID 'CODE' FIELD 'U'
ID 'UUID' FIELD l_uuid_x16.
READ TABLE t_ps_id INTO ls_ps_id INDEX 1.
CLEAR t_ps_id.
ls_pack-guid_ps = ls_ps_id-guid_ps.
ls_pack-unit = <fs_item>-quantity_unit.
ls_pack-quan = <fs_item>-quantity.
ls_pack-matid = <fs_item>-product-GUID.
ls_pack-guid_stock = l_uuid_x16.
APPEND ls_pack to lt_pack.
CLEAR: ls_pack, l_uuid_x16, ls_ps_id.
* Code to get the Handling unit proposals
CALL FUNCTION '/SCWM/HU_PROPOSAL'
EXPORTING
IT_PACK = lt_pack
IO_PACK_REF = lo_pack_ref
IMPORTING
ET_HUHDR = lt_huhdr
ET_HUITM = lt_huitm
ET_RETURN = lt_bapireturn
EV_SEVERITY = lv_severity.
CLEAR : lt_bapireturn, lv_severity, lt_pack.
LOOP AT lt_huhdr INTO ls_huhdr.
* Code to generate handling unit number for the handling units proposed
CALL FUNCTION '/SAPAPO/VMI_PO_NR_GET_NEXT'
EXPORTING
IV_BUYERID = lv_buyerid
IV_VENDORID = lv_supplierid
IV_SHIPTOLOCID = cs_delivery-SHIPFROM_LOCATION-GUID
IV_SHIPFROMLOCID = cs_delivery-SHIPTO_LOCATION-GUID
IV_NRTYPE = 'HU'
IV_NTH_NUMBER_GET = 1
IMPORTING
EV_BSTKD = lv_bsktd.
ls_huhdr-huident = lv_bsktd.
APPEND ls_huhdr TO lt_huhdrf.
CLEAR : ls_huhdr, lv_bsktd.
ENDLOOP.
* The table lt_huhdrf shall have all the details of handling units created. Now the following code shall assign this information to the ASN structure for creating the ASN with rele-vant packing details.
LOOP AT lt_huhdrf INTO ls_huhdr.
CLEAR : ls_huitm, lt_del_item, ls_hu.
* Capturing the HU number and the packaging material
ls_hu-ID = ls_huhdr-huident.
ls_hu-packproduct-id = ls_huhdr-pmat.
* Capturing the HU hierarchy
LOOP AT lt_huhdrf INTO ls_huhdr1 WHERE higher_guid = ls_huhdr-guid_hu.
* Determining the sub-handling units for a particular handling unit
ls_shu-id = ls_huhdr1-huident.
APPEND ls_shu to lt_shu.
CLEAR : ls_shu, ls_huhdr1.
ENDLOOP.
ls_hu-incl_hu = lt_shu.
CLEAR lt_shu.
* Determining the delivery item, against which the HUs are linked
LOOP AT lt_huitm INTO ls_huitm WHERE guid_parent = ls_huhdr-guid_hu.
CLEAR: ls_del_item.
ls_del_item-id = <fs_item>-id.
ls_del_item-QUANTITY = ls_huitm-quana.
ls_del_item-QUANTITY_UNIT = ls_huitm-meins.
APPEND ls_del_item to lt_del_item.
ENDLOOP.
ls_hu-delivery_item = lt_del_item.
CLEAR lt_del_item.
APPEND ls_hu to lt_hu.
CLEAR : ls_huhdr, ls_hu.
ENDLOOP.
CLEAR : lt_huhdr, lt_huitm, lt_huhdrf.
ENDLOOP.
* End of loop & assigning the HUs to the ASN structure for all items.
<fs_hu> = lt_hu.
endmethod.
***Code End
Figure 3
Modified code
Note
The code included in this article was developed primarily for demonstration purposes. Therefore, no error and exception handling has been incorporated. You should use discretion when using this code in your implementation.
Use Cases
We now discuss two use cases involving different approaches toward using the SAP system for packing at the time of ASN creation.
Use Case 1
We have come across use cases in which users wished to inform the system specifically whether a product is required to be packed or not at the time of ASN creation (owing to the dynamics of their business process), even when an active packing specification exists in the system for that product.
For this type of use case, you need to modify the template of ASN creation through the file transfer process. To modify the template, follow these steps:
1. Enhance the DDIC Structure /SCA/DM_FTR_ASNDLPD_IN_TAB (Figure 4) by appending the new field that is used as a reference to the importing parameter for ASN due lists. To open the class, use transaction code SE24. From there, navigate to the method. To open the structure directly, use the transaction code SE11.

Figure 4
Structure to be modified in case new fields need to be added for an importing parameter
2. Enhance the DDIC Structure /SCA/DM_FTR_ASNDLPD_OUT_TAB (Figure 5) by appending the new field that is used as a reference to the exporting parameter for ASN due lists.

Figure 5
Structure to be modified in case new fields need to be added for an exporting parameter
3. Incorporate an IF condition so that the above custom code only works based on the value provided in the new field during file upload.
Use Case 2
Sometimes the products are not packed per the standard packaging specifications, but are packed in an ad hoc way based on a business requirement. For example, instead of informing the system that 10 units of a product should always go into a box, the user might pack three units in box 1, four units in box 2, and so on (for example, substrate in a semiconductor industry) where there is no specific packing pattern.
In such cases, the enhancement details remain more or less the same. The user has to add columns to capture the ad hoc quantities and based on the ad hoc quantity, the user needs to call the function module /SAPAPO/VMI_PO_NR_GET_NEXT to generate the handling unit (HU) number and directly populate the ASN structure. There is no need to call any other functions pertaining to the packaging specifications and HU proposals.
Process Flow (For the Development Shown Above)
Now we explain the step-by-step flow of the new process outlined in Figure 2.
SNC: Generate a download file for Due List for Purchasing Documents profile on SNC Web UI. Once the downloading process is successful, the profile status is Ready and the file can be downloaded by clicking the link Click here to download (Figure 6).

Figure 6
Generate a download file for ASN creation
SNC: After the file is downloaded, it needs to be modified by providing the required entries to create an ASN (e.g., ASN number, ASN quantity, delivery date, ship date). After the file is made ready, click the Upload button to upload the file on the UI against the Due List for Purchasing Documents profile. Once the upload is successful, click the View Log button to view a log that indicates that the ASN was published successfully (Figure 7).

Figure 7
Upload the file for ASN creation
Note
Uploading, downloading, and modifying files in SNC are basic steps, so we do not include details about this process.
Figure 8 shows the log of a file upload.

Figure 8
Log of a file upload
SNC: To review the ASN that was successfully created and published, close the log screen and then navigate to the ASN details menu item under the menu Delivery (refer back to Figure 7). You can view the ASN in the SNC Web UI (Figure 9).

Figure 9
ASN details of the ASN that was created through file upload
Click the Packing button on the ASN details screen. In the next screen, you can see that three handling units were created (5300000119, 5300000120, 5300000121) with PACKSNC as the packing material (Figure 10).

Figure 10
Handling units that were created while creating an ASN during the upload process
ECC: Review the ASN in ECC. Log in to the ECC system and use the transaction code VL33N to open the inbound delivery. You can see that the inbound delivery 180000834 was created for the vendor shipment ASN001 (Figure 11).

Figure 11
Display inbound delivery in ECC
Select the inbound delivery shown in Figure 11 and press Enter. The next screen displays details of the inbound delivery (Figure 12).

Figure 12
Inbound delivery item overview
ECC: Review the packing information against the inbound delivery. Navigate to the menu item Edit > Pack. The system displays the handling units and the relevant information such as the packed quantity and the packing material (Figure 13).

Figure 13
Packing details
Press F3 and then double-click the item to navigate to the item details screen (Figure 14).

Figure 14
Inbound delivery item details
ECC: Because EWM is the system in which the goods receipt is performed, the inbound delivery is distributed to that system (Figure 14).
EWM: The ERP document is distributed to EWM and the corresponding EWM delivery document 1813 is created (Figure 15). The handling unit’s information can be seen in here as well under the HU tab.

Figure 15
The handling unit’s information in a delivery document in EWM
EWM: To perform the goods receipt, click the Goods Receipt button. The Goods Receipt status now reads Completed (Figure 16).

Figure 16
A goods receipt completed for delivery in EWM
ECC: The actual GR date is updated on the ECC side after the GR is complete in SAP EWM. To view the updated GR date, log in to ECC and open the delivery using transaction code VL33N (Figure 17).

Figure 17
Goods receipt information is visible in the delivery document in ECC
SNC: The ASN status on SNC is updated to the Goods Receipt Complete, thereby completing the entire chain (Figure 18).

Figure 18
ASN details under the delivery menu in the SNC Web UI
V. Krishna Anaparthi
V. Krishna Anaparthi has vast experience in the field of enterprise consulting. Playing the roles of project manager and solution architect, he is instrumental in the successful implementation of multiple SAP projects across the consumer goods, pharmaceutical, and high-tech industries. He is currently serving as the process architect at SAP Labs India Pvt. Ltd. and is a part of the SAP Business By Design development team.
Krishna holds an MBA from NITIE, Mumbai, India. He has PMP, CPIM, and CSCP certifications and is proficient in supply chain and project management processes.
You may contact the author at v.krishna.anaparthi@sap.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.

M. Shilpa Reddy
M. Shilpa Reddy is a senior quality engineer at SAP Labs India Pvt. Ltd. She has been working in the field of SAP SNC for the past seven years along with other key modules, such as SAP MDG. She is a part of the STC team and is instrumental in ensuring the quality of SAP products before they are released to the market.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.