cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi,

I encounter a little problem. I set up an RF menu which consist partly of standard transactions like LM05 or LM50. On the other hand there are also custom functions. I created all HTML templates and published the services, so far it seemed ok. Screen look ok. But navigating through the functions or menu entries I had a weird phenomenon.

E.g. when I get an error message and leave it pressing "OK" in a standard transaction or if I press F3 in the entry screen of a standard transaction, then the system performs a complete logoff! I'd like to have that, when pressing F3 in the uppermost menu level, but nowhere else.

In my custom transactions it will work fine, as I do not use the standard error screen (If i would, I expect the same problems as with standard transactions); if I leave the entry screen using F3 it will return to the menu.

As I could see, the difference is:

  • the custom transactions end with "leave program" when I press F3
  • the standard transactions end (in form "BACK_TO_PROGRAM") with "leave to transaction MMENU", where MMENU = LM01.

Is there a possibility to make the error screen or the standard entry screen to perform a "leave program" instead of "leave to transactions" or do I do something wrong?

This is only when calling it as an ITS service in a web browser, in SAPGUI transactions work fine.

My service settings are:

on the logoff-tab I have entered a URL, consisting of the logoff-service combined with the service itself:

....logoff?erdirecturl = <my service>

In another system, where I use only custom transactions I use the very same service settings and it works fine. If you need more information, feel free to ask.

Thx in advance

Volker

0 Likes
View Entire Topic
volker_bock
Participant
0 Likes

Hello everybody,

now I will try to share the solution I found to my "requirements". I will not do it in too much detail, but I believe, it will still be understandable. Procedures may be adapted to find other / similar solutions.

  1. the "flaws", which I did not like were (as described above):
    1. pressing F3 on top level menu leads to the Logon Screen (Transaction LM00), which may be confusing for some users
      --> I'd prefer an immediate logout here
    2. pressing F8 anywhere in the menu leads to a logout confirmation screen ("Unsaved data will be lost ..."). This screen (SAPLSPO1 0100) is not a genuine RF screen and has no F-Key mapping also
      --> I'd also prefer an immediate logout here

As I use a mix of standard and custom transactions in my service, an important setting in the SICF-Service is to have ~SINGLETRANSACTION deactivated, which allows the correct return from standard RF transactions by "leave to transaction"; my own transactions do a "leave program". Necessary also is a custom JS-File processed by ~ITSMOBILEJSINCLUDE = <myfile> in SICF GUI Parameters.

What did I do:

I acvtivated Userexit MWMRF888. On the one hand I had then the chance to change the layout. More important: I put an output field G_PREV_MENU on the menu screens, which was populated with the value from parameter ID "PREV_MENU". The field was then hidden in the HTML template by changing the output width of this field to zero:               

`style="`width("15", "12.300em"); align("G_PREV_MENU", 1); style("G_PREV_MENU", 1)`" `
`style="`width("15", "0.000em"); align("G_PREV_MENU", 1); style("G_PREV_MENU", 1)`" `
if ( 'G_PREV_MENU'[1].highlighted == "X" )
    `class="MobileEditHighlightedDisabled `class("G_PREV_MENU", 1)`" `
else;
     `class="MobileEditDisabled `class("G_PREV_MENU", 1)`" `
end;

at another part of the HTML coding I replaced the original coding for handling the F8 button being pressed (--> immediate logout):

...

else
    `onclick="setOkCode('`'ZVZ_TIPPE_RLMOB-PMLGF'[1].okcode`');" `
    `onclick="setOkCode('/nex');" `
end;

...


Also, in PBO coding, if being in the top level menu, the F3 is hidden (to prevent it from being pressed):

IF g_prev_menu = 'MAIN00'.
   IF screen-name = 'ZVZ_TIPPE_RLMOB-PBACK'.
        screen-invisible = 1.
        screen-active    = 0.
        MODIFY SCREEN.
    ENDIF.
ENDIF.

Then I copied the file MOBILE.JS from the service ITSMOBILE to my own service and renamed it. in the function "function processKeyEvent(event)"  I inserted a part, which controls the F-Keys F3 and F8 depending on the value of G_PREV_MENU:

...

  else if ( (event.keyCode >= 112) && (event.keyCode <= 123) )
  {
    if ( event.shiftKey == true )
    {
      /* F13 to F24 */
      setFKey(event.keyCode - 111 + 12);
      eventdone = true;
    }
    else
    {
/*  ----------------------------- begin insert ------------------------------------------- */
      /* Logoff via F8, only in menu screens (g_prev_menu must be defined) */
      if ( (event.keyCode == 119) &&
           ( typeof(document.forms["mobileform"]["g_prev_menu[1]"]) != "undefined" )
         )
      {
      setOkCode("/nex");
      eventdone = true;
      }
      /* Logoff via F3, only in top level menu */
      else if ( ( typeof(document.forms["mobileform"]["g_prev_menu[1]"]) != "undefined" )  &&
                (event.keyCode == 114) &&
                ( (document.forms["mobileform"]["g_prev_menu[1]"].value == "MAIN00") )
              )
      {
      setOkCode("/nex");
      eventdone = true;
      }
      else
      {
      /* F1 to F12, in other cases */
      setFKey(event.keyCode - 111);
      eventdone = true;
      }
/*  ----------------------------- end insert ----------------------------------------- */
    }
  }
  else if (event.keyCode == 33)

...

I know, it looks a bit complicated, but once its done ... it works. I learnt much finding that solution :-).

Volker