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
.