In this tutorials, you will learn what are the important pre requisites to create an ABAP program in SAP and how to create SAP ABAP program step by step.
Pre-requisites to create SAP ABAP Program
- Name: The program name of SAP Abap should start with a letter Z or Y because, A to X letters are reserved for SAP programs.
- Title: Under title, you need to update the description of an ABAP program.
- Type: Type of program – Executable program, Include Program, Module Pool Program, etc.
- Package: It refers to folder, where the SAP Abap program can be stored and created.
In real time scenarios, the packages are maintained as per modules and sub modules and not for individual programs.
How to Create an ABAP Program in SAP
Step 1: Enter the transaction code “SE38” in the SAP command field.
Step 2: ABAP Editor – Initial Screen appears on the screen. Now enter the following details
- Program: Enter the name of program name in the given box.
- Sub Objects: Choose the source code in the sub-objects.
- Now click on create button to create a new SAP ABAP program.
Step 3: A screen “ABAP Program Attributes ZDEMO_ABAP_Program change” opens. Enter the following details.
- Title: Update the title of ABAP program
- Type: Update the type of program as “Executable Program” which can be tested independently.
- After entering all the details for ABAP program, click on save icon
Step 4: A pop up screen displays “create object directory entry ” click on the local object option.
In Real time, we never select as local object to save the ABAP program ( it is not transportable from development to quality and quality to production).
Now the ABAP Editor for the current program ZDEMO_ABAP_PROGRAM open as follows.
Write the simple program as follows.
After program source code is done, click on save icon or ctrl+s to save the ABAP program.
To check the ABAP source code syntax errors, press ctrl+ f2 or choose icon check
To activate the ABAP program, click on activate icon or ctrl+f3.
After activating the program, you get the following screen. Now press enter to continue
To run the ABAP program, press the function key F8 or click on the icon direct processing.
The output of an ABAP program displays as follows
Successfully we have created new abap program in SAP and executed.