‎2008 Mar 05 10:30 AM
hi
can anybody tell me detail description about the various attributes of the subscreen like vertical horizontal and scrollable.
regards,
Uday.
best answers will be rewarded.
‎2008 Mar 05 10:40 AM
Hi,
Attributes of subscreen are:
Scrollable
This attributes the scrolling function if the defined length of the subscreen area exceeds the visible length.
Properties
This attribute controls the behavior of the tabulator in include areas in which subscreens execute.
Sequentially pressing the tabulator key (tabulator string) is standardly converted on the screen into a jump to the next field to the right of the row and then to the first field to the left in the next row, etc. In this case it is of no importance whether the fields belong to the same nesting level or whether they belong to included subscreens.
In the past, this flat assignment was only interrupted for the fields lying within a frame. If the tabulator jumps to a field within the frame for the first time, further tabulator steps take you to the other fields of the frame. This tabulator string can now also be required for include areas in which subscreens execute. The KeepTab property was introduced as a further attribute of the subscreen area for this reason.
The two possible values for the KeepTab property are:
TRUE
The tabulator string is kept within the include area of the subscreen with this value.
FALSE (default)
The tabulator string does not recognize screen nesting("flat assignment").
The selected value cannot be changed at runtime.
Resizing
vertical/ horizontal This attribute defines the behavior of the subscreen area if you manually change the height (vertical resizing) and/or width (horizontal resizing) of the window. Set this attribute if you want the size of the subscreen area to change with the size of the window.
Min. lines:Defines the minimum number of rows for vertical resizing.
Min. Columns :
Defines the minimum number of columns for horizontal resizing.
regards,
vineela.
‎2008 Mar 05 10:33 AM
Hi,
Subscreens
Subscreens allow you to embed one screen within another at runtime. The term subscreen applies both to the screen that you embed, and the area on the main screen in which you place it. This section is about subscreen areas. The actual screens that you embed are called subscreen screens. When you use a subscreen, the flow logic of the embedded screen is also embedded in the flow logic of the main screen. Using subscreens on screens is like using includes in ABAP programs.
Subscreens allow you to expand the content of a screen dynamically at runtime. For example, screen exits, which are part of the enhancement concept, use the subscreen technique. Some complex screen elements, like tabstrip controls, also use them.
To use a subscreen, you must:
Define the subscreen area(s) on a screen
Define suitable subscreen screens
Include the subscreen screen in the subscreen area.
Defining Subscreen Areas
You define subscreen areas using the Screen Painter in the layout of the screen on which you want to embed a subscreen. Each subscreen area on a screen has a unique name, and a position, length, and height. Subscreen areas may not overlap either with each other or with other screen elements. You can also specify whether a subscreen area can be resized vertically or horizontally when the user resizes the window. If the area supports resizing, you can specify a minimum size for it. If the resizing attributes are selected, the PAI event is triggered whenever the user resizes the main screen.
Defining Subscreen Screens
You can create subscreen screens either in the same program or a different program. To create a subscreen screen, enter the screen type Subscreen in the screen attributes. The statically-defined next screen must be the number of the subscreen itself. Choose a size for the screen, making sure that it fits within the subscreen area into which you want to place it. If the subscreen screen is too big for the subscreen area, only the top left-hand corner of it will be displayed.
You create the layout, element list, and flow logic of a subscreen screen in the same way as a normal screen. Subscreens may also include other subscreens. However, the following restrictions apply:
You should arrange the screen elements so that they are not truncated if a subscreen area is too small.
If you want to create several subscreen screens in an ABAP program, you should make sure that the individual screen elements have names unique among the subscreens. If the subscreen screens belong to the same program as the main screen, you should also make sure that names are not used twice there. Otherwise, you must separate data transported from the screen in your ABAP program after each user action (see example).
Subscreens cannot have their own OK_CODE field. Function codes linked to user actions on subscreens are placed in the OK_CODE field of the main screen. This also applies to subscreen screens defined in a different program to the main screen.
The flow logic of a subscreen screen may not contain a MODULE ... AT EXIT-COMMAND statement. Type E functions may only be handled in the main screen.
The flow logic of a subscreen screen may not contain any dialog modules containing the statements SET TITLEBAR, SET PF-STATUS, SET SCREEN, LEAVE SCREEN, or LEAVE TO SCREEN. Any of these statements causes a runtime error. You cannot change the GUI status of a main screen in a subscreen screen.
You can also define selection screens as subscreens.
Including Subscreen Screens
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.
You cannot place the CALL SUBSCREEN statement between CHAIN and ENDCHAIN or LOOP and ENDLOOP (see table controls). While a subscreen screen is being processed, the system field SY-DYNNR contains its screen number. Its contents therefore change when the CALL SUBSCREEN statement occurs and when you return to the main screen.
When you use subscreen screens, remember that the data from their input/output fields is transported to and from the programs in which they are defined. The function codes of user actions on the screen, on the other hand, are always placed in the OK_CODE field of the main screen, and transported into the program in which it is defined. You should therefore name the function codes of your subscreen screens differently from those of the main screen.
If, for encapsulation reasons, you define subscreen screens in other ABAP programs, you must ensure that the required global data of your ABAP programs is transported into the program of the calling screen after you have called their PAI flow logic.
For example, you can define subscreen screens in function groups and pass their global data to and from function module parameters. You must then call the function modules in appropriate dialog modules in the main program to transport the data.
You can also export the global data from the main program as a data cluster to ABAP memory before the PBO of a subscreen screen and import it into a PBO module of the subscreen.
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.
HTH
Regards,
Dhruv Shah
‎2008 Mar 05 10:36 AM
Hi,
A demo program to create subscreen in your ABAP Program
This report will display the user last login date and time.
Subscreen selection 1 : User Name
2 : Last Login Date
3 : Class Belong To
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.
Regards,
Priya.
‎2008 Mar 05 10:40 AM
Hi,
Attributes of subscreen are:
Scrollable
This attributes the scrolling function if the defined length of the subscreen area exceeds the visible length.
Properties
This attribute controls the behavior of the tabulator in include areas in which subscreens execute.
Sequentially pressing the tabulator key (tabulator string) is standardly converted on the screen into a jump to the next field to the right of the row and then to the first field to the left in the next row, etc. In this case it is of no importance whether the fields belong to the same nesting level or whether they belong to included subscreens.
In the past, this flat assignment was only interrupted for the fields lying within a frame. If the tabulator jumps to a field within the frame for the first time, further tabulator steps take you to the other fields of the frame. This tabulator string can now also be required for include areas in which subscreens execute. The KeepTab property was introduced as a further attribute of the subscreen area for this reason.
The two possible values for the KeepTab property are:
TRUE
The tabulator string is kept within the include area of the subscreen with this value.
FALSE (default)
The tabulator string does not recognize screen nesting("flat assignment").
The selected value cannot be changed at runtime.
Resizing
vertical/ horizontal This attribute defines the behavior of the subscreen area if you manually change the height (vertical resizing) and/or width (horizontal resizing) of the window. Set this attribute if you want the size of the subscreen area to change with the size of the window.
Min. lines:Defines the minimum number of rows for vertical resizing.
Min. Columns :
Defines the minimum number of columns for horizontal resizing.
regards,
vineela.