Application Development 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: 

two gui status with 2 containers

ifat_bar
Participant
0 Kudos
213

Hello,

I have 2 containers in one screen . I need to create 2 gui status for each container.

The problems id that i created only 1 status, and cannt create the second.

attach is the code :

MODULE status_0100 OUTPUT.

SET PF-STATUS 'MAIN'.

SET TITLEBAR 'SALV_STANDARD_SECOND'.

PERFORM fullscreen.

ENDMODULE. " S

*&----


*

*& Form FULLSCREEN

*&----


*

  • text

*----


*

  • --> p1 text

  • <-- p2 text

*----


*

FORM fullscreen .

  • Main Screen - Contract or PO

DATA: lt_salv_t_ui_func TYPE salv_t_ui_func,

ls_salv_stract TYPE salv_s_ui_func.

DATA: lr_functions TYPE REF TO cl_salv_functions_list.

DATA: lr_columns TYPE REF TO cl_salv_columns,

lr_column TYPE REF TO cl_salv_column_table.

DATA: lr_selections TYPE REF TO cl_salv_selections,

lt_rows TYPE salv_t_row,

lt_column TYPE salv_t_column,

ls_cell TYPE salv_s_cell.

*... §6 register to the events of cl_salv_table

DATA: lr_events TYPE REF TO cl_salv_events_table,

lv_text TYPE string.

DATA: lr_layout TYPE REF TO cl_salv_layout,

ls_key TYPE salv_s_layout_key,

lr_s_layout TYPE salv_s_layout.

IF gr_container_main IS NOT BOUND.

IF cl_salv_table=>is_offline( ) EQ if_salv_c_bool_sap=>false.

CREATE OBJECT gr_container_main

EXPORTING

container_name = 'CONTAINER'.

ENDIF.

ENDIF.

TRY.

cl_salv_table=>factory(

EXPORTING

r_container = gr_container_main

container_name = 'CONTAINER'

IMPORTING

r_salv_table = gr_table

CHANGING

t_table = gt_printout_main ).

CATCH cx_salv_msg. "#EC NO_HANDLER

ENDTRY.

lr_layout = gr_table->get_layout( ).

*... §4.1 set the Layout Key

ls_key-report = sy-repid.

lr_layout->set_key( ls_key ).

*... §4.2 set usage of default Layouts

lr_layout->set_default( abap_true ).

*... §4.3 set Layout save restriction

lr_layout->set_save_restriction( if_salv_c_layout=>restrict_none ).

  • gs_test-layout = p_lay02.

  • lr_layout->set_initial_layout( gs_test-layout ).

  • lr_layout = gr_table->get_layout( ).

  • lr_layout->set_default( abap_true ).

  • lr_s_layout = lr_layout->f4_layouts( ).

lr_functions = gr_table->get_functions( ).

lr_functions->set_all( abap_true ).

  • TRY.

  • lv_text = text-b01.

  • lr_functions->add_function(

  • name = 'GET_SEL'

  • icon = space

  • text = lv_text

  • tooltip = lv_text

  • position = if_salv_c_function_position=>right_of_salv_functions ).

*

  • CATCH cx_salv_wrong_call cx_salv_existing.

  • ENDTRY.

TRY.

lv_text = text-b02.

lr_functions->add_function(

name = 'LIMIT_DAT'

icon = space

text = lv_text

tooltip = lv_text

position = if_salv_c_function_position=>right_of_salv_functions ).

CATCH cx_salv_wrong_call cx_salv_existing.

ENDTRY.

lr_events = gr_table->get_event( ).

CREATE OBJECT ge_events.

SET HANDLER ge_events->on_user_command FOR lr_events.

SET HANDLER ge_events->on_double_click FOR lr_events.

lr_selections = gr_table->get_selections( ).

lr_selections->set_selection_mode( if_salv_c_selection_mode=>multiple ).

lr_columns = gr_table->get_columns( ).

lr_columns->set_optimize( abap_true ).

PERFORM set_columns_technical USING lr_columns.

gr_table->display( ).

  • DATA: event_receiver TYPE REF TO lcl_event_receiver.

  • SET HANDLER event_receiver->handle_hotspot_click1 FOR gcl_fl_for_db_table.

********************container1****************

IF gr_container_main1 IS NOT BOUND.

IF cl_salv_table=>is_offline( ) EQ if_salv_c_bool_sap=>false.

CREATE OBJECT gr_container_main1

EXPORTING

container_name = 'CONTAINER1'.

ENDIF.

ENDIF.

TRY.

cl_salv_table=>factory(

EXPORTING

r_container = gr_container_main1

container_name = 'CONTAINER1'

IMPORTING

r_salv_table = gr_table_sec

CHANGING

t_table = lt_printout_second ).

CATCH cx_salv_msg. "#EC NO_HANDLER

ENDTRY.

lr_events = gr_table_sec->get_event( ).

CREATE OBJECT ge_events.

SET HANDLER ge_events->on_user_command FOR lr_events.

SET HANDLER ge_events->on_double_click FOR lr_events.

lr_selections = gr_table_sec->get_selections( ).

lr_selections->set_selection_mode( if_salv_c_selection_mode=>multiple ).

lr_columns = gr_table_sec->get_columns( ).

lr_columns->set_optimize( abap_true ).

PERFORM set_columns_technical1 USING lr_columns.

gr_table_sec->display( ).

ENDFORM. " FULLSCREEN

Please advise

Regards

Yifat Bar

1 ACCEPTED SOLUTION

uwe_schieferstein
Active Contributor
0 Kudos
88

Hello Ifat

The gui status is linked to the entire screen on which you display (or better: attach) your containers.

A container is just a part of a screen and, therefore, cannot have its "own" gui status.

Depending on the control you put into your containers you can have two different (ALV or tree) toolbars but just a single gui status for both of them.

Regards

Uwe

1 REPLY 1

uwe_schieferstein
Active Contributor
0 Kudos
89

Hello Ifat

The gui status is linked to the entire screen on which you display (or better: attach) your containers.

A container is just a part of a screen and, therefore, cannot have its "own" gui status.

Depending on the control you put into your containers you can have two different (ALV or tree) toolbars but just a single gui status for both of them.

Regards

Uwe