Skip to Content
0
Former Member
Nov 28, 2008 at 09:20 AM

data global

22 Views

Hi abappers,

Any way for define data global into conditional before star-of-selection.

I try explain the problem...

If I want execute the program in background the data:

TYPE-POOLS:   slis.
DATA: gt_fieldcat   TYPE slis_t_fieldcat_alv,
      gs_fieldcat LIKE LINE OF gt_fieldcat,
      gss_layout     TYPE slis_layout_alv,
      ls_print    TYPE slis_print_alv,
      gt_listheader TYPE slis_t_listheader.

...

...

But if I wnat execute the program without background the data:

DATA:
  go_grid             TYPE REF TO cl_gui_alv_grid,
  fieldcat  TYPE lvc_t_fcat,             
 gs_layout   TYPE lvc_s_layo,
              
                   
*gt_sort TYPE lvc_t_sort, " Sorting Table
*  Internal table for storing info. for ALV grid
i_sort TYPE STANDARD TABLE OF lvc_s_sort INITIAL SIZE 0.

...

...

I don´t know if with

IF SY-BACH IS INITIAL.

TYPE-POOLS:   slis.
DATA: gt_fieldcat   TYPE slis_t_fieldcat_alv,
      gs_fieldcat LIKE LINE OF gt_fieldcat,
      gss_layout     TYPE slis_layout_alv,
      ls_print    TYPE slis_print_alv,
      gt_listheader TYPE slis_t_listheader.

ELSE.

DATA:
  go_grid             TYPE REF TO cl_gui_alv_grid,
  fieldcat  TYPE lvc_t_fcat,             
 gs_layout   TYPE lvc_s_layo,
              
                   
*gt_sort TYPE lvc_t_sort, " Sorting Table
*  Internal table for storing info. for ALV grid
i_sort TYPE STANDARD TABLE OF lvc_s_sort INITIAL SIZE 0.

ENDIF.

Can you help me, please.

Cordial greetings.