Skip to Content
0

How to pass initialization parameters from an SAPUI5 application to an OData service

Mar 07, 2017 at 06:41 PM

74

avatar image

Hello experts,

I have made an SAPUI5 application that uses an ABAP OData service in order to performs some action over a set of tasks. This set is determined by the user that is currently logged in, i.e. the sy-uname.

Now I want that that application will be initialized with an arbitrary user, known to the SAPUI5 application when it starts.

I want to launch the UI5 app with a parameter PersonnelNumber=xxxxxxx and I want that parameter to be passed with every request made to the OData service in order to make the OData service work with the chosen PersonnelNumber.

I've seen that I could use serviceUrlParams like this:

var oModel =new sap.ui.model.odata.v2.ODataModel({ 
    serviceUrl:"http://services.odata.org/Northwind/Northwind.svc",    
    serviceUrlParams:{
        PersonnelNumber:"27161617"}}); 

https://sapui5.hana.ondemand.com/#docs/guide/6c47b2b39db9404582994070ec3d57a2.html

But I don't know how to get that number in the ABAP OData service.

Can someone kindly help me?

Thank you.

Pietro

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Sergio Guerrero Mar 07, 2017 at 06:51 PM
0

your odata service may be able to receive parameters via filtering on the query string such as:

../service?$filter=COLUMN eq 'value'

please check out the odata filtering syntax for other operations

let us know if this helps you

Share
10 |10000 characters needed characters left characters exceeded
Jun Wu Mar 07, 2017 at 07:36 PM
0

check if this one helps

IO_TECH_REQUEST_CONTEXT->GET_SEARCH_STRING

Share
10 |10000 characters needed characters left characters exceeded