Skip to Content
0
May 22, 2020 at 07:25 AM

Create Sales Scheduling Agreement via Sales Scheduling Agreement (A2X) API

216 Views

Hi Experts,

We are trying to create Sales Scheduling Agreements in the system with the following API:

Sales Scheduling Agreement (A2X)

POST

https://xxxxxxxxx/sap/opu/odata/sap/API_SALES_SCHEDULING_AGREEMENT/A_SalesSchedgAgrmt

We are sending the following request in order to create sales scheduling agreement items, delivery schedules and schedule lines at the same time:

{

"SalesSchedgAgrmtType": "LZ",

"SalesOrganization": "3402",

"DistributionChannel": "10",

"OrganizationDivision": "00",

"SoldToParty": "18013",

"SalesSchedgAgrmtDate": "2020-01-01T00:00:00",

"PurchaseOrderByCustomer": "P045879",

"CustomerPurchaseOrderDate": "2020-01-01T00:00:00",

"PricingDate": "2020-01-01T00:00:00",

"DelivSchedTypeMRPRlvnceCode": "C",

"AgrmtValdtyStartDate": "2020-01-01T00:00:00",

"AgrmtValdtyEndDate": "2020-12-31T00:00:00",

"YY1_SD_SP_V0_SDH": "TEST",

"to_Item": {

"results": [

{

"SalesSchedulingAgreementItem": "000010",

"Material": "9000903",

"ProductionPlant": "ES20",

"StorageLocation": "1020",

"to_Partner": {

"results": [

{

"PartnerFunction": "SH",

"Customer": "47030"

}

]

},

"to_PricingElement": {

"results": [

{

}

]

},

"to_SalesSchedgAgrmtDelivSched": {

"results": [

{

"SalesSchedulingAgreement": "",

"SalesSchedulingAgreementItem": "000010",

"IntDeliveryScheduleNumber": "0000",

"SchedulingAgreementReleaseType": "1",

"DeliveryScheduleStartDate": "2020-01-01T00:00:00",

"DeliveryScheduleEndDate": "2020-12-31T00:00:00",

"CustomerDeliveryScheduleNumber": "1",

"DeliveryScheduleDate": "2020-01-01T00:00:00",

"ScheduleLineDateKey": "D",

"LastDeliveryDocument": "089694882",

"LastIntDeliveryScheduleNumber": "9999",

"JITHorizonEndDate": "2020-12-31T00:00:00",

"CustomerFiscalYear": "2020",

"RequirementsStatusKey": "B",

"DeliveryScheduleCreationDate": "2020-01-01T00:00:00",

"DelivSchedFreeDefinedAttrib01": "A",

"DelivSchedFreeDefinedAttrib02": "B",

"DelivSchedFreeDefinedAttrib03": "C",

"DelivSchedFreeDefinedAttrib04": "D",

"DelivSchedFreeDefinedAttrib05": "E",

"LastReceiptQuantity": "0",

"CumulativeReceiptQuantity": "0",

"HghstDelivGoAheadCumltvQty": "0",

"ActlMatlGoAheadCumltvQty": "0",

"ActlProdnGoAheadCumltvQty": "0",

"ActlDelivGoAheadCumltvQty": "0",

"HghstMatlGoAheadCumltvQty": "0",

"CumulativeIssuedQuantity": "0",

"CumulativeDeliveredQuantity": "0",

"CumulativeInTransitQuantity": "0",

"SalesSchedgAgrmtInTrnstQty": "0",

"OrderQuantityUnit": "ST",

"to_SalesSchedgAgrmtSchedLine": {

"results": [

{

"ScheduleLine": "10",

"SchedulingAgreementReleaseType": "2",

"ScheduleLineCategory": "L2",

"OrderQuantityUnit": "10",

"SalesDelivDateCategory": "",

"RequestedDeliveryDate": "2020-01-01T00:00:00",

"RequestedDeliveryTime": "PT15H51M04S",

"ScheduleLineOrderQuantity": "10",

"CorrectedQtyInOrderQtyUnit": "0",

"ScheduleLineOpenQuantity": "10",

"ConfdOrderQtyByMatlAvailCheck": "0",

"DelivBlockReasonForSchedLine": ""

}

]

}

}

]

},

"to_Text": {

"results": [

{

}

]

}

}

]

},

"to_Partner": {

"results": [

{

}

]

},

"to_PricingElement": {

"results": [

{

}

]

},

"to_Text": {

"results": [

{

}

]

}

}

We are getting a 201 Created Response.

The sales scheduling agreement is created in the system. However, no delivery schedule and schedule lines are updated.

Are we sending the wrong request?

The business documentation shows the following example:

POST <host>/sap/opu/odata/sap/API_SALES_SCHEDULING_AGREEMENT/A_SalesSchedgAgrmt

X-CSRF-Token: abc

Content-Type: application/json

Accept: application/json

{

"SalesSchedgAgrmtType": "LZ",

"SalesOrganization": "1010",

"DistributionChannel": "10",

"OrganizationDivision": "00",

"SalesGroup": "100",

"SalesOffice": "100",

"SalesDistrict": "AT0001",

"SoldToParty": "S10103276",

"PurchaseOrderByCustomer": "Sales Scheduling Agreements Header",

"to_Item": [

{

"SalesSchedulingAgreementItem": "10",

"SalesSchedgAgrmtItemCategory": "LZN",

"Material": "TG-D501",

"MaterialByCustomer": "MAT01 API Test"

}

]

}

However, there is no example to show how to update delivery schedules and schedule lines.

Do you have information regarding this subject?

Thank your very much in advance for your comments!

Best regards,

Jorge.

Attachments

32345-image.png (148.3 kB)