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: 

ALV Grid - Columns Displays?

Former Member
0 Kudos

Any way to display an ALV grid in different sections?

Meaning, The top half of the report lines up columns differently then the bottom half of the report.

For instance, The first two columns are always the same for all fields, but becuse the rest of the fields are not related to one another in any way the report breaks and displays te columns differently at a certain point in the output of the display?

Thank -You

1 ACCEPTED SOLUTION

Former Member
0 Kudos

In the field catalog give the <b>emphasize</b>.

For first 2 columns:

ls_fcat-emphasize = 'C310'.

For all other columns:

ls_fcat-emphasize = 'C400'.

These make the ALV columns in different colors.

In case if u want to color a particular row or particular cell, do the below things:

Assign a variable celltab TYPE lvc_t_styl, in the internal table which u dispaly the data.

In the layout give, wa_layout-stylefname = 'CELLTAB'.

Modify the final internal table like this sample code:

DATA : lt_celltab TYPE lvc_t_styl,

ls_celltab TYPE lvc_s_styl.

READ TABLE i_final_data INTO wa_final_data INDEX 1.

ls_celltab-fieldname = 'LNG_TYPES'.

ls_celltab-style = '00000060'.

INSERT ls_celltab INTO TABLE lt_celltab.

CLEAR ls_celltab.

ls_celltab-fieldname = 'LNG_QUANTITY'.

ls_celltab-style = '00003060'.

INSERT ls_celltab INTO TABLE lt_celltab.

CLEAR ls_celltab.

ls_celltab-fieldname = 'NG_TYPES'.

ls_celltab-style = '00000666'.

INSERT ls_celltab INTO TABLE lt_celltab.

CLEAR ls_celltab.

ls_celltab-fieldname = 'NG_QUANTITY'.

ls_celltab-style = '00000066'.

INSERT ls_celltab INTO TABLE lt_celltab.

CLEAR ls_celltab.

wa_final_data-celltab[] = lt_celltab[].

MODIFY i_final_data FROM wa_final_data INDEX 1.

CLEAR: ls_celltab, lt_celltab, wa_final_data.

Here ls_celltab-style = '00003060' will make that particular cell in different color.

Regards,

Prakash.

Message was edited by: Prakash Ramu

4 REPLIES 4

Former Member
0 Kudos

In the field catalog give the <b>emphasize</b>.

For first 2 columns:

ls_fcat-emphasize = 'C310'.

For all other columns:

ls_fcat-emphasize = 'C400'.

These make the ALV columns in different colors.

In case if u want to color a particular row or particular cell, do the below things:

Assign a variable celltab TYPE lvc_t_styl, in the internal table which u dispaly the data.

In the layout give, wa_layout-stylefname = 'CELLTAB'.

Modify the final internal table like this sample code:

DATA : lt_celltab TYPE lvc_t_styl,

ls_celltab TYPE lvc_s_styl.

READ TABLE i_final_data INTO wa_final_data INDEX 1.

ls_celltab-fieldname = 'LNG_TYPES'.

ls_celltab-style = '00000060'.

INSERT ls_celltab INTO TABLE lt_celltab.

CLEAR ls_celltab.

ls_celltab-fieldname = 'LNG_QUANTITY'.

ls_celltab-style = '00003060'.

INSERT ls_celltab INTO TABLE lt_celltab.

CLEAR ls_celltab.

ls_celltab-fieldname = 'NG_TYPES'.

ls_celltab-style = '00000666'.

INSERT ls_celltab INTO TABLE lt_celltab.

CLEAR ls_celltab.

ls_celltab-fieldname = 'NG_QUANTITY'.

ls_celltab-style = '00000066'.

INSERT ls_celltab INTO TABLE lt_celltab.

CLEAR ls_celltab.

wa_final_data-celltab[] = lt_celltab[].

MODIFY i_final_data FROM wa_final_data INDEX 1.

CLEAR: ls_celltab, lt_celltab, wa_final_data.

Here ls_celltab-style = '00003060' will make that particular cell in different color.

Regards,

Prakash.

Message was edited by: Prakash Ramu

0 Kudos

Highlighted rows using "emphasis" will work just fine....Thank-You.

Former Member
0 Kudos

hi,

Emphasize (highlight columns in color): As name suggests, this field parameter is used to highlight certain field with chosen colors.

Value set: SPACE, 'X' or 'Cxyz' (x:'1'-'9'; y,z: '0'=off ,'1'=on).

'X' = column is colored with the default column highlight color.

'Cxyz' = column is colored with a coded color:

- C: Color (coding must begin with C)

- X: color number

- Y: bold

- Z: inverse

Regards,

Sailaja.

Former Member
0 Kudos

I have an ALV report with 2 different internal tables displayed in 2 separate ALV grids. Is that what you're trying to do? If so, I can share how I got it to work.

-Beth