Function

Examples and explanations

With InputAssistant plus GuiXT Controls you have a convenient way to use SAP OData services in GuiXT. In particular, newer SAP systems implement numerous OData services provided by SAP; these also form the basis of the Fiori apps. GuiXT supports the currently used OData versions v2 and v4.

SAP has already integrated all required authorization checks into the services, so there is no risk of displaying data to the user or allowing them to change data for which they are not authorized.

On the website "SAP Business Accelerator Hub" SAP provides a catalog of all OData services.

The OData Tool of the GuiXT Script Editor Pro offers a convenient search function, a live preview of the content, as well as automatic generation of the OData calls for your scripts. 

In addition to the OData services of the SAP standard, you can also call self-developed services.

GuiXT supports all OData "CRUD" operations (Create, Read, Update, Delete):
  • Adding an entity: guinet.odata.create
  • Reading one or more entities: guinet.odata.read
  • Changing an entity: guinet.odata.update
  • Deleting an entity: guinet.odata.delete

In addition, there are the functions

  • Logging on to an OData session: guinet.odata.logon
  • Logging off an OData session: guinet.odata.logout
  • Executing an action: guinet.odata.execute

You can find documentation on all calls in

GuiXT API for SAP OData Services

Detailed examples on individual topics are provided there in separate articles.

Example 1
Reading all maintenance orders for a given date
CreateTable V[myorders] _
  MaintenanceOrder _
  MaintenanceOrderType _
  MaintenanceOrderDesc _
  MaintOrdBasicStartDate

CallVB guinet.odata.read _
  service:="sap/opu/odata/sap/API_MAINTENANCEORDER/
                     MaintenanceOrder" _
  filter:="MaintOrdBasicStartDate eq 04.04.2025" _
  result:="myorders" 


Result V[myorders]:
4001320	YBA1	Equipment Repair (T&M)		04.04.2025
4001321	YBA1	Pump Service			04.04.2025
4001322	YBA1	Equipment Repair (Fixed Price)	04.04.2025
4001323	YBA1	Follow-on for 4001322		04.04.2025
4001324	YBA1	Equipment Repair (Fixed Price)	04.04.2025

                                         
Logon
An explicit logon call is normally not necessary, since GuiXT automatically performs the logon internally with the first OData operation per SAP GUI session.
The server name for the https OData connection is taken from the GuiXT profile or the "guixt.ini" file, parameter "ODataServer". For authenticating the user, the username and password of the running SAP GUI session are used.
If the SAP GUI logon is done via SSO, you can add "authmode=sso" to the specification of the OData server so that GuiXT instead chooses a different authentication method.
The authentication methods OAuth 2.0, SAML and X.509 client certificates are used automatically by Windows if configured.

You can work with an explicit logon call, for example if you want to establish an OData connection to another SAP system in order to compare data of the current system with another system.
Any connection that may already exist is closed by an explicit logon.

Example of a logon:

Logging on to an OData session
CallVB guinet.odata.logon _
  server:="abc.com" _
  authmode:="sso"
Example 2
Reading a country name
// define result structure
CreateStructure V[countrytext] _
    Country CountryName NationalityName

// OData call
CallVB guinet.odata.read _
  service:="sap/opu/odata/sap/API_COUNTRY_SRV/A_CountryText" _
  filter:="Country eq 'IT' and Language eq 'EN'" _
  result:="countrytext" 


Result V[countrytext]:
IT  Italy   Italian
Example 3
Reading a maintenance order together with its operations
CreateStructure V[myorder] _
    MaintenanceOrder _
    MaintenanceOrderType _
    MaintenanceOrderDesc _
    MaintOrdBasicStartDate

CreateTable V[myoperations] _
    MaintenanceOrder _
    MaintenanceOrderOperation _
    Plant _
    WorkCenter _
    OperationDescription _
    MaintOrderOperationDuration _
    MaintOrdOperationDurationUnit

CallVB guinet.odata.read _
  service:="sap/opu/odata/sap/API_MAINTENANCEORDER/
         MaintenanceOrder('4001324')" _
  expand:="to_MaintenanceOrderOperation" _
  result:="myorder,myoperations" 


Result V[myorder]:
4001324 YBA1    Equipment Repair (Fixed Price)  04.04.2025
V[myoperations]:
4001324	0010	1710	RES-0500	Dismantle	1,0	STD
4001324	0020	1710	RES-0500	Repair		5,0	STD
4001324	0030	1710	RES-0500	Assemble	2,0	STD
                    
Authorizations and Security Model GuiXT OData does not use its own technical service user to access SAP S/4HANA. All requests run in the user context of the respective logged-on end user – the library forwards their logon credentials unchanged to the SAP gateway server. The SAP backend therefore performs exactly the same authorization checks as it would for any other HTTP client that logs on to the same OData service with the same credentials – such as a web browser or a tool like Postman. This includes in particular:
  • the start authorization for the OData service itself (authorization object S_SERVICE),
  • all AUTHORITY-CHECK and @AccessControl checks implemented in the service at the data level,
  • all field- and row-level restrictions (e.g. plant, document type, or controlling area authorizations).

GuiXT OData itself does not implement its own authorization logic and does not filter or modify requests in any way that goes beyond what the end user could also request via direct access to the same OData service. Technically, the library merely represents an alternative HTTP client; authorization control remains entirely with the SAP gateway and backend.

Verifiability: This property can be demonstrated specifically for each service by performing a test call via GuiXT OData with an active SAP authorization trace (transaction ST01 or evaluation via SU53 after a failed access attempt) and comparing it with an equivalent call via a browser or the SAP Gateway Client Tool (/IWFND/GW_CLIENT). Both access paths trigger the same authorization checks.
Component InputAssistant + GuiXT Controls