‎2010 Mar 24 11:43 AM
Hi All,
I have an ALV report but with many columns but for printing this repost I need to split some information (columns) in two rows maintaining the test of the column.
Is it possible? By pressing the icon "Modify Layout" I can't find this option. Maybe I can modify the source Abap code when I set the field attribute (fieldcatalog_build).
For example:
LOOP AT gw_fkat ASSIGNING <fkat>.
CASE <fkat>-fieldname.
WHEN 'CBOX'.
<fkat>-tech = 'X'. "hidden field
Any suggestion will be well appreciate.
Thanks in advance for your kind support.
Luigi
‎2010 Mar 24 12:21 PM
Hi,
You may use hierarchial ALV to display the fields of a table in two rows. Make an internal table having key fields of your main internal table and the fields which you want to display in the second row. Fill this table using the main internal table..
Use FM REUSE_ALV_HIERSEQ_LIST_DISPLAY. Pass main table as header table and new table as item table.
Regards,
Jayesh
Edited by: Jayesh Gupta on Mar 24, 2010 1:22 PM
‎2010 Mar 24 12:21 PM
Hi,
You may use hierarchial ALV to display the fields of a table in two rows. Make an internal table having key fields of your main internal table and the fields which you want to display in the second row. Fill this table using the main internal table..
Use FM REUSE_ALV_HIERSEQ_LIST_DISPLAY. Pass main table as header table and new table as item table.
Regards,
Jayesh
Edited by: Jayesh Gupta on Mar 24, 2010 1:22 PM
‎2010 Mar 24 12:28 PM
This link would be helpful to create this kind of hierarchial ALV.
[http://www.sapalv.net/2009/08/example-of-hierarchical-sequential-list/]
Remember, in your case, both header table and item table comes from the same table. So, fieldcatalog will have to be created manually and not by using REUSE_ALV_FIELDCATALOG_MERGE.
Jayesh
Edited by: Jayesh Gupta on Mar 24, 2010 1:38 PM
‎2010 Mar 24 3:54 PM
Thanks for your suggestion but I'm trying to re-use the structure filled by this FM:
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = gc_alv_structure
CHANGING
ct_fieldcat = gw_fkat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
If I try:
WHEN 'FILL1'.
<fkat>-tech = ' '.
<fkat>-row_pos = 1.
<fkat>-col_pos = 1.
WHEN 'FILL2'.
<fkat>-tech = ' '.
<fkat>-row_pos = 1.
<fkat>-col_pos = 2.
and I call
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_callback_program = gv_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = gc_status
is_layout_lvc = gw_layo
it_fieldcat_lvc = gw_fkat
i_grid_settings = lw_grid_settings
i_save = 'A'
is_variant = variant
it_events = gt_events
TABLES
t_outtab = gt_report
EXCEPTIONS
program_error = 1
OTHERS = 2.
I don't see the two filed on the top of the field description on second line. Why is it wrong?
Any help will be well appreciated.
Thank for your help.
Luigi
‎2010 Mar 24 4:08 PM
Hi ,
I hope we can split the single row into two with a definded length by using this function module RKD_WORD_WRAP . Please search with this function module u will get many codes how to use it.
Regards,
Venkat appikonda
‎2010 Mar 24 5:14 PM
Thanks for your reply but what I need is not exacly the necessity to split text line but to change my ALV layout from
col1 col2 col3 col4 col5 col6 col7
data1 data2 data3 data4 data5 data6 data7
data1 data2 data3 data4 data5 data6 data7
data1 data2 data3 data4 data5 data6 data7
to
col1 col2 col3 col4 col5
col6 col7
data1 data2 data3 data4 data5
data6 data7
data1 data2 data3 data4 data5
data6 data7
data1 data2 data3 data4 data5
data6 data7
I hope to have your support. I'm trying with my tests.
Many thanks in advance for your kind support.
Luigi