‎2008 Oct 24 11:40 AM
I have two containers with two different structures. but i have always the structure from the first container in the second container, how can this be solved that i have 2 different structures in two containers.
container 1 :
IF g_custom_container1 IS INITIAL.
CREATE OBJECT g_custom_container1
EXPORTING
container_name = 'CCCONTAINER1'.
CREATE OBJECT grid1
EXPORTING
i_parent = g_custom_container1.
CALL METHOD grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'structure1'
is_layout = gs_layout
CHANGING
it_outtab = lt_tab
it_fieldcatalog = lt_fct
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
endif.
container 2:
IF g_custom_container2 IS INITIAL.
CREATE OBJECT g_custom_container2
EXPORTING
container_name = 'CCCONTAINER2'.
CREATE OBJECT grid2
EXPORTING
i_parent = g_custom_container2.
CALL METHOD grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'structure2'
is_layout = gs_layout
it_toolbar_excluding = pt_exclude
CHANGING
it_outtab = lt_itab2
it_fieldcatalog = lt_fct
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.
endif.
‎2008 Oct 24 11:46 AM
see here..
CALL METHOD grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'structure1' "use Caps should be STRUCTURE1
is_layout = gs_layout
CHANGING
it_outtab = lt_tab
it_fieldcatalog = lt_fct "Both the places you are using same
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.CALL METHOD grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'structure2' "use CAPS
is_layout = gs_layout
it_toolbar_excluding = pt_exclude
CHANGING
it_outtab = lt_itab2
it_fieldcatalog = lt_fct "Same as abovefor that reason you are getting the same in the output.
‎2008 Oct 24 11:46 AM
see here..
CALL METHOD grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'structure1' "use Caps should be STRUCTURE1
is_layout = gs_layout
CHANGING
it_outtab = lt_tab
it_fieldcatalog = lt_fct "Both the places you are using same
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
OTHERS = 4.CALL METHOD grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'structure2' "use CAPS
is_layout = gs_layout
it_toolbar_excluding = pt_exclude
CHANGING
it_outtab = lt_itab2
it_fieldcatalog = lt_fct "Same as abovefor that reason you are getting the same in the output.
‎2008 Oct 24 12:53 PM
Hello Muhammet
If you have multiple grid instances you need multiple fieldcatalogs. If the DDIC information is sufficient just tell the grid instance the name of the structure and do NOT provide any fieldcatalog (e.g. ).
If you need to manipulate the fieldcatalogs (e.g. defining checkboxes, hotspots, etc.) then you need multiple fieldcatalog variables, e.g.:
DATA:
gt_fcat_1 TYPE lvc_t_fcat,
gt_fcat_2 TYPE lvc_t_fcat.Regards
Uwe
‎2008 Oct 24 12:54 PM