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

Creating fieldcatalog using internal table

Former Member
0 Likes
432

Hi,

The requirement is to create the fieldcatalog same as internal table, Can any one put some light on it,

I explore SDN and other sites also, used FMs LVC_FIELDCATALOG_MERGE' and 'REUSE_ALV_FIELDCATALOG_MERGE', but it is taking whole DB table to which this Internal table is ref.

Thanks for kind attension,

Anmol Bhat.

2 REPLIES 2
Read only

Former Member
0 Likes
389

Hi Anmol,

try this code


    DATA: o_alv TYPE REF TO cl_salv_table.
    DATA: lx_msg TYPE REF TO cx_salv_msg.
    TRY.
        cl_salv_table=>factory(
         IMPORTING
         r_salv_table = o_alv
         CHANGING
         t_table      =  <Internal Table>).   "Pass your internal table here automatically it will build field catalog
      CATCH cx_salv_msg INTO lx_msg.
    ENDTRY.
    o_alv->display( ).             "it will display the report in ALV format no need calling 'REUSE_ALV_DISPLAY_LIST'

Prabhudas

Read only

Former Member
0 Likes
389

Thanks,

Actually I want the Fieldcat, but ur logic help me to get the fiedcat too. Thanks a lot. Clossing the threat.