Skip to Content
Personal Insights
Author's profile photo Anuja Kawadiwale

Getting started with ABAP Programming from Scratch

 

I am happy to share my very first blog post on SAP ABAP Programming. 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.

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

 

Step 3: Enter package name and press Enter.

 

 

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

 

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.

 

 

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

 

 

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

 

 

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(.).

 

 

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.

 

 

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.

 

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

 

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.

 

 

Once you execute it, you will get the output.

 

 

Here you have completed the first step into your learning SAP ABAP programming journey. I hope this blog post helped you as beginner.

As we continue to learn more, I will use this first blog post to link all the parts of this series.

Here you can check next blog post Getting Started With ABAP: PART 2

Follow my profile to be notified of the next blog post. Please feel free to ask any questions you have in the comments section below.

Join the conversation about the ABAP programming by following the tag  ABAP Development

Post questions and answer related to tag by following the tag Questions & Answers

Read other blog post on topic ABAP Development

 

Assigned Tags

      13 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Matthew Billingham
      Matthew Billingham

      Don't use SAPGui to develop. Use ADT / Eclipse. It's a far more modern and powerful development environment.

      Author's profile photo Anuja Kawadiwale
      Anuja Kawadiwale
      Blog Post Author

      Thanks for the feedback

      Author's profile photo Paul Hardy
      Paul Hardy

      I have a request as well.

      If it is at all possible do not use FORM routines in your next examples. If someone 100% new to ABAP starts using FORM routines they will never stop.

      That should not be too much of an ask given that students learn OO programming at university. Please let them know ABAP has been OO enabled since the year 2000, the procedural option is just there to be downward compatible.

      Also any examples of DYNPRO programming in the SAP GUI with business logic in the PBO/PAI modules would not be a good idea. Or function modules for any purpose other than calling an SAP GUI screen or RFC connections.

      I was asked to produce a free ABAP beginners course for online learning company Michael Management but I had to decline because my wife has been really ill this year. But if I had produced it I would not of even mentioned any of the 20-30 year old stuff except maybe in a "do not use this because XYZ is better and here is why" sense.

      Cheersy Cheers

      Paul

       

      Author's profile photo Jelena Perfiljeva
      Jelena Perfiljeva

      Well, SAP put all "ABAP for beginners" authors out of business recently by publishing their free course: https://learning.sap.com/learning-journey/get-started-with-abap-programming-on-sap-btp

      Author's profile photo ALEXANDRE LANGER
      ALEXANDRE LANGER

      Thanks for the post, I'm starting to learn abap and you're helping me a lot. Please continue.

      Author's profile photo Jelena Perfiljeva
      Jelena Perfiljeva

      SAP recently published free learning journey Get Started with ABAP Programming on SAP BTP

      It contains pretty much the same beginner ABAP material as this and subsequent posts. Not sure why it says "on SAP BTP" (everything is BTP these days 🙂 ) but it actually covers all ABAP basics that could be used in many different environments and versions.

      I might be biased as I co-wrote a book on the subject, but I agree with others that this blog series teaches the concepts that are already outdated. Not to claim that no one uses SE38 anymore (I do) but writing "getting started" post in 2022 and not even mentioning other options seems like, well, a disservice to the community.

      There is no explanation of "why", which is quite important. We start with "create a package". Why? And what is this "package"?

      Beginners will eat up any content because they don't know any better. I'd very much recommend listening to the advice from experienced developers like Paul and Matthew.

      Thank you.

      Author's profile photo Anuja Kawadiwale
      Anuja Kawadiwale
      Blog Post Author

      Hi Jelena,

      I have gone through the contents of recently published learning journey. Do you really think that it is for beginner ? In that document it is clearly mentioned it is for intermediate level. It is really difficult for beginner to directly jump on Restful Application Programming. If you still think it is for beginner then i would like to say it's upto their choice. You can not force anyone to go through this procedure because you think. I find this is a great way to learn as beginner hence i created this blog post series.

      People are saying it is outdated, but thing is still people working on this. For you people it is outdated that doesn't means it is outdated for everyone. This blog post series is not for the people who say it is outdated. It is for beginner. I think when we learn basic thing and then move on advanced things it is always right way to learn why should move to advanced things. Otherwise beginner will use advanced things but why ? They will never know.

      Author's profile photo Shai Sinai
      Shai Sinai

      The reason that this guide might be outdated isn't because some people "think so".

      It is because it contains exactly the same content that was available 20 years ago, while ABAP has changed (a lot) in the meanwhile. It is fine that you won't include more "advanced"/new topics (like RAP), but I think you should at least describe the alternatives/changes in the topics you are handling.

      Since these are guides for beginners, the readers might not have any preliminary knowledge and accept your information as is. In some cases it might be misleading.

      Author's profile photo Anuja Kawadiwale
      Anuja Kawadiwale
      Blog Post Author

      Hi Shai,

      You people are just using word misleading. Instead of that can you please write what statements are wrongly written.

      Which statement is wrong in my blog post ?

      Misleading word indicates 'Stop Writing Blog'.

      Author's profile photo Sandra Rossi
      Sandra Rossi

      No, don't stop writing blog posts. I think it will help some types of developers who just want to learn the old way.

      The comments are constructive remarks about posting. I'm pretty sure you're right in the domain you want to teach, and Jelena/Shai are also right in the general ABAP domain and trends. So, you teach "classic" ABAP (and also "classic" SAP GUI-based development environment), there's Cloud ABAP without transaction codes, but you're right that "classic ABAP" is still often used. If you know all that, you could warn people of current alternatives so that they can choose what to learn, old versus new. But of course, it's up to you.

      Other people could also write a general purpose blog post to explain how to choose the ABAP they want to learn. Tough topic !

       

      Author's profile photo Jelena Perfiljeva
      Jelena Perfiljeva

      Definition of "misleading" is "giving a wrong idea or impression". This post gives the readers a wrong impression that SE80/SE38 is the only way to create an ABAP program in 2022.

      It would be a better choice to start with explaining that there are many ways for that and many ABAP models, then say for whatever reason you want to focus these posts on classic development in SAP GUI. Then the readers could choose whether to follow you down that path or read something else.

      Community members are giving you constructive feedback because they want you to write better posts, to improve, not because they want you not to write anything. It's much easier to just roll eyes and not say anything, move along. It might be more pleasant for the author to not hear negative feedback. But what would you learn from that? Nothing.

      Author's profile photo Anuja Kawadiwale
      Anuja Kawadiwale
      Blog Post Author

      Hi Jelena,

      I have mentioned in my blog post that my post is based on classic development in SAP GUI.

      If i am not wrong in SAP GUI there are only two ways to create program.

      Here i am not talking about other models. I dont think there is need to mentioned other ways to create program in other models.

      Author's profile photo Jelena Perfiljeva
      Jelena Perfiljeva

      For the readers: please also take a look at this ABAP Starter repository that has some helpful information and additional links.

      Edit: not an endorsement but there is also a free ABAP course on YT from Zapyard (formerly SAPYard).