Posts

Showing posts with the label While Loop

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 :-