Skip to Content
avatar image
Former Member

BSP and session management

Hi everyone, I am doing development with BSPs in CRM People-Centric UI. Here's something that is puzzling me... when a BSP calls another using the BSP extension "BSP" "CALL" from within a view, under what circumstances is another terminal session launched?

In my case, I am calling a screen of type "Preview" which means in real terms that a URL is constructed with the name of a new BSP and its controller. The URL is then launched by view code that looks like this:

<script language="JavaScript" type="text/javascript">

window.open("<%= gv_url %>", "Preview");

//window.open();

</script>

After this, the new browser window opens with the url displayed at the top. The controller class executes (do_request method).

OK so far. Here's my question... this new window sometimes executes in the original terminal session, and sometimes not! This affects debugging and more importantly program execution, since the code in the second window gets its data by an IMPORT FROM SHARED MEMORY command. If the new code is in a separate terminal session, the logic fails. This is SAP code, not my code!

When does this happen? Yesterday, I could get the same terminal session (and program success) by starting the BSP from within an open CRM SAPGUI session. The different terminal session (program failure) happens if you start the application from the internet browser directly. Today, even starting from SAPGUI is triggering a separate terminal session. Can anyone help me to track down where the same session/different session decision happens?

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Oct 18, 2003 at 10:14 AM

    Hallo Paul,

    You write a lot of detail, but not all of it hangs together so that one can easily answer the question (or be sure that the answer is correct). So let my write little bits of answers, and we take it from there.

    First aspect: When you are already in the server, and just using <bsp:call> to call another controller, then session management plays no role. You are already in one session, and you are just effectively asking another controller (which is just an ABAP class!) to place its output into the response. No session management aspects here.

    Next aspect is that we have "window.open(url)". Usually each BSP application runs in its own session (roll-area). You did not give any information about what is this URL, but your write "name of new BSP", so we assume for the moment different BSP application, new session.

    There are techniques to force this new controller into the same session, but we do not officially support this, and I assume for the moment it is not what you are doing.

    Although not completely relevant, you might also consider to read:

    BSP In-Depth: Confusion between Stateless, Stateful and Authentication

    /people/mark.finnern/blog/2003/09/24/bsp-in-depth-confusion-between-stateless-stateful-and-authentication

    Why do you think that you are in another session? Use transaction SM04 to see how many HTTP sessions you have open. (You can filter for your user.) Specifically check before pressing the preview button in browser, and check again afterwards.

    Next aspect is: "gets its data by an IMPORT FROM SHARED MEMORY". This is my opinion should make no difference to whether you are running in the same session or a new session. Shared memory means exactly "shared" over sessions. And this is why I am thinking that there is another type of problem, and it is not session related.

    Maybe a stupid question: are you 100% sure that the preview request lands on the same application server? (Especially with load-balancers, etc.) I know of cases where people were trying to debug on one appserver, and the requests were running against another appserver. To see what the browser is doing, consider to read:

    BSP Trouble Shooting: HTTP Browser Traces

    /people/brian.mckellar/blog/2003/10/12/bsp-trouble-shooting-http-browser-traces

    You write "This is SAP code, not my code!". My usual advice: send it back! If you think there is a problem, then of course you are free to open a OSS/CSN trouble ticket.

    regards, brian

    PS: I tip different application server. However, there is one other common reason for this type of problem, namely that the browser session is running into a different client that the SAPGUI session for debugging is using! I would recommend to check and verify these aspects first.

    Add comment
    10|10000 characters needed characters exceeded

    • Hallo Paul,

      I am still on hold here 😊

      But to get back to your question on client dependance of the IMPORT FROM SHARED MEMORY, I decided to ask the real experts. I called (using my second phone:) the ABAP Language group, and received the answer below (all names changed to protect the innocent).

      bye, brian

      -

      -


      The table INDX is client dependent, but you can define your own table (similar to INDX) without a client field:

      MANDT optional (client)

      RELID mandatory

      mandatory

      SRTF2 mandatory

      user data optional (any number of user data fields)

      CLUSTR mandatory

      CLUSTD mandatory

      Regards, Thomas