Application Development and Automation 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 OO Offline

Former Member
0 Kudos
408

Hello,

I have a problem with a report, an ALV OO is display in offline mode. there is no code to display the ALV in this mode.

I use the method cl_gui_alv_grid=>offline at the beginn of the report and they say that is offline. in this point there no declaration or object created yet.


Thanks for the help.


Jonathan Albert


This is the code.


DATAl_offline TYPE int4.

   CALL METHOD cl_gui_alv_grid=>offline

     RECEIVING

       e_offline = l_offline.

   IF l_offline IS NOT INITIAL.

     MESSAGE 'Offline' TYPE 'I'.

   ENDIF.

   IF l_o_ct_alv IS INITIAL .

     CREATE OBJECT l_o_ct_alv

       EXPORTING

         container_name              = l_cte_container

       EXCEPTIONS

         cntl_error                  = 1

         cntl_system_error           = 2

         create_error                = 3

         lifetime_error              = 4

         lifetime_dynpro_dynpro_link = 5

         OTHERS                      = 6.

     IF sy-subrc <> 0.

       RETURN.

     ENDIF.

     CREATE OBJECT l_o_alv_grid

       EXPORTING

         i_parent          = l_o_ct_alv

       EXCEPTIONS

         error_cntl_create = 1

         error_cntl_init   = 2

         error_cntl_link   = 3

         error_dp_create   = 4

         OTHERS            = 5.

     IF sy-subrc <> 0.

       RETURN.

     ENDIF.

   ENDIF.

   PERFORM fieldcat TABLES l_ti_fieldcat .

   FREE l_es_layout.


   l_es_layout-zebra = abap_true.

   l_es_layout-cwidth_opt = abap_true.

   l_es_layout-sel_mode = 'A'.

   CALL METHOD l_o_alv_grid->set_table_for_first_display

     EXPORTING

       is_layout                     = l_es_layout

     CHANGING

       it_outtab                     = l_ti_log

       it_fieldcatalog               = l_ti_fieldcat

     EXCEPTIONS

       invalid_parameter_combination = 1

       program_error                 = 2

       too_many_lines                = 3

       OTHERS                        = 4.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
186

The problem is solve, the error is because the variable SY-BATCH is marked in a Bapi that is before the display of the ALV. A clear of SY_BATCH is the solution. The method OFFLINE of the class CL_GUI_ALV_GRID, read incorrectly this variable.

1 REPLY 1

Former Member
0 Kudos
187

The problem is solve, the error is because the variable SY-BATCH is marked in a Bapi that is before the display of the ALV. A clear of SY_BATCH is the solution. The method OFFLINE of the class CL_GUI_ALV_GRID, read incorrectly this variable.