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
975

I Have 2 screens to Develop.

1st screen which is Normal screen has 3 fields...

Based on the selection iam populating the

records in the 2nd screen's Table control.

I want to populate the subscreen which holds the input values of

the first screen in the second screen.

it means second screen must have both subscreen and the table control.

iam able to poplulate the records in the table control but

i need the logic to display the subscreen in the 2nd screen.

can anybody help please.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
934

Hi Madhu,

You can code this logic in PAI module of the first screen. in PAI you read the values that are read and then assign it to the fields in the subscreen when populating the values in the table control.

This should work.

- Guru

7 REPLIES 7
Read only

Former Member
0 Likes
935

Hi Madhu,

You can code this logic in PAI module of the first screen. in PAI you read the values that are read and then assign it to the fields in the subscreen when populating the values in the table control.

This should work.

- Guru

Read only

0 Likes
934

Thanks Guru

Read only

Former Member
0 Likes
934

Hi madhu,

If you are creating the subscreen for same program of main screen.The PBO and PAI of these 2 will be same.OK.The name of any screen elements in same program should not be same.

Q1. You want to populate the subscreen which holds the input values of

the first screen in the second screen.

A. Declare the same fields which are in first screen with diff. names.

In PAI move all screen values to second screen elements.you will get the

values. As usual call the subscreen from PBO of Main screen.

Q2.If you want to get the values in table control while creating the table control

wizard it will ask the internal table name .Give the internal table name in

which data you want to transfer to table control.

Pls see the below code.

Example

Subscreens

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.

The next screen number of screen 100 is 100 (statically-defined). Its layout is as follows:

There are four pushbuttons with the function codes SUB1 to SUB4, and two subscreen areas AREA1 and AREA2.

In the same ABAP program, there are four subscreen screens 110 to 140. Each of these fits the subscreen area exactly. The layout is:

The input/output field of all four subscreen screens has the name FIELD. The function codes of the pushbuttons on the subscreen screens 110 and 130 are OK1 and OK2.

The screen flow logic for screen 100 is as follows:

PROCESS BEFORE OUTPUT.

MODULE status_100.

CALL SUBSCREEN: area1 INCLUDING sy-repid number1,

area2 INCLUDING sy-repid number2.

PROCESS AFTER INPUT.

MODULE cancel AT EXIT-COMMAND.

MODULE save_ok.

CALL SUBSCREEN: area1,

area2.

MODULE user_command_100.

The screen flow logic of subscreen screens 110 and 130 is:

PROCESS BEFORE OUTPUT.

MODULE fill_0110|0130.

PROCESS AFTER INPUT.

MODULE user_command_0110|0130.

The screen flow logic of subscreen screens 120 and 140 is:

PROCESS BEFORE OUTPUT.

MODULE fill_0120|0150.

PROCESS AFTER INPUT.

When you run the program, a screen appears on which subscreens 110 and 130 are displayed. The pushbuttons on the main screen allow you to choose between two subscreen screens for each screen area. The pushbuttons on the subscreens allow you to transfer the data from subscreens 110 and 130 to subscreens 120 and 140.

Since the same field name FIELD is used on all subscreens, the identically-named ABAP field is transferred more than once in each PBO and PAI event of the main screen. For this reason, the values have to be stored in the auxiliary fields FIELD1 and FIELD2 in the ABAP program.

The pushbuttons on the subscreen screens have different function codes, and they are handled normally in an ABAP field. If the function codes had had the same names, it would again have been necessary to use auxiliary fields.

Pls. reward points if helpful.

Read only

0 Likes
934

Thanks Murali

Read only

Former Member
0 Likes
934

first you must darw one subscreen area in your screen2 and name it area.

try this code in your screen2.

PROCESS BEFORE OUTPUT.

MODULE status_0100.

CALL SUBSCREEN area INCLUDING sy-repid subscreennumber.

PROCESS AFTER INPUT.

CALL SUBSCREEN area.

MODULE user_command_0100.

i think this will help u.

Read only

0 Likes
934

Thanks vikram

Read only

Former Member
0 Likes
934

hi

good

go through this report,

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.

thanks

mrutyun^