Screen Exits

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 36

Screen Exits

1
Definition

• Screen exits refer to areas of a main screen reserved by


SAP developers for customers to design their own
screens as customer exits. In these areas you can
display/ enter your own data.

2
Objectives

• Knowing when to apply Screen exits.


• Using an enhancement consisting of Screen exit along
with a Program Exit.

3
Screen Exits

SAP Customer

Field 1 Field 1 Field z

Field 2 Field 2

Field x

Field y

4
Subscreens

SAP R/3
Name System Help






Phone no. 200


Meyer
Last name
SAP R/3
System Help Name Klaus






Phone no.
abcd
45678
200
Last name
SAP R/3

abcd
System Help
  
  

Last name Meyer

P. O. box P. O. box 11334

Fax no. Fax no.


abcd
67890 R

300 300

5
Defining Screen Exits

SAP R/3
System Help
  

Customer
  

Program: SAPMabbc
Screen: 1234

Customer field 1

Subscreen area Customer field 2


abcd

SAP Program: SAPLXyyz


Screen: 0444
PROCESS BEFORE OUTPUT.
...
CALL CUSTOMER-SUBSCREEN abcd
INCLUDING 'SAPLXYYZ' '0444'.
...

6
Calling Subscreens

SAP Customer
SAP R/3
System Help
  
  

Field y
Field z
Subscreen area
abcd

Program: SAPMabbc Screen: .... Program: SAPLXyyz Screen: 0444

PROCESS BEFORE OUTPUT. PROCESS BEFORE OUTPUT.


...
CALL CUSTOMER -SUBSCREEN abcd
INCLUDING 'SAPLXYYZ' '0444' .
...
PROCESS AFTER INPUT. PROCESS AFTER INPUT.
...
CALL CUSTOMER-SUBSCREEN abcd.

7
Transporting Data to Subscreens

SAP Customer
PROCESS BEFORE OUTPUT. PROCESS BEFORE OUTPUT.
... MODULE a.
MODULE export_data. MODULE b.
CALL CUSTOMER- SUBSCREEN abcd
INCUDING 'SAPLXYYZ' '0444' .

Interface FUNCTION-POOL Xyyz .


Program sapmabbc. DATA: g1 LIKE ... , g2 ... .
DATA: f1 LIKE ... , f2 ... . ...
... FUNCTION exit_sapmabbc _001.
MODULE export_data. ...
... e01 MOVE e01 TO g1 .
CALL CUSTOMER - FUNCTION '001' MOVE e02 TO g2 .
EXPORTING e01 = f1 e02 ...
e02 = f2. ENDFUNCTION.
...
ENDMODULE. . MODULE a OUTPUT.
.
. ...
MOVE g1 TO ... .
...

8
Transporting Data from Subscreens

SAP Customer
PROCESS AFTER INPUT. PROCESS AFTER INPUT.
... ...
CALL CUSTOMER-SUBSCREEN abcd. MODULE m.
MODULE import_data. MODULE n.
...

Interface FUNCTION-POOL Xyyz .


Program sapmabbc. DATA k1 LIKE ... , k2 ...
DATA h1 LIKE ... , h2 ... . ...
... FUNCTION exit_sapmabbc _002.
MODULE import_data. ...
... i01 MOVE k1 TO i01 .
CALL CUSTOMER-FUNCTION '002' MOVE k2 TO i02 .
IMPORTING i01 = h1 i02 ...
i02 = h2 ENDFUNCTION.
...
ENDMODULE. . MODULE m.
.
. ...
k1 = ... . R

...

9
Activation

• The subscreen screen is called in the processing logic


of the main screen with the instruction ‘Call CUSTOMER-
SUBSCREEN’. This call is inactive and will be skipped
when the screen is processed until the customer has
activated the relative enhancement screen.

10
To Summarise

Customer
subscreen
Customer
processing

Interface

Data transfer
SAP R/3
System Help
  
  

Subscreen area

11
Example

We will be working with the enhancement ‘MM06E005’ it


has several screen exits but we will be working with the
first screen ‘SAPMM06E’ screen no ‘101’ which will be
calling the sub screen ‘SAPLXM06’ screen no ‘101’ which is
not existing and has to be created.

12
Transaction
Code
‘CMOD’

13
Create a
Project

14
Enter the
short text
and select
Enhancement
assignment

from the
menu or
Application
Tool Bar

15
Enter the Enhancement Name and
save the project.

Note : at any particular point any


enhancement can belong to only one
Project

16
we will display customer no in sub
screen area and display it using
ME23 transaction
(screen shot taken from smod
transaction)

This is where
we will be
working with
17
• Points to be noted while coding
• 1) the global data of the calling module pool is not known to the
function groups belonging to the subscreen.
• 2) The function modules belonging to the program exists lie in the
same function group as the subscreen screen.

18
• PBO (main) PBO (sub)
(YOU) Transfer Displays the
the data to the data in
subscreen subscreen
CALL SUBSCREEN
• PAI (main) PAI (sub)
CALL SUBSCREEN
(YOU) Transfer
Process the data the data to the
received from the main program
subscreen
19
Go to SE51
and create a
new subscreen
‘SAPLXM06’
with screen no
‘0101’

20
Just add the field EKKO-KUNNR
and save it
To display the data here we will have to
export the data in the main program to
memory and then import it from
memory into the subscreen

21
Go to SE51 and display the
main screen
‘SAPMM06E’ with screen no
‘0101’

22
Here we have
to code for
transferring
data to the
subscreen for
display

23
24
Double click on
the user exit
EXIT_SAPMM06E_006

25
Double
click on
the
include
‘ZXM06U36

26
It will ask u
to create a
new object

Click ‘YES’

27
Write Your code
here
i.e. export it to
memory
Generate it and
go back

28
Since I am trying to export EKKO-EBELN
to I have declare this in the function pool
which is of the same name as the
subscreen I.e ‘SAPLXM06’
Go to se38 and give the program name as
‘SAPLXM06’ and display it

29
Since we are trying to
declare the data
double click on the
include ‘LXM06TOP ’

30
Double click
on the include
‘ZXM066TOP’

31
Now do your declaration here
and generate it.

Once this part is done go back


to the flow logic of your
subscreen which you have
created

32
Write your code in the PBO
write a new module pool or
use the existing

MODULE STATUS_0101.
(double click on the module

33
Type in your code here and
generate
(i.e import your data here)
And go back to your flow
logic

34
Generate
your flow
logic here

Go to your project and activate it


35
Thank You

36

You might also like