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: 

Changing the Layout of ALV Grid

Former Member
0 Kudos

Hi,

I have a tree on the left corner (This is diaplayed using the Class cl_gui_simple_tree).

The right hand side displays the ALV Grid (cl_gui_alv_grid)based on the Selected node of the Tree.

The Problem is that I am not able to change the Layout of the Grid for different nodes selected.The lists vary

completely from one another.

I am using the Method SET_TABLE_FOR_FIRST_DISPLAY to display the list.

Regs,

Siva

Message was edited by: Siva Prakash

1 ACCEPTED SOLUTION

Vinod_Chandran
Active Contributor
0 Kudos

You have to use the field catalog option for this requirement. The field catalog is used to pass dynamic structure of the output. I think currently you are using the parameter 'I_STRUCTURE_NAME' and passing a table or structure to this. Instead you have to use the parameter 'IT_FIELDCATALOG'.

If you want help on how to fill this parameter, refer this link.

Message was edited by: Vinod C

2 REPLIES 2

Vinod_Chandran
Active Contributor
0 Kudos

You have to use the field catalog option for this requirement. The field catalog is used to pass dynamic structure of the output. I think currently you are using the parameter 'I_STRUCTURE_NAME' and passing a table or structure to this. Instead you have to use the parameter 'IT_FIELDCATALOG'.

If you want help on how to fill this parameter, refer this link.

Message was edited by: Vinod C

Former Member
0 Kudos

If you are talking about changing the layout for each node that you select on the left hand side, this is what you need to do.

Select the existing layout first, change the layout and then set the layout again.

declare a variable of type LVC_S_LAYO.

Get the layout using.

CALL METHOD grid1->get_frontend_layout

  • IMPORTING

  • ES_LAYOUT =

.

Do the data display.

Either SET_TABLE or REFRESH_TABLE

Change the layout settings in the variable.

Set the new Layout.

CALL METHOD grid1->set_frontend_layout

EXPORTING

is_layout =

.

This should help.

Please award points if is solves the issue.

Ravi