SAP Executable ABAP Report SAPMN1PB documentation. Module Pool for 'Call. Dialog is a module pool program. Welcome to SAP ABAP Interview Questions. Basics of ABAP: Modulepool Program (Transaction Program). Transaction, in R/3 system is an operation that lets the user make necessary changes to the database. The entire R/3 system is nothing but set of business transaction. The data transfer from old system to SAP R/3 database, or modifying data, or deleting data, which is not required, is done through transaction. The special transaction monitor called the SAP dispatcher handles the sequence of steps that takes place in any transaction. The main task of transaction is to update database table. ALV Grid in Module Pool. Hence for the sub screen we call sub screen including program name and screen number. Classical Report of Single Table 2. The database table is not updated until a transaction is completed. All changes can be rolled back if the transaction has not finished. There can be single screen or multiple screens depending upon the transaction. So this step can consist of single step or multiple steps. In this phase you prepare database record. Actual updating of database table takes place in this phase. My Experiments with ABAP. Context Menu in Module Pool Program. PROGRAM: Introduces a module pool or subroutine pool: REPORT. Calls a function module: CALL METHOD: Calls a method. And all these codes are stored in a table TSTC. Consider the case where one user is modifying a record, and second user is trying to delete the same record. If the second user is successful in deleting the record then the first user will face problem for modifying the record that is already deleted. The avoid such situation, R/3 system has provided Logical Unit of Work, which is defined as a locking mechanism to protect transaction integrity. Of course, there are other measures, which ensures data integrity like check table i. Within SAP system there are three types of transaction and may be distinguished as. It can be defined as a period in which operation requested must be performed as a unit, i. At the end of LUW, either of the database changes are committed or rolled back. One SAP LUW can have several databases LUW. So a set of a database is either committed or rolled back. The special ABAP/4 command COMMIT WORK, marks the end of a SAP LUW. Is made up of a set of related task combined under one transaction code. ABAP/4 transactions are for programming environment, in which ABAP/4 transaction functions like one complete object containing screens, menus and transaction codes. Also user can set his own locking mechanism. The LUW starts when a lock entry in the system table is created, and it ends when the lock is released. This tool allows you to design screen, process screen through program and update the database table. SAP has provided one and only one way to update the database table, i. Though you can update database table by using open SQL statement through program, SAP usually doesn’t recommend this kind of updating. Many standard transactions are available to update standard table but if the need arises, the developer should be able to develop new transaction, which allows the updating of database tables. This can be achieved by using various components of screen painter. Following are the few concepts and steps for creating entire new transaction. Dynpro concept. A dynpro refers to the screen + flow logic. With screen painter you can develop screen and flow logic. The relationship between screen, flow logic, and program can be shown as follows. Dynpro, as figure indicates consist of screen and flow logic and places exactly one call to module pool program. A transaction consists of many screens and for each screen flow logic is attached. When the transaction is executed, the screen places a call to flow logic and flow logic in turn places a call to module pool program. In module pool program too, events get triggered and these events are handled in flow logic. Flow logic editor is subset of ABAP/4 editor. The system automatically displays the two important events for the flow logic. Normally, you select NORMAL option for usual R/3 screen. Other options available are SUBSCREEN & MODAL DIALOG BOX. Modal dialog box is used to establish independent and interactive dialog box while subscreen is screen within screen. Here you need to specify the next screen number, which must be processed after the current one. You can go to full screen editor. From screen attribute screen. By pressing full screen editor pushbutton. Or From initial screen of screen painter. There are two modes available with full screen editor. The graphical mode works similarly to typical window application. Steps involved in the placing of fields on the screen are as follows. Click the pushbutton Dict/program fields on the full screen editor Or Goto . Various components of dictionary can be attached to this element like search help, foreign key. Any pushbutton is associated with function code as in menu item in menu painter. When the user clicks the pushbutton this code is stored in OKCODE. This OKCODE is created by system without a name and is not visible on the screen. In ABAP/4 this field is work field and is nothing but an area wherein system stores the variable and is the last field of the field list and is invisible, hence user needs to give the name OKCODE. It is not mandatory to give the name OKCODE; developer can give any name to this field. Later the screen is processed and processing of screen is done by flow logic. PAI and PBO. This event is triggered before the screen is displayed. The processing of screen before the display of screen is done in this event. For example, filling in default values in the screen fields. The processing of screen can include displaying another screen, or just displaying list or quitting the transaction itself and many more things. Usually it is displaying another screen. These operations can be carried out in the PAI event. OKCODE plays an important role in this operation. You can handle this event when the user presses F4 key by writing code for the same in module pool program. Normally when the user presses F4, list of possible values is displayed. You can add your own functionality to the Help button by writing code for the same in the POH event. Normally, for reports, on line executable programs are written but for transaction, Module Pool Programs are written. The module pool program contains only modules to handle various events associated with screen and data declaration statements. These are global field, PBO modules, and PAI modules. It is entirely user’s decision whether to use these modules or write directly into main program. Type of program should be given . The control is passed to Module Pool Program. Module Pool Program handles the code for these events and again passes back control to the flow logic and finally to screen. Unlike on line program, in this case, the control remains with flow logic. The switching of control between flow logic and module pool program and back is common process when user executes transaction. Creation of a Complete Transaction. Steps involved to create a complete transaction. Function code can be handled as follows: During the Designing of the screen, a function code is assigned to pushbutton. LEAVE TO SCREEN 0. ENDCASE. ENDMODULE. LEAVE TO SCREEN 1. ENDCASE. ENDMODULE. BACK button, he comes back to main screen. Flow logic for screen 1. PROCESS AFTER INPUT. MODULE INPUT. Flow logic for screen 2. PROCESS AFTER INPUT. USER. In case of transaction transfer of data from program to screen is automatic i. The fields, which you define in the screen receives the data from program and displays the same. Data entered in the database table should be valid and correct. Data entered is validated at each and every point. ABAP/4 offers various methods to validate data and those are as follows. These checks are performed by the system automatically when the user enters the data for the screen field. System performs these checks before PAI event is triggered. Types of field checks performed by system are as follows: . Entry checkbox, the field becomes mandatory. When the transaction is executed if user leaves this particular field blank, the system displays error message. User cannot proceed until the user enters some data. Whenever data is entered, system checks for the proper format of the data. Each user has its own format for date, which is defined in the user master record. If the date defined in the user master record is in the format DD/MM/YYYY, if the user enters the date, say, in YY/DD/MM, the user displays the error message. System also checks for the value of month or days. For example if month entered is greater than twelve then the error message is displayed. Whenever the user enters the data, the system checks for the check table values. Also in Domain, if you have fixed values, then the system checks for these values. In this case, you are restricting value of a screen field. This cannot be achieved by automatic field check. Hence there is a need of additional validation. It can be done in flow logic by using following statement. Field - -- -- -- -- -- -- -- Values. Syntax. PAI. Field sflight- carrid values (. If the value entered happens to be wrong, that field is enabled for user to enter. If you have multiple Field statements in your flow logic, it is sequential execution. Consider the following case: PAI. The system will give invalid value or some previous value as the field sflight- carrid is used in module before it is checked i. The field is not available to the system unless it executes the field statement. Field statement transfers the values to the program and is done only once. If you don’t have Field statement in your flow logic, transfer of values takes place in PAI event. Field Sflight- carrid values (. Many times if the user enters wrong value for one field, then you might want to give option to user to enter all the fields, which is not possible by using Field statement only. This functionality can be achieved by Chain – endchain. The field price will be disabled for input. Usually, logically related fields are grouped together with Chain- Endchain statement. The next screen displayed depends upon the attributes of first screen. In attributes you need to give Next Screen number i. These are static attributes of the screen.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2017
Categories |