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: 
Read only

ALV - Help splitting rows

Former Member
0 Likes
903

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

1 ACCEPTED SOLUTION
Read only

jayesh_gupta
Active Participant
0 Likes
756

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

5 REPLIES 5
Read only

jayesh_gupta
Active Participant
0 Likes
757

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

Read only

0 Likes
756

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

Read only

Former Member
0 Likes
756

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

Read only

former_member203501
Active Contributor
0 Likes
756

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

Read only

Former Member
0 Likes
756

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