Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2069

Re: Adding a column dynamically to the alv : dump

$
0
0

Hi Abhishek,

 

 

you are adding field dynamically.so you need to create field catalog first.then call it in ALV.

 

field catalog format.

 

 

   fieldcatalog-fieldname   = 'GRP_ID'.

   fieldcatalog-seltext_m   = 'Group ID'.

   fieldcatalog-col_pos     0.

   append fieldcatalog to fieldcatalog.

   clear  fieldcatalog.

 

   fieldcatalog-fieldname   = 'TYPE_ID'.

   fieldcatalog-seltext_m   = 'Type ID'.

   fieldcatalog-col_pos     1.

   append fieldcatalog to fieldcatalog.

   clear  fieldcatalog.

 

   fieldcatalog-fieldname   = 'PGM_ID'.

   fieldcatalog-seltext_m   = 'Program ID'.

   fieldcatalog-col_pos     = 2.

   fieldcatalog-outputlen   = 18.

   fieldcatalog-emphasize   = 'X'.

   fieldcatalog-key         = 'X'.

   fieldcatalog-do_sum      = 'X'.

   fieldcatalog-no_zero     = 'X'.

   append fieldcatalog to fieldcatalog.

   clear  fieldcatalog.

 

   fieldcatalog-fieldname   = 'BEGDA'.

   fieldcatalog-seltext_m   = 'Start Date'.

   fieldcatalog-col_pos     = 3.

   append fieldcatalog to fieldcatalog.

   clear  fieldcatalog.

 

   fieldcatalog-fieldname   = 'ENDDA'.

   fieldcatalog-seltext_m   = 'End date'.

   fieldcatalog-col_pos     = 4.

   append fieldcatalog to fieldcatalog.

   clear  fieldcatalog.


gd_layout-no_input          = 'X'.

gd_layout-colwidth_optimize = 'X'.


call function 'REUSE_ALV_GRID_DISPLAY'

     exporting

       i_callback_program = gd_repid

       is_layout          = gd_layout

       it_fieldcat        = fieldcatalog[]

       i_save             = 'X'

     tables

       t_outtab           = lt_alv

     exceptions

       program_error      = 1

       others             = 2.

   if sy-subrc <> 0.

     message id sy-msgid type sy-msgty number sy-msgno

             with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

   endif.




Viewing all articles
Browse latest Browse all 2069

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>