Escolar Documentos
Profissional Documentos
Cultura Documentos
Contents
Introduction Why do we need Dialog programming Differences between report & Dialog programming Structure of a Dialog program Main components in Dialog programming Events Screen painter in ABAP/4 Menu painter in ABAP/4 Interaction between screen painter and ABAP/4 modules How communication is maintained in ABAP/4 modules How to create simple dialog program
Introduction
DIALOG PROGRAMMING
Dialog program is an ABAP development which consists of many screens which when linked together make up an application which allows the user to perform a specific functionality These screens are referred too as dynpros (DYnamic PROgrams) and are made up of the actual user screen and its associated flow logic which are all stored within an SAP module pool. In dialog programming we use the Screen Painter to create screens and program the sequence in which they appear. We write an ABAP/4 program (ABAP/4 module pool) for our screens. This is a collection of dialog modules which are called by the flow logic of our screens. We use dialog programs for both reading and changing database tables.
Screens (dynpros) Each dialog in an SAP system is controlled by dynpros. A dynpro (Dynamic Program) consists of a screen and its flow logic and controls exactly one dialog step.
Flow logic: Calls of the ABAP/4 modules for a screen. The flow logic determines which processing takes place before displaying the screen (PBO-Process Before Output) and after receiving the entries the user made on the screen (PAIProcess After Input).
Screen layout: Positions of the texts, fields, pushbuttons, and so on for a screen Screen attributes: Number of the screen, number of the subsequent screen, and Screen type Field attributes: Definition of the attributes of the individual fields on a screen
You use the Screen Painter and the Menu Painter to create and design screen templates and screen programs. You define the processing logic in an ABAP/4 program (module pool). Data structures are defined in the ABAP/4 Dictionary. You can access these structures from the ABAP/4 program and when defining screen fields.
10
11
Events
12
Events
PBO (Process Before Output) : A processing event which is called before the screen is displayed. Its tasks include the initialization of the screen fields and supply default data values for the screen. PAI (Process After Input) : A processing event taking place after you leave a screen. Its tasks are to process the input data or initiate the update of the database. POH (Process On Help Request) : A processing event taking place when user requests field help (F1) . Process On Help-Request ... Field <f> Module <mod>. ...
13
Events
After the PROCESS ON HELP-REQUEST statement, you can only use the MODULE statement together with the FIELD statement. When the user chooses F1 for a field <f>, the system calls the module <mod> belonging to the FIELD <f> statement. If there is more than one FIELD statement for the same field <f>, only the first is executed. HELP_OBJECT_SHOW_FOR_FIELD :This function module displays the data element documentation for components of any structure or database table from the ABAP Dictionary. You pass the name of the component and structure or table to the import parameters FIELD and TABLE. HELP_OBJECT_SHOW: Use this function module to display any SAP script document. You must pass the document class (for example, TX for general texts, DE for data element documentation) and the name of the document to the import parameters DOKCLASS and DOKNAME.
14
Events
POV (Process On Value Request) : A processing event takes place when user request F4 help. Process On Value Request. ... Field <f> Module <mod>. ... F4IF_FIELD_VALUE_REQUEST: Calls the input help of the ABAP Dictionary dynamically. We can pass the component names of a structure or database table of the ABAP Dictionary to the function module in the import parameters TABNAME and FIELDNAME. The function module starts the ABAP dictionary input help for this component. All of the relevant screen fields are read. If we specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the users selection is returned to the corresponding field on the screen. If we specify the table parameter RETURN_TAB, the selection is returned into the table instead.
15
Events
F4IF_INT_TABLE_VALUE_REQUEST: This function module displays a value list that we created in an ABAP program. The value list is passed to the function module as the table parameter VALUE_TAB. If you specify the import parameters DYNPPROG, DYNPNR, and DYNPROFIELD, the users selection is returned to the corresponding field on the screen. If we specify the table parameter RETURN_TAB, the selection is returned into the table instead.
16
Transaction Flow
17
There are two ways of starting a sequence of screens. 1) Using a Transaction Code 2) From ABAP program
18
When you use a transaction code to start a screen sequence, the corresponding ABAP program is automatically loaded as well. The processing logic of the program is controlled by the screen flow logic. On reaching the end of the screen sequence (next screen 0), the entire program terminates, and control returns to the point from which the transaction was called.
19
20
21
22
Screen objects
23
Screen objects
24
25
26
When a screen is processed, the system table SCREEN contains an entry for each screen object that has been created in the Screen Painter for that screen. The SCREEN table is initialized in the PBO of each screen. It is filled with the screen objects belonging to that screen. You can handle the system table SCREEN like any other internal table, although you do not have to declare it in your program. It is maintained internally by the system, and updated each time a new screen is displayed.
27
2010 2010 Wipro Wipro Ltd Ltd - Confidential Confidential
28
Display/Change
Display/Change
A B
A B
Output field
Input/Output field
SAP AG
29
30
31
Sample Transaction
32
33
34
35
36
Saving Program
Give the title and select the program attributes as TYPE : M Status : S. save it in the package.
37
38
39
40
Defining screens
41
42
43
Screen Attributes
Provide the details and save it.
44
45
46
painter
Screen Layout (Graphical Screen Painter) . To design screens, you use the Screen Painter.
The interface of the graphical Screen Painter contains easy-to-use functions for defining the various screen elements (e.g. input/output fields, field texts, boxes, etc.). You choose each screen element and position it on the screen using the mouse. This is WYSIWYG graphical design using drag-and-drop. To delete screen elements, you select the element with the mouse and then choose Delete. To move screen elements, you use the mouse to drag the element to the required position.
47
48
Screen Layout
Click on lay out it will take to screen painter.
49
50
51
52
53
54
Screen Design
55
56
57
58
59
60
61
62
Transaction creation
Create transaction to test the report.
63
64
Test Transaction
Click on F8 to test the transaction on se93of transaction or give transaction name on command filed or on se80 right click on transaction->execute->direct processing. Provide the carrid and connid in the respective fields and click on display for result.
65
Result
66
Thank You