(RPG) Call stack of RPG / LongRange
Posted: Thu Oct 18, 2012 1:34 am
Hello everybody,
I have a question concerning the call stack of LongRange and RPG. I hope I will be succesful in explaining our problem because it seems to be a little bit complex (at least to me).
Please let me first explain what we are actually doing:
In LongRange studio we define a main menu with a menu item "Geschaeftszahlen und Umsatz". Target Type is FormView, target object is a RPG program called JH_STRBU.
This RPG program JH_STRBU serves as a menu program and by using push buttons (and onclick requests) it calls other RPG programs.
One example for such a call is this:
When (RequestACTION = 'AGRUMS');
GZ_RQ_ACTION = 'GESAMT ';
GZ_RQ_PGM = 'JH_AGRUMS';
CallP JH_AGRUMS(GZ_RQ_ACTION:GZ_RQ_PGM:SavedSTATE:SystemINFO);
In the now called RPG program JH_AGRUMS we defined a back button to return to the menu RPG JH_STRBU.
For preventing going back to JH_STRBU while still handling other requests in JH_AGRUMS we inserted the following statement into Subroutine "DisplayFormView":
If (RequestACTION <> 'BACK_TO_JH_STRBU');
RequestPROGRAM = 'JH_AGRUMS';
Else;
RequestPROGRAM = 'JH_STRBU';
EndIf;
And now here is the problem:
when I leave JH_AGRUMS using the Back-Button I return to JH_STRBU. Then I use the LongRange-Menu-Button in the top left of the first row of the screen to go back to main menu. Now I can activate other menu items without any problems.
But when I use this MENU-Button in JH_AGRUMS and then return to main menu I cannot activate any other menu item after that. No matter which item I choose: JH_AGRUMS is always activated and shown on screen (but in the first row on the screen the symbolic name of the selected menu item is shown).
There must be some part in our programming in which we corrupt the normal invocation stack / invocation routine of LongRange. Or is it simply impossible to create own (RPG) menu programs to control the application flow.
Is there a way to disable the Menu-Button on the screen in any way?
If any screen shots or code snippets would be helpful for better understanding please let me know.
With many thanks for your support,
Joerg
I have a question concerning the call stack of LongRange and RPG. I hope I will be succesful in explaining our problem because it seems to be a little bit complex (at least to me).
Please let me first explain what we are actually doing:
In LongRange studio we define a main menu with a menu item "Geschaeftszahlen und Umsatz". Target Type is FormView, target object is a RPG program called JH_STRBU.
This RPG program JH_STRBU serves as a menu program and by using push buttons (and onclick requests) it calls other RPG programs.
One example for such a call is this:
When (RequestACTION = 'AGRUMS');
GZ_RQ_ACTION = 'GESAMT ';
GZ_RQ_PGM = 'JH_AGRUMS';
CallP JH_AGRUMS(GZ_RQ_ACTION:GZ_RQ_PGM:SavedSTATE:SystemINFO);
In the now called RPG program JH_AGRUMS we defined a back button to return to the menu RPG JH_STRBU.
For preventing going back to JH_STRBU while still handling other requests in JH_AGRUMS we inserted the following statement into Subroutine "DisplayFormView":
If (RequestACTION <> 'BACK_TO_JH_STRBU');
RequestPROGRAM = 'JH_AGRUMS';
Else;
RequestPROGRAM = 'JH_STRBU';
EndIf;
And now here is the problem:
when I leave JH_AGRUMS using the Back-Button I return to JH_STRBU. Then I use the LongRange-Menu-Button in the top left of the first row of the screen to go back to main menu. Now I can activate other menu items without any problems.
But when I use this MENU-Button in JH_AGRUMS and then return to main menu I cannot activate any other menu item after that. No matter which item I choose: JH_AGRUMS is always activated and shown on screen (but in the first row on the screen the symbolic name of the selected menu item is shown).
There must be some part in our programming in which we corrupt the normal invocation stack / invocation routine of LongRange. Or is it simply impossible to create own (RPG) menu programs to control the application flow.
Is there a way to disable the Menu-Button on the screen in any way?
If any screen shots or code snippets would be helpful for better understanding please let me know.
With many thanks for your support,
Joerg