Application Development 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: 

Report based SALV classes

Former Member
0 Kudos

Hi,

I have some questions about SALV report:

1. How I can to color key columns without to define

DB table with keys(like in demo examples),and

without that color rows make color line on key colomns if I just add color to key column.

2. I am using set_top_of_list method of cl_salv_table

to create header.

But I can't find how to create two types of header

like I did using REUSE_ALV_COMMENTARY_WRITE.

Thank you very much

Irena

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Irena,

Regarding coloring the columns, you need to include a color table as a part of the DATA table.

types: begin of data_table.

include type MAIN_DATA.

types: t_color type lvc_t_scol,

end of DATA_TABLE.

Once this is done, you need to color each of the cells of each of the row differently, if that is what you are looking for.

ls_color-fname = 'COLUMN1'.

ls_color-color-col = col_positive.

ls_color-color-int = 0.

ls_color-color-inv = 0.

append ls_color to t_color.

data_table-t_color = lt_color.

That means there will be multiple rows in the t_color table for each row in the DATA table.

Hope this will fix the issue for you.

As you are dealing with SALV classes, we will not have a FIELD CATALOG at all.

Regards,

Ravi

Note : Please mark the helpful answers.

4 REPLIES 4

Former Member
0 Kudos

Hi irena,

1. if the fields are not key fields in the database table,

then we have to make use

of the field-catalogue,

2. in field-catalogue,

there is one field

KEY

make that 'X'.

regards,

amit m.

Former Member
0 Kudos

Irena,

Regarding coloring the columns, you need to include a color table as a part of the DATA table.

types: begin of data_table.

include type MAIN_DATA.

types: t_color type lvc_t_scol,

end of DATA_TABLE.

Once this is done, you need to color each of the cells of each of the row differently, if that is what you are looking for.

ls_color-fname = 'COLUMN1'.

ls_color-color-col = col_positive.

ls_color-color-int = 0.

ls_color-color-inv = 0.

append ls_color to t_color.

data_table-t_color = lt_color.

That means there will be multiple rows in the t_color table for each row in the DATA table.

Hope this will fix the issue for you.

As you are dealing with SALV classes, we will not have a FIELD CATALOG at all.

Regards,

Ravi

Note : Please mark the helpful answers.

former_member188685
Active Contributor
0 Kudos

Hi,

try setting this KEY = 'X' for the field which you want to show the key color in your fieldcatalog.

<b>fieldcatalog-key = 'X'.</b>

Regards

Vijay

Former Member
0 Kudos

Thank you very much, your answer,Ravi, solves my problem.

Just I hoped that I'l use some property of key fields.

What about question 2?