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 gridlines

Former Member
0 Likes
1,054

Hi all,

I am using the alv grid (cl_gui_alv_grid). My problem is that i need to show horizontal gridlines (between rows) only when needed and not always. in the layout of the grid the only option i see will disable all grid lines. Please let me know if anyone has an idea in this regard.

regards

Manoj.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
956

You can dynamically change the layout of the report and set the grid lines whenever you want. If you are using ALV With classes look at one of the SET_LAYOUT methods. You will have to call this method and then call the REFRESH_TABLE_DISPLAY method.

Regards,

Ravi

Note : Please mark all the helpful answers

Hi all,

I am using the alv grid (cl_gui_alv_grid). My problem is that i need to show horizontal gridlines (between rows) only when needed and not always. in the layout of the grid the only option i see will disable all grid lines. Please let me know if anyone has an idea in this regard.

regards

Manoj.

8 REPLIES 8
Read only

Former Member
0 Likes
956

This message was moderated.

Read only

Former Member
0 Likes
957

You can dynamically change the layout of the report and set the grid lines whenever you want. If you are using ALV With classes look at one of the SET_LAYOUT methods. You will have to call this method and then call the REFRESH_TABLE_DISPLAY method.

Regards,

Ravi

Note : Please mark all the helpful answers

Read only

0 Likes
956

Hi Ravi,

Could you explain a little further. the only public mehod i see is SET_LAYOUT_OF_DOUBLEGRID in the class CL_GUI_ALV_GRID. Is this the method you are talking about?

Thanks

Manoj.

Read only

0 Likes
956

yeah there is a method called SET_FRONTEND_LAYOUT. but it takes in only a structure for the layout..i need something to control horizontal lines at the row level.

Read only

0 Likes
956

You are on track.

What you need to do is to call the GET_FRONTEND_LAYOUT first to get the current layout and do the modifications to that to set / unset the grid lines ( there will be a field for that in the structure LVC_S_LAYO). Once the new value is set call the SET_FRONTEND_LAYOUT method.

Regards,

Ravi

Note : Please mark all the helpful answers

Read only

0 Likes
956

hi Ravi,

Thanks for the reply. I understood what you are saying but this would adjust the layout of the entire grid. I do not have the option of putting in a horizontal line for one row and disabling it for the next. the 'NO_HGRIDLN' is the grid is a bool.

Any ideas

Regards

Manoj.

Read only

0 Likes
956

I am afraid that kind of facility is not available with ALV grid.

If the objective is highlight specific rows, you can do that by displaying them in a different color from the rest of the rows.

Regards,

Ravi

Read only

0 Likes
956

yeah i was afraid of the same. thanks anyway, i have awarded points:-).

I am actually highlighting rows with diff colors already...but wanted this additional feature to show rows in pairs without line in between.

thanks anyways.