简体   繁体   English

强制默认 ALV 布局

[英]Force a default ALV layout

I have an ALV grid where I need the default display to change between four different views based on the inputs and and the button selected.我有一个 ALV 网格,我需要根据输入和选择的按钮在四个不同的视图之间切换默认显示。 The difference between the inputs is a certain data type that is specific to my business.输入之间的差异是特定于我的业务的特定数据类型。 There are two different buttons, one which displays all columns, one which only displays some of the columns.有两种不同的按钮,一种显示所有列,一种仅显示部分列。

I know that default displays can be set on the ALV page itself.我知道可以在 ALV 页面本身上设置默认显示。 I have done this, but this will save the display for one of my data types, and then when the other data type is entered, the ALV grid still has the other layout.我已经这样做了,但这将保存我的一种数据类型的显示,然后当输入另一种数据类型时,ALV 网格仍然具有另一种布局。

Is there a way to hard code which default to use?有没有办法硬编码默认使用? I am preparing the columns of the ALV grid in a perform, I would like to just be able to select a default display within that perform, but I am not sure how to go about this or if it is even possible.我正在表演中准备 ALV 网格的列,我希望能够在该表演中选择一个默认显示,但我不确定如何去做,或者是否可能。

Thanks,谢谢,

Use the layout key information ( SALV_S_LAYOUT_KEY for CL_SALV_TABLE , obtained via the layout object - similar stuff exists for CL_GUI_ALV_GRID , search for DISVARIANT ) to specify different handles depending on the buttons selected.使用布局键信息( SALV_S_LAYOUT_KEYCL_SALV_TABLE ,通过布局对象获得 - CL_GUI_ALV_GRID存在类似的东西,搜索DISVARIANT )根据选择的按钮指定不同的句柄。 This will allow for the user to save different layout variants for either list type and specify different default layouts.这将允许用户为任一列表类型保存不同的布局变体并指定不同的默认布局。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM