Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Abap slide class3


Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Abap slide class3

  1. 1. ABAP workshop Date: 10/28/2009 **DRAFT**
  2. 2. Topics <ul><li>Field, Data Element and Domains </li></ul><ul><li>Flow Events </li></ul><ul><li>Input Help (List of Values) –demo/coding </li></ul><ul><li>Field Help (F1 Help) –demo/coding </li></ul><ul><li>Understanding Menu Bar, Application Toolbar and Function keys </li></ul><ul><li>Menu Control and Function Keys </li></ul><ul><li>Context Menu </li></ul><ul><li>Title Bar </li></ul><ul><li>Demo </li></ul><ul><li>Hands-on Practice </li></ul>
  3. 3. Data Element & Domains of Fields <ul><li>Domain depicts the technical attributes of a field </li></ul><ul><ul><li>its data type, field length, no. of decimal places, appearance on the screen </li></ul></ul><ul><li>Data Element denotes the semantic attributes </li></ul><ul><ul><li>short description, label names for a field that uses this. </li></ul></ul><ul><li>Data Elements are directly attached to the Fields </li></ul><ul><li>Data Element has an underlying Domain (optional) </li></ul><ul><li>Domains are not directly attached to the fields </li></ul><ul><li>A single Domain can be under many Data Elements. </li></ul><ul><li>Within Domain - value range of a field can be described. Whereas within the Data Element parameter id and search help for a particular field can be assigned. </li></ul>Domain Data Element Field Data Element Field
  4. 4. Flow Events <ul><li>PROCESS BEFORE OUTPUT (PBO) </li></ul><ul><ul><li>Fires before a screen is displayed. Can be used to initialize fields. </li></ul></ul><ul><li>PROCESS AFTER INPUT (PAI) </li></ul><ul><ul><li>Fires on an user action (menu/buttons/function-keys) </li></ul></ul><ul><li>PROCESS ON VALUE REQUEST (POV) </li></ul><ul><ul><li>Fires when a set of possible values is requested (F4) </li></ul></ul><ul><li>PROCESS ON HELP REQUEST (POH) </li></ul><ul><ul><li>Fires when general help is requested (F1) </li></ul></ul>
  5. 5. Input Help (List of Values) <ul><li>1) Fixed Value (DOMAIN LEVEL) - Hard coded list in Data Dictionary </li></ul><ul><ul><li>Using domain (of the Data Element) of the field </li></ul></ul><ul><li>2) Check Tables (FIELD LEVEL) </li></ul><ul><ul><li>Specifying the Check table on the Field level </li></ul></ul><ul><li>3) Assigning the &quot;Search Help&quot; repository object (DATA ELEMENT LEVEL) </li></ul><ul><ul><li>Create a &quot;Search Help&quot; Object [as an independent step] and then assign it to data element of the field. </li></ul></ul><ul><li>4) Assigning the &quot;Search Help&quot; repository object (SCREEN ELEMENT LEVEL) </li></ul><ul><ul><li>Create a &quot;Search Help&quot; Object [as an independent step] and then assign it to dynpro screen element in screen painter. </li></ul></ul><ul><li>5) Self defined Dropdown List Boxes (SCREEN ELEMENT LEVEL) </li></ul><ul><ul><li>Most flexible but requires simple SQL to populate the list. </li></ul></ul>
  6. 6. (1) Fixed Value (Domain Level) Domain of the Data Element Data Element of a Field
  7. 7. (2) Check Tables (Field Level) Click on the Foreign Keys Icon
  8. 8. (3 & 4) Search Help (Object) Create ‘ Srch Helps’ Object(s) And attach to the Data Element Or attach directly to the Dynpro field LPos: Field Order SPos: Search Order
  9. 9. Search Help Field Order LPos: Field Order SPos: Search Order
  10. 10. (5) Self defined Dropdown MODULE create_dropdown_box INPUT. dynpro_utilities1=>value_help( ). ENDMODULE. … DATA city_list TYPE STANDARD TABLE OF city_line. SELECT distinct ZCITY ZCITYDESCR from ZCITY_TBL into corresponding fields of table city_list where ZCITY like '%O%' order by ZCITY. CALL FUNCTION ' F4IF_INT_TABLE_VALUE_REQUEST ' EXPORTING retfield = 'ZCITY' value_org = 'S' TABLES value_tab = city_list EXCEPTIONS … Select Listbox or Listbox with key
  11. 11. Field Help (F1 Help) <ul><li>1) Documentation - (only one) can be attached to the Data Element of the Field needing help documentation. </li></ul><ul><li>2) Additional Documentation - (multiple can be attached to the Data Element of the Field needing help ‘additional documentation’), Dynpro screen field can call just one - the one relevant to its context using ‘ PROCESS ON HELP-REQUEST’ Flow Logic . </li></ul><ul><li>PROCESS ON HELP-REQUEST. (assuming 0001 and 0002 are ‘additional documentation’ help is entered/exists) </li></ul><ul><ul><li>FIELD ZBC400_S_HDR_CURR-CITYTO WITH '0001'. </li></ul></ul><ul><ul><ul><ul><ul><li>Or </li></ul></ul></ul></ul></ul><ul><ul><li>FIELD ZBC400_S_HDR_CURR-CITYTO WITH '0002'. etc </li></ul></ul><ul><li>3) Uses the Process on Help Request (POH) event. </li></ul>
  12. 12. Field Help - Documentation Click here in Change Mode to modify (display mode shown) Data Element
  13. 13. Field Help - Additional Documentation PROCESS ON HELP-REQUEST. FIELD field1 WITH '0001'. Or FIELD field1 WITH '0002'. Click here. Add as many as you wish Data Element Call any one Additional help
  14. 14. Menu Control <ul><li>Create GUI Status object (Interface Component) </li></ul><ul><li>Command: SET PF-STATUS 'ZTEST1'. </li></ul><ul><li>Each screen can have same or different menu (set this in PROCESS BEFORE OUTPUT) </li></ul><ul><li>Various menus are: Menu Bar, Standard Tool Bar, Application Toolbar </li></ul><ul><li>Function Keys are generally related to Menu </li></ul><ul><li>Context Menu is inherited from Function Keys,so is same for all fields on screen by default, but… </li></ul><ul><li>Context Menu – each field can be made different </li></ul><ul><li>(ZWRKSHP_010 and ZWRKSHP_010A) </li></ul>
  15. 15. Bars in the SAP GUI Menu Bar Standard Tool Bar Title Bar Application Toolbar Related Item Function Keys F1, F2…
  16. 16. Menu Painter
  17. 17. Menu Painter GUI Status -> ZTEST1 Note: Standard tool bar is shown at the top of the Function Keys Setup! Screen 1/2 Screen 2/2
  18. 18. Function Keys <ul><li>The following Function Keys are reserved and are handled at run time </li></ul><ul><ul><ul><li>F1 (field help), </li></ul></ul></ul><ul><ul><ul><li>F4 (Input Help) </li></ul></ul></ul><ul><ul><ul><li>F10 (positions the cursor in the (top) menu bar) </li></ul></ul></ul><ul><li>Double Click automatically gets the functionality of whatever F2 is setup to do – applies to all fields by default. (see subsequent slides) </li></ul><ul><li>F2 or Double Click can be setup so that different logic can be mapped to individual fields (see ZWRKSHP_010C & subsequent slides) </li></ul>
  19. 19. Double Click (all fields) <ul><li>When we map a/any functionality to F2 , the same functionality is automatically executed when we Double Click the object. </li></ul><ul><li>Example: If we set the F2 to say “BACK1” (also the Function code), the F2 as well as the Double Click get the functionality from the usual ABAP CASE statement logic. </li></ul>… . CASE ok_code. When 'BACK' or 'BACK1'. SET SCREEN 100. … .
  20. 20. Double Click (individual fields) <ul><li>The Function Code for F2 is set to CS (CURSOR-SELECTION) and TYPE to S (System Function). In PAI use the FIELD statement to call a module. </li></ul><ul><li>… </li></ul><ul><li>PROCESS AFTER INPUT. </li></ul><ul><li>FIELD Field1 MODULE C1 AT CURSOR-SELECTION. </li></ul><ul><li>FIELD Field2 MODULE C2 AT CURSOR-SELECTION. </li></ul>Actual module defn: MODULE C1 INPUT. CALL TRANSACTION 'SE13'. ENDMODULE.
  21. 21. Context Menu <ul><li>The Context Menu for a SCREEN is ‘automatically’ defaulted from the ‘ function keys ’ MENU setup done using menu designer – i.e., GUI STATUS </li></ul><ul><li>The Context Menu for individual fields is done using the ON_CTMENU_ field as explained in the subsequent slide. </li></ul>
  22. 22. Context Menu (of field) <ul><li>Using the ON_CTMENU_ field of screen Elements </li></ul><ul><li>FORM on_ctmenu_my_input2 USING l_menu TYPE REF TO cl_ctmenu. </li></ul><ul><li>CALL METHOD l_menu->add_function </li></ul><ul><li>EXPORTING fcode = 'MY_CONTEXT_MENU7’ </li></ul><ul><li>text = 'My Context Menu 7 '. </li></ul><ul><li>… </li></ul><ul><li>CASE save_ok . </li></ul><ul><li>… </li></ul><ul><li>WHEN 'MY_CONTEXT_MENU7'. </li></ul><ul><li>CALL TRANSACTION 'SE92'. </li></ul><ul><li>… </li></ul><ul><li>ENDCASE. </li></ul>
  23. 23. Title Bar <ul><li>THE GUI TITLE is Interface Component </li></ul><ul><li>SET TITLEBAR title. >> Command </li></ul>Create Here Use/Call Here
  24. 24. Upcoming Topics <ul><li>Data Clusters </li></ul><ul><li>File Access </li></ul><ul><li>Authorization Checks </li></ul><ul><li>Lock Concept and Enqueue </li></ul>