In S/4HANA Public Cloud, Handling Unit Shipping Label Output can be configured via Output Parameter Determination App. The plant column within the “Handling Unit” Output Application Object is retrieved from the Handling Unit (HU) header.
Whether a plant is determined automatically for the HU header in turn is configured in the Packaging Material Type SSC-UI. By default, the plant is not determined automatically.
Depending on the configuration it might be that Plant and Storage Location in the Handling Unit Header are not determined and it is currently not possible to achieve this purely via configuration without possibly unwanted implications. Therefore for S/4HANA Cloud 2302 und 2308 we suggest to use the extensibility features for a consistent determination of Plant and Storage Location without unwanted side effects.
If the default has not been adapted, the plant column within Output Parameter Determination can not be directly used, as the HU header would have a plant. If the business use case requires differentiations based on plant information (for example: different print queue per plant), a different approach to differentiate by plant needs to be implemented:
In a nutshell, the steps to be able to differentiate by plant within the Output Parameter Determination app:
1. Create a new custom field within the HU header extensibility context
2. Implement the HU BAdI to retrieve the plant information from the HU items (at item level, plant and storage location are always maintained and kept up to date)
3. Add custom field as column to Output Parameter Determination app
1. Create a new custom field within the HU header extensibility context
Go to the “Custom Fields and Logic” App (make sure your user has the business role SAP_BR_EXTENSIBILITY_SPEC assigned to access this app).
Choose:
- Business Context: Handling Unit
- Label: Label of your choice, “CUSTOM_PLANT” for example
- Type: Text
- Length: 4
Click on “Create and Edit” after entering the data above.
In the detail screen of “CUSTOM_PLANT”, navigate to User Interfaces and make sure that “C_HANDLINGUNITOMPARAMDETERMINE” is enabled. This CDS View is serving the field values for the Output Parameter Determination App within the Handling Unit Output Application Object.
Publish the field:
The publishing process might take a few minutes, refresh the list view afterwards a few times until the field you see that the field is published. Once published, you can carry on with step 2.
2. Implement the HU BAdI to retrieve the plant information from the HU items (at item level, plant and storage location are always maintained and kept up to date)
Open the “Custom Logic” app and click on “Create”:
In the creation screen, search for Business Context “Handling Unit” and select it:
Select “Change Handling Unit Header Data” and click on Step 2:
Provide a new for the custom logic implementation, for example “FillCustomPlantFromItems”. Click on “Review”:
In the review screen, click on “Create”:
In the next screen, click on “Publish”:
Once published, you can click on “Open Code Editor”:
In the Code Editor, make sure your custom field is available as changing parameter:
In the next step, ABAP code has to be written.
To write a fixed plant into the custom field, the following code could be used:
LOOP AT CT_HEADER_ATTRIBUTES ASSIGNING FIELD-SYMBOL(<fs_header>).
<fs_header>-yy1_custom_plant_huh = '1010'.
ENDLOOP.
However, if the system possesses more than one plant, this logic would fall short. For more than one plant in the system, the coding has to iterate through the items and pick the plant from there, specifically from the first item for which the plant field is populated:
LOOP AT CT_HEADER_ATTRIBUTES ASSIGNING FIELD-SYMBOL(<fs_header>).
LOOP AT it_item_attributes ASSIGNING FIELD-SYMBOL(<fs_item>) WHERE venum = <fs_header>-venum.
IF <fs_item>-werks IS NOT INITIAL.
<fs_header>-yy1_custom_plant_huh = <fs_item>-werks.
EXIT.
ENDIF.
ENDLOOP.
ENDLOOP.
After pasting the above code, click on “Save and Publish”:
3. Add custom field as column to Output Parameter Determination app
To use the custom field in the Output Parameter Determination app, open the app, select the Output Application Object “Handling Unit”, determination step “Output Type” and make a right click on the “Determination Step” Label. In the menu, click on “Refresh Condition Parameters of Application”:
Confirm the popup by clicking on “Yes”.
For this example, let’s assume different queues per plant should be chosen. In order to achieve this, select “Printer Settings” in the determination step dropdown and click on “Edit”:
Once in edit mode, click on “Table Settings”:
In the table settings popup, select Insert Column -> From Context Data Objects..:
Select the CUSTOM_PLANT field and click on “OK”:
The field should now be visible in the table settings popup, click on “OK”:
If you now scroll to the right of the output parameter table, you should see the CUSTOM_PLANT column:
In order to differentiate printing queues per plant, select the HU_SHIPPING_LABEL row, copy and paste it:
You should have two “HU_SHIPPING_LABEL” rows afterwards:
Scroll to the right, click on the arrow down on the second row from the top and select “Direct Value Input”:
Enter plant 1010 (or any plant that is available in your system) and click on “OK”:
Repeat the same step with the third row, choose a different plant that exists in your system (in this example: 1710):
Change the print queue for the third row to another queue (in this example: HU_QUEUE):
Click on “Activate”:
Confirm the popup by clicking on “Yes”:
In order to test the settings, create an Outbound Delivery for the first plant and one for the second plant, the printing queues should now differ.
Outbound Delivery for plant 1010, Output Item for HU after packing at least one delivery item into it:
Outbound Delivery for plant 1710, Output Item for HU after packing at least one delivery item into it:
In conclusion, configuring Handling Unit Shipping Label Output in S/4HANA Public Cloud involves several steps to achieve differentiation based on plant information. By default, the plant is not determined automatically for the HU header, but with the use of extensibility features, a consistent determination of Plant and Storage Location can be achieved without unwanted side effects. The steps outlined in this blog post provide a solution to differentiate by plant within the Output Parameter Determination app.
More information on Handling Unit Output Management within S/4HANA Cloud: https://help.sap.com/docs/SAP_S4HANA_CLOUD/32da8359c8ee4e8b8e8c5e15cacba5aa/36597ffd10024278bdb455c22bfd8c60.html