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: 
Read only

ALV Grid Views

Former Member
0 Likes
436

Hi all good ABAP friends

When calling the method set_table_for_first_display, the resulting report is displayed in Grid view. The View button can then be used to change the view to List or Excel. It seems that Grid is the default view. Is there a way of seting the default view to List? In other words the report should be displayed in List view by the set_table_for_first_display method.

Any ideas?

Hi all good ABAP friends

When calling the method set_table_for_first_display, the resulting report is displayed in Grid view. The View button can then be used to change the view to List or Excel. It seems that Grid is the default view. Is there a way of seting the default view to List? In other words the report should be displayed in List view by the set_table_for_first_display method.

Any ideas?

1 REPLY 1
Read only

Former Member
0 Likes
381

After set_table_for_first_display you can call list by that way.

    TYPE-POOLS: SLIS.
    DATA: GT_FIELDCAT_ALV TYPE SLIS_T_FIELDCAT_ALV,
          G_LAYOUT TYPE SLIS_LAYOUT_ALV.

    CALL FUNCTION 'LVC_TRANSFER_TO_SLIS'
         EXPORTING
              IT_FIELDCAT_LVC = FCAT
         IMPORTING
              ET_FIELDCAT_ALV = GT_FIELDCAT_ALV.

    G_LAYOUT-ALLOW_SWITCH_TO_LIST = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
              IS_LAYOUT   = G_LAYOUT
              IT_FIELDCAT = GT_FIELDCAT_ALV
         TABLES
              T_OUTTAB    = OUTTAB[].

Code worked in system 6.0 (in 4.6 another structure of type-pool SLIS).

For full information you can read this blog: [Want to switch to ALV List from ALV Grid at runtime ?|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/3696] [original link is broken] [original link is broken] [original link is broken];