1

Get Started With ABAP: PART 2

 2 years ago
source link: https://blogs.sap.com/2022/06/12/get-started-with-abap-part-2/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
June 12, 2022 3 minute read

Get Started With ABAP: PART 2

This is the second blog post in this series. Here is the previous blog post Get Started with ABAP Programming From Scratch

In the first blog post, we learn how to create package and how to write your first program.

In this blog post you will learn how to print multiple text on same line and multiple line as well as how to give comments.

In previous blog post we have seen how to create package and program from transaction SE80. So, once you open SE80 (Transaction Code for ABAP Editor) you have already created the package so need to create it every time. Just right click on existing package name and create new program.

While creating program you will see the below window.

Part2_1.png

Here you can see that type of the program is Executable program. We can create other type of the program that we will learn in later part. Here we are creating Executable Program that is one of the types of program.

How to write multiple text on same line

We can do these two ways.

First Method:

Step 1: As we learned how to print text in previous blog post. Now I want to print two text on the same line.

Code:

Write ‘This is my first Program.’.
write ‘I am learning SAP ABAP.’.

Part2_2.png

Step 2: Check, Activate and Execute the program.

Output:

Part2_3.png

Second Method:

Step 1: Write Code.

Code:

Write: ‘This is my first Program.’,’I am learning SAP ABAP.’.

Part2_4.png

Step 2: Check, Activate and Execute.

Output:

Part2_5.png

In second method we used colon (:) just after write keyword. So, we don’t need to write two statement to print two or multiple text on same line. In this way you can print multiple text with just one statement.

How to print text on next line

Suppose I want to print second text on next line.

Step 1: Write code.

Code:

Write: ‘This is my first Program.’,/’I am learning SAP ABAP.’.

Part2_6.png

Output:

In this way we can print text on next line by using forward slash (/).

Part2_7.png

How to give comments

Full Line Comments:

We can give full line comments by using *.

Part2_8.png

Partial Line Comment:

We can give partial comment using “.

Part2_9.png

Here we have completed the second part of learning SAP ABAP programming. I hope this blog post helped you as beginner.

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

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.

Previous Blog Post Get Started with ABAP Programming From Scratch

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


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK