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: 

OO ALV in Background - Control Framework Fatal Error GUI not reached

Former Member
0 Kudos

Hi

I'm using OO in background via the OFFLINE method but the program still won't run in the background

any idea what's wrong as this IMO should work according to the "sparse" documentation available.

Here's the relevant bit of code




MODULE status_0100 OUTPUT.
data: off type int4.
if sy-batch = 'X'.
 CALL METHOD cl_gui_alv_grid=>offline
RECEIVING
e_offline = off.
endif.



  IF grid_container1 IS INITIAL.
    CREATE OBJECT grid_container1
            EXPORTING
               container_name = 'CCONTAINER1'.
    CREATE OBJECT  grid1
       EXPORTING
          i_parent = grid_container1.
    struct_grid_lset-edit = 'X'.    "To enable editing in ALV

    CALL METHOD grid1->set_table_for_first_display
      EXPORTING is_layout =  struct_grid_lset
      CHANGING
                 it_outtab       = <dyn_table>
                 it_fieldcatalog = it_fldcat.


  ENDIF.
  SET PF-STATUS '001'.
  SET TITLEBAR '000'.

ENDMODULE.


Cheers

jimbo

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos

Hello James

I have not yet used ALV list in background but I found the solution in thread:

[background processing in ALV Oops|;

According to the answer in this thread you have to change your coding like this:


" Create container only in dialog, not in background
IF ( off IS INITIAL ).
    CREATE OBJECT grid_container1
            EXPORTING
               container_name = 'CCONTAINER1'.
    CREATE OBJECT  grid1
       EXPORTING
          i_parent = grid_container1.
ENDIF.

  CREATE OBJECT  grid1
     EXPORTING
        i_parent = grid_container1.  " container initial in background!
...

Regards,

Uwe

3 REPLIES 3

uwe_schieferstein
Active Contributor
0 Kudos

Hello James

I have not yet used ALV list in background but I found the solution in thread:

[background processing in ALV Oops|;

According to the answer in this thread you have to change your coding like this:


" Create container only in dialog, not in background
IF ( off IS INITIAL ).
    CREATE OBJECT grid_container1
            EXPORTING
               container_name = 'CCONTAINER1'.
    CREATE OBJECT  grid1
       EXPORTING
          i_parent = grid_container1.
ENDIF.

  CREATE OBJECT  grid1
     EXPORTING
        i_parent = grid_container1.  " container initial in background!
...

Regards,

Uwe

0 Kudos

Hi uwe

thanks -- that solved it.

Points awarded.

I don't often run this stuff in background but just sometimes we need it for a long running job

Cheers

jimbo

0 Kudos

Hello James

Thank you for the confirmation. So I know that it works even if I have never used it (yet).

Kind Regards,

Uwe