Application Development 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 with grid->set_table_for_first_display

ronaldo_aparecido
Contributor
0 Kudos

Hi Experts.

I'm working with  grid->set_table_for_first_display to develop ALV in module pool .My question is:

I can´t use 'REUSE_ALV_FIELDCATALOG_MERGE' to create my fieldcat what function  can i use compatible with grid->set_table_for_first_display

to create my fieldcat ?

Thansk for help.

1 ACCEPTED SOLUTION

Clemenss
Active Contributor
0 Kudos

On the long run, you may be better using CL_SALV_TABLE=>CREATE as you just don't have to create the field catalog.

Regards,

Clemens

5 REPLIES 5

raymond_giuseppi
Active Contributor
0 Kudos

You could try LVC_FIELDCATALOG_MERGE.

Regards,

Raymond

Clemenss
Active Contributor
0 Kudos

On the long run, you may be better using CL_SALV_TABLE=>CREATE as you just don't have to create the field catalog.

Regards,

Clemens

0 Kudos

create field catalog as below

it_fcat   TYPE lvc_t_fcat, (Table Type ALV control: Field catalog)

wa_fcat   TYPE lvc_s_fcat (Structure ALV control: Field catalog)

assign the values to field catalog as below...

wa_fcat-row_pos = row.
wa_fcat-col_pos = col.
wa_fcat-fieldname = field.
wa_fcat-tabname   = tabnm.
wa_fcat-coltext = text.   you can add other properties also... like editable, drop down.. etc...

append wa_fcat to it_fcat.


then pass this field catalog to set_table_for_first_display as below..


CALL METHOD g_grid->set_table_for_first_display
     CHANGING
       it_fieldcatalog      = it_fcat
       it_outtab            = it_final.

0 Kudos

Thanks Kunal and how could i use a user_command in this case?do you have examples?

0 Kudos

Hi Ronaldo,

If you are using set_table_for_first_display method then you must have created container for it..

Once the screen is created there are two events created those are- PBO & PAI..

User Commands are handled in PAI event..

GOTO -> SE38 -> do F4 on BCALV* , you will get lots of examples.. SAP has covered all the topics related to ALV.. like tree, editable, etc.. etc..


Please check