Technical Articles
Using Postman call SAP S/4HANA Cloud SOAP API and simulate outbound SOAP call integration flow
This blog post explains how to use Postman call SAP S/4HANA Cloud SOAP API, and how to simulate SAP S/4HANA Cloud call integration flow by SOAP protocol
What you will learn
⭐ How to use Postman call SAP S/4HANA Cloud SOAP API
⭐ How to use Postman simulate SAP S/4HANA Cloud call integration flow
Prerequisites
Environment
- Setup integration environment
In prior to simulate SAP S/4HANA Cloud outbound call, you can prepare an integration environment firstly. Regarding to the scenario, please refer to the blog posts Integrate SAP S/4HANA Cloud with third-party WMS by SAP Cloud Platform Integration Suite for details.
Using Postman call SAP S/4HANA Cloud SOAP API
Launch Postman, and then create a new collection, try to create a new POST call. Postman support SOAP protocol but should complete some settings in advance.
- Configure API endpoint
Setup API URL clearly.
- Setup Authorization
I selectBasic Auth
here, you could setup other method if OAuth 2.0 or certificate configured
- Setup Headers
Deselect the Content-Type, and then create new one, set the value in text/xml
- Setup Body
This part is critical for the API call, for this use case, we callwarehouseshippingadvice_in
which exposures inSAP_COM_0440
. For business scenarios, you should refer to the WSDL file, and then filter your required fields. I just setup the mandatory fields in the post body.Notes:
SOAPUI could analyses the WSDL file automatically, and then generate a form to help you build up the required fields. But SOAPUI is not free, Postman could replace it ideally.We should build up the SOAP Envelope in the request body, which include SOAP:Header and SOAP:Body. SAP S/4HANA Cloud inbound SOAP API call must include messageID which defined as UUID, the tool SOAPUI refer to WS-A addressing generate messageID automatically. Fortunately, we can add it in Postman manually.
Add the sectionxmlns:wsa="http://www.w3.org/2005/08/addressing"
in label soap:Envelope. And then add new line<wsa:messageId>urn:uuid:{{$randomUUID}}</wsa:messageId>
in the soap:Header. Postman provide inner method to generate UUID. The following sample lists out minimal fields for the APIwarehouseshippingadvice_in
.<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dec="http://sap.com/xi/EDI/DECWMS" xmlns:wsa="http://www.w3.org/2005/08/addressing"> <soap:Header> <wsa:messageId>urn:uuid:{{$randomUUID}}</wsa:messageId> </soap:Header> <soap:Body> <dec:WarehouseShippingAdvice> <MessageHeader> <CreationDateTime>2020-12-02T08:38:03Z</CreationDateTime> </MessageHeader> <Delivery> <DeliveryDocument>80000023</DeliveryDocument> <Party> <ActionCode>01</ActionCode> <PartnerFunction>LF</PartnerFunction> </Party> <Deadlines> <ActualGoodsMovementDateTime timeZoneCode="GMTUK" daylightSavingTimeIndicator="false">2020-12-02T05:00:00Z</ActualGoodsMovementDateTime> </Deadlines> <DeliveryItem> <DeliveryDocumentItem>10</DeliveryDocumentItem> <Material>TG11</Material> <ActualDeliveryQuantity unitCode="PCE">1</ActualDeliveryQuantity> <ActualDeliveredQtyInBaseUnit unitCode="PCE">1</ActualDeliveredQtyInBaseUnit> <DeliveryToBaseQuantityDnmntr>1</DeliveryToBaseQuantityDnmntr> <DeliveryToBaseQuantityNmrtr>1</DeliveryToBaseQuantityNmrtr> </DeliveryItem> </Delivery> </dec:WarehouseShippingAdvice> </soap:Body> </soap:Envelope>
After all these configurations, you can post request to SAP S/4HANA Cloud successfully, and you will read code 202 now. Regarding to verify message status, please refer to this blog post.
- Alternative method to binding the MessageId
If adding the messageId in SoapHeader not work for you, you can try to add a context in URL: https://xxxxx.ondemand.com/sap/bc/srt/scs_ext/sap/warehouseshippingadvice_in?MessageId=916C6E5X-3BB2-11CA-A054-08002B1BB6K9
How to accept the messageid totally determined by the API definition. Please select appropriate method to binding the messageid for your scenario.
Using Postman simulate SAP S/4HANA Cloud call integration flow
If you want to simulate SAP S/4HANA Cloud outbound call integration flow by Postman. Here is the sample to help you build up payload in Postman
- Configure API endpoint
Setup API URL clearly.
- Setup Authorization
I selectBasic Auth
here, you could fetch the username and password in the integration tenant related instance key. You can find details Prerequisites in the blog post
- Setup Headers
Deselect the Content-Type, and then create new one, set the value in text/xml
- Setup Body
SAP S/4HANA Cloud outbound call is a little differentiate with inbound call. The document content included in the soap:body. You could build up your request body as follows.<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pm="https://www.postman.com/"> <soapenv:Header/> <soapenv:Body> <n0:WarehouseShippingOrderRequest xmlns:n0="http://sap.com/xi/EDI/DECWMS" xmlns:pm="https://www.postman.com/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:prx="urn:sap.com:proxy:CC8:/1SAI/TAS6D390B236B1180C932B8:783" xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"> <MessageHeader> <ID>00163E2C7B391EDB8BDD718E1D24601C</ID> <CreationDateTime>2020-11-25T06:57:58Z</CreationDateTime> <SenderBusinessSystemID>0LOALS1</SenderBusinessSystemID> </MessageHeader> <Delivery> <DeliveryDocument>0080007588</DeliveryDocument> <DeliveryDocumentType>LF</DeliveryDocumentType> <DeliveryDocumentTypeName>Outbound Delivery</DeliveryDocumentTypeName> <DeliveryPriority>02</DeliveryPriority> <DeliveryPriorityDesc>Normal</DeliveryPriorityDesc> <CustomerGroup>01</CustomerGroup> <CustomerGroupName>Customer Group 01</CustomerGroupName> <SDDocumentCategory>J</SDDocumentCategory> <SalesOrganization>1010</SalesOrganization> <SalesOrganizationName>Dom. Sales Org DE</SalesOrganizationName> <ShippingPoint>1010</ShippingPoint> <ShippingPointName>Shipping Point 1010</ShippingPointName> <Warehouse>182</Warehouse> <WarehouseName>3rd Party WM Integration</WarehouseName> <HeaderGrossWeight unitCode="KGM">180.0</HeaderGrossWeight> <HeaderNetWeight unitCode="KGM">162.0</HeaderNetWeight> <HeaderVolume unitCode="MTQ">1.8</HeaderVolume> <Incoterms> <IncotermsClassification>EXW</IncotermsClassification> <IncotermsClassificationName>Ex Works</IncotermsClassificationName> <IncotermsTransferLocation>Walldorf</IncotermsTransferLocation> <IncotermsLocation1>Walldorf</IncotermsLocation1> </Incoterms> <ShippingCondition>01</ShippingCondition> <ShippingConditionName>Standard</ShippingConditionName> <Party> <PartnerFunction>AG</PartnerFunction> <AddressID>0000022831</AddressID> <Customer>0010100003</Customer> <Address> <FormOfAddress>Company</FormOfAddress> <AddressName>Inlandskunde DE 3</AddressName> <CityName>Budenheim</CityName> <PostalCode>55258</PostalCode> <StreetName>Gallierstraße_123</StreetName> <HouseNumber>700</HouseNumber> <CountryTwoLetterISOCode>DE</CountryTwoLetterISOCode> <LanguageISOCode>DE</LanguageISOCode> <Region>RP</Region> <AddressSearchText1>KUNDE3</AddressSearchText1> <AddressTimeZone>CET</AddressTimeZone> <CityFileTestStatus>C</CityFileTestStatus> <TransportZone>0000000002</TransportZone> <PhoneNumber1>09990 365-0</PhoneNumber1> <EmailAddress>irmgard.zeller@sap.com</EmailAddress> </Address> </Party> <Party> <PartnerFunction>WE</PartnerFunction> <CustomerPartnerDescription>1010</CustomerPartnerDescription> <AddressID>0000022831</AddressID> <Customer>0010100003</Customer> <Address> <FormOfAddress>Company</FormOfAddress> <AddressName>Inlandskunde DE 3</AddressName> <CityName>Budenheim</CityName> <PostalCode>55258</PostalCode> <StreetName>Gallierstraße_123</StreetName> <HouseNumber>700</HouseNumber> <CountryTwoLetterISOCode>DE</CountryTwoLetterISOCode> <LanguageISOCode>DE</LanguageISOCode> <Region>RP</Region> <AddressSearchText1>KUNDE3</AddressSearchText1> <AddressTimeZone>CET</AddressTimeZone> <CityFileTestStatus>C</CityFileTestStatus> <TransportZone>0000000002</TransportZone> <PhoneNumber1>09990 365-0</PhoneNumber1> <EmailAddress>irmgard.zeller@sap.com</EmailAddress> </Address> </Party> <Deadlines> <PickingDateTime timeZoneCode="CET">2020-11-26T23:00:00Z</PickingDateTime> <LoadingDateTime timeZoneCode="CET">2020-12-01T23:00:00Z</LoadingDateTime> <IssueDateTime timeZoneCode="CET">2020-12-02T23:00:00Z</IssueDateTime> <DeliveryDateTime timeZoneCode="CET">2020-12-03T23:00:00Z</DeliveryDateTime> </Deadlines> <DeliveryItem> <DeliveryDocumentItem>000010</DeliveryDocumentItem> <Material>TG11</Material> <OriginallyRequestedMaterial>TG11</OriginallyRequestedMaterial> <DeliveryDocumentItemText>Handelsware 11, PD, normaler Handel</DeliveryDocumentItemText> <MaterialGroup>L001</MaterialGroup> <MaterialGroupName>Trading Materials</MaterialGroupName> <MaterialType>HAWA</MaterialType> <MaterialByCustomer>RM129</MaterialByCustomer> <Plant>1010</Plant> <PlantName>Plant 1 DE</PlantName> <StorageLocation>101I</StorageLocation> <StorageLocationName>3rd Party WMS</StorageLocationName> <ActualDeliveryQuantity unitCode="PCE">10.0</ActualDeliveryQuantity> <ActualDeliveredQtyInBaseUnit unitCode="PCE">10.0</ActualDeliveredQtyInBaseUnit> <ItemNetWeight unitCode="KGM">162.0</ItemNetWeight> <ItemGrossWeight unitCode="KGM">180.0</ItemGrossWeight> <ItemVolume unitCode="MTQ">1.8</ItemVolume> <LoadingGroup>0001</LoadingGroup> <LoadingGroupName>Crane</LoadingGroupName> <TransportationGroup>0001</TransportationGroup> <TransportationGroupName>On pallets</TransportationGroupName> <DistributionChannel>10</DistributionChannel> <DistributionChannelName>Direct Sales</DistributionChannelName> <Division>00</Division> <DivisionName>Product Division 00</DivisionName> <PartialDeliveryIsAllowed>true</PartialDeliveryIsAllowed> <DeliveryDocumentItemCategory>TAN</DeliveryDocumentItemCategory> <DeliveryDocumentItemCatName>Standard Item</DeliveryDocumentItemCatName> <CumulativeBatchQtyInBaseUnit unitCode="PCE">0.0</CumulativeBatchQtyInBaseUnit> <CumulativeBatchGrossWeight unitCode="KGM">0.0</CumulativeBatchGrossWeight> <CumulativeBatchNetWeight unitCode="KGM">0.0</CumulativeBatchNetWeight> <CumulativeBatchVolume unitCode="MTQ">0.0</CumulativeBatchVolume> <CumulativeBatchQtyInSalesUnit unitCode="PCE">0.0</CumulativeBatchQtyInSalesUnit> <ReferenceSDDocument>0000024129</ReferenceSDDocument> <ReferenceSDDocumentItem>000010</ReferenceSDDocumentItem> <DeliveryToBaseQuantityDnmntr>1</DeliveryToBaseQuantityDnmntr> <DeliveryToBaseQuantityNmrtr>1</DeliveryToBaseQuantityNmrtr> <GoodsMovementType>601</GoodsMovementType> <GoodsMovementRefDocType>L</GoodsMovementRefDocType> <InspectionLot>000000000000</InspectionLot> <DeliveryItemOrderReferenceData> <SalesDocument>0000024129</SalesDocument> <SalesDocumentItem>000010</SalesDocumentItem> <ReferenceSDDocumentCategory>C</ReferenceSDDocumentCategory> <SalesDocumentDate>2020-11-25</SalesDocumentDate> <PurchaseOrderByCustomer>VZ</PurchaseOrderByCustomer> <PurchasingDocumentItem>00000</PurchasingDocumentItem> </DeliveryItemOrderReferenceData> </DeliveryItem> <DeliveryItem> <DeliveryDocumentItem>000020</DeliveryDocumentItem> <Material>TG11</Material> <OriginallyRequestedMaterial>TG11</OriginallyRequestedMaterial> <DeliveryDocumentItemText>Handelsware 11, PD, normaler Handel</DeliveryDocumentItemText> <MaterialGroup>L001</MaterialGroup> <MaterialGroupName>Trading Materials</MaterialGroupName> <MaterialType>HAWA</MaterialType> <MaterialByCustomer>RM129</MaterialByCustomer> <Plant>1010</Plant> <PlantName>Plant 1 DE</PlantName> <StorageLocation>101I</StorageLocation> <StorageLocationName>3rd Party WMS</StorageLocationName> <ActualDeliveryQuantity unitCode="PCE">20.0</ActualDeliveryQuantity> <ActualDeliveredQtyInBaseUnit unitCode="PCE">20.0</ActualDeliveredQtyInBaseUnit> <ItemNetWeight unitCode="KGM">162.0</ItemNetWeight> <ItemGrossWeight unitCode="KGM">180.0</ItemGrossWeight> <ItemVolume unitCode="MTQ">1.8</ItemVolume> <LoadingGroup>0001</LoadingGroup> <LoadingGroupName>Crane</LoadingGroupName> <TransportationGroup>0001</TransportationGroup> <TransportationGroupName>On pallets</TransportationGroupName> <DistributionChannel>10</DistributionChannel> <DistributionChannelName>Direct Sales</DistributionChannelName> <Division>00</Division> <DivisionName>Product Division 00</DivisionName> <PartialDeliveryIsAllowed>true</PartialDeliveryIsAllowed> <DeliveryDocumentItemCategory>TAN</DeliveryDocumentItemCategory> <DeliveryDocumentItemCatName>Standard Item</DeliveryDocumentItemCatName> <CumulativeBatchQtyInBaseUnit unitCode="PCE">0.0</CumulativeBatchQtyInBaseUnit> <CumulativeBatchGrossWeight unitCode="KGM">0.0</CumulativeBatchGrossWeight> <CumulativeBatchNetWeight unitCode="KGM">0.0</CumulativeBatchNetWeight> <CumulativeBatchVolume unitCode="MTQ">0.0</CumulativeBatchVolume> <CumulativeBatchQtyInSalesUnit unitCode="PCE">0.0</CumulativeBatchQtyInSalesUnit> <ReferenceSDDocument>0000024129</ReferenceSDDocument> <ReferenceSDDocumentItem>000010</ReferenceSDDocumentItem> <DeliveryToBaseQuantityDnmntr>2</DeliveryToBaseQuantityDnmntr> <DeliveryToBaseQuantityNmrtr>2</DeliveryToBaseQuantityNmrtr> <GoodsMovementType>601</GoodsMovementType> <GoodsMovementRefDocType>L</GoodsMovementRefDocType> <InspectionLot>000000000000</InspectionLot> <DeliveryItemOrderReferenceData> <SalesDocument>0000024129</SalesDocument> <SalesDocumentItem>000010</SalesDocumentItem> <ReferenceSDDocumentCategory>C</ReferenceSDDocumentCategory> <SalesDocumentDate>2020-11-25</SalesDocumentDate> <PurchaseOrderByCustomer>VZ</PurchaseOrderByCustomer> <PurchasingDocumentItem>00000</PurchasingDocumentItem> </DeliveryItemOrderReferenceData> </DeliveryItem> </Delivery> </n0:WarehouseShippingOrderRequest> </soapenv:Body> </soapenv:Envelope>
Hello Arvin Wu
Perfect blog