How to Upload a Standard Modulepool Program

Module pool programming

You are reading a preview.

Activate your 30 day free trial to continue reading.

  •  
  1. i. Module pool programming By – SUDHIR KUMAR
  2. two. Module pool programming 1 Introduction 2 Syntax Clarification iii Demonstration 4 Exercises five HelpMe 2
  3. 3. Purpose For performing any kind of task in SAP R/3 organization, a transaction is used. SAP provides a standard set up of transactions to manipulate data in the organization. Just sometimes, the need to create a customer specific transaction arise due to following reasons : Standard SAP may not back up that task. A item transaction needs to exist customized to suit the client requirements . A transaction is defined every bit a sequence of dynpros(sap term for screens) having input and output fields and corresponding processing logic behind them to perform particular task. 3
  4. iv. Use user-friendly user interface. format and consistency checks for the information entered by the user. an easy way of correcting wrong entries. access to data by storing it in the database. 4
  5. v. Module puddle programming 1 PrepareMe ii Syntax description 3 Sit-in 4 Exercises 5 HelpMe v
  6. half dozen. Developing Module pool Program Tools used: ABAP Editor(SE38) – To maintain primary ABAP programme. Program contains data declarations and modules. Screen Painter(SE51)– used to maintain components of screen. Menu Painter(SE41) – Used to design GUI. Maintain Transaction(SE93) – To create transaction code for program. Object Navigator (Repository Browser)(SE80) - You should always use the object navigator for online programs because you will be able to run into the hierarchy. From this hierarchy list, y'all volition be able to co-operative to the Screen Painter, ABAP Editor, Carte du jour Painter, and ABAP Dictionary. 6
  7. 7. Creating a Program Create a program using transaction SE38. Program name as Z_MODULE_TRAINING. Program type should be Module Puddle. Save and activate the programme. Use object navigator(SE80) to further develop the object. 7
  8. 8. Program Construction Module pool program when viewed from SE80 transaction will have structure as below, viii
  9. 9. Assigning transaction code Dialog program is executed using transaction code. We tin not execute this like normal written report using execute or pressing F8 button. Transaction is created using SE93 transaction or from object browser past right clicking on transaction, click on create. Give proper noun and clarification and select the radio button Plan and screen (dialog transaction) 9
  10. 10. Utilize of Screen Screen is a interface between user and SAP. Using screen user can provide input to plan and in turn plan will display result on screen. Screen is made up of screen elements such equally text box, input/output field, cheque box, radio button etc.  One of the strength is that screen elements are combined with the ABAP dictionary to allow check the consistency of the data that user has entered. 10
  11. 11. Screen Painter To beginning the Screen Painter, choose the corresponding pushbutton on the initial screen of the ABAP Workbench or enter Transaction SE51. Best practice is to go to transaction SE80, enter programme name and you lot tin perform ane of the beneath, 1. Create new screens. 2. Exam an existing screen. 3. Create new components for an existing screen . Screen is e'er created for an existing plan. 11
  12. 12. Developing Screen From Object navigator (SE80) nosotros can create the screen as shown, Click on Screen, right click and select create option. Now enter screen number. 12
  13. 13. Developing Screen A screen number must exist unique and upwardly to 4 numbers long. All screen numbers higher up 9000 are reserved for Sap's customers. The number thou is reserved for table screens and report selection screen. Usual exercise is to have screen numbers starting with 100 so keep as 200, 300. Enter screen number and click on create. 13
  14. xiv. Developing Screen Enter description and salvage. Bank check the screen and activate it. 14
  15. fifteen. Screen Attributes Short description – Describes screen purpose Original linguistic communication – Default logon language Package – Identifies the package with which screen is saved Last inverse on/by – Date & time screen is last changed Last generation – Engagement & fourth dimension screen is concluding generated. 15
  16. 16. Screen Attributes Screen Type –  Normal – Default setting Subscreen – To betoken the screen as a subscreen Modal dialog box – used to brandish details in a dialog box. Used for data input, confirmation/mistake/help messages. Selection screen – Identifies selection screen. The system sets this attribute automatically. Settings Agree data – On checking this, system tin can hold entries fabricated on the screen at runtime. System automatically displays this data if the user calls the particular screen over again. 16
  17. 17. Screen Attributes Settings Switch off runtime compress – On setting this selection, the screen is not compressed at runtime. If you hide fields dynamically at runtime, empty lines may appear on the screen and the processing may take longer time. Template non executable – If this attribute is set: ·  The screen cannot be generated or activated and therefore cannot be executed. ·   The screen is not included in the screen consistency checks during the extended program check. This attribute is primarily for internal use by SAP. Concur scroll position – On setting the attribute, the coil position is retained when the user returns to the screen after processing another screen. Without application tool bar – To suppress the brandish of the application toolbar belonging to the current programme status. Other Attributes Side by side Screen – Next screen number to exist displayed. 17
  18. eighteen. Screen Attributes Other Attributes Cursor position – Identifies the screen chemical element that contains the cursor when a screen is first displayed. If yous leave this field blank, the organization uses the first screen field that can accept input. Screen group – Specifies a four-character identifier of a group of associated screens. Line/Columns – Occupied – Specifies the size of the screen expanse currently occupied with screen elements Maintained – Size of the screen in rows/columns. Context card – It will agree a routine proper name required to prepare the context carte du jour in the plan. This routine connects the screen (elements) from the Screen Painter to the context card of the program. Input/output fields , Text fields, Table controls, Subscreens Global Class CL_CTMENU , methods- LOAD_GUI_STATUS, ADD_FUNCTION, ADD_MENU etc.. 18
  19. 19. Screen Layout Manner The Screen Painter has a layout editor that you lot use to design your screen layout. It works in two modes:  Graphical way – Drag and drop interface is used, similar to a drawing tool. Alphanumeric mode – Keyboard and menus are used for designing. Both modes offer the same functions simply apply different interfaces. Graphical way of screen designing is commonly used. 19
  20. 20. Screen Designing Nosotros have learnt about creating a screen. To start screen blueprint, click on layout button on screen. Graphical Screen painter volition beginning loading. 20
  21. 21. Components of Layout Editor Element palette – Used for creating screen elements. These can be drag & dropped on screen. Work Surface area – Screen design is washed in this area. Element bar – screen element attributes appear in this line. You can also change these attributes in the corresponding field. 21
  22. 22. Screen Components Screen element properties can be seen in detail past double clicking on the element. Properties of an element can be set here, such every bit variable length, F4 help, input/output, fashion of brandish etc.  Best practice is to define screen elements by adopting the respective field from the ABAP Dictionary. However, you lot tin too use field descriptions that you defined in your programme. To do this yous must generate the program kickoff. 22
  23. 23. Screen Elements Screen elements are, Each chemical element will take unique proper noun. Text field Function code will be assigned for push button buttons, tab titles in tab strip Input/Output field controls, Input/output fields with the "Dropdown box" aspect. Cheque box Each element will have its position on screen, visible/definite length, mode of display etc. Radio button Push button Tab strip Box Sub screen area Table control Custom control Status Icon 23
  24. 24. Screen Elements Push Push – Can be placed on screen past drag & drop from Element palette. To set the properties, double click on it. Each screen element should accept unique proper noun. In addition to that push button push will have text and function lawmaking assigned to it. 24
  25. 25. Screen Elements Once screen is designed, it should be saved and checked for errors and activated. Screen looks equally below, 25
  26. 26. Testing Screen Screen can tested by executing F8 or click on push button 26
  27. 27. Testing Screen 27
  28. 28. Flow Logic Default flow logic for any screen is generated as shown beneath, 28
  29. 29. Carte du jour Painter In all programs GUI consists of a menu bar, a standard toolbar, an application toolbar and title bar. A program'south GUI is created in Menu Painter. To Create a Bill of fare for a screen, in menstruation logic uncomment MODULE STATUS_0400. in PBO issue Procedure Before OUTPUT. MODULE STATUS_0400. PROCESS Subsequently INPUT. * MODULE USER_COMMAND_0400. 29
  30. 30. Menu Painter Now double click on STATUS_0400. A pop upward window will appear. Click on Yep. Module volition be created as below, *&---------------------------------------------------------------------* *& Module STATUS_0400 OUTPUT *&---------------------------------------------------------------------* module STATUS_0400 output. * SET PF-Condition 'xxxxxxxx'. * SET TITLEBAR 'xxx'. endmodule. " STATUS_0400 OUTPUT 30
  31. 31. Menu Painter Uncomment the line Gear up PF-Condition 'xxxxxxxx'. a nd supercede 'xxxxxxxx' with name 'STATUS_400'. Click on STATUS_400. Click Yes on the popular-up. 31
  32. 32. Menu Painter Enter description and choose the status type as Normal screen which is default. 32
  33. 33. Menu Painter Click on to expand the carte bar, application toolbar and role keys. System and Assist are default in carte bar 33
  34. 34. Creating Carte bar To create a user defined carte du jour enter the proper noun of the carte du jour and double click on it. We can ascertain options for the bill of fare here as below, 34
  35. 35. Creating Application Tool bar Awarding tool bar can also be created in same way as card bar. 35
  36. 36. Assigning function keys We can assign code to existing part keys. Simply keys for which code is assigned will be agile. We can see this when the menu painter is executed. 36
  37. 37. Execution We can test the carte painter by clicking on F8 key or execute button Enter a screen number and title if y'all desire to simulate a whole screen. If yous do not enter a screen number, the organization simulates the condition using an empty test screen. 37
  38. 38. Execution Output as below, New Menu is added, Observe Item in Application tool bar, Save, Back & Print push button on standard tool bar enabled. 38
  39. 39. More on Menstruum Logic Period logic refers to code backside the screens. It is the lawmaking that processes a screen. Flow Logic commands are different than ABAP commands (e.thou., IF … ENDIF is not valid in Period Logic). Dynamic Processor (DYNPRO) controls the menses logic and prepares data to be displayed on the screen. 39
  40. forty. More on Flow Logic Each screen has its own Flow Logic which is divided into 4 main events: • PROCESS BEFORE OUTPUT (PBO) - event candy before the screen is displayed. • Procedure Later INPUT (PAI) - consequence processed later on the user has invoked a function code (due east.g., clicked on a pushbutton) or pressed the 'Enter' central. • Process on Value Asking (POV) - Triggered when the user requests field help (F1) Each screen must be generated. If you make a change to any component of a screen, the screen must be re-generated earlier execution. 40
  41. 41. Keywords supported Keywords supported by flow logic events are as below, Keyword Function MODULE Calls a dialog module in an ABAP program FIELD Specifies the bespeak at which the contents of a screen field should be transported ON Used in conjunction with FIELD VALUES Used in conjunction with FIELD CHAIN Starts a processing chain ENDCHAIN Ends a processing concatenation Call Calls a sub screen LOOP Starts processing a screen tabular array ENDLOOP Stops processing a screen tabular array 41
  42. 42. PBO Consequence By default the module created in PBO event volition exist like MODULE STATUS_<screen number> Ex:-MODULE STATUS_0100.  This module will be processed before the screen is displayed. By default this module will exist commented. To use this uncomment and double click on information technology to get the module created. *&---------------------------------------------------------------------* *& Module STATUS_0100 OUTPUT *&---------------------------------------------------------------------* module STATUS_0100 output. * SET PF-Status 'XXX'. * SET TITLEBAR 'xxx'. endmodule. " STATUS_0100 OUTPUT 42
  43. 43. PBO Upshot Menu bar and title bar tin can be set in this module. Bill of fare Bar- To set carte du jour bar uncomment the SET PF_STATUS and give a name to condition as , Fix PF-STATUS 'STATUS100'. Double click on STATUS100 and click yes to create GUI condition. 43
  44. 44. PBO Event Title Bar To assign a championship uncomment Ready TITLEBAR and give a name every bit, Gear up TITLEBAR 'TITLE100'. Double click on TITLE100 and click aye to create GUI championship. Enter title as beneath and click on , salvage and actuate. Once all the modules in the PBO block are processed, the system copies the content of the fields in the ABAP piece of work area to their respective fields in the screen work surface area. 44
  45. 45. PAI Consequence Default module in PAI issue will exist MODULE USER_COMMAND_<screen number>. Ex:- MODULE USER_COMMAND_0100. This upshot is triggered once the user invokes function lawmaking or presses Enter cardinal on the screen. System variable SY-UCOMM will concur the function code assigned to the screen elements (push button, radio button, cheque box etc). Within the higher up module code has to written to co-operative to group of code based on the function lawmaking from SY-UCOMM. The arrangement copies the contents of the fields in the screen work area to their corresponding fields in the ABAP work area once user clicks Enter key on screen or any function code is invoked. 45
  46. 46. PAI Consequence- Sample Code *&---------------------------------------------------------------------* *& Module USER_COMMAND_0100 INPUT *&---------------------------------------------------------------------* MODULE user_command_0100 INPUT. CASE sy-ucomm. WHEN 'ENT'. SELECT ebeln ebelp bukrs INTO Respective FIELDS OF TABLE it_po FROM ekpo WHERE ebeln = po_no. WHEN 'BCK'. LEAVE TO SCREEN 0. ENDCASE. ENDMODULE. " USER_COMMAND_0100 INPUT 46
  47. 47. Includes To have structured manner of code it is best exercise to accept includes. There should be a TOP include which will have the data declarations. Include for PBO modules, include for PAI modules. Include for POV and POH modules if whatever. 47
  48. 48. Includes To create include correct click on object name, select Include from the Create menu. 48
  49. 49. Includes We can gave the include names as Z<Programme>_TOP, Z<Plan>_PBO, Z<Program>_PAI. This will help to empathize which modules are covered in each include. Each include program will insert a include statement in the main program. 49
  50. 50. Message Statement The "Bulletin" statement is used to issue user messages. Syntax is MESSAGE <tnnn> [WITH <var1> <var2> <var3> <var4>]. t – Bulletin type nnn –Bulletin Number WITH – This is optional. Information technology is needed if variables are used in a bulletin. A message can contain up to four variables, indicated with an ampersand (&) in the message text. Nosotros can code the Message statement in the PAI event. 50
  51. 51. Message Types Southward:success I I: data A: abend X: leave West: warning E: mistake X The bulletin type determines where the message is displayed and what activity the user can or must take on the current screen. 51
  52. 52. Messages Success message is displayed at the bottom of the screen. If you have adjacent screen so the bulletin will be displayed at the bottom of the next screen. Information message is displayed in a dialog box in same screen. After pressing Enter fundamental on dialog box user will be taken to adjacent screen. The user is not restricted from going on to the next screen. 52
  53. 53. Messages Abend message is displayed on the electric current screen in a dialog box. The user cannot make any changes to the values on the current screen. Afterwards pressing the 'Enter' key on the dialog box, transaction will be terminated. Leave bulletin is identical to the ABEND message except that the transaction is terminated with a brusk dump instead of the message in a dialog box. Alert message is displayed at the lesser of the electric current screen. On pressing the 'Enter' cardinal on the electric current screen, the user will be taken to the next screen even if no changes were fabricated on the electric current screen . Thus user is not restricted from going on to the next screen. 53
  54. 54. Messages ERROR message is displayed at the bottom of the current screen. The user must make changes to the values on the current screen. On pressing the 'Enter' key on the current screen, the user will exist taken to the side by side screen only if the appropriate corrections were made on the current screen. If no corrections were fabricated, the mistake message would be redisplayed at the bottom of the electric current screen. When a warning or error message is triggered the system will end at current screen, prompting the user to make corrections. All the same the input fields on the screen will be disabled for input. 54
  55. 55. Treatment Fault messages There are 2 ways to effect mistake/alarm messages. − Upshot an error or warning message with the Menses Logic SELECT statement. − Define valid values for a screen field with the Menstruum Logic VALUES statement. FIELD argument is a Flow Logic command, not an ABAP control. The purpose of the "FIELD" argument is to keep a single screen field open for input afterwards an mistake or warning bulletin is issued. FIELD statement is used in PAI effect. Syntax is: FIELD <screen field> MODULE <module name>. 55
  56. 56. FIELD with select statement Screen field tin be validated confronting entry in database table. To validate Purchase order number in PAI module, Procedure Afterward INPUT. field PO_NO module PO_CHECK. MODULE USER_COMMAND_0100. Module PO_CHECK is as beneath, module po_check input. data: lv_ebeln blazon ekko-ebeln. select single ebeln into lv_ebeln from ekko where ebeln = PO_NO. if sy-subrc ne 0. message e003(Z6). endif. endmodule. " po_check INPUT 56
  57. 57. Error for invalid input Error for Purchase gild when invalid number is entered. 57
  58. 58. FIELD with Values Check The Menstruum Logic VALUES statement defines a set of valid values for the screen field specified in the FIELD statement.  If the value entered in this field is not in the valid set, an mistake message will be issued by the organization. Procedure AFTER INPUT. field PO_NO values ('1', '100'). This indicates PO_NO can take input every bit either ane or 100. For any other value system volition through error and the field will be open for input. With VALUES parameter for field, we can get a list of possible values by clicking on the drop-down arrow of the screen fields or pressing the 'F4' fundamental. It will listing the values mentioned. 58
  59. 59. Values option PO_NO with values 1 and 100. 59
  60. 60. CHAIN Argument To keep multiple screen fields open for input later on an error or warning message is displayed, you need to utilise the "Concatenation" and "ENDCHAIN" Flow Logic commands.  These statements group the "FIELD" statements and the "MODULE" statements together.  The basic syntax of these statements is: Concatenation.   FIELD: <f1>, <f two>,...   MODULE <mod1>.    FIELD: <g1>, <g 2>,...    MODULE <mod2>. ... ENDCHAIN. If an error or warning message is issued in <module proper noun>, all the screen fields listed in the "FIELD" statements will be open for input. threescore
  61. 61. Cursor Position By default, the cursor volition be positioned in the first field open for input on a screen. Cursor position can exist changed in ii ways – 1. By setting the cursor position in PBO effect- Syntax - Set up CURSOR FIELD <field name> Cursor volition be placed on the screen field mentioned. 2. Cursor position in screen attributes- Mention the field name where cursor to be placed on screen in cursor position attribute . 61
  62. 62. Screen commands The Exit SCREEN statement ends the current screen and calls the subsequent screen. When the organization encounters the "SET SCREEN <screen #>" ABAP statement, it temporarily overrides the "Next Screen" attribute with this <screen #> and the PAI processing continues. After all PAI modules are executed, the system goes to the PBO outcome of <screen #>. 62
  63. 63. Screen commands "LEAVE TO SCREEN <screen #>" ABAP statement, terminates the screen's PAI effect and immediately goes to the PBO of <screen #>. The "LEAVE TO SCREEN <screen #> statement performs the functionality of ii statements: "SET SCREEN <screen #>" and "Exit SCREEN". "Phone call SCREEN <screen #>" ABAP statement, temporarily suspends the current screen's PAI processing and immediately goes to the PBO effect of <screen #>. When control returns dorsum to the "calling" screen, its PAI processing will resume. 63
  64. 64. More than on PAI modules All modules listed in the PAI event get executed from peak to bottom. We tin can command the execution of the modules using additions to MODULE. Additions are,  ON INPUT  ON Request  AT EXIT-Control  AT CURSOR-SELECTION 64
  65. 65. ON INPUT With the "ON INPUT" addition to the "MODULE" argument, a module volition be executed only if the specified field's value is not equal to the initial value appropriate to its information type  Ex- blanks for graphic symbol fields and zeroes for numeric fields. The basic syntax for this provisional execution Flow Logic command is: − FIELD <screen field> MODULE <module> ON INPUT. − The PAI <module> will be executed just if the value in <screen field> is non equal to its initial value. − The "ON INPUT" addition must be used with a "FIELD" statement because this condition depends on the value of a detail field. If you desire to conditionally execute a module that is coded within a "CHAIN … ENDCHAIN", you must use "ON CHAIN-INPUT". 65
  66. 66. ON Asking With the "ON REQUEST", a module will exist executed just if a value has been entered in the specified field since the screen was displayed.  The basic syntax for this conditional execution Flow Logic command is: FIELD <screen field> MODULE <module> ON REQUEST. − The PAI <module> will exist executed just if a value was entered in <screen field> since the screen was displayed. − The "ON REQUEST" addition must be used with a "FIELD" statement because this condition depends on the value of a particular field. If you lot want to conditionally execute a module that is coded within a "Concatenation … ENDCHAIN", you must use " ON Concatenation-Request". 66
  67. 67. AT Go out-COMMAND With the "AT EXIT-Command" improver to the "MODULE" statement, a module will be executed just if the user invokes a function code with the 'E' function type.  Office type assigning is explained in slide 73. The bones syntax for this conditional execution Flow Logic command is: MODULE <module> AT Get out-Command. 67
  68. 68. AT EXIT-Control − The PAI <module> volition be executed but if the user invokes a FUNCTION blazon 'Eastward'. − The "AT Exit-Command" addition cannot be used with a "FIELD" statement. If the user invokes a type 'E' function lawmaking, a module with the "AT Exit- COMMAND" addition will be executed immediately.  Information technology will be executed even earlier the automatic field checks. 68
  69. 69. Assigning Function type Function type tin exist assigned for screen buttons and for menu painter keys. In menu painter, click on the required key. In the pop-upward window select function type every bit 'E' from driblet down. 69
  70. 70. AT CURSOR-Selection You can specify that a module should only be called if the cursor is positioned on a particular screen element. Syntax - MODULE <mod> AT CURSOR-Option . The module <mod> is called whenever the part code of the user action is CS with function type S. The module is chosen in the sequence in which it occurs in the flow logic.  It does not bypass the automatic input checks. 70
  71. 71. AT CURSOR-SELECTION You lot tin also combine this MODULE statement with the FIELD statement: FIELD <f> MODULE <mod> AT CURSOR-Pick. For more than one field: CHAIN.   FIELD: <f1>, <f 2>,...   MODULE <mod> AT CURSOR-SELECTION. ENDCHAIN. 71
  72. 72. Modifying Screen Fields All fields of the current screen are stored in the organization tabular array SCREEN with their attributes. The LOOP AT SCREEN statement places this information in the header line of the system tabular array. We can modify the attributes of the fields and update the screen table using Modify SCREEN. Sample code: loop at screen. if screen-name = 'GV_MATNR'. screen-input = 1. modify screen. endif. endloop. 72
  73. 73. Modifying Screen Fields You tin dynamically modify the following attributes of a field: − ACTIVE − REQUIRED − INPUT − OUTPUT − INTENSIFIED − INVISIBLE − LENGTH − Display 3D − VALUE Assist A field attribute is turned "on" with a value of 1. It is turned "off" with a value of 0. The statements LOOP AT SCREEN ... ENDLOOP ascertain a loop around a statement cake. 73
  74. 74. Logical Unit of measurement of Work (LUW) Screen Screen Screen ane 2 three SELECT A UPDATE A DELETE B SELECT B Database Database Database Transaction Transaction Transaction LUW refers to a collection of actions performed at the database level as a complete unit. In this ex: LUW is selecting A and B from the database, updating A, and deleting B. This would be the desired LUW because nosotros would want to rollback all changes if any of these actions failed. 74
  75. 75. LUW Changes will be saved (commit work) in database at the cease of tertiary screen. An SAP LUW will end with either the COMMIT WORK or ROLLBACK Work statement. A logical unit of measurement consisting of dialog steps, whose changes are written to the database in a single database LUW is chosen an SAP LUW. If an SAP LUW contains database changes, you should either write all of them or none at all to the database. Include a database commit when the transaction has ended successfully, and a database rollback in example the plan detects an error. 75
  76. 76. LUW Since database changes from a database LUW cannot be reversed in a subsequent database LUW, you must make all of the database changes for the SAP LUW in a unmarried database LUW. In our example, we demand to perform UPDATE A and DELETE B at the end of third screen. 76
  77. 77. SAP Locks R/three system contain lock mechanism for SAP LUWs chosen SAP Locks. Lock object is created in ABAP Dictionary. A lock object definition contains the database tables and their key fields on the basis of which you want to set a lock. System automatically generates ii office modules with the names ENQUEUE_<lock object name> and DEQUEUE_<lock object name> when a lock is generated. Locks can be set and released on corresponding database table by calling these function modules in program. 77
  78. 78. SAP Locks Consider beneath example, When user clicks on change, the programme locks the relevant database object past calling the corresponding ENQUEUE function. You tin can release the lock by calling DEQUEUE role when user clicks on SAVE or when user clicks on BACK push. 78
  79. 79. Table Control A table control is an area on the screen where the organization displays information in a tabular grade. It is processed using a loop. To create a table command, drag & drop table command from screen elements on screen painter. Give a name to tabular array control. Select the tabular array definition and fields clicking on Dictionary/Programme fields object push. Each table control need to exist alleged in announcement office of the program as, CONTROLS <ctrl> TYPE TABLEVIEW USING SCREEN <scr>. where <ctrl> is the proper name of the tabular array control on a screen. 79
  80. 80. Tabular array Control You must lawmaking a LOOP statement in both the PBO and PAI events for each table in your screen. This is because the LOOP statement causes the screen fields to exist copied back and forth between the ABAP plan and the screen field.  For this reason, at to the lowest degree an empty LOOP...ENDLOOP must exist there. eighty
  81. 81. Table Control Sample code - PROCESS Before OUTPUT. MODULE STATUS_0100. LOOP AT it_po INTO wa_ekpo WITH Control tab2 CURSOR tab2-current_line. ENDLOOP. Process Afterward INPUT. field po_no module po_check. module exit_mod at exit-command. MODULE USER_COMMAND_0100. loop at it_po. endloop. 81
  82. 82. Tab Strip Controls Use – − To requite circuitous applications a uniform structure and make it easier for users to navigate between their components. − To make the structure of the application easier for users to larn and understand. 82
  83. 83. Tab Strip Command components Components of tab strip control Tab Championship – Title of the component to which user tin navigate. They are push buttons. 83
  84. 84. Tab Strip Control components Tab title row - All tab titles will announced in a row. Tab Folio - A tab page contains a collection of fields that logically vest together. Tab pages are implemented using subscreens. Tab Surroundings - The screen surround effectually the tabstrip must remain constant. When you lot change between tab pages, the menus, application toolbar, and other fields exterior the tabstrip command must non change. For designing and using tab strip controls, meet Transaction BIBS . 84
  85. 85. Footstep loops Step loops are considerable less flexible than table controls. Used to grouping screen elements together. A step loop is a repeated series of loop blocks. A loop block consists of i or more loop lines of graphical screen elements. Loop blocs can be defined equally stock-still or variable. − In a stock-still loop, the lower limit of the loop area always remains as originally defined. − For a variable loop, the number of repetitions is adapted dynamically in the screen program to suit the size of the current window. 85
  86. 86. Creating a Footstep loop Open up a screen in the layout editor. In one or more lines, create the elements you desire to repeat. Select all the elements on the desired line(south) as a group. Choose Edit Grouping  Pace loop Define. Your element lines now make up a single step loop cake. The block includes the original elements with their attributes and a predefined number of repetition blocks. Each repetition contains a re-create of the beginning cake without attributes.  The repetition blocks are consecutively numbered, so that you can institute a reference to a item line. 86
  87. 87. Step loops To utilise a Step-Loop cake in an online program, you lot must create one work expanse for the Step-Loop block. To hold all the lines of a Step-Loop block in the program's retention expanse, utilize an internal table. Ex:-TYPES: BEGIN OF TY_REC, MATNR TTPE MARA-MATNR, MATKL Blazon MARA-MATKL, End OF TY_REC. Information: GT_MARA TYPE TABLE OF TY_REC WITH HEADER LINE. For Pace loop the menstruation logic statement loop must exist coded in both PBO and PAI event. 1 grade of the Flow Logic "LOOP" argument is; LOOP. . . . <menses logic statements> . . . ENDLOOP. 87
  88. 88. Subscreen A subscreen is a screen that is displayed in a specified area of the main screen.  A subscreen cannot be displayed by itself. The subscreen displayed in the predefined expanse will depend on the user'south request on the main screen. Subscreen is used to vary the fields displayed on a screen. As an example: − The "chief" screen contains the customer number, name, and a predefined area for a subscreen. − 1 subscreen contains customer address information. − Another subscreen contains customer depository financial institution information . 88
  89. 89. Creating Subscreen In master screen, − In the screen layout, place the screen chemical element 'subscreen' on layout. − Yous can set the length and width of the subscreen by double clicking on subscreen. − Provide unique name to subscreen, salve and actuate information technology. Subscreen 89
  90. xc. Creating Subscreen  Create a subscreen − Create a screen as given in earlier slides. − Screen type should exist subscreen. − Specify the screen length and tiptop equally in principal screen. − Save the subscreen and go to screen layout. Here subscreen are volition be displayed. 90
  91. 91. Creating Subscreen User can pattern in the subscreen expanse as below, 91
  92. 92. Telephone call subscreen in PBO To include a subscreen in a predefined expanse on the "master" screen, utilise the "Phone call SUBSCREEN" statement in the "principal" screen'southward PBO issue. syntax : CALL SUBSCREEN <area> INCLUDING <programme> <subscreen #>. − <area> : name of the subscreen area defined on the "main" screen. This subscreen area will be the location of the subscreen. This <area> cannot be enclosed in single quotes. − <program> : proper noun of the plan where the subscreen exists. 92
  93. 93. Telephone call subscreen in PBO − <subscreen #> : number of the subscreen to brandish in the subscreen surface area. − The <programme> and <subscreen #> can be literals (i.e. enclosed in single quotes) or variables. When the "CALL SUBSCREEN" argument is encountered in the "main" screen'southward PBO event, the system executes the PBO issue of the subscreen. Then, the system returns to finish the PBO effect of the "main" screen . 93
  94. 94. Telephone call subscreen in PAI If the subscreen contains any PAI code, use the "Telephone call SUBSCREEN" statement in the PAI consequence of the "main" screen. Syntax : CALL SUBSCREEN <area>. − The <surface area> is the proper noun of the subscreen area defined on the "main" screen. This <surface area> cannot be enclosed in single quotes. The "CALL SUBSCREEN" statement must be used to invoke the PAI upshot of the subscreen. - When the "CALL SUBSCREEN" statement is encountered in the "main" screen's PAI event, the arrangement executes the PAI result of the subscreen. 94
  95. 95. Call subscreen in PAI − Then, the system returns to finish the PAI event of the "master" screen. − Without this "CALL SUBSCREEN" statement in the PAI consequence of the "chief" screen, the PAI event of the subscreen cannot be processed by the system. If the subscreen does not contain any PAI code, this "CALL SUBSCREEN" statement is not needed in the PAI effect of the "main" screen. In both the PBO and PAI of the "main" screen, the "Call SUBSCREEN" statement cannot be used inside a "LOOP" or a "CHAIN". 95
  96. 96. Main screen Flow logic Main screen period logic for calling subscreen. PROCESS Before OUTPUT. MODULE STATUS_0100. call subscreen SUB1 including 'Z_MODULE_TRAINING' '0110'. Process AFTER INPUT. telephone call subscreen SUB1. MODULE USER_COMMAND_0100. 96
  97. 97. Subscreen Restrictions The following ABAP/4 statements cannot be used in a subscreen's PBO or PAI modules (instead, they must be used in the "main" screen): − SET PF-Status − SET TITLEBAR − SET SCREEN − Exit TO SCREEN − CALL SCREEN − Note: These ABAP/4 statements in a subscreen will pass a syntax check; even so, they will result in runtime errors. 97
  98. 98. Additions with ABAP OOPS Enjoy SAP controls (ALV Grid , ALV Tree, HTML controls etc) can be displayed in screen. To place these grids we need to have screen element Custom Control placed on the screen. Likewise we need to accept ABAP OOPS cognition. ( Refer package SLIS for examples) 98
  99. 99. Process on Assistance This upshot is a user programmed aid. If the user presses the 'F1' fundamental with the cursor is positioned in <screen field>, the <supplemental documentation> will be displayed forth with the information element'southward short text and documentation. The only other Period Logic argument that tin be used in the POH event is: FIELD <screen field> MODULE <module>. 99
  100. 100. Procedure on Value This consequence is a user-programmed help that occurs when the user presses F4 with the cursor positioned on a screen field. The modules specified in the subsequent FIELD statement is called instead of the SAP help. Syntax is: FIELD <screen field> MODULE <module>. 100
  101. 101. Module pool programming 1 PrepareMe 2 Syntax Description three Demonstration four Exercises 5 HelpMe 101
  102. 102. Demonstration Please refer the attached document for demo example. Microsoft Word Certificate 102
  103. 103. Module pool programming 1 Introduction ii Syntax Description 3 Demonstration 4 Exercises v HelpMe 103
  104. 104. Exercises Please refer the attached documents for easily-on. Practice 1 – This covers input/output, radio button, table control, screen navigation, flow logic events, Menu painter. Microsoft Word Exercise 2 – This covers tab Document strip, subscreen, table control, four flow logic events, screen navigation, carte painter. Microsoft Word Document 104
  105. 105. Module pool programming 1 Introduction 2 Syntax Description three Sit-in 4 Exercises v HelpMe 105
  106. 106. HelpMe Refer help.sap.com Refer Transaction code ABAPDOCU (check in drop down ABAP User Dialogs) for documentation and examples For screen elements and controls (table control, tabstrip) refer transaction BIBS. Refer package SLIS for examples of ALV grids, ALV Tree. 106

  • Module pool programs are besides chosen as dialog programs, Online programs or transactions These programs are a collection of screens, their Menses Logic, and the lawmaking within the main ABAP plan. The term "screen" refers to the actual, concrete image that the users sees. The term "catamenia logic" refers to the code behind the screens (i.east., the logic that initializes screens and responds to a user's requests on the screens). Each screen has its own Menses Logic. The term "dynpro" (dynamic program) refers to the combination of the screen and its Menstruation Logic. Menu will also have user interface for ABAP programs.
  • Sample code: loop at screen. if screen-name = &apos;GV_OBJ_ID&apos;. screen-input = 1. change screen. endif. endloop. This will enable the screen field GV_OBJ_ID for input. SCREEN is an internal table provided by SAP.
  • stroblehicked.blogspot.com

    Source: https://www.slideshare.net/sghosh89/module-pool-programming

    0 Response to "How to Upload a Standard Modulepool Program"

    Post a Comment

    Iklan Atas Artikel

    Iklan Tengah Artikel 1

    Iklan Tengah Artikel 2

    Iklan Bawah Artikel