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: 

calling subscreens in module pool

former_member192432
Participant
0 Kudos
5,219

hi,

How to call a 3 different subscreens by clicking on push buttons which are created in application tool bar like create delete change respectively in MODULE POOL programming.

regards..

chetan

8 REPLIES 8

Former Member
0 Kudos
1,429

Hi chetan teli,

i think it is imposible to call 3 different screens at a time.

Former Member
0 Kudos
1,429

Hi Chetan,

CALL SUBSCREEN area1 INCLUDING w_program_name screen_number.

here try to fill the variables in conditions. w_program_name screen_number.

go through the following link.

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbabfe35c111d1829f0000e829fbfe/content.htm

Regards.

Eshwar.

GauthamV
Active Contributor
0 Kudos
1,429

hi,

it is possible.

check this sample code.

MODULE user_command_0100 INPUT.

CASE save_ok.

WHEN 'CREA'.

CALL TRANSACTION 'ZFGLMR'.

WHEN 'CHAN'.

CALL TRANSACTION 'ZFGLMC'.

WHEN 'DISP'.

CALL TRANSACTION 'ZFGLMD'.

WHEN 'BACK'.

LEAVE TO SCREEN 0.

ENDCASE.

ENDMODULE. " USER_COMMAND_0100 INPUT

Former Member
0 Kudos
1,429

Hi Chetan,

go through the below document i hope u will get some help...

Selection Screens as Subscreens

In the same way that you can define a screen as a subscreen in the Screen Painter, it is now possible to define selection screens as subscreens in an ABAP program:

SELECTION-SCREEN BEGIN OF SCREEN <scrn> AS SUBSCREEN

[NO INTERVALS]

[NESTING LEVEL <n>].

...

SELECTION-SCREEN END OF SCREEN <scrn>.

Selection screens that you define in this way can be included in:

Subscreens on screens

Tabstrip Controls on screens

Tabstrip Controls on Selection Screens

You cannot call them using CALL SELECTION-SCREEN.

If you use the NO INTERVALS addition, the subscreen is made smaller and the selection criteria are all displayed with single input fields.

The NESTING LEVEL also reduces the size of the subscreen. You can use it to prevent scrollbars from appearing when you use the subscreen in a tabstrip control on the selection screen and the tabstrip already has a frame. If there is no frame around the tabstrip control, use NESTING LEVEL 0. For each frame around the tabstrip control, increase NESTING LEVEL by one.

When you include a selection screen as a subscreen on a screen or in a tabstrip control on a screen, you should remember that the CALL SUBSCREEN statement is executed in both the PBO and PAI events in the screen flow logic. Although you cannot program PAI modules for selection screens as subscreens, the CALL SUBSCREEN statement ensures that the input data is transferred to the ABAP program in the PAI event.

As on normal selection screens, the usual permitted user actions trigger the usual selection screen processing. This allows you to check user input or process function codes.

Examples

Selection screens as subscreens on screens.

REPORT demo_sel_screen_as_subscreen.

SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-010.

PARAMETERS: p1(10) TYPE c,

p2(10) TYPE c,

p3(10) TYPE c.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN END OF SCREEN 1100.

SELECTION-SCREEN BEGIN OF SCREEN 1200 AS SUBSCREEN.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-020.

PARAMETERS: q1(10) TYPE c OBLIGATORY,

q2(10) TYPE c OBLIGATORY,

q3(10) TYPE c OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN END OF SCREEN 1200.

DATA: ok_code TYPE sy-ucomm,

save_ok TYPE sy-ucomm.

DATA: number(4) TYPE n VALUE '1100'.

START-OF-SELECTION.

CALL SCREEN 100.

MODULE status_0100 OUTPUT.

SET PF-STATUS 'SCREEN_100'.

ENDMODULE.

MODULE cancel INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE user_command_0100 INPUT.

save_ok = ok_code.

CLEAR ok_code.

CASE save_ok.

WHEN 'BUTTON1'.

number = 1100.

WHEN 'BUTTON2'.

number = 1200.

ENDCASE.

ENDMODULE.

AT SELECTION-SCREEN.

MESSAGE s888(sabapdocu) WITH text-030 sy-dynnr.

This defines two selection screens u2013 1100 and 1200 u2013 as subscreens.

The next screen (statically defined) for screen 100 is itself. It has the following layout:

The screen contains a subscreen area AREA and two pushbuttons with the function codes BUTTON1 and BUTTON2.

The screen flow logic for screen 100 is as follows:

PROCESS BEFORE OUTPUT.

MODULE status_0100.

CALL SUBSCREEN area INCLUDING sy-repid number.

PROCESS AFTER INPUT.

MODULE cancel AT EXIT-COMMAND.

CALL SUBSCREEN area.

MODULE user_command_0100.

When you run the program, a screen appears on which selection screen 1100 is displayed as a subscreen. You can display either selection screen in the subscreen area, using the pushbuttons to switch between them. Before you switch from selection screen 1200 to 1100, you must fill out the obligatory fields. The data you enter is available to the program in the parameters in the PAI event.

Selection screens as subscreens in a tabstrip control on a screen.

REPORT demo_sel_screen_in_tabstrip.

SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN

NO INTERVALS.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-010.

PARAMETERS: p1(10) TYPE c,

p2(10) TYPE c,

p3(10) TYPE c.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN END OF SCREEN 1100.

