Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV In Background.

Former Member
0 Kudos

Hello Everybody,

ALV report when run in foreground is working fine.But when scheduled in background sm36 it is going to the shortdump,showing an error msg "control framework gui status not set".

Can anyone help me with this problem.

If the GUI controls in ALV are to b disabled in background and enabled in foreground what condition has to b used??

How can the GUI status be set according to the mode in which the program is being executed??

How to know as to when a program is being scheduled in background or foreground?

Thanking you in anticipation.

Regards,

Sirisha .

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Hi, implement this coding in the PBO of your screen and it should work fine.


* ALV Grid
DATA: R_GRID TYPE REF TO CL_GUI_ALV_GRID.
DATA: R_CONTROL TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
DATA: G_DOCK TYPE REF TO CL_GUI_DOCKING_CONTAINER.

* Check whether the program is run in batch or foreground
    IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.
* Run in foreground
      CREATE OBJECT R_CONTROL
             EXPORTING CONTAINER_NAME = 'CONTAINER_1'.
      CREATE OBJECT R_GRID 
             EXPORTING I_PARENT = R_CONTROL.
    ELSE.
* Run in background
      CREATE OBJECT R_GRID 
             EXPORTING I_PARENT = G_DOCK.
    ENDIF.

Regards,

Rich Heilman

5 REPLIES 5

venkata_ramisetti
Active Contributor
0 Kudos

Hi

can you provide us the required short dump(Not everything)?

Thanks,

Ramakrishna

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Hi, implement this coding in the PBO of your screen and it should work fine.


* ALV Grid
DATA: R_GRID TYPE REF TO CL_GUI_ALV_GRID.
DATA: R_CONTROL TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
DATA: G_DOCK TYPE REF TO CL_GUI_DOCKING_CONTAINER.

* Check whether the program is run in batch or foreground
    IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.
* Run in foreground
      CREATE OBJECT R_CONTROL
             EXPORTING CONTAINER_NAME = 'CONTAINER_1'.
      CREATE OBJECT R_GRID 
             EXPORTING I_PARENT = R_CONTROL.
    ELSE.
* Run in background
      CREATE OBJECT R_GRID 
             EXPORTING I_PARENT = G_DOCK.
    ENDIF.

Regards,

Rich Heilman

0 Kudos

Thanks Rich. I have the same problem. I solved the problem with your code and i am using events double click in foreground. we have to remove this events when we are executing in background since these events are not supported by class CL_GUI_DOCKING_CONTAINER.

thanks and regards,

vamshi tallada

Former Member
0 Kudos

Hi,

You can use SY-BATCH to check if the program is running in foreground or in background..SY-BATCH = 'X' means it is background..

Thanks,

Naren

Former Member
0 Kudos

Thanks Rich.I really appreciate it.