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

subscreen

Former Member
0 Likes
541

hai..

how to add a subscreen to main screen.

thanks,

pandu.

4 REPLIES 4
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
505

Hi,

You need to create a SUB SCREEN Area in the main screen.

Then in the Flow logic of the Main screen you need to add

CALL SUBSCREEN sub_area INCLUDING prog_name screen_number. in PBO and

CALL SUBSCREEN sub_area. in PAI.

Example:

REPORT demo_dynpro_subscreens.

DATA: ok_code TYPE sy-ucomm,

save_ok TYPE sy-ucomm.

DATA: number1(4) TYPE n VALUE '0110',

number2(4) TYPE n VALUE '0130',

field(10) TYPE c, field1(10) TYPE c, field2(10) TYPE c.

CALL SCREEN 100.

MODULE status_100 OUTPUT.

SET PF-STATUS 'SCREEN_100'.

ENDMODULE.

MODULE fill_0110 OUTPUT.

field = 'Eingabe 1'(001).

ENDMODULE.

MODULE fill_0120 OUTPUT.

field = field1.

ENDMODULE.

MODULE fill_0130 OUTPUT.

field = 'Eingabe 2'(002).

ENDMODULE.

MODULE fill_0140 OUTPUT.

field = field2.

ENDMODULE.

MODULE cancel INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE save_ok INPUT.

save_ok = ok_code.

CLEAR ok_code.

ENDMODULE.

MODULE user_command_0110 INPUT.

IF save_ok = 'OK1'.

number1 = '0120'.

field1 = field.

CLEAR field.

ENDIF.

ENDMODULE.

MODULE user_command_0130 INPUT.

IF save_ok = 'OK2'.

number2 = '0140'.

field2 = field.

CLEAR field.

ENDIF.

ENDMODULE.

MODULE user_command_100 INPUT.

CASE save_ok.

WHEN 'SUB1'.

number1 = '0110'.

WHEN 'SUB2'.

number1 = '0120'.

CLEAR field1.

WHEN 'SUB3'.

number2 = '0130'.

WHEN 'SUB4'.

number2 = '0140'.

CLEAR field2.

ENDCASE.

ENDMODULE.

Regards,

Sesh

.

Read only

Former Member
0 Likes
505

hi,

just in the main screen place a ui element called subscreen.

and in the pbo module and pai module... call that subscreen

regards,

Navneeth K.

Read only

Former Member
0 Likes
505

Hi,

You include a subscreen screen using the CALL SUBSCREEN statement in the flow logic of the main screen.

To include a subscreen screen in the subscreen area of the main screen and call its PBO flow logic, use the following statement in the PBO event of the main screen:

PROCESS BEFORE OUTPUT.

...

CALL SUBSCREEN <area> INCLUDING <prog> <dynp>.

...

This statement assigns the subscreen screen with number <dynp> to the subscreen area called <area>. With <prog> you must specify the ABAP program in which the subscreen screen is defined. If it does not find a corresponding subscreen screen, a runtime error occurs. The PBO flow logic of the subscreen screen is also included at the same point. This can call PBO modules of the ABAP program in which the subscreen screen is defined. At the end of the subscreen PBO, the global fields from the program are passed to any identically-named screen fields in the subscreen screen. The PBO flow logic of the subscreen screen can itself include further subscreens.

The name <area> of the subscreen area must be entered directly without inverted commas. You can specify the names <prog> and <dynp> either as literals or variables. If you use variables, you must declare and fill identically-named variables in the ABAP program. The screen number <dynp> must be 4 characters long. If you do not assign a subscreen screen to an area, it remains empty.

To call the PAI flow logic of the subscreen screen, use the following statement in the PAI flow logic of the main screen:

PROCESS AFTER INPUT.

...

CALL SUBSCREEN <area>.

...

This statement includes the PAI flow logic of the subscreen screen included in the subscreen area <area> in the PBO event. This can call PAI modules of the ABAP program in which the subscreen screen is defined. Data is transported between identically-named fields in the subscreen screen and the ABAP program either when the PAI event is triggered, or at the corresponding FIELD statements in the PAI flow logic of the subscreen screen.

Check this code.

REPORT ZSUBSCREEN.

TABLES: USR02, "Logon data

SSCRFIELDS. "FIELDS ON SELECTION SCREENS

*----


  • SUBSCREEN 1

*----


SELECTION-SCREEN BEGIN OF SCREEN 100 AS SUBSCREEN.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-010.

SELECT-OPTIONS: USERNAME FOR USR02-BNAME.

SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN END OF SCREEN 100.

*----


  • SUBSCREEN 2

*----


