cancel
Showing results for 
Search instead for 
Did you mean: 

OData Payload - can't PATCH AgreementTerms

mmangels85
Explorer
426

Hello experts,

one of my OData-Payloads is giving me a hard time. I checked the API numerous times, all the mandatory fields are filled and I'm at a loss why I keep getting a 400 - Bad Request. If I remove the 'AgreementTerms' part it works perfectly fine, but I can't get it to work as a whole.

--batch
Content-Type: multipart/mixed; boundary=changeset_1

--changeset_1
Content-Type: application/http
Content-Transfer-Encoding: binary
PATCH Agreements(MKT_AgreementOrigin='CRM',MKT_AgreementExternalID='40001') HTTP/1.1
Content-Type:  application/json
Content-Length: ###
Sap-Cuan-SourceSystemId: XXXCLN123
Sap-Cuan-SourceSystemType:
Sap-Cuan-SequenceId: AGREEMENT_MASTER_DATA
Sap-Cuan-RequestTimestamp: 20170508141617.0000001
Sap-Cuan-ExternalReferenceId: XXXCLN12320170508141617_01

{
"MKT_AgreementOrigin":"CRM",
"MKT_AgreementExternalID":"40001",
"ContactID":"20001",
"ContactOrigin":"MAFIS",
"MKT_AgreementType":"VERTR_STRO",
"MKT_AgreementStartDateTime":"2018-01-01T00:00:00",
"MKT_AgreementEndDateTime":"2019-12-31T00:00:00",
"MKT_MarketingArea":"ENERGIE",
"MKT_AgreementIsCanceled":false,
"MKT_AgrmtCancellationReason":"",
"YY1_CONSUMPTION_VALUE_MKT":"5000",
"YY1_CONSUMPTION_UNIT_MKT":"kWh",
"OriginDataLastChgUTCDateTime":"/Date(1574636400000)/"
}

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

PATCH AgreementTerms(MKT_AgreementOrigin='CRM',MKT_AgreementExternalID='40001',MKT_AgrmtTermsStartDateTime='2018-01-01T00:00:00',MKT_AgrmtTermsEndDateTime='2019-12-31T00:00:00') HTTP/1.1
Content-Type:  application/json
Content-Length: ###
Sap-Cuan-SourceSystemId: XXXCLN123
Sap-Cuan-SourceSystemType:
Sap-Cuan-SequenceId: AGREEMENT_MASTER_DATA
Sap-Cuan-RequestTimestamp: 20170508141617.0000001
Sap-Cuan-ExternalReferenceId: XXXCLN12320170508141617_01


{
"MKT_AgreementStatus":"A",
"MKT_AgreementRenewalType":"3",
"ProductOrigin":"CRM",
"ProductID":"STROM_PRODUKT_1",
"MKT_AgrmtCanclnConditions":"3",
"MKT_AgreementPaymentFrequency":"4",
"OriginDataLastChgUTCDateTime":"/Date(1574636400000)/"
}

--changeset_1--
 --batch--

I would be very thankfu for any ideas.

View Entire Topic
WolfgangGedemer
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Maximilian,

try to use this payload: payloadwithoneemptyline.txt

Only one empty row in front of "PATCH"-row.

Best Regards,
Wolfgang