Basic Dialog Programming

Hello Everybody and  hello World.
I would like to know how to do a basic dialog programming..
Can anyone help me?Please....
give me some advice....Im very eager to learn that dialog programming
Thanks in advance
aVaDuDz

hi
INTRODUCTION TO DIALOG PROGRAMMING
OVERVIEW
There are programs in every domain that require certain amount of user interaction .Such requirements in ABAP are fulfilled with the help of a user dialog and dialog programming which encapsulates the entire logic pertaining to the required user dialog.
One needs to take care that user interactions with the system are comfortable and user friendly along with being logically coherent.
<u><i><b>
What is a user dialog?</b></i></u>
Any kind of user interaction with the system can be called as a user dialog:
1)     Entering data on the screen.
2)     Clicking a button.
3)     Navigation between screens.
<u><i><b>Need of dialog programming</b></i></u>
In a typical dialog, the system displays a screen on which the user can enter or request information. As a reaction on the user input or request, the program executes the appropriate actions: it branches to the next screen, displays an output, or changes the database.
Example
A travel agent wants to book a flight. The agent enters the corresponding data on the screen. The system either confirms the desired request, that is, the agent can book the flight and the customer travels on the desired day on the reserved seat to the chosen destination, or the system displays the information that the flight is already booked up.
To fulfill such requirements, a dialog program must offer:
• A user-friendly user interface
• Format and consistency checks for the data entered by the user
• Easy correction of input errors
• Access to data by storing it in the database.
ABAP/4 offers a variety of tools and language elements to meet the requirements stated above in the dialog programs.
<u><i><b>Why dialog programming is also known as module pool?</b></i></u>
Dialog Programming consists of screens and corresponding ABAP program. Screens call dialog modules in the associated ABAP program from their flow logic. Type M programs serve principally as containers for these dialog modules, and hence dialog programming is also known as module pools. A module pool program is a program type which is not executable directly. You can not just run by hitting F8 like a report program. You must tie a transaction code to a screen in order to start the program.
VARIOUS COMPONENTS OF A DIALOG PROGRAM
Unlike report, interface or any conversion development which generally entails the creation of one autonomous program which can be executed independently of other objects, dialog program development entails development of multiple objects none of which can be executed on its own. Instead all objects are linked hierarchically to the main program and are executed in a sequence dictated by the Dialog Main Program.
Components of a dialog program
1)     Transaction
2)     Screen
3)     GUI status
4)     ABAP program
All these components are explained in detail below.
1)     TRANSACTION  :
The transaction starts a screen sequence. You create transaction codes in the Repository   Browser in the ABAP Workbench or using Transaction SE93. A transaction code is linked to an ABAP program and an initial screen. As well as using a transaction code, you can start a screen sequence from any ABAP program using the CALL SCREEN statement.
2) SCREEN
As a user of an R/3 system, one is always confronted with screens. From the moment one logs on, one can see a screen and one must perform actions on this screen. All those screens are components of ABAP programs. Generally, we define the screens of an ABAP program with the Screen Painter tool of the ABAP.
In the R/3 system, screens are program objects that consist of two parts. First, they have a layout that defines the front end appearance of the window that is presented to the user. Second, they have a flow logic that is executed on the backend by the application server. The screen flow logic is a program layer between the front end and the actual ABAP application program at the backend. The language used to program screen flow logic has a similar syntax to ABAP, but is not part of ABAP itself. Unlike ABAP programs, the screen flow logic contains no explicit data declarations. You define the screen fields by placing elements on the screen mask instead. When you define screen fields by referring to data types in the ABAP Dictionary, the runtime environment automatically creates dialogs for field help, input help, and error handling that depends on the semantics of the data type in the dictionary.
The screen flow logic is similar to an ABAP program in that it contains processing blocks. These processing blocks are event blocks that are triggered by the ABAP runtime environment. The most important event blocks are:
• PROCESS BEFORE OUTPUT
The respective event (PBO) is triggered after the PROCESS AFTER INPUT (PAI) processing of the previous screen and before the current screen is displayed.
• PROCESS AFTER INPUT
The respective event (PAI) is triggered when the user chooses a function on the current screen.
• PROCESS ON HELP REQUEST
This event is triggered when function key F1 is pressed.
• PROCESS ON VALUE REQUEST
This event is triggered when function key F4 is pressed.
The main task of these processing blocks is to call ABAP dialog modules using the MODULE statement. During the PBO event, you can call any dialog module in the ABAP program that is marked with the addition OUTPUT. In the PAI event, you can call any dialog module program that is marked with the addition INPUT. The screens of an ABAP program can share the dialog modules of that program. You use the dialog modules called during PBO to prepare the screen and the dialog modules called during PAI to react to the user input.
Each screen of an ABAP program has a unique screen number. The screens of an ABAP program can be combined to form screen sequences. Screen sequences are either built statically by setting the following screen in the Screen Painter or dynamically by overriding the static setting in the ABAP program. The last screen of a screen sequence is always the one where the following screen is set to zero.
HANDLING USER INTERACTIONS
A user can interact in various ways with screens. We distinguish between actions that trigger PAI and those that don’t. In general, filling input fields with values does not trigger PAI.
Actions that do trigger PAI include:
• Choosing a pushbutton on the screen.
• Choosing a specially prepared check box or radio button on the screen.
• Choosing a function in the menu, standard toolbar, or application toolbar.
• Choosing a function key on the keyboard.
ATTRIBUTES OF SCREEN
Like all objects in the R/3 Repository, screens have attributes that both describe them and determine how they behave at runtime. Important screen attributes for ABAP programming:
•     Program
The name of the ABAP program (type 1, M, or F) to which the screen belongs.
•     Screen number
A four-digit number, unique within the ABAP program that identifies the screen within the program. If your program contains selection screens, remember that selection screens and Screen Painter screens use the same namespace. For example, if you have a program with a standard selection screen, you may not contain any further screens with the number 1000. Lists, on the other hand, have their own namespace.
•     Screen type
A normal screen occupies a whole GUI window. Modal dialog boxes only cover a part of a GUI window. Their interface elements are also arranged differently. Selection screens are generated automatically from the definition in the ABAP program. You may not define them using the Screen Painter. A subscreen is a screen that you can display in a subscreen area on a different screen in the same ABAP program.
•     Next screen
Statically-defined screen number, specifying the next screen in the sequence. If you enter zero or leave the field blank, you define the current screen as the last in the chain. If the next screen is the same as the current screen, the screen will keep on calling itself. You can override the statically-defined next screen in the ABAP program.
•     Cursor position
Static definition of the screen element on which the cursor is positioned when the screen is displayed. By default, the cursor appears on the first input field. You can overwrite the static cursor position dynamically in your ABAP program by using SET CURSOR FIELD <f>
•     Screen group
Four-character ID, placed in the system field SY-DYNGR while the screen is being processed. This allows you to assign several screens to a common screen group. You can use this, for example, to modify all of the screens in the group in a uniform way. Screen groups are stored in table TFAWT.
•     Hold data
If the user calls the screen more than once during a terminal session, he or she can retain changed data as default values by choosing System -> User profile -> Hold data.
VARIOUS SCREEN ELEMENTS
A screen can contain a wide variety of elements, either for displaying field contents, or for allowing the user to interact with the program (for example, filling out input fields or choosing pushbutton functions). We use the Screen Painter to arrange elements on the screen.
We can use the following elements:
•     Text fields
Display elements, which cannot be changed either by the user or by the ABAP program.
•     Input/output fields and templates
Used to display data from the ABAP program or for entering data on the screen. Linked to screen fields.
•     Dropdown list boxes
Special input/output fields that allow users to choose one entry from a fixed list of possible entries.
•      Checkbox elements
Special input/output fields that the user can either select (value ‘X’) or deselect (value SPACE). Checkbox elements can be linked with function codes.
•     Radio button elements
Special input/output fields that are combined into groups. Within a radio button group, only a single button can be selected at any one time. When the user selects one button, all of the others are automatically deselected. Radio button elements can be linked with function codes.
•     Pushbuttons
Elements on the screen that trigger the PAI event of the screen flow logic when chosen by the user. There is a function code attached to each pushbutton, which is passed to the ABAP program when it is chosen.
•     Frame
Pure display elements that group together elements on the screen, such as radio button groups.
•     Subscreens
Area on the screen in which you can place another screen.
•     Table controls
Tabular input/output fields.
•     Tab strip controls
Areas on the screen in which you can switch between various pages.
•     Custom Controls
Areas on the screen in which you can display controls. Controls are software components of the presentation server.
•     Status icons
Display elements, indicating the status of the application program.
•     OK field
Every screen has a twenty-character OK_CODE field (also known as the function code field) that is not displayed directly on the screen. User actions that trigger the PAI event also place the corresponding function code into this field, from where it is passed to the ABAP program. You can also use the command field in the standard toolbar to enter the OK field. To be able to use the OK field, you need to assign a name to it.
All screen elements have a set of attributes, some of which are set automatically, others of which have to be specified in the Screen Painter. They determine things such as the layout of the screen elements on the screen. You can set the attributes of screen elements in the Screen Painter - either for a single element, or using the element list, which lists all of the elements belonging to the current screen. Some of the attributes that you set statically in the Screen Painter can be overwritten dynamically in the ABAP program.
     3) GUI STATUS
