cancel
Showing results for 
Search instead for 
Did you mean: 

ALV-Grid - update fields in subscreens (tabstrip)

Former Member
0 Kudos
388

hi,

I have an dynpro with an alv-grid and an tabstrip (3 tabs). An event of the alv is "double_click". Now if I double-click of a line in the alv it should update the fields of the subscreens (tabstrips). How can I do this?

Thanks

Markus S.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member188685
Active Contributor
0 Kudos

Hi Go to Environment->Examples->Control Examples

U can find lot of examples on alv grid controls.

Regards

Vijay

Former Member
0 Kudos

hi,

I can't find any helpful example. Could you give me an example? Must I raise PAI from the subscreen?

Thanks

Markus

former_member188685
Active Contributor
0 Kudos

try this DEMO_DYNPRO_TABSTRIP_LOCAL

and assign for each subscreen custom container.

and try to implement in the same way as this example.

but this is a demo program and no controls

only screens.

regards

vijay

former_member188685
Active Contributor
0 Kudos

Hi Try this also

The function code for the pushbuttion of the tab has to be deactivated in the PBO.

For example, look at the program DEMO_DYNPRO_TABSTRIP_SERVER. Copy this to a Z program and add the following in your code -

MODULE status_0100 OUTPUT.

SET PF-STATUS 'SCREEN_100'.

if number = '0120'.

loop at screen.

if screen-name = 'PUSH3'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

endloop.

endif.

ENDMODULE.

Regards

vijay

former_member188685
Active Contributor
0 Kudos

Hi,

Check this link if you need help in sub-screen.

http://www.sapgenie.com/abap/code/abap19.htm

Here is the sample code for Tabstrip control.In that I am using single grid display when first button is pressed and multi-grid display when second button in the tabstrip is pressed.

CONTROLS: main_tab TYPE TABSTRIP.

DATA: BEGIN OF i_main_tab,

subscreen LIKE sy-dynnr,

prog LIKE sy-repid VALUE

'ZZZ_TABSTRIP',

pressed_tab LIKE sy-ucomm VALUE c_main_tab-tab1,

END OF i_main_tab.

MODULE status_9001 OUTPUT.

SET PF-STATUS 'ZSTATUS'.

SET TITLEBAR 'ZTITLE'.

main_tab-activetab = i_main_tab-pressed_tab.

CASE i_main_tab-pressed_tab.

WHEN c_main_tab-tab1.

IF o_custom_container1 IS INITIAL.

  • Creating Object

PERFORM f9000_objects_create.

  • Building the field catalog

PERFORM f9001_build_field_cat TABLES i_fcat

USING 'ZZZ_GRID'.

  • For Layout

PERFORM f9002_layout USING sy-title c_x c_a c_x.

i_main_tab-subscreen = '9100'.

  • Displaying data

CALL METHOD o_alvgrid1->set_table_for_first_display

EXPORTING

is_variant = w_variant

i_save = c_a

is_layout = w_layout

CHANGING

it_outtab = i_grid[]

it_fieldcatalog = i_fcat[]

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE i005 WITH text-009."Error in ALV report display

LEAVE LIST-PROCESSING.

ENDIF.

endif.

when c_main_tab-tab2.

if o_custom_container2 is initial.

perform f9000_objects_create1 using:

  • create custom container

'o_custom_container2' '' '' '',

  • Create splitter container

'o_splitter' o_custom_container2 '2' '1',

  • Create event reciever

'o_eventreceiver' '' '' ''.

  • Creating containers for the split grids

call method o_splitter->get_container exporting row = 1

column = 1

receiving container = o_container1.

call method o_splitter->get_container exporting row = 2

column = 1

receiving container = o_container2.

  • Set where the splits on the screen comes

call method o_splitter->set_row_height

exporting

id = 1

height = 45

exceptions

cntl_error = 1

cntl_system_error = 2

others = 3.

if sy-subrc ne 0.

perform f9003_error_handle using text-E04.

endif.

perform f9000_objects_create1 using:

  • Create the alv grids

'o_alvgrid2' o_container1 '' '',

'o_alvgrid3' o_container2 '' ''.

set handler o_eventreceiver->handle_double_click for o_alvgrid2.

perform f9001_build_field_cat tables i_fcat1

using 'ZZZ_GRID1'.

perform f9001_build_field_cat tables i_fcat2

using 'ZZZ_GRID2'.

  • For Layout

PERFORM f9002_layout USING sy-title c_x c_a c_x.

i_main_tab-subscreen = '9200'.

if not i_grid1[] is initial.

call method o_alvgrid2->set_table_for_first_display

exporting

is_variant = w_variant

i_save = c_a

is_layout = w_layout

CHANGING

it_outtab = i_grid1[]

it_fieldcatalog = i_fcat1[]

exceptions

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

others = 4.

if sy-subrc <> 0.

message i005 with text-009."Error in ALV report display

leave list-processing.

endif.

  • Populate the GRID2 data

read table i_grid1 into w_grid1 index 1.

if sy-subrc = 0.

if not i_grid2[] is initial.

  • Generate the grid2 data.

call method o_alvgrid3->set_table_for_first_display

exporting

is_variant = w_variant

i_save = c_a

is_layout = w_layout

CHANGING

it_outtab = i_grid2[]

it_fieldcatalog = i_fcat2[]

exceptions

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

others = 4.

endif.

endif.

else.

  • No data for the entered selection criteria

message i005 with text-010.

leave list-processing.

endif.

endif.

WHEN OTHERS.

  • DO NOTHING

ENDCASE.

ENDMODULE. " STATUS_9001 OUTPUT

MODULE main_tab_active_tab_get INPUT.

CASE sy-ucomm.

WHEN c_main_tab-tab1.

i_main_tab-pressed_tab = c_main_tab-tab1.

i_main_tab-subscreen = '9100'.

WHEN c_main_tab-tab2.

i_main_tab-pressed_tab = c_main_tab-tab2.

i_main_tab-subscreen = '9200'.

WHEN OTHERS.

  • DO NOTHING

ENDCASE.

ENDMODULE. " MAIN_TAB_ACTIVE_TAB_GET

MODULE user_command_9001 INPUT.

CASE sy-ucomm.

WHEN 'BACK'.

PERFORM exit_program.

SET SCREEN '0'.

WHEN 'EXIT' OR 'CANC'.

PERFORM exit_program.

LEAVE PROGRAM.

ENDCASE.

ENDMODULE. " USER_COMMAND_9000 INPUT

  • For screen 9001 we need to write Flow logic as below. For subscreens, Flow logic is

  • not required.

PROCESS BEFORE OUTPUT.

MODULE STATUS_9001.

CALL SUBSCREEN main_tab_sca

INCLUDING i_main_tab-prog i_main_tab-subscreen.

*

PROCESS AFTER INPUT.

MODULE user_command_9001.

MODULE main_tab_active_tab_get.

try to do this

regards

vijay

Former Member
0 Kudos

hi,

thank you for the answers. I have solved my problem. I raise PAI with following code:


method.
...
    CALL METHOD cl_gui_cfw=>set_new_ok_code
      EXPORTING new_code = 'ALV_DOUBLE_CLICK'.
...
endmethod.

Now the PBO from the dynpro (alv and tabstrip on it) will raise. In PBO I update the subscreen-fields and load the subscreens:


call subscreen ...

What do you think about the procedure?

Thanks Markus

former_member188685
Active Contributor
0 Kudos

Hi Markus,

I think that solves ur prob.

If ur problem solves Close this thread.

Regards

Vijay