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: 

ALV: Converting fieldcatalog to create internal table

Thomas1
Associate
Associate
0 Kudos
1,617

Hi all,

when displaying internal tables using ALV I have to provide a fieldcatalog of type SLIS_FIELDCAT_ALV

while I can create a dynamic internal table using a call to method CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE where I have to provide the fieldcatalog with type LVC_S_FCAT.

Does any one know of a method or function module which allows to convert a structure SLIS_FIELDCAT_ALV into LVC_S_FCAT? A simple move-corresponding does not work as the corresponding fields have different names.

Thanks & regards,

Thomas

1 ACCEPTED SOLUTION

Former Member
0 Kudos
524

Hi,

If you are displaying a list using cl_gui_alv_grid class, the field catalogue needs to be of type lvc_t_fcat anyways.

so I would suggest you create the create the field catalog as lvc_t_fcat at first place instead of creating it as SLIS_FIELDCAT_ALV.

5 REPLIES 5

Former Member
0 Kudos
525

Hi,

If you are displaying a list using cl_gui_alv_grid class, the field catalogue needs to be of type lvc_t_fcat anyways.

so I would suggest you create the create the field catalog as lvc_t_fcat at first place instead of creating it as SLIS_FIELDCAT_ALV.

venkat_o
Active Contributor
0 Kudos
524

hi,

Here is the example . Clearly explained. Have a look.

[OOPs ALV simple program|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/abap-7StepstocreateOOPSALV%2528forbeginners%2529&]

Regards,

Venkat.O

Former Member
0 Kudos
524

Hi,

Try using FM REUSE_ALV_GRID_DISPLAY_LVC to display ALV data instead of using FM REUSE_ALV_GRID_DISPLAY.

'REUSE_ALV_GRID_DISPLAY' is for the SLIS type pool.

'REUSE_ALV_GRID_DISPLAY_LVC' is for the LVC type pool which of course has a better functionality.

Hope this helps.

Thanks,

Balaji

Thomas1
Associate
Associate
0 Kudos
524

Dear all,

thank you very much for your helpful input. Combining these I was able to solve this issue.

Kind regards,

Thomas

RaymondGiuseppi
Active Contributor
0 Kudos
524

(Sorry, a little late)

To convert between the two format ALV and LVC use :

LVC_TRANSFER_FROM_SLIS

LVC_TRANSFER_TO_SLIS

Regards