Adding OData service to EI_Script_OD worksheet

 

In order to create an OData script on EI_Script_OD worksheet one needs to choose button  „Add OData service”. The OData popup window will appear:

In this window one defines OData service call parameters like http method (GET, POST, PUT,PATCH,…), OData service URI and other call parameters. In the case of http method, other than GET, additionally data to be passed to the service is defined (header and data parameters defined in the right part of the window).

 

Description of various OData window elements is gathered in the table below :

Element name

Description of the element

OData service type

Defines, whether the OData service is an SAP or a non-SAP service.  

OData service version

For SAP OData service defines implementation version (V2 or V4)

http method

Defines http method used when calling service. Most OData services implements GET method (reporting). Others implement additionally creation, changing and deleting data using methods POST/PATCH/DELETE. Implemented methods are usually to be found in service description (e.g. on https://api.sap.com webpage)

Protocol

http/ https or to be chosen automatically by the SAP system

Host name

OData server address. Can be selected automatically with “Search for host and port” button.

Port

OData server port. Can be selected automatically with “Search for host and port” button.

Service path

URI path to the service. For SAP depends on service version.

OData service

OData service with prefixes (e.g. namespace). Can be selected automatically with “Find service”.

OData resource

Usually EntitySet. Can be selected via „Find EntitySet” button.

Parameters 1/2

Other OData service parameters. One can choose from the list accessible with button „Search”.

Format

Result format (json or xml). Preferred format is JSon(xml should be used only id service does not provide json. In case  when XML is chosen (not recommended), one has to set the configuration  parameter EI_C_OD_MATCHING_LEVEL ResultMatchingLevel to value 1.

Button „Call GET query to test service” or „Call GET query to fetch call data”

Allows reading GET method call results into query data to provide data for other method calls (e.g. put) or just for testing the GET query.

Important: the number of records read in that way is limited by the Records value (below).

No of records (0=all)

Defines filtering results of query via $top=N clause. This  filtering apply to:
- testing GET service
- fetching GET service data as Data Input for other than GET service calls
- getting result fields definition (after pressing OK) via GET query.
Important: If not all fields are fetched via automatic script generation, one may increase the records value (or put it to 0).

Checkbox „Use GET query to get CSRF-Token and ETag

When checked, then before calling other methods than get, EasyInput first calls the GET method, read header parameters CSRF-Token and ETag (if exists) and passes these parameters as header parameters for subsequent other method calls (CSRF-Token and If-Match).

Query header

Defines data format for http method other than GET.

Query data

Defines data string passed as Data to query (for methods other than GET) or shows testing result( for GET method).  

 

After defining all necessary OData service parameters, one should click OK button, in order EasyInput created OData Script in worksheet EI_Script_OD.
Important! Info about OData return fields is taken from OData GET service call, and not from service metadata. That is why, if no data exists, or not enough records to be taken for definition checking is specified, then the definition may be read incorrectly (e.g. partially)!

After creating script automatically, the script should be adjusted by adding (WriteData) and (ReadData) information. See general EasyInput script worksheet information.