abap - subscreens

3
7/17/2019 ABAP - Subscreens http://slidepdf.com/reader/full/abap-subscreens 1/3 ABAP | Subscreens Before you read this tutorial make sure you what a Dialog Program is … Subscreens A subscreen is an independent screen that is displayed in an area of another (“main”) screen !ubscreens allow you to embed one screen within another at runtime "ou can include multiple sub#screens on main screen $he term subscreen applies both to the screen that you embed% and the area on the main screen in which you place it $his tutorial is about subscreen areas $he actual screens created through !&' transaction% are called subscreen screens if defined in screen attributes hen you use a subscreen% the flow logic of the embedded screen is also embedded in the flow logic of the main screen*ence% +sing subscreens on screens is like using includes in ABAP programs $o use a subscreen% you must follow three simple steps Define the subscreen area(s) on a screen , Define suitable subscreen screens - .nclude the subscreen screen in the subscreen area Also% you need to ad/ust the frame of sub#screen and main screen "ou need to name it in the field name field 0urther% you also need to ad/ust the fields within the subscreen to make them appear in main screen .n case the sub#screen is defined to be larger than the a1ailable area in the main screen% only the part of subscreen will be 1isible that fi ts in the the area a1ailable $he area is always measured from the top left corner of screen *ence you should take ade2uate care while defining sub#screen areas and creating sub#screens EXAMPLE 0or instance here we ha1e defined two sub#screen areas on main screen and ha1e attached two different !ub#screen to corresponding areas hene1er main screen is called% the PB3 of main screen

Upload: assign7997061

Post on 08-Jan-2016

8 views

Category:

Documents


0 download

DESCRIPTION

ABAP - Subscreens

TRANSCRIPT

Page 1: ABAP - Subscreens

7/17/2019 ABAP - Subscreens

http://slidepdf.com/reader/full/abap-subscreens 1/3

ABAP | Subscreens

Before you read this tutorial make sure you what a Dialog Program is …

Subscreens

A subscreen is an independent screen that is displayed in an area of another (“main”) screen

!ubscreens allow you to embed one screen within another at runtime "ou can include multiple

sub#screens on main screen

$he term subscreen applies both to the screen that you embed% and the area on the main

screen in which you place it $his tutorial is about subscreen areas $he actual screens created

through !&' transaction% are called subscreen screens if defined in screen attributes

hen you use a subscreen% the flow logic of the embedded screen is also embedded in the

flow logic of the main screen *ence% +sing subscreens on screens is like using includes in ABAP

programs

$o use a subscreen% you must follow three simple steps

Define the subscreen area(s) on a screen

, Define suitable subscreen screens

- .nclude the subscreen screen in the subscreen area

Also% you need to ad/ust the frame of sub#screen and main screen "ou need to name it in the field

name field

0urther% you also need to ad/ust the fields within the subscreen to make them appear in main screen

.n case the sub#screen is defined to be larger than the a1ailable area in the main screen% only the part

of subscreen will be 1isible that fi ts in the the area a1ailable $he area is always measured from the

top left corner of screen *ence you should take ade2uate care while defining sub#screen areas and

creating sub#screens

EXAMPLE

0or instance here we ha1e defined two sub#screen areas on main screen and ha1e attached two

different !ub#screen to corresponding areas hene1er main screen is called% the PB3 of main screen

Page 2: ABAP - Subscreens

7/17/2019 ABAP - Subscreens

http://slidepdf.com/reader/full/abap-subscreens 2/3

is called But before display% the PB34s of each screen attached with sub#screen areas on main screen

are also called

"ou can include a subscreen screen using the 5A66 !+B!57&&8 statement in the flow logic of the

main screen

$o include a subscreen screen in the subscreen area of the main screen and call its PB3 flow logic% use

the following statement in the PB3 e1ent of the main screen9

P735&!! B&037& 3+$P+$

5A66 !+B!57&&8 :area; .856+D.8< =:prog;> :dynp;

$his statement assigns the subscreen screen with number :dynp; to the subscreen area called

:area; "ou can also specify the program in which the subscreen screen is defined (optional) .f you

do not specify the program e?plicitly% the system looks for the subscreen screen in the same ABAP

program as the main program .f it does not find a corresponding subscreen screen% a runtime error

occurs $he PB3 flow logic of the subscreen screen is also included at the same point $his can call

PB3 modules of the ABAP program in which the subscreen screen is defined At the end of the

subscreen PB3% the global fields from the program are passed to any identically#named screen fields in

the subscreen screen $he PB3 flow logic of the subscreen screen can itself include further subscreens

$he name :area; of the subscreen area must be entered directly without in1erted commas "ou can

specify the names :prog; and :dynp; either as literals or 1ariables .f you use 1ariables% you must

Page 3: ABAP - Subscreens

7/17/2019 ABAP - Subscreens

http://slidepdf.com/reader/full/abap-subscreens 3/3

declare and fill identically#named 1ariables in the ABAP program $he screen number :dynp; must be

@ characters long .f you do not assign a subscreen screen to an area% it remains empty

$o call the PA. flow logic of the subscreen screen% use the following statement in the PA. flow logic of

the main screen9

P735&!! A0$&7 .8P+$

5A66 !+B!57&&8 :area;

$his statement includes the PA. flow logic of the subscreen screen included in the subscreen area

:area; in the PB3 e1ent $his can call PA. 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 PA. e1ent is triggered% or at the corresponding 0.&6D statements in

the PA. flow logic of the subscreen screen

Points to Remember

8ames of elements of sub#screens within a screen should be uni2ue

"ou should not ha1e 3 53D& or 053D& attached with sub#screen $he 3 53D& of main

screen itself is 3 53D& of sub#screen

!ub#screens cannot ha1e any dialog modules containing !&$ $.$6&BA7% !&$ P0#!$A$+!% !&$

!57&&8% 6&AC& !57&&8 or 6&AC& $3 !57&&8 $his will cause runtime error

"ou need to call it in the flow logic (both PB3 and PA.) of the main screen

5A66 !+B!57&&8 is not allowed in 5*A.8 &8D5*A.8 and 633P &8D633P statements

5an not ha1e an A$ & .$#53EEA8D module

$he fields that you use are the global fields $hey must be declared in the top include

.f using subscreens from another dialog program the data transfer will not happen unless you

add specific code