Each screen has a GUI status. This controls the menu bars, standard toolbar, and application toolbar, with which the user can choose functions in the application. Like screens, GUI statuses are independent components of an ABAP program. You create them in the ABAP Workbench using the Menu Painter.
4) PROGRAM
Each dynpro refers to exactly one ABAP/4 dialog program. Such a dialog program is also called a module pool, since it consists of interactive modules. Each screen and GUI status in the R/3 System belongs to one ABAP program. The ABAP program contains the dialog modules that are called by the screen flow logic, and also process the user input from the GUI status. ABAP programs that use screens are also known as dialog programs.
In a module pool (type M program); the first processing block to be called is always a dialog module. However, you can also use screens in other ABAP programs, such as executable programs or function modules. The first processing block is then called differently; for example, by the runtime environment or a procedure call. The screen sequence is then started using the CALL SCREEN statement.
DATA TRANSFER BETWEEN SCREEN AND ABAP PROGRAM
During PAI, the system automatically transports all screen fields to identically named global ABAP program fields. At the end of the last PBO module, and before the screen is displayed, all of the data is transported from the ABAP program to any identically named fields in the screen. By standard, all screen data is transported immediately before PAI processing starts. But for the dedicated handling of screen fields — for example, to carry out an error dialog — you can control the moment at which data is passed from screen fields to their corresponding ABAP fields by using the FIELD statement in the screen flow logic.
regards
navjot
reward points if helpfull

