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

code for subscreen elements of a tabstrip.

Former Member
0 Likes
471

hi

i want to know

what are the methods to code for subscreen elements of a tabstrip.

thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
401

Amit, hi

The following link gives full details:-

http://help.sap.com/saphelp_nw04/helpdata/en/17/5bf1b52ba211d2954f0000e8353423/content.htm

Kind regards

Mark

2 REPLIES 2
Read only

Former Member
0 Likes
402

Amit, hi

The following link gives full details:-

http://help.sap.com/saphelp_nw04/helpdata/en/17/5bf1b52ba211d2954f0000e8353423/content.htm

Kind regards

Mark

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
401

Hi,

According to the tab pressed,you can write the coding in PAI and display the output in PBO.

Following is the sample code.I am using custom container.

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

&----


  • This is used to catch the pressed tab

----


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 INPUT

&----


*& Module USER_COMMAND_9001 INPUT

&----


  • This is used for user command

----


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.