cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Assistance with Updating Outbound Delivery Multiple Item Lines (Custom Fields)

Rawel
Explorer
0 Kudos
127

Good afternoon SAP Team,

I’m currently facing an issue and would appreciate your guidance. Could you please advise on how to update custom fields for multiple item lines in an Outbound Delivery?

The custom fields are triggered from specific events, but I believe my current approach may be incorrect.


Rawel_0-1762248812247.png
For reference: In the example shown in the attached photo, each custom field is bound to a single property.

Additional Details:

Here’s the process flow I’m following:

  1. I create a Stock Transfer Order. using Stock Transfer Order API

  2. An Outbound Delivery is generated, which includes the custom fields.

  3. After creation, I attempt to update or modify the custom fields for each item line within the Outbound Delivery.

However, I’ve noticed that only the first item line is successfully updated, while the subsequent item lines remain unchanged.

I suspect this may be related to how my current update logic is structured or how the payload is being handled

 

{
            "PurchaseOrderType": "UB",
            "CompanyCode": "BMII",
            "PurchasingOrganization": "MGPO",
            "PurchasingGroup": "001",
            "Supplier": "",
            "SupplyingPlant": "01BP",
            "YY1_Warehouse_Name_PDH": "Paranaque ",
            "_PurchaseOrderItem": [
                {
                    "PurchaseOrderItem": "10",
                    "Material": "A1",
                    "Plant": "02BP",
                    "OrderQuantity": 5.00,
                    "PurchaseOrderQuantityUnit": "PCE",
                    "NetPriceAmount": 0.00,
                    "DocumentCurrency": "PHP",
                    "YY1_OrderType_PDI": "0",
                    "YY1_Store_Name_PDI": "SM Megamall",
                    "YY1_DeliveryTypePO_PDI": "1D",
                    "YY1_Fan_Out_Category_PDI": "0",
                    "YY1_Item_Description_PDI": "1st Item",
                    "YY1_Order_Session_Id_PDI": "1st Session",
                    "YY1_Store_SubUnitPO1_PDI": "1",
                    "YY1_Item_Category_Name_PDI": "Cakes",
                    "YY1_MaterialVariantCod_PDI": "A27",
                    "PurchaseOrderItemCategory": "3",
                    "_PurchaseOrderItemNote": [
                        {
                            "TextObjectType": "F01",
                            "PlainLongText": "1st item"
                        },
                        {
                            "TextObjectType": "F03",
                            "PlainLongText": "1st Item Link Desc"
                        }
                    ]
                },
                {
                    "PurchaseOrderItem": "20",
                    "Material": "A1",
                    "Plant": "02BP",
                    "OrderQuantity": 10.00,
                    "PurchaseOrderQuantityUnit": "PCE",
                    "NetPriceAmount": 0.00,
                    "DocumentCurrency": "PHP",
                    "YY1_OrderType_PDI": "1",
                    "YY1_Store_Name_PDI": "SM Megamall",
                    "YY1_DeliveryTypePO_PDI": "1D",
                    "YY1_Fan_Out_Category_PDI": "0",
                    "YY1_Item_Description_PDI": "2nd Item",
                    "YY1_Order_Session_Id_PDI": "2nd Session",
                    "YY1_Store_SubUnitPO1_PDI": "2nd",
                    "YY1_Item_Category_Name_PDI": "2nd Cakes",
                    "YY1_MaterialVariantCod_PDI": "A1",
                    "PurchaseOrderItemCategory": "3",
                    "_PurchaseOrderItemNote": [
                        {
                            "TextObjectType": "F01",
                            "PlainLongText": "2nd Item Desc"
                        },
                        {
                            "TextObjectType": "F03",
                            "PlainLongText": "2nd Item Link"
                        }
                    ]
                }
            ]
        }

 

Accepted Solutions (1)

Accepted Solutions (1)

Lakshmipathi
SAP Champion
SAP Champion

To update custom fields for multiple item lines in an Outbound Delivery in SAP S/4HANA Public Cloud, you must ensure that each item line is individually addressed in the payload and that the custom fields are correctly mapped to the item-level extension structure. The issue you're facing—only the first item updating—likely stems from incorrect payload structure or binding logic.

Below would be some of the key considerations for updating multiple item lines

In SAP S/4HANA Public Cloud, custom fields created via Custom Fields and Logic app must be explicitly bound to the item-level business context, such as Delivery Item & Purchase Order Item. If your custom fields are bound only to the header or a single item property, they won’t apply to multiple items.

Your payload must include distinct entries for each item, and each entry must contain its own set of custom fields. Ensure that the item-level extension fields (e.g., YY1_*_PDI) are nested correctly under each item node.

When using the Outbound Delivery API, confirm that you're calling the correct PATCH or PUT method for item-level updates. Some APIs may default to updating only the first item unless the payload explicitly loops through all items.

Answers (0)