Similar Messages

  • Sample basic program 4 dialog programming

    hi
       can any one send me the sample code 4 simple dialog programming....

    Hi Sandy,
    Simple Dialog Programming:
    PROCESS BEFORE OUTPUT.
    MODULE 0250_STATUS.
    LOOP.
    MODULE STATUS_0120.
    ENDLOOP.
    LOOP.
    MODULE STATUS_0110.
    ENDLOOP.
    LOOP.
    MODULE STATUS_0100.
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE REFRESH_0250.
    LOOP.
    MODULE USER_COMMAND_0120.
    ENDLOOP.
    LOOP.
    MODULE USER_COMMAND_0110.
    ENDLOOP.
    For example, if the user enter the Delete Screen, you will make all the Fields non-Editable.
    *& Module 0250_STATUS OUTPUT
    text *
    MODULE 0250_STATUS OUTPUT.
    SET PF-STATUS 'Z250'.
    SET TITLEBAR 'Z250'.
    IF OKSAVE = 'DEL'.
    Make the SAVE Menu button inactive
    SET PF-STATUS 'Z250' EXCLUDING 'SAVE'.
    Make all the Fields non-Editable
    LOOP AT SCREEN.
    SCREEN-INPUT = 0.
    MODIFY SCREEN.
    ENDLOOP.
    ENDIF.
    For example, if the user enter the Modify Screen, you will make all the Fields Group 1 that
    have a 'M' non-Editable.
    You specify the 'M' for Group 1 using the Screen Painter Attribute
    IF OKSAVE = 'MOD'.
    Make the DELE Menu button inactive
    SET PF-STATUS 'Z250' EXCLUDING 'DELE'.
    Make all the Fields Groups 'M' non-Editable
    LOOP AT SCREEN.
    check screen-group1 = 'M'.
    SCREEN-INPUT = 0.
    MODIFY SCREEN.
    ENDLOOP.
    ENDIF.
    CLEAR OKCODE.
    ENDMODULE.
    Regards,
    Priyanka.

  • What is difference between report programming and dialog programming?

    hi,
    what is difference between report programming and dialog programming? plz provide some example code
    bye

    ABAP programming
    Basically reports are used to read database and represent the results in lists.
    Reports are collections of processing blocks that the system calls depending on events.
    We can use reports to evaluate data from database tables.
    Reports are stand alone programs and controlled by events.
    A report itself never creates events
    steps in report:
    Processing the selection screen
    Reading the database
    Evaluating the data and creating lists
    Outputting a list.
    1st u write simple logics, after that u can enhance the code as step by step.
    http://venus.imp.mx/hilario/Libros/TeachYrslfAbap4/index.htm
    http://help.sap.com/saphelp_47x200/helpdata/en/d1/802cfc454211d189710000e8322d00/frameset.htm
    http://www.sapdev.co.uk/reporting/reportinghome.htm
    Dialog Programming
    Structure of a Dialog Program
    A dialog program consists of the following basic components:
    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. 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 (PAI-Process After Input).
    The screen layout fixed in the Screen Painter determines the positions of input/output fields, text fields, and graphical elements such as radio buttons and checkboxes. In addition, the Menu Painter allows to store menus, icons, pushbuttons, and function keys in one or more GUI statuses. Dynpros and GUI statuses refer to the ABAP/4 program that control the sequence of the dynpros and GUI statuses at runtime.
    ABAP/4 module pool
    Each dynpro refers to exactly one ABAP/4 dialog program. Such a dialog program is also called a module pool, since it consists of interactive modules. The flow logic of a dynpro contains calls of modules from the corresponding module pool. Interactive modules called at the PBO event are used to prepare the screen template in accordance to the context, for example by setting field contents or by suppressing fields from the display that are not needed. Interactive modules called at the PAI event are used to check the user input and to trigger appropriate dialog steps, such as the update task.
    All dynpros to be called from within one transaction refer to a common module pool. The dynpros of a module pool are numbered. By default, the system stores for each dynpro the dynpro to be displayed next. This dynpro sequence or chain can be linear as well as cyclic. From within a dynpro chain, you can even call another dynpro chain and, after processing it, return to the original chain.
    Check this link for basics.
    http://sap.mis.cmich.edu/sap-abap/abap09/index.htm
    Check this link for Dialog Programming/Table Control
    http://www.planetsap.com/Tips_and_Tricks.htm#dialog
    Check this SAP Help for Dialog Program doc.
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/content.htm
    Check this SAP Help link for Subscreens.
    http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbabfe35c111d1829f0000e829fbfe/content.htm
    Check this link for subscreen demo program.
    http://abapcode.blogspot.com/2007/05/demo-program-to-create-subscreen-in.html
    Also check this link too.
    http://abapcode.blogspot.com/2007/06/dialog-programming-faq.html
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9cdc35c111d1829f0000e829fbfe/frameset.htm
    http://sap.mis.cmich.edu/sap-abap/abap09/sld004.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/52/670ba2439b11d1896f0000e8322d00/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/52/670c17439b11d1896f0000e8322d00/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/52/670c17439b11d1896f0000e8322d00/frameset.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9ccf35c111d1829f0000e829fbfe/frameset.htm
    http://abapprogramming.blogspot.com/

  • In dialog programming i want to leave the current transaction

    Hi,
    In dialog programming i want to leave the current transaction and come out to the standard   sap initial screen.
    Please advise me how can i apply.
    Thanks.

    Basic question, please search before posting.
    Thread locked.
    Thomas

  • Triggering a workflow through a dialog program

    I tried to trigger a workflow through a dialog program using FM. I also created BOR and workflow(SWDD). The dialog program basically deletes a sales order and then a workflow should trigger.  I am not able to see the email. Am I missing anything here?
    Pls find below the coding..'ZCSS_SO1' is the BO.
    Data : g_objtype LIKE SWR_STRUCT-OBJECT_TYP,
    G_OBJKEY LIKE SWR_STRUCT-OBJECT_KEY,
    G_EVENT LIKE SWR_STRUCT-EVENT.
    data begin of l_input_container occurs 0.
    include structure swcont.
    data end of l_input_container.
    data: v_vbeln like vbak-vbeln.
    g_objtype = 'ZCSS_SO1'.
    g_event = 'DELETE'.
    G_OBJKEY = 'SALESDOCUMENT'.
    CALL FUNCTION 'SWC_ELEMENT_SET'
    EXPORTING
    element = 'ELEMENT'
    field = 'VALUE'
    tables
    container = l_input_container.
    CALL FUNCTION 'SWE_EVENT_CREATE_IN_UPD_TASK'
    EXPORTING
    objtype = g_objtype
    objkey = G_OBJKEY
    event = g_event
    tables
    event_container = l_input_container.
    commit work.

    Hi Chandri,
    You can firstly check whether the code you have written below is triggering the BO event or not by switching on the trace using transaction SWELS , then running the transaction (dialog program mentioned below). After, switch off the trace and then view the trace from transaction SWEL.
    Your BO and event should show up in the trace.
    Regards,
    Aditya
    p.s. also for the mail, check what method u are using?

  • Structure of dialog programming?

    Hi All,
    what is the stucture of dialog program?
    Regards,
    Waseem

    Structure of a Dialog Program
    A dialog program consists of the following basic components:
    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. 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 (PAI-Process After Input).
    The screen layout fixed in the Screen Painter determines the positions of input/output fields, text fields, and graphical elements such as radio buttons and checkboxes. In addition, the Menu Painter allows to store menus, icons, pushbuttons, and function keys in one or more GUI statuses. Dynpros and GUI statuses refer to the ABAP/4 program that control the sequence of the dynpros and GUI statuses at runtime.
    ABAP/4 module pool
    Each dynpro refers to exactly one ABAP/4 dialog program. Such a dialog program is also called a module pool, since it consists of interactive modules. The flow logic of a dynpro contains calls of modules from the corresponding module pool. Interactive modules called at the PBO event are used to prepare the screen template in accordance to the context, for example by setting field contents or by suppressing fields from the display that are not needed. Interactive modules called at the PAI event are used to check the user input and to trigger appropriate dialog steps, such as the update task.
    All dynpros to be called from within one transaction refer to a common module pool. The dynpros of a module pool are numbered. By default, the system stores for each dynpro the dynpro to be displayed next. This dynpro sequence or chain can be linear as well as cyclic. From within a dynpro chain, you can even call another dynpro chain and, after processing it, return to the original chain.
    http://sap.mis.cmich.edu/sap-abap/abap09/sld007.htm

  • Difrence between module pool and dialog programming

    Hi abapers,
    can plz tell me difrence between module pool and dialog programming.

    Hi,
    Actually Dialog Programming is Module pool Programming.
    Please go thru this , see if your dbout gets clear.
    Basic components of dialog program?
    - Screens (Dynpros)
    - Each dialog in an SAP system is controlled by dynpros.A dynpros consists of a screen
    And its flow logic and controls exactly one dialog step.
    - ABAP/4 module Pool.
    Each dynpro refers to exactly one ABAP/4 dialog program .Such a dialog program is also called a module pool ,since it consists of interactive modules.
    Regards,
    Priyanka.

  • Dialog programming and module-pool programming

    Can someone tell em the difference between <b>dialog programming and module-pool programming</b> ?

    Hi Vinod ,
    Actually Dialog Programming is Module pool Programming.
    Please go thru this , see if your dbout gets clear.
    Basic components of dialog program?
    -          Screens (Dynpros)
    -          Each dialog in an SAP system is controlled by dynpros.A dynpros consists of a screen
    And its flow logic and controls exactly one dialog step.
    -          ABAP/4 module Pool.
         Each dynpro refers to exactly one ABAP/4 dialog program .Such a dialog program is also  called a module pool ,since it consists of interactive modules.
    Regards,
    AShwini

  • Beginning Dialog Programming

    Dear Friends,
    I want to begin with dialog programming in ABAP. So, please tell me how to start & where to look out for the good examples. Please tell me about the examples in IDES also.
    Bye,
    Nishant

    Nishant,
    I found the book 'ABAP/4 Programming the SAP R/3 System' critical to my success when I started learning Dialog Programming 2 years ago.
    This book covers other issues as well, but there are a 120 pages devoted to the basics of Dialog Programming.
    It also covers ABAP Objects, reports, interactive reports, and building all types of dictionary objects.
    http://tinyurl.com/9a6t4
    Make sure to get 2nd Edition.
    Hope this helps,
    Brett

  • Imp: Module pool Or Dialog programming

    Hi ,
    I have got  a requirement to work on module pool programming.....Please help me with some documents which explains me about it from scratch clearly .
    Awaiting for ur reply...........

    basics of module pool
    <u><i><b>OVERVIEW</b></i></u>
    There are programs in every domain that require certain amount of user interaction .Such requirements in ABAP are fulfilled with the help of a user dialog and dialog programming which encapsulates the entire logic pertaining to the required user dialog.
    One needs to take care that user interactions with the system are comfortable and user friendly along with being logically coherent.
    <u><i><b>What is a user dialog?</b></i></u>
    Any kind of user interaction with the system can be called as a user dialog:
    1)     Entering data on the screen.
    2)     Clicking a button.
    3)     Navigation between screens.
    <u><i><b>Need of dialog programming</b></i></u>
    In a typical dialog, the system displays a screen on which the user can enter or request information. As a reaction on the user input or request, the program executes the appropriate actions: it branches to the next screen, displays an output, or changes the database.
    Example
    A travel agent wants to book a flight. The agent enters the corresponding data on the screen. The system either confirms the desired request, that is, the agent can book the flight and the customer travels on the desired day on the reserved seat to the chosen destination, or the system displays the information that the flight is already booked up.
    To fulfill such requirements, a dialog program must offer:
    • A user-friendly user interface
    • Format and consistency checks for the data entered by the user
    • Easy correction of input errors
    • Access to data by storing it in the database.
    ABAP/4 offers a variety of tools and language elements to meet the requirements stated above in the dialog programs.
    <u><i><b>
    Why dialog programming is also known as module pool?</b></i></u>
    Dialog Programming consists of screens and corresponding ABAP program. Screens call dialog modules in the associated ABAP program from their flow logic. Type M programs serve principally as containers for these dialog modules, and hence dialog programming is also known as module pools. A module pool program is a program type which is not executable directly. You can not just run by hitting F8 like a report program. You must tie a transaction code to a screen in order to start the program.
    <i><b>VARIOUS COMPONENTS OF A DIALOG PROGRAM</b></i>
    Unlike report, interface or any conversion development which generally entails the creation of one autonomous program which can be executed independently of other objects, dialog program development entails development of multiple objects none of which can be executed on its own. Instead all objects are linked hierarchically to the main program and are executed in a sequence dictated by the Dialog Main Program.
    <u><i><b>
    Components of a dialog program</b></i></u>
    1)     Transaction
    2)     Screen
    3)     GUI status
    4)     ABAP program
    All these components are explained in detail below.
    1)     TRANSACTION  :
    The transaction starts a screen sequence. You create transaction codes in the Repository   Browser in the ABAP Workbench or using Transaction SE93. A transaction code is linked to an ABAP program and an initial screen. As well as using a transaction code, you can start a screen sequence from any ABAP program using the CALL SCREEN statement.
    2) SCREEN
    As a user of an R/3 system, one is always confronted with screens. From the moment one logs on, one can see a screen and one must perform actions on this screen. All those screens are components of ABAP programs. Generally, we define the screens of an ABAP program with the Screen Painter tool of the ABAP.
    In the R/3 system, screens are program objects that consist of two parts. First, they have a layout that defines the front end appearance of the window that is presented to the user. Second, they have a flow logic that is executed on the backend by the application server. The screen flow logic is a program layer between the front end and the actual ABAP application program at the backend. The language used to program screen flow logic has a similar syntax to ABAP, but is not part of ABAP itself. Unlike ABAP programs, the screen flow logic contains no explicit data declarations. You define the screen fields by placing elements on the screen mask instead. When you define screen fields by referring to data types in the ABAP Dictionary, the runtime environment automatically creates dialogs for field help, input help, and error handling that depends on the semantics of the data type in the dictionary.
    The screen flow logic is similar to an ABAP program in that it contains processing blocks. These processing blocks are event blocks that are triggered by the ABAP runtime environment. The most important event blocks are:
    • PROCESS BEFORE OUTPUT
    The respective event (PBO) is triggered after the PROCESS AFTER INPUT (PAI) processing of the previous screen and before the current screen is displayed.
    • PROCESS AFTER INPUT
    The respective event (PAI) is triggered when the user chooses a function on the current screen.
    • PROCESS ON HELP REQUEST
    This event is triggered when function key F1 is pressed.
    • PROCESS ON VALUE REQUEST
    This event is triggered when function key F4 is pressed.
    The main task of these processing blocks is to call ABAP dialog modules using the MODULE statement. During the PBO event, you can call any dialog module in the ABAP program that is marked with the addition OUTPUT. In the PAI event, you can call any dialog module program that is marked with the addition INPUT. The screens of an ABAP program can share the dialog modules of that program. You use the dialog modules called during PBO to prepare the screen and the dialog modules called during PAI to react to the user input.
    Each screen of an ABAP program has a unique screen number. The screens of an ABAP program can be combined to form screen sequences. Screen sequences are either built statically by setting the following screen in the Screen Painter or dynamically by overriding the static setting in the ABAP program. The last screen of a screen sequence is always the one where the following screen is set to zero.
    ATTRIBUTES OF SCREEN
    Like all objects in the R/3 Repository, screens have attributes that both describe them and determine how they behave at runtime. Important screen attributes for ABAP programming:
    •     Program
    The name of the ABAP program (type 1, M, or F) to which the screen belongs.
    •     Screen number
    A four-digit number, unique within the ABAP program that identifies the screen within the program. If your program contains selection screens, remember that selection screens and Screen Painter screens use the same namespace. For example, if you have a program with a standard selection screen, you may not contain any further screens with the number 1000. Lists, on the other hand, have their own namespace.
    •     Screen type
    A normal screen occupies a whole GUI window. Modal dialog boxes only cover a part of a GUI window. Their interface elements are also arranged differently. Selection screens are generated automatically from the definition in the ABAP program. You may not define them using the Screen Painter. A subscreen is a screen that you can display in a subscreen area on a different screen in the same ABAP program.
    •     Next screen
    Statically-defined screen number, specifying the next screen in the sequence. If you enter zero or leave the field blank, you define the current screen as the last in the chain. If the next screen is the same as the current screen, the screen will keep on calling itself. You can override the statically-defined next screen in the ABAP program.
    •     Cursor position
    Static definition of the screen element on which the cursor is positioned when the screen is displayed. By default, the cursor appears on the first input field. You can overwrite the static cursor position dynamically in your ABAP program by using SET CURSOR FIELD <f>
    •     Screen group
    Four-character ID, placed in the system field SY-DYNGR while the screen is being processed. This allows you to assign several screens to a common screen group. You can use this, for example, to modify all of the screens in the group in a uniform way. Screen groups are stored in table TFAWT.
    •     Hold data
    If the user calls the screen more than once during a terminal session, he or she can retain changed data as default values by choosing System -> User profile -> Hold data.
    VARIOUS SCREEN ELEMENTS
    A screen can contain a wide variety of elements, either for displaying field contents, or for allowing the user to interact with the program (for example, filling out input fields or choosing pushbutton functions). We use the Screen Painter to arrange elements on the screen.
    We can use the following elements:
    •     Text fields
    Display elements, which cannot be changed either by the user or by the ABAP program.
    •     Input/output fields and templates
    Used to display data from the ABAP program or for entering data on the screen. Linked to screen fields.
    •     Dropdown list boxes
    Special input/output fields that allow users to choose one entry from a fixed list of possible entries.
    •      Checkbox elements
    Special input/output fields that the user can either select (value ‘X’) or deselect (value SPACE). Checkbox elements can be linked with function codes.
    •     Radio button elements
    Special input/output fields that are combined into groups. Within a radio button group, only a single button can be selected at any one time. When the user selects one button, all of the others are automatically deselected. Radio button elements can be linked with function codes.
    •     Pushbuttons
    Elements on the screen that trigger the PAI event of the screen flow logic when chosen by the user. There is a function code attached to each pushbutton, which is passed to the ABAP program when it is chosen.
    •     Frame
    Pure display elements that group together elements on the screen, such as radio button groups.
    •     Subscreens
    Area on the screen in which you can place another screen.
    •     Table controls
    Tabular input/output fields.
    •     Tab strip controls
    Areas on the screen in which you can switch between various pages.
    •     Custom Controls
    Areas on the screen in which you can display controls. Controls are software components of the presentation server.
    •     Status icons
    Display elements, indicating the status of the application program.
    •     OK field
    Every screen has a twenty-character OK_CODE field (also known as the function code field) that is not displayed directly on the screen. User actions that trigger the PAI event also place the corresponding function code into this field, from where it is passed to the ABAP program. You can also use the command field in the standard toolbar to enter the OK field. To be able to use the OK field, you need to assign a name to it.
    All screen elements have a set of attributes, some of which are set automatically, others of which have to be specified in the Screen Painter. They determine things such as the layout of the screen elements on the screen. You can set the attributes of screen elements in the Screen Painter - either for a single element, or using the element list, which lists all of the elements belonging to the current screen. Some of the attributes that you set statically in the Screen Painter can be overwritten dynamically in the ABAP program.
    Regards
    navjot
    reward points if helpfull

  • Dialog programming, data being washed out in TAB Control

    Hi,
         i am working on dialog programming , in which i am using Table Control  for user input (data is not coming from database table) . everything is going well till assignment of data to internal table but when
    control goes to PBO by any means like pressing ENTER etc. then data being washed out.
    PROCESS BEFORE OUTPUT.
      MODULE TC_CONTROL.
      LOOP AT it_data
             INTO wa_data
             WITH CONTROL tc_control
             CURSOR tc_control-current_line.
        MODULE tc_control_get_lines.
      ENDLOOP.
    PROCESS AFTER INPUT.
    LOOP AT IT_DATA.
        CHAIN.
          FIELD WA_DATA-FREPS_N.
          FIELD wa_data-TOEPS_N.
          FIELD wa_data-PRCH_A.
          FIELD wa_data-SRVC_AMT .
          FIELD wa_data-ACCNT_C.
          FIELD wa_data-AMT_D.
          FIELD wa_data-NARR_X.
          FIELD wa_data-CRPRD_N.
          MODULE tc_control_modify ON CHAIN-REQUEST.
        ENDCHAIN.
      ENDLOOP.
    *Abap program
    MODULE TC_CONTROL OUTPUT.
    DESCRIBE TABLE it_data LINES tc_control-lines.
    ENDMODULE.                 " TC_CONTROL  OUTPUT
    CONTROLS: TC_CONTROL TYPE TABLEVIEW USING SCREEN 1000,
              TC_CONTROL1 TYPE TABLEVIEW USING SCREEN 1000.
    DATA:     G_TC_CONTROLS_LINES  LIKE SY-LOOPC,
              G_TC_CONTROLS_LINES1  LIKE SY-LOOPC.
    *&      Module  tc_control_get_lines  OUTPUT
          text
    MODULE tc_control_get_lines OUTPUT.
    g_tc_controls_lines = sy-loopc.
    move-corresponding it_data to wa_data.
    ENDMODULE.                 " tc_control_get_lines  OUTPUT
    MODULE tc_control_modify INPUT.
    move-corresponding wa_data to it_data.
    MODIFY it_data
        FROM wa_data
        INDEX tc_control-current_line.
    append it_data.
    clear it_data.
    ENDMODULE.                 " tc_control_modify  INPUT
    Please suggest me any clue.
    Thanks in advance
    vijay dwivedi

    Hi ,
    I have understood the problem.
    In your ABAP code replace all the occurrrences of wa_data  with the structurename.
    Use the TABLES keyword to declare the structure .That structure will be same as
    reference table of the table control .
    Here the structure is SPFLI.
    Check the bellow code , it will resolve the issue.
    ABAP code - -
    program  zsdn.
    tables spfli.  " Declare the structure
    data : it_data like table of spfli with header line,
    *wa_data TYPE spfli,  " commented
    w_i type i.
    *CONTROLS TC_CONTROL TYPE TABLEVIEW USING SCREEN 100.
    controls: tc_control type tableview using screen 1000,
    tc_control1 type tableview using screen 1000.
    data: g_tc_controls_lines like sy-loopc,
    g_tc_controls_lines1 like sy-loopc.
    module tc_control output.
      describe table it_data lines tc_control-lines.
    endmodule. " TC_CONTROL OUTPUT
    module tc_control_get_lines output.
      g_tc_controls_lines = sy-loopc.
      move-corresponding it_data to spfli.
    endmodule. " tc_control_get_lines OUTPUT
    module tc_control_modify input.
      move-corresponding spfli to it_data.
      modify it_data
      from spfli
      index tc_control-current_line.
      append it_data.
      clear it_data.
    endmodule. " tc_control_modify INPUT
    module status_0100 output.
      set pf-status 'STAT'.
    *  SET TITLEBAR 'xxx'.
    endmodule.                 " STATUS_0100  OUTPUT
    module user_command_0100 input.
      case sy-ucomm.
        when 'BACK' or 'EXIT' or 'CANCEL'.
          leave to screen 0.
      endcase.
    endmodule.                 " USER_COMMAND_0100  INPUT
    *&      Module  POPLATE_TABLE  OUTPUT
    *       text
    module poplate_table output.
      if it_data is initial.
        select * from spfli into table it_data.
      endif.
    endmodule.                 " POPLATE_TABLE  OUTPUT
    Screen code (Scr no 1000) - -
    PROCESS BEFORE OUTPUT.
      MODULE status_0100.
      MODULE poplate_table.
      MODULE tc_control.
      LOOP AT it_data WITH CONTROL tc_control CURSOR w_i.
        MODULE tc_control_get_lines.
      ENDLOOP.
    PROCESS AFTER INPUT.
      MODULE user_command_0100.
      LOOP AT it_data.
        MODULE tc_control_modify ON CHAIN-REQUEST.
    *    ENDCHAIN.
      ENDLOOP.
    Regards
    Pinaki

  • How to call a dialog program with return value in another dialog program

    Dear All,
    How can I call a dialog program with return value from another dialog program?
    Regards,
    Alok.

    Hi Alok,
    You can you SET/GET parameters to do this.
    This is some information about this.
    To fill the input fields of a called transaction with data from the calling program, you can use the SPA/GPA technique. SPA/GPA parameters are values that the system stores in the global, user-specific SAP memory. SAP memory allows you to pass values between programs. A user can access the values stored in the SAP memory during one terminal session for all parallel sessions. Each SPA/GPA parameter is identified by a 20-character code. You can maintain them in the Repository Browser in the ABAP Workbench. The values in SPA/GPA parameters are user-specific.
    ABAP programs can access the parameters using the SET PARAMETER and GET PARAMETERstatements.
    To fill one, use:
    SET PARAMETER ID pid FIELD f.
    This statement saves the contents of field f under the ID pid in the SAP memory. The ID pid can be up to 20 characters long. If there was already a value stored under pid, this statement overwrites it. If you double-click pid in the ABAP Editor, parameters that do not exist can be created as a Repository object.
    To read an SPA/GPA parameter, use:
    GET PARAMETER ID pid FIELD f.
    This statement places the value stored under the pid ID into the variable f. If the system does not find any value for pid in the SAP memory, sy-subrc is set to 4. Otherwise, it sets the value to 0.
    Thanks,
    SriRatna

  • How to call a Dialog Program from another Dialog Program

    Dear All,
    How can I call a dialog program with return value from another dialog program?
    Regards,
    Alok.

    Hi Alok,
    1. Insted of creating 2 different Dialog program. It's good to create as many screens as you want in same module pool program. Any way you can use the different TCODE for each screen.
    2. Another and The best way is to create a function group and then inside function group use the function 2 module... In the function group define a global variable which will be present for both the function group if they are getting executed in sequence. and inside the Function Module call the screens using command " call screen <screenno>".
    3. You can use set / get parameter to pass values of a field between two dynpro program.

  • Making attributes of field dynamic in dialog program in layout editor.

    hi,
    to make a field required or possible or hidden, we define its attributes in attributes in layout editor.
    is it possible to make attributes of fields that we define in layout editor dynamic ?
    if functional people want to make some field non-mandatory or mandatory then they go in configuration, and do it. so does this mean that the attributes of the fields that we define in layout editor during dialog program can be made dynamic.
    how is this possible ? because attributes are selected using dropdown, its not a code ?
    please help in solving this mystery...

    Screen Modifications --
    <u>demo_dynpro_modify_simple
    demo_dynpro_modify_screen</u>
    <b><u>Please dont forget to reward points</u></b>
    Sudheer

  • Using CheckBox / Radio-Button Control in Dialog Program

    Dear Friends,
    Please let me know the way to use check-box / radio-button control in dialog programs. Where & how to define them & write the logic.
    If possible provide a small example.
    Regards,
    Alok.

    Hi,
    goto tcode abapdocu.. abap user dialogs - screens-processing screens you will get examples for all --pushbutt6ons radiobutton checkboxes everything
    <b>here is a sample code for you</b>
    PROGRAM demo_dynpro_check_radio .
    DATA: radio1(1) TYPE c, radio2(1) TYPE c, radio3(1) TYPE c,
          field1(10) TYPE c, field2(10) TYPE c, field3(10) TYPE c,
          box TYPE c.
    DATA: ok_code TYPE sy-ucomm,
          save_ok TYPE sy-ucomm.
    CALL SCREEN 100.
    MODULE user_command_0100 INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'RADIO'.
          IF radio1 = 'X'.
            field1 = 'Selected!'.
            CLEAR: field2, field3.
          ELSEIF radio2 = 'X'.
            field2 = 'Selected!'.
            CLEAR: field1, field3.
          ELSEIF radio3 = 'X'.
            field3 = 'Selected!'.
            CLEAR: field1, field2.
          ENDIF.
        WHEN 'CANCEL'.
          LEAVE PROGRAM.
      ENDCASE.
    ENDMODULE.
    <b>flow logic:</b>
    PROCESS BEFORE OUTPUT.
    PROCESS AFTER INPUT.
      MODULE user_command_0100.
    regards,
    pankaj singh.
    <i><b>
    reward if helpful</b></i>

Maybe you are looking for