-1

I am trying to find out how could I get information about external session id? I see it on a very top of the abap stack: enter image description here

However, did not find any way to access this variable in the Data Provider Class. Do you have any tipp?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Denis
  • 31
  • 2
  • 8

2 Answers2

0

The session_id is actually a static attribute specified in the IF_HTTP_SERVER interface. Because of the way in which ABAP sessions work, it is not possible to have two HTTP requests processed simultaneously in the same ABAP session, so I guess it makes sense to have the session_id as static.

Anyway, you can do something like this in your DPC_EXT class to obtain the session:

DATA(lv_session) = cl_http_server=>if_http_server~session_id.

Result of above code

Serban Petrescu
  • 5,127
  • 2
  • 17
  • 34
0

I had the same question and came to the same solution as Serban provided. However, I hoped that sending multiple requests from the same browser window would have the same session id -- what is my understanding of session ids BTW. Which does not seem to be the case: subsequent odata calls from the same browser window to the same service (actually the exactly same service calls) showed always different sessionids in the debugger. So I think the sessionid on abap side is not really useful.

tomtom
  • 3
  • 1
  • 4