2023 May 03 9:57 AM
Hi all, I have an program that displays ALV grid which the user can edit its layout. My goal is to get the layout of the ALV grid which was saved in a variant.
its columns are like this:
Plant | Material | Material Description | Delivery Date | Quantity | Country | <---Default layout
Material | Material Description | Country | Delivery Date | Quantity <---Layout named ZLAY01 which is saved via variant.
To execute my program it has the following fields:
Plant
Material
Material Description
Delivery Date
Quantity
Country
and a field(named p_layout) for variant which reads the layout that will be displayed.
However, I was getting error with the FM in which it returns sy-subrc = 1 or no_infos. Can you please guide me where did I went wrong? thanks
form obtain_alv_layout_data.
x_layout-f2code = space.
x_layout-zebra = 'X'.
x_layout-get_selinfos = 'X'.
x_layout-colwidth_optimize = space.
x_layout-cell_merge = space.
x_layout-no_input = space.
x_layout-no_vline = space.
x_layout-no_colhead = space.
x_layout-lights_condense = space.
x_layout-totals_text = space.
x_layout-subtotals_text = space.
x_layout-totals_only = space.
x_layout-key_hotspot = space.
x_layout-detail_popup = space.
x_layout-group_change_edit = space.
x_layout-group_buttons = space.
x_layout-group_buttons = space.
endform.
CALL FUNCTION 'REUSE_ALV_LIST_LAYOUT_INFO_GET'
IMPORTING
ES_LAYOUT = x_layout
ET_FIELDCAT = t_fieldcat[]
EXCEPTIONS
NO_INFOS = 1
PROGRAM_ERROR = 2
OTHERS = 3
.
2023 May 03 10:21 AM
You are a little bit poor with informations and coding. What do you have implemented an ALV-Grid or an ALV-List?
Maybe you implemented an ALV-Grid with FM REUSE_ALV_GRID_DISPLAY, so I think, the FM of your choice is REUSE_ALV_GRID_LAYOUT_INFO_GET
2023 May 03 10:47 AM
You say "this FMs" and indicating twice "REUSE_ALV_LIST_LAYOUT_INFO_GET", so maybe is it a typo, and you mean "these FMs" and you did not indicate the name of the second FM?
2023 May 03 11:27 AM
Look at a sample program such as BCALV_TEST_FULLSCREEN
Or provide more information, from where do you call the FM, etc.
2023 May 04 1:48 PM
And how do you call the FM?
I created a programm using FM 'REUSE_ALV_GRID_DISPLAY'.
I implemented a PF-STATUS of my own with an additional button. The user-command of the button is 'TEST'. If the user press the button, the FM 'REUSE_ALV_GRID_LAYOUT_INFO_GET' will be processed
and I don't get any error.