SELECTION-SCREEN BEGIN OF SCREEN 1200 AS SUBSCREEN

NO INTERVALS.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-020.

PARAMETERS: q1(10) TYPE c OBLIGATORY,

q2(10) TYPE c OBLIGATORY,

q3(10) TYPE c OBLIGATORY.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN END OF SCREEN 1200.

CONTROLS mytabstrip TYPE TABSTRIP.

DATA: ok_code TYPE sy-ucomm,

save_ok TYPE sy-ucomm.

DATA: number(4) TYPE n VALUE '1100'.

START-OF-SELECTION.

mytabstrip-activetab = 'BUTTON1'.

CALL SCREEN 100.

MODULE status_0100 OUTPUT.

SET PF-STATUS 'SCREEN_100'.

ENDMODULE.

MODULE cancel INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE user_command_0100 INPUT.

save_ok = ok_code.

CLEAR ok_code.

CASE save_ok.

WHEN 'BUTTON1'.

mytabstrip-activetab = save_ok.

number = 1100.

WHEN 'BUTTON2'.

mytabstrip-activetab = save_ok.

number = 1200.

ENDCASE.

ENDMODULE.

AT SELECTION-SCREEN.

MESSAGE s888(sabapdocu) WITH text-030 sy-dynnr.

This defines two selection screens u2013 1100 and 1200 u2013 as subscreens.

The next screen (statically defined) for screen 100 is itself. It has the following layout:

The screen contains a tabstrip area called MYTABSTRIP with three tab titles BUTTON1, BUTTON2 and BUTTON3. The function codes have the same name, and no special function type. All of the tab titles are assigned to a single subscreen area AREA.

The screen flow logic for screen 100 is as follows:

PROCESS BEFORE OUTPUT.

MODULE status_0100.

CALL SUBSCREEN area INCLUDING sy-repid number.

PROCESS AFTER INPUT.

MODULE cancel AT EXIT-COMMAND.

CALL SUBSCREEN area.

MODULE user_command_0100.

This example is programmed in almost exactly the same way as the last one, and behaves in the same way. The only difference is that the pushbuttons have been replaced with tab titles, and the control MYTABSTRIP has been declared and filled. Scrolling between the tab pages is programmed in the ABAP program. Each time the user chooses a tab title, the function code from the OK_CODE field is assigned to the ACTIVETAB component of structure MYTABSTRIP. At the same time, the variable NUMBER is filled with the screen number of the subscreen that has to be displayed in the subscreen area AREA of the tabstrip control.

Thanks & Regards

Ashu Singh.

former_member188685
Active Contributor
0 Kudos
1,429

Crate a screen 100, in that create a sub screen area. and 2 radiobuttons.

now create 2 screen and make it as subscreen.

in the flow logic of the main screen you can call this to call the subscreen.

V_DYNNR is used for Dynamic subscreens.

call subscreen sub including sy-repid v_dynnr.

check the Demo program DEMO_DYNPRO_SUBSCREENS

PROGRAM  zmodule.
 
DATA: a value 'X',
           b.
DATA: v_dynnr TYPE sy-dynnr value  '0200'.
 
 
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_0100  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_0100 INPUT.
 
  IF a = 'X'.
    v_dynnr = '0200'.
  ELSE.
    v_dynnr = '0300'.
  ENDIF.
 
ENDMODULE.                 " USER_COMMAND_0100  INPUT

Flow logic of Fist screen.

PROCESS BEFORE OUTPUT.
 
 MODULE STATUS_0100.
call subscreen sub including sy-repid v_dynnr.
 
*
PROCESS AFTER INPUT.
 MODULE USER_COMMAND_0100.

Regards

Vijay babu Dudla

former_member673464
Active Contributor
0 Kudos
1,429

hi,

you can write a logic for calling the subscreens in the PAI of the screen based on the ok-code given to the push button.

for eg:

case sy-ucomm.

when 'DEL1'.

call screen 1100.

when 'DEL2'.

call screen 1101.

when 'DEL3'.

call screen 1102.

endcase.

Regards,

Veeresh

former_member787646
Contributor
0 Kudos
1,429

Hi

You can achieve the logic with the help of the following steps.

1. Create a Main Screen of Screen Type Normal and add a Sbscreen Area on that screen in the Screen

Painter. In the Element List Tab of the Screen Add a variable "OK_CODE" and activate the Screen.

2. In the Flow logic of the Main Screen Add the following code.

CALL SUBSCREEN '<subscreen_area> INCLUDING SY-CPROG <screen_no>.

And in the PAI Block add the following line.

CALL SUBSCREEN '<subscreen_area>

3. In the flow login Double click on the line "MODULE STATUS_0100 OUTPUT" and add the following code in the ABAP program.

MODULE status_0100 OUTPUT.

DATA: OK_CODE TYPE SY-UCOMM.

DATA: SCR_NO(4) TYPE N VALUE '0110'.

OK_CODE = SY-COMM.

CASE OK_CODE.

WHEN 'CREA'.

SCR_NO = '0110'.

WHEN 'CHAN'.

SCR_NO = '0120'.

WHEN 'DISP'.

SCR_NO = '0130'.

ENDCASE.

ENDMODULE.

4 Create 3 screens of Type Subscreen (with the screen no's 0110, 0120 & 0130) and add the fields in

the screen.

Hope it helps.

Murthy