SELECTION-SCREEN BEGIN OF SCREEN 200 AS SUBSCREEN.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-020.

SELECT-OPTIONS: LASTLOGI FOR USR02-TRDAT.

SELECTION-SCREEN END OF BLOCK B2.

SELECTION-SCREEN END OF SCREEN 200.

*----


  • SUBSCREEN 3

*----


SELECTION-SCREEN BEGIN OF SCREEN 300 AS SUBSCREEN.

SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-030.

SELECT-OPTIONS: CLASSTYP FOR USR02-CLASS.

SELECTION-SCREEN END OF BLOCK B3.

SELECTION-SCREEN END OF SCREEN 300.

  • STANDARD SELECTION SCREEN FOR SCROLLING LEFT AND RIGHT

SELECTION-SCREEN: FUNCTION KEY 1,

FUNCTION KEY 2.

SELECTION-SCREEN: BEGIN OF TABBED BLOCK SUB FOR 15 LINES,

END OF BLOCK SUB.

START-OF-SELECTION.

SELECT * FROM USR02 WHERE BNAME IN USERNAME

AND ERDAT IN LASTLOGI

AND CLASS IN CLASSTYP.

WRITE: / 'User ', USR02-BNAME,

'Last Login Date ', USR02-TRDAT,

'Last Login Time ', USR02-LTIME,

'CLASS ', USR02-CLASS.

ENDSELECT.

END-OF-SELECTION.

INITIALIZATION.

  • SCREEN ICON LEFT AND RIGHT

SSCRFIELDS-FUNCTXT_01 = '@0D@'.

SSCRFIELDS-FUNCTXT_02 = '@0E@'.

SUB-PROG = SY-REPID.

SUB-DYNNR = 100.

AT SELECTION-SCREEN.

CASE SY-DYNNR.

WHEN 100.

IF SSCRFIELDS-UCOMM = 'FC01'.

SUB-DYNNR = 300.

ELSEIF SSCRFIELDS-UCOMM = 'FC02'.

SUB-DYNNR = 200.

ENDIF.

WHEN 200.

IF SSCRFIELDS-UCOMM = 'FC01'.

SUB-DYNNR = 100.

ELSEIF SSCRFIELDS-UCOMM = 'FC02'.

SUB-DYNNR = 300.

ENDIF.

WHEN 300.

IF SSCRFIELDS-UCOMM = 'FC01'.

SUB-DYNNR = 200.

ELSEIF SSCRFIELDS-UCOMM = 'FC02'.

SUB-DYNNR = 100.

ENDIF.

ENDCASE.

Reward points if it is helpful..

Regards,

Omkar.

Message was edited by:

Omkaram Yanamala

Read only

Former Member
0 Likes
505

HI,

see the below program for tab trip.

in this screen 1001 is normal screen and screens 2001,2002 are sub screens.

PROGRAM ZBHTSTRIP.

DATA:OKCODE LIKE SY-UCOMM.

DATA: N1 TYPE I, N2 TYPE I, R1 TYPE I, R2 TYPE I.

DATA SCRNO(4) TYPE N VALUE 2001.

CONTROLS TABS TYPE TABSTRIP.

MODULE USER_COMMAND_1001 INPUT.

CASE OKCODE.

WHEN 'ADD'.

R1 = N1 + N2.

SCRNO = 2001.

TABS-ACTIVETAB = OKCODE.

WHEN 'MUL'.

R2 = N1 * N2.

SCRNO = 2002.

TABS-ACTIVETAB = OKCODE.

WHEN 'BACK'.

SET SCREEN 0.

WHEN 'CLEA'.

CLEAR: N1,N2.

ENDCASE.

ENDMODULE. " USER_COMMAND_1001 INPUT

MODULE STATUS_1001 OUTPUT.

  • SET PF-STATUS 'xxxxxxxx'.

SET TITLEBAR 'TIT1001'.

ENDMODULE. " STATUS_1001 OUTPUT

<b>FLOW LOGIC:</b>

PROCESS BEFORE OUTPUT.

MODULE STATUS_1001.

CALL SUBSCREEN SUBA INCLUDING 'ZBHTSTRIP' SCRNO.

*

PROCESS AFTER INPUT.

MODULE USER_COMMAND_1001.

  • CALL SUBSCREEN SUBA.

PROCESS BEFORE OUTPUT.

  • MODULE STATUS_2001.

*

PROCESS AFTER INPUT.

  • MODULE USER_COMMAND_2001.

PROCESS BEFORE OUTPUT.

  • MODULE STATUS_2002.

*

PROCESS AFTER INPUT.

  • MODULE USER_COMMAND_2002.

rgds,

bharat.