Screen Exits

36
1 Screen Exits

Transcript of Screen Exits

Page 1: Screen Exits

1

Screen Exits

Page 2: Screen Exits

2

• 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.

Definition

Page 3: Screen Exits

3

• Knowing when to apply Screen exits.• Using an enhancement consisting of Screen exit along

with a Program Exit.

Objectives

Page 4: Screen Exits

4

Screen Exits

SAP Customer

Field 1

Field 2

Field 1

Field 2

Field x

Field y

Field z

Page 5: Screen Exits

5

Subscreens

R

P. O. box

Fax no.

Name

Phone no.

System HelpSAP R/3

Last name

abcd

System HelpSAP R/3

Last name Meyer

abcdName Klaus

Phone no. 45678

System HelpSAP R/3

Last name Meyer

abcdP. O. box 11334

Fax no. 67890

200

300 300

200

Page 6: Screen Exits

6

Defining Screen Exits

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

Program:Program: SAPLXyyz SAPLXyyzScreen:Screen: 04440444

Customer field 1

Customer field 2

System HelpSAP R/3

Subscreen areaSubscreen areaabcdabcd

Program:Program: SAPMabbc SAPMabbcScreen:Screen: 1234 1234

SAP

Customer

Page 7: Screen Exits

7

Calling Subscreens

SAP Customer

Program:Program: SAPMabbc SAPMabbc Screen:Screen: .... ....

PROCESS BEFORE OUTPUT.PROCESS BEFORE OUTPUT.......CALL CUSTOMERCALL CUSTOMER -SUBSCREEN -SUBSCREEN abcdabcd INCLUDINGINCLUDING 'SAPLXYYZ''SAPLXYYZ' '0444''0444' ........PROCESS AFTER INPUT.PROCESS AFTER INPUT.......CALL CUSTOMER-SUBSCREEN CALL CUSTOMER-SUBSCREEN abcd.abcd.

PROCESS BEFORE OUTPUT.

PROCESS AFTER INPUT.

Program: SAPLXyyz Screen: 0444

System HelpSAP R/3

Subscreen areaSubscreen areaabcdabcd

Field y

Field z

Page 8: Screen Exits

8

Transporting Data to Subscreens

SAP Customer

Program sapmabbc.Program sapmabbc.DATA: DATA: f1f1 LIKE LIKE ...... , , f2f2 ...... . .......MODULE MODULE export_data.export_data.......CALL CUSTOMERCALL CUSTOMER --FUNCTION '001'FUNCTION '001' EXPORTING e01 = f1 EXPORTING e01 = f1 e02 e02 = = f2.f2.......ENDMODULE.ENDMODULE.

FUNCTION-POOL Xyyz .DATA: g1 LIKE ... , g2 ... ....FUNCTION exit_sapmabbc _001.... MOVE e01 TO g1 . MOVE e02 TO g2 ....ENDFUNCTION.

MODULE a OUTPUT.... MOVE g1 TO .......

InterfaceInterface

e01e01

e02e02

..

..

..

PROCESS BEFORE OUTPUT.PROCESS BEFORE OUTPUT.......MODULE MODULE export_data.export_data.CALL CUSTOMER-CALL CUSTOMER- SUBSCREEN SUBSCREEN abcdabcd INCUDING 'SAPLXYYZ' '0444'INCUDING 'SAPLXYYZ' '0444' ..

PROCESS BEFORE OUTPUT. MODULE a. MODULE b.

Page 9: Screen Exits

9

Transporting Data from Subscreens

R

SAP Customer

ProgramProgram sapmabbc.sapmabbc.DATADATA h1h1 LIKE LIKE ...... , , h2 h2 .............. MODULEMODULE import_data.import_data.......CALLCALL CUSTOMER-FUNCTION '002' CUSTOMER-FUNCTION '002' IMPORTING IMPORTING i01i01 = = h1h1 i02 i02 = = h2 h2 ......ENDMODULE.ENDMODULE.

FUNCTION-POOL Xyyz .DATA k1 LIKE ... , k2 ......FUNCTION exit_sapmabbc _002.... MOVE k1 TO i01 . MOVE k2 TO i02 ....ENDFUNCTION.

MODULE m.... k1 = .......

InterfaceInterface

i01i01

i02i02

..

..

..

PROCESS AFTER INPUT.PROCESS AFTER INPUT.......CALLCALL CUSTOMER-SUBSCREEN CUSTOMER-SUBSCREEN abcd.abcd.MODULE MODULE import_data.import_data.

PROCESS AFTER INPUT.... MODULE m. MODULE n....

Page 10: Screen Exits

10

• 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.

Activation

Page 11: Screen Exits

11

To Summarise

Data transfer

Customerprocessing

CustomerCustomersubscreensubscreen

Interface

System HelpSAP R/3

Subscreen area

Page 12: Screen Exits

12

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.

Example

Page 13: Screen Exits

13

Transaction Code

‘CMOD’

Page 14: Screen Exits

14

Create a Project

Page 15: Screen Exits

15

Enter the short text and select

Enhancement

assignment

from the menu or Application Tool Bar

Page 16: Screen Exits

16

Enter the Enhancement Name and save the project.

Note : at any particular point any enhancement can belong to only one Project

Page 17: Screen Exits

17

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

Page 18: Screen Exits

18

• 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.

Page 19: Screen Exits

19

• PBO (main) PBO (sub)

• PAI (main) PAI (sub)

(YOU) Transfer the data to the subscreenCALL SUBSCREEN

Displays the data in

subscreen

(YOU) Transfer the data to the main program

CALL SUBSCREEN

Process the data received from the

subscreen

Page 20: Screen Exits

20

Go to SE51 and create a new subscreen

‘SAPLXM06’ with screen no ‘0101’

Page 21: Screen Exits

21

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

Page 22: Screen Exits

22

Go to SE51 and display the main screen

‘SAPMM06E’ with screen no ‘0101’

Page 23: Screen Exits

23

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

Page 24: Screen Exits

24

Page 25: Screen Exits

25

Double click on the user exit

EXIT_SAPMM06E_006

Page 26: Screen Exits

26

Double click on the include ‘ZXM06U36’

Page 27: Screen Exits

27

It will ask u to create a new object

Click ‘YES’

Page 28: Screen Exits

28

Write Your code here

i.e. export it to memory

Generate it and go back

Page 29: Screen Exits

29

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

Page 30: Screen Exits

30

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

Page 31: Screen Exits

31

Double click on the include ‘ZXM066TOP’

Page 32: Screen Exits

32

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

Page 33: Screen Exits

33

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

MODULE STATUS_0101.

(double click on the module

Page 34: Screen Exits

34

Type in your code here and generate

(i.e import your data here)

And go back to your flow logic

Page 35: Screen Exits

35

Generate your flow logic here

Go to your project and activate it

Page 36: Screen Exits

36

Thank You