SAP Knowledge Base Article - Public

3616292 - Item Sequence Changed While Creating Purchase Request Through Web Services

Symptom

User is creating a purchase request with multiple line items using web service, however the item sequence got changed after the document creation. 

Environment

SAP Business ByDesign

Reproducing the Issue

  1. Login to SOAP UI
  2. Entre the payload request for Purchase Request with multiple line items 
  3. Execute the payload
  4. Item sequence is changed after the document creation 

Cause

In the given payload, user has not used the tag Item ID and hence the random sequence has taken by the system. (<ItemID>1</ItemID>) 

Resolution

You can use the below sample payload to fix the issue; Please make sure to fill the party details like Company ID, Product ID, Supplier details etc.

<n0:PurchaseRequestMaintainBundleRequest xmlns:n0="http://sap.com/xi/SAPGlobal20/Global">
 <BasicMessageHeader/>
 <PurchaseRequestMaintainBundle actionCode="01">
  <Item actionCode="01">
   <ItemID>1</ItemID>
   <ProductKeyItem>
    <ProductTypeCode>1</ProductTypeCode>
    <ProductIdentifierTypeCode>1</ProductIdentifierTypeCode>
    <ProductID>A</ProductID>
   </ProductKeyItem>
   <TypeCode>18</TypeCode>
   <DeliveryPeriod>
    <StartDateTime timeZoneCode="UTC">2024-09-17T12:00:00.1234567Z</StartDateTime>
    <EndDateTime timeZoneCode="UTC">2024-09-17T12:00:00.1234567Z</EndDateTime>
   </DeliveryPeriod>
   <ShipToLocationID>B</ShipToLocationID>
   <ListUnitPrice/>
   <Quantity unitCode="EA">25</Quantity>
   <CompanyIDParty actionCode="01">
    <PartyID>ABC</PartyID>
   </CompanyIDParty>
   <RequesterIDParty actionCode="01">
    <PartyID>40</PartyID>
   </RequesterIDParty>
   <RecipientIDParty/>
   <BuyerResponsibleIDParty/>
   <SupplierIDParty/>
   <directMaterialIndicator>true</directMaterialIndicator>
  </Item>
  <Item actionCode="01">
   <ItemID>2</ItemID>
   <ProductKeyItem>
    <ProductTypeCode>1</ProductTypeCode>
    <ProductIdentifierTypeCode>1</ProductIdentifierTypeCode>
    <ProductID>C</ProductID>
   </ProductKeyItem>
   <TypeCode>18</TypeCode>
   <DeliveryPeriod>
    <StartDateTime timeZoneCode="UTC">2024-09-17T12:00:00.1234567Z</StartDateTime>
    <EndDateTime timeZoneCode="UTC">2024-09-17T12:00:00.1234567Z</EndDateTime>
   </DeliveryPeriod>
   <ShipToLocationID>A2A</ShipToLocationID>
   <ListUnitPrice/>
   <Quantity unitCode="EA">30</Quantity>
   <CompanyIDParty actionCode="01">
    <PartyID>B</PartyID>
   </CompanyIDParty>
   <RequesterIDParty actionCode="01">
    <PartyID>40</PartyID>
   </RequesterIDParty>
   <RecipientIDParty/>
   <BuyerResponsibleIDParty/>
   <SupplierIDParty/>
   <directMaterialIndicator>true</directMaterialIndicator>
  </Item>
  <Item actionCode="01">
   <ItemID>3</ItemID>
   <ProductKeyItem>
    <ProductTypeCode>1</ProductTypeCode>
    <ProductIdentifierTypeCode>1</ProductIdentifierTypeCode>
    <ProductID>D</ProductID>
   </ProductKeyItem>
   <TypeCode>18</TypeCode>
   <DeliveryPeriod>
    <StartDateTime timeZoneCode="UTC">2024-09-17T12:00:00.1234567Z</StartDateTime>
    <EndDateTime timeZoneCode="UTC">2024-09-17T12:00:00.1234567Z</EndDateTime>
   </DeliveryPeriod>
   <ShipToLocationID>B</ShipToLocationID>
   <ListUnitPrice/>
   <Quantity unitCode="EA">40</Quantity>
   <CompanyIDParty actionCode="01">
    <PartyID>B</PartyID>
   </CompanyIDParty>
   <RequesterIDParty actionCode="01">
    <PartyID>40</PartyID>
   </RequesterIDParty>
   <RecipientIDParty/>
   <BuyerResponsibleIDParty/>
   <SupplierIDParty/>
   <directMaterialIndicator>true</directMaterialIndicator>
  </Item>
  <Item actionCode="01">
   <ItemID>4</ItemID>
   <ProductKeyItem>
    <ProductTypeCode>1</ProductTypeCode>
    <ProductIdentifierTypeCode>1</ProductIdentifierTypeCode>
    <ProductID>E</ProductID>
   </ProductKeyItem>
   <TypeCode>18</TypeCode>
   <DeliveryPeriod>
    <StartDateTime timeZoneCode="UTC">2024-09-17T12:00:00.1234567Z</StartDateTime>
    <EndDateTime timeZoneCode="UTC">2024-09-17T12:00:00.1234567Z</EndDateTime>
   </DeliveryPeriod>
   <ShipToLocationID>B</ShipToLocationID>
   <ListUnitPrice/>
   <Quantity unitCode="EA">50</Quantity>
   <CompanyIDParty actionCode="01">
    <PartyID>B</PartyID>
   </CompanyIDParty>
   <RequesterIDParty actionCode="01">
    <PartyID>40</PartyID>
   </RequesterIDParty>
   <RecipientIDParty/>
   <BuyerResponsibleIDParty/>
   <SupplierIDParty/>
   <directMaterialIndicator>true</directMaterialIndicator>
  </Item>
 </PurchaseRequestMaintainBundle>
</n0:PurchaseRequestMaintainBundleRequest>

Response:

<n0:PurchaseRequestMaintainBundleConfirmation xmlns:n0="http://sap.com/xi/SAPGlobal20/Global" xmlns:prx="urn:sap.com:proxy:LGK:/1SAI/TAEE0B36BCC3167C82F9285:804">
<PurchaseRequestResponse>
<ChangeStateID> </ChangeStateID>
<PurchaseRequestID>PR ID</PurchaseRequestID>
<PurchaseRequestUUID></PurchaseRequestUUID>
</PurchaseRequestResponse>
<Log/>
</n0:PurchaseRequestMaintainBundleConfirmation>

See Also

Refer to: KB0100397 - Knowledge Gap / How To Question

Keywords

xml payload, purchase request, item sequence, sap, webservice, item id, correct payload, purchase request ui , KBA , SRD-SRM-PRO , Purchase Requests and Orders , Problem

Product

SAP Business ByDesign all versions