Показаны сообщения с ярлыком /IWFND/MAINT_SERVICE. Показать все сообщения
Показаны сообщения с ярлыком /IWFND/MAINT_SERVICE. Показать все сообщения

среда, 13 октября 2021 г.

How to make oData service working from outside

 At first, select oData service you want to check, for example, something with business partner.

 Here is API_BUSINESS_PARTNER service - need to activate in /IWFND/MAINT_SERVICE


Then, go to "Call Browser" button:

URL with this format will be opened: 

https://s4host.net:8070/sap/opu/odata/sap/API_BUSINESS_PARTNER/?$format=xml

Here you can see some collections, which starts from "A_" patterns:


Copy such collection (A_BusinessPartner) and put it after basic service name:

https://s4host.net:8070/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner

It brings the list of business partners from the system:


To have information about exact BP, put BP number in such format to URL:

https://s4host.net:8070/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner('300000')


You can do the same from Postman for example:


To expand business partner data for some particular directions, you can add such extension (in blue):

https://s4host.net:8070/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner('300000')/to_BusinessPartnerAddress


To have all API structure, you can append URL by $metadata extension:
https://s4host.net:8070/sap/opu/odata/sap/API_BUSINESS_PARTNER/$metadata


To create Sales Order, you can use Postman with those POST request:

https://s4host.net:8070/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder

Put your POST-URL and request X-CSRF-Token=fetch through GET request:


Then put the received result in header value of POST request:



More-or-less minimum POST request JSON payload looks like that (values coloured by blue)

{
    "SalesOrderType""OR",
    "SalesOrganization""RU01",
    "DistributionChannel""01",
    "OrganizationDivision""01",
    "SoldToParty""2",
    "PurchaseOrderByCustomer""Created via OData Service",
    "CustomerPaymentTerms""0001",
    "to_Partner": [
        {
            "PartnerFunction""SH",
            "Customer""2"
        }
    ],
    "to_Item": [
        {
            "Material""2000000010",
            "RequestedQuantity""2",
            "to_PricingElement": [
                {
                    "ConditionType""PR00",
                    "ConditionRateValue""125"
                }
            ]
        },
        {
            "Material""2000000011",
            "RequestedQuantity""10",
            "to_PricingElement": [
                {
                    "ConditionType""PR00",
                    "ConditionRateValue""230"
                }
            ]
        }
    ]
}



Here are some useful links:

SAP API Business Hub

How to find an API on SAP S/4HANA OP (EN) | SAP Blogs

Create Sales Order - SAP Help Portal

https://help.sap.com/docs/SAP_S4HANA_ON-PREMISE/1dad2180e6f34b75ac77afce5cb5eda1/7ab0bcc20b1611da1503000bcddc2565.html?&version=2020.001 

Other API-s examples

API_VMSVEHICLE

API_VMSVEHICLELOCATION

Operations for Vehicle Management System for Vehicle - Read - SAP Help Portal

Converting UUID between hyphened representation and RAW16 | SAP Blogs

Request syntax for vehicles


четверг, 26 ноября 2020 г.

How to activate Fiori service


If you've added some Fiori launcher role, some app services might not be activated.

For example, in Sales Orders chapter I have Sales Order Fulfillment Resolve Issues app


where I want to select follow-up activity:


And have an error with key-words App could not be opened either due to an incorrect SAP Fiori launchpad configuration or a missing role assignment and Failed to resolve navigation target:


After that, go to transaction /IWFND/ERROR_LOG - SAP Gateway Error Log  where you can see the service name (CB_SALES_ORDER_SRV)


Having the name of service, go to transaction /IWFND/MAINT_SERVICE where pass the procedure below: 

Add service


Put service name in search field of Technical Service Name, find the service, add them:


Confirm Package assignment:


After service activation, instead of error we see the beautiful screen of sales order overview app: