2010 Apr 01 11:08 AM
I am looking for alv report in which I will not create fieldcatalogue manually but pass the structure as it is and display the alv. Please provide me sample code.
Moderator message: Please do not use all upper case in the future.
Edited by: Thomas Zloch on Apr 1, 2010 12:31 PM - converted to lower case
2010 Apr 01 11:11 AM
Donot post in ALL CAPS. Please read the forum rules before posting
I am looking for alv report in which I will not create fieldcatalogue manually but pass the structure as it is and display the alv. Please provide me sample code.
Moderator message: Please do not use all upper case in the future.
Edited by: Thomas Zloch on Apr 1, 2010 12:31 PM - converted to lower case
2010 Apr 01 11:11 AM
Donot post in ALL CAPS. Please read the forum rules before posting
2010 Apr 01 11:12 AM
Use the function module "REUSE_ALV_FIELDCATALOG_MERGE" to create the field catalog of all the fields in a structure
eg :
data : xfieldcat type slis_t_fieldcat_alv.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy-repid
i_internal_tabname = <internal table structure>
i_bypassing_buffer = 'X'
i_buffer_active = ' '
changing
ct_fieldcat = xfieldcat
exceptions
inconsistent_interface = 1
program_error = 2
others = 3.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = xfieldcat[]
tables
t_outtab = <internal table>.
Regards
Vinod
Edited by: Vinod Kumar on Apr 1, 2010 3:45 PM
2010 Apr 01 11:13 AM
2010 Apr 01 11:18 AM
Hi
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'progname
i_internal_tabname = 'REPORT_TAB'
CHANGING
ct_fieldcat = bo_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
it_fieldcat = bo_fieldcat.
TABLES
t_outtab = alvgrid_tab.
best regard
Marco
2010 Apr 01 11:28 AM
come on guys we have 2010 by now, would you guys please try to evolve to modern techniques and make use of either:
CL_GUI_ALV_GRID or CL_SALV_TABLE?
I dont mind how you code your programs, that is YOUR point, but when people asking for advice since they are new to the subject, we shouldnt teach them old fashioned stuff.
Edited by: Florian Kemmer on Apr 1, 2010 12:28 PM
2010 Apr 01 11:19 AM
Hi,
Use the following function mudule
g_repid = sy-repid.
g_tabname_header = 'ZLS_PROD_ERR_LOG'.
REFRESH i_fieldcat.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = g_repid
i_structure_name = g_tabname_header
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.Now you can pass this i_fieldcat to FM 'REUSE_ALV_GRID_DISPLAY'.
Thanks & Regards
Rocky Agarwal
2010 Apr 01 11:36 AM
In addition to the all caps thing, please search for existing solutions first, there are many available. Use the classes as suggested by Florian rather than the function modules.
Thread locked
Thomas