ERP Database - The Unofficial ERP Knowledge Base

Facebook Twitter del.icio.us Digg it
ERP Database contains a huge collection of articles related to ERP System and Software. Many of the articles are specifically related to SAP. All these ERP/SAP articles are freely available to everyone.

If you would like to submit an article or share any document related to ERP or any specific ERP software. Please mail it to support@erpdb.info. Please make sure that the documents are not copyrighted.
Social Bookmarks:

Create a Program in SAP ABAP

Print This Post Email This Post Written by admin on Nov 21st, 2011 | Filed under: ABAP, ABAP Programs

You can navigate to the ABAP Editor through the Menu. You can also create favorites for certain transactions and put it into your custom menu. You can type SE38 from anywhere in the SAP environment to redirect you to the ABAP editor (must come out to a Area Menu or prefix transaction code with /n). Tools such as the Function Builder, Data Dictionary, Screen Painter and Menu Painter are integrated to the ABAP editor and you can navigate to the Editor and load the corresponding program by double-clicking on a program name on a Program field. The ABAP Editor can be used to create Programs of different types (Module Pool, Report, Include, Subroutine Pool, etc.)

Steps to create a Program in SAP ABAP

Creating Program Step 1

Create Program in SAP ABAP 1

  • As indicated before, the ABAP Editor can be used to create Module Pool (Dialog Programs), Report Programs (which output lists or reports by accessing the database), Includes (non executable programs which can be included into a main program), Subroutine Pool (a collection of subroutines which can be reused) and several other types of programs.
  • On the ABAP Editor: Initial Screen, a program name should be given and “Create” push button needs to be pressed.
  • A Developer Key maybe required for the specific user to create/edit programs. This is supplied by SAP.
  • All custom programs should begin with “Z” or “Y” if they are report programs.
  • There are other specific conventions that need to be used for creation of custom Module Pools (SAPMZxxxxx), custom Subroutine Pools (SAPFZxxxxx), etc. which are covered in later topics.

Creating Program Step 2

Create Program in SAP ABAP 2

  • Enter the Title (a description), Type (such as Executable Program, Module Pool, etc. Right now enter Executable Program)
  • Choose an Application and a Status for the Program (these are all informational attributes)
  • The checkbox for “Fixed Point Arithmetic” is mostly checked. This is to indicate that Fixed point arithmetic will be used to perform all calculations. If it is not checked, packed numbers (Decimals in ABAP) will be treated as integers when used in assignments and calculations.
  • By checking the “Editor Lock” checkbox, one could prevent other users from making changes to the program.
    Once all the attributes have been filled, press the “Save” Button.

Creating Program Step 3

Create Program in SAP ABAP 3

  • Enter the development class in this dialog box. A Development class groups together a set of related ABAP workbench objects. Programs, Tables, Structures, Menus, Screens, Messages, and even data can be assigned a development class.
  • A Development class is particularly useful when transporting Objects from one SAP “Instance” (R/3 system) to another.
  • You could create a new development class from the Object Navigator (also called the Repository Browser).
    An object can be created as a Local Object which would be specific to the user. A development class $TMP is assigned to such local objects.
  • Local Objects cannot be transported to other SAP Instances.

Creating Program Step 4

Create Program in SAP ABAP 4

  • If a valid development class had been assigned in the previous step (NOT applicable for “Local Objects”), then the system asks for a transport request.
  • A transport request is used to track the changes and can be used to:
    • Group related changes to a request number
    • Pull back changes made against a certain request number
    • Transport objects to another SAP Instance
  • Transports are managed in a Correction and Transportation System (CTS) which can be accessed by the transactions SE01, SE09 and SE10.

Creating Program Step 5

Create Program in SAP ABAP 5

  • The program now appears in the editor. ABAP code can be incorporated into the program after the “REPORT” statement.
  • If a check syntax is run on the program, any syntax errors are thrown on the same window on the bottom portion. Clicking on a syntax error takes you to the appropriate line.
  • Correct the errors (if any).
  • Activate the program (Ctrl+F3 can be used as a shortcut) before executing it.
  • All programs need to be activated before executing.

 

Share

If you like this post, you may as well like these too:

  1. ABAP Program: Sample program for OLE Automation REPORT ZSOURCE2801. * Including OLE types INCLUDE OLE2INCL. * Tables and variables for later use TABLES: CUSTOMERS. DATA: APPLICATION TYPE OLE2_OBJECT, WORKBOOK TYPE OLE2_OBJECT, SHEET TYPE OLE2_OBJECT, CELLS TYPE OLE2_OBJECT....
  2. SAP ABAP Program Types Each ABAP program has a type, which is defined in the program attributes. What is the purpose of all the different program types? The program type determines which processing blocks...
  3. ABAP Program to Send External Mail from SAP Here is a ABAP program which would allow you to send mail to any external system from SAP. Ensure that you have all the required configurations done by the basis...
  4. Generate Temporary ABAP Program Ever had a need to create a temporary program during the run time. Here is a simple program which will allow you to learn that. REPORT ZSOURCE2501. * Internal table...
  5. Call an ABAP program from a BSP Call an ABAP program from a BSP is somehow impossible due to memory context handling for a web transaction like a BSP. If you try, it would lead to an...
  6. ABAP Program to Send Mail with Attachment This ABAP program use the function module ‘SO_NEW_DOCUMENT_ATT_SEND_API1′ to send the email with attachment. There are five steps involved in sending the email with attachment. Add Recipients Put in the...
  7. CREATE : ABAP Keyword a day CREATEBasic formCREATE OBJECT obj class.Addition… LANGUAGE languEffectGenerates an object of the class class . To address an OLE automation server (e.g. EXCEL) from ABAP/4 , the server must be registered...
  8. ABAP Program:Reading data from a file REPORT ZSOURCE2602. * Data declarations for later use TABLES CUSTOMERS. PARAMETERS FILENAME(128) DEFAULT '/usr/tmp/testfile.dat' LOWER CASE. DATA: MSG_TEXT(50), ALL_CUSTOMER_NAMES LIKE CUSTOMERS-NAME OCCURS 100 WITH HEADER LINE. * Opening the File...
  9. ABAP Program : Working with Temporary Programs Ever had a need to create a temporary program during the run time. Here is a simple program which will allow you to learn that. REPORT ZSOURCE2501. * Internal table...
  10. ABAP Program:Transferring data to a file (presentation server) REPORT ZSOURCE2603. * Data declarations for later use PARAMETERS FILENAME(128) DEFAULT 'c:usersdefaulttestfile.dat' LOWER CASE. TABLES CUSTOMERS. DATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE. * Get data for file...
  11. ABAP Programs:Sample dialog program (flight reservation) * This program source contains all modules and subroutines of the * flight reservation program, but screen and GUI status definitions * are not included. *&———————————————————————* *&———————————————————————* *& Include MSABBTOP...
  12. ABAP Program: Dynamic external perform (call back form) Here the two programs which are calling dynamically. REPORT ZSOURCE2309. PERFORM EXTFORM IN PROGRAM ZSOURCE2310 USING 'CALL_BACK_FORM' SY-CPROG. FORM CALL_BACK_FORM. WRITE / 'I am the call back form in ZSOURCE2309.'....
  13. ABAP: How to create a dynamic internal table and work area FIELD-SYMBOLS:<fs_table> TYPE STANDARD TABLE, <fs_table_wa> TYPE ANY. DATA: table_ref TYPE REF TO data, wa_ref TYPE REF TO data. DATA: l_structure TYPE dd02l-tabname value 'VBAP'.   CREATE DATA table_ref TYPE STANDARD...



Leave a Reply