Posts

Showing posts with the label Conditional Statements

Mastering SAP ABAP: Exploring Conditional Statements, CASE Statements, and Looping Techniques in Day 17

Image
Welcome back everyone to the Day 17 of my complete SAP ABAP master series. So, basically we were discussing about conditional statements where we have discussed IF statements. How to provide multiple IF conditions :- To provide multiple if conditions we use else if statements. ******************************************************** DATA : lv_input(2) TYPE n VALUE 2. *Checking of multiple IF conditions IF lv_input = 1. WRITE : 'The output is', lv_input. ELSEIF lv_input = 2. WRITE : 'The output is', lv_input. ELSEIF lv_input = 3. WRITE : 'The outpput is', lv_input. ELSE. WRITE : 'Wrong Input'. ENDIF. ******************************************************* So, this is all about if statements. let’s discuss CASE statements. CASE Statements :- It is a conditional statement. Multiple statements blocks are there, depends upon the condition one block executes. If none of the conditions are satisfied, it goes to others part. Syntax :- ...

Embarking on ABAP Adventures: Unveiling the Sum of Two Numbers

Image
 Welcome back everyone, So basically we were discussing the basic points of ABAP programming in our previous blogs, So we will continue with writing our first program { sum of two numbers }. As you remember, we have selected the type of above program as executable why? It is because, we have to execute the program Note :- In any programming language, a program generally have 3 parts :- Input Processing Logic Output so, for our first program we will first go for input, then processing logic and then for output. We have discussed in our previous blog, that DATA is used to define a variable. So, basically we have to create three data object, one for output and 2 for input. Then we will provide the input, in this program we will start with default input and in the upcoming one we will take inputs from the user. Then we will perform the operation. In SAP we use write statement to display the output. After writing the code, for best practices always use the pretty p...