cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to create Sales order Items in bulk independently

0 Kudos

Hi Team,

May i know whether we can Create multiple Sales Order Items of a Sales Order in a Batch?

i dont want to create Header + Items at one go, instead want to create header first and then items in bulk after the creation of Order Header.

tried different approaches but ended up creating multiple post calls in the same Changeset as shown below:

--changeset
Content-Type: application/http
Content-Transfer-Encoding: binary


POST A_SalesOrder('AA')/to_Item HTTP/1.1
sap-content-accept: header
Content-Type: application/json
Accept: application/json


{




 SalesOrder" : "AA",
"SalesOrderItem" : "10",
"HigherLevelItem" : "0",
"SalesOrderItemCategory" : "XX",
"SalesOrderItemText" : "XXX",
"PurchaseOrderByCustomer" : "XX",
"Material" : "XX",
"MaterialByCustomer" : "",
"PricingDate" : "XXXX",
"RequestedQuantity" : "1",
"RequestedQuantityUnit" : "XX",
"ItemGrossWeight" : "1.000",
"ItemNetWeight" : "1.000",
"ItemWeightUnit" : "XX",
"ItemVolume" : "0.000",
"ItemVolumeUnit" : "",
"TransactionCurrency" : "XXX",
"NetAmount" : "XXX",
"MaterialGroup" : "",
"MaterialPricingGroup" : "",
"Batch" : "",
"ProductionPlant" : "XXXX",
"StorageLocation" : "",
"DeliveryGroup" : "0",
"ShippingPoint" : "XXXX",
"ShippingType" : "",
"DeliveryPriority" : "0",
"IncotermsClassification" : "XXX",
"IncotermsTransferLocation" : "",
"IncotermsLocation1" : "",
"IncotermsLocation2" : "",
"CustomerPaymentTerms" : "",
"SalesDocumentRjcnReason" : "",
"ItemBillingBlockReason" : "",
"WBSElement" : "",
"ProfitCenter" : "",
"ReferenceSDDocument" : "",
"ReferenceSDDocumentItem" : "X",
"SDProcessStatus" : "X",
"DeliveryStatus" : "X",
"OrderRelatedBillingStatus" : "",
"RequirementSegment" : ""


}




--changeset
Content-Type: application/http
Content-Transfer-Encoding: binary


POST A_SalesOrder('AA')/to_Item HTTP/1.1
sap-contect-accept: header
Content-Type: application/json
Accept: application/json


{
"SalesOrder" : "AA",
"SalesOrderItem" : "20",
"HigherLevelItem" : "0",
"SalesOrderItemCategory" : "XX",
"SalesOrderItemText" : "XXX",
"PurchaseOrderByCustomer" : "XX",
"Material" : "XX",
"MaterialByCustomer" : "",
"PricingDate" : "XXXX",
"RequestedQuantity" : "1",
"RequestedQuantityUnit" : "XX",
"ItemGrossWeight" : "1.000",
"ItemNetWeight" : "1.000",
"ItemWeightUnit" : "XX",
"ItemVolume" : "0.000",
"ItemVolumeUnit" : "",
"TransactionCurrency" : "XXX",
"NetAmount" : "XXX",
"MaterialGroup" : "",
"MaterialPricingGroup" : "",
"Batch" : "",
"ProductionPlant" : "XXXX",
"StorageLocation" : "",
"DeliveryGroup" : "0",
"ShippingPoint" : "XXXX",
"ShippingType" : "",
"DeliveryPriority" : "0",
"IncotermsClassification" : "XXX",
"IncotermsTransferLocation" : "",
"IncotermsLocation1" : "",
"IncotermsLocation2" : "",
"CustomerPaymentTerms" : "",
"SalesDocumentRjcnReason" : "",
"ItemBillingBlockReason" : "",
"WBSElement" : "",
"ProfitCenter" : "",
"ReferenceSDDocument" : "",
"ReferenceSDDocumentItem" : "X",
"SDProcessStatus" : "X",
"DeliveryStatus" : "X",
"OrderRelatedBillingStatus" : "",
"RequirementSegment" : ""


}


--changeset--




--batch--


its creating two items 10, 20 for the order AA without any issues. but it obviously takes two Create Entity type calls

1st one with Changeset begin + Create Entity

2nd one with Create Entity + Changeset End

In case we have 10 items -

1st one with Changeset begin + Create Entity

2nd one for create Entity 3rd one for Create Entity

.

.

10th one with Create Entity + Changeset End

My question is - do we have an approach where we can eliminate the need to call all these multiple calls and have one call to create all the items in one go ? any help is appreciated.

thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

hi andre.fischer

May i request you to kindly let me know if you think we can achieve using a better approach please.

thanks