Application Development and Automation 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: 
Read only

2 container with 2 structures

Former Member
0 Likes
516

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
497

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 above

for that reason you are getting the same in the output.

3 REPLIES 3
Read only

Former Member
0 Likes
498

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 above

for that reason you are getting the same in the output.

Read only

uwe_schieferstein
Active Contributor
0 Likes
497

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

Read only

0 Likes
497

thanks for your answers, it work now.