Showing results for 
Search instead for 
Did you mean: 

Dynamic OData Model Creation & Maintaining Soft State .

Former Member
0 Kudos

Hi All,

I have two questions about SAP Gateway. It would be helpful if anyone add points to it.


1.     I have created an Gateway service in SEGW & an created an entity test of type SFLIGHT . but in my case the type of the entity is dynamic.. it changes depending on the selected document.. So, is there any way to create a gateway entity dynamically..(model).

2.     In the context of maintaining an OData Service as Stateful. I previously started a discussion Maintain stateful Odata service and I got some response form SAP Guru's that OData service is meant to be stateless.. & if requirement persists then i was told to maintain the state on client side. I went through the code in one of the HTTP Handler class /IWCOR/CL_REST_HTTP_HANDLER in this i found this part for making a session as stateful. So, i tried changing gv_stateful  to true & a session is created in SM04 . But when the next request is fired  it is not going under same session.

         IF gv_custom_session_mgmt <> abap_true.

                      " default HTTP handler is stateless

                      IF gv_stateful = abap_true.

                        server->set_session_stateful( stateful = if_http_server=>co_enabled ).


                        server->set_session_stateful( stateful = if_http_server=>co_disabled ).




            I came across Soft State support for OData Services.  & created an sample scenario to test it .. But I Could not get           it..  So, Can you please tell me about this topic ?.

Any Help would be appreciated.


Shiva Shankar Prakash.            

Accepted Solutions (0)

Answers (1)

Answers (1)

Active Contributor
0 Kudos

Hello Shiva,

1. IMO in GW Level , GW Model which we create is static.

We cannot make it happen to dynamically add or change properties or change the entity types of the entities of the GW Model based on the user selection.

We cannot access anything extra which is not a part of your GW Model or which is not defined in the Model.

May be in the GW Model you can initially add all the possible properties and entities that an end user may expect and then can give flexibility to select the properties, entities to be present as part of the GW response.

Since everything will be defined inside the GW Model you can make use of them in your CRUD operation accordingly and can act upon them.

If at all user wants an extra field in the service then we are bound to add that in the GW Model inside a particular entity and then generate objects for the new changes to get added.

2. Referring the below may help you ->