Hi,
I have a requirement to create an ALV report. for that I need to create a field catelog for an internal table. currently I am doing the following way and it works fine. but for each field of the report i will have to call this function module. Is there any easy way to create field catelog from internal table? Your help is appriciated.
perform fill_fieldcat using 'INVOI' " Field name
'T_LOAD' " Table name
'Vendor Invoice' " Sel text
'10' " Length
'' " Hotspot
'X'. " Key
:
:
:
FORM fill_fieldcat USING P_F_NAME
P_TAB_NAME
P_SEL_TEXT_L
P_OUT_LEN
P_HOTSPOT
P_TAB_KEY.
clear wa_fieldcat.
wa_fieldcat-fieldname = p_f_name.
wa_fieldcat-tabname = p_tab_name.
wa_fieldcat-seltext_l = p_sel_text_l.
wa_fieldcat-outputlen = p_out_len.
wa_fieldcat-hotspot = p_hotspot.
wa_fieldcat-key = p_tab_key.
append wa_fieldcat to ts_fieldcat.
ENDFORM. " fill_fieldcat
Thank you,
Surya