Wednesday 29 June 2022

Getting started with ABAP Programming from Scratch

In this blog post you will learn how to create package and how to write your first program. This blog post based on classic development in SAP GUI.

How to Create Package

Once you login to the system, below screen will be open. On the left side of the screen there is command field. You can enter transaction code to go to any task of SAP application.

SE80 and SE38 are transaction code for ABAP editor.

Follow the below steps to create package.

Step 1: Enter SE80 transaction code in command field and press Enter.

SAP ABAP Development, SAP ABAP Programming, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Preparation, SAP ABAP Prep, SAP ABAP Certification

Step 2: Select package from the drop-down list.

SAP ABAP Development, SAP ABAP Programming, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Preparation, SAP ABAP Prep, SAP ABAP Certification

Step 3: Enter package name and press Enter.

SAP ABAP Development, SAP ABAP Programming, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Preparation, SAP ABAP Prep, SAP ABAP Certification

Step 4: It will prompt you to create the package if the package with the same name is not present. Click on Yes.

SAP ABAP Development, SAP ABAP Programming, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Preparation, SAP ABAP Prep, SAP ABAP Certification

Step 5: Give short description and press enter and package is created.

How to write program


Step 1: Once the package is created, right click on the package name. You will get the below options.

SAP ABAP Development, SAP ABAP Programming, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Preparation, SAP ABAP Prep, SAP ABAP Certification

Step 2: Click on Create option. Once you click on it you will get options. Select Program option.

SAP ABAP Development, SAP ABAP Programming, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Preparation, SAP ABAP Prep, SAP ABAP Certification

Step 3: Give the program name. Program name should start with Z or Y.

SAP ABAP Development, SAP ABAP Programming, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Preparation, SAP ABAP Prep, SAP ABAP Certification

Step 4: Save it in your package. Once you save it you will get below screen. Here you can write your code.

Program to print Text


There is a keyword WRITE to print a text on output screen.

Syntax: Write ‘This is my first program’.

Write: It is a keyword to print text on output screen.

Whatever the text that we want to print on output screen must be inside the single quotation mark.

The statement is closed with period(.).

Note: Each statement must be closed with period(.).

SAP ABAP Development, SAP ABAP Programming, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Preparation, SAP ABAP Prep, SAP ABAP Certification

Once you write your code, you can check your code whether it is syntactically correct or not.

To check click on check button which is shown in below image.

SAP ABAP Development, SAP ABAP Programming, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Preparation, SAP ABAP Prep, SAP ABAP Certification

Once you click on it will show you the error if it is present. If not, you will get the message like No syntax errors found in report.

SAP ABAP Development, SAP ABAP Programming, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Preparation, SAP ABAP Prep, SAP ABAP Certification

Then you have to activate your program. To activate this, click on activate button.

SAP ABAP Development, SAP ABAP Programming, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Preparation, SAP ABAP Prep, SAP ABAP Certification

Once your program is activated you can execute your program. Click on execute to run the program.

Note: Any changes if you done in your program then first you have to activate the program then run it. If the program is inactive then you will not be able to run your program. You can see that status just besides the report name.

SAP ABAP Development, SAP ABAP Programming, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Preparation, SAP ABAP Prep, SAP ABAP Certification

Once you execute it, you will get the output.

SAP ABAP Development, SAP ABAP Programming, SAP ABAP Career, SAP ABAP Skills, SAP ABAP Jobs, SAP ABAP Tutorial and Material, SAP ABAP Guides, SAP ABAP Preparation, SAP ABAP Prep, SAP ABAP Certification

No comments:

Post a Comment