0% found this document useful (0 votes)
25 views1 page

Zb14 Uncond Cond Loops

This document contains code to demonstrate unconditional and conditional loops in ABAP. It defines parameters for the start and end numbers of a range. It then uses an unconditional DO loop, addition times loop, and WHILE loop to display the sequence of numbers between the given range. The unconditional DO loop exits if the start number equals the end number, otherwise it increments the start number by 1 each iteration. The WHILE loop displays and increments the start number until it reaches the end number.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views1 page

Zb14 Uncond Cond Loops

This document contains code to demonstrate unconditional and conditional loops in ABAP. It defines parameters for the start and end numbers of a range. It then uses an unconditional DO loop, addition times loop, and WHILE loop to display the sequence of numbers between the given range. The unconditional DO loop exits if the start number equals the end number, otherwise it increments the start number by 1 each iteration. The WHILE loop displays and increments the start number until it reaches the end number.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

*&---------------------------------------------------------------------*

*& Report ZB14_UNCOND_COND_LOOPS


*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT

zb14_uncond_cond_loops.

* Define the Parameters


PARAMETERS:p_num1 TYPE i,
p_num2 TYPE i.

** Display the sequence of numbers between the given range using Un condition
al Loop (DO...ENDDO)
DO.
WRITE:/25 p_num1.
* IF p_num1 = p_num2.
*
EXIT.
**
STOP.
**
CONTINUE.
* ENDIF.
CHECK p_num1 NE p_num2.
p_num1 = p_num1 + 1.
ENDDO.
WRITE: 'OUT SIDE OF THE LOOP'.
* using an Addition TIMES
*DO 10 TIMES.
* WRITE:/25 p_num1.
* IF p_num1 = p_num2.
*
EXIT.
* ENDIF.
* p_num1 = p_num1 + 1.
*ENDDO.
* Display the sequence of numbers between the given range using Un conditiona
l Loop (DO...ENDDO)
WHILE p_num1 < p_num2.
WRITE:/25 p_num1.
p_num1 = p_num1 + 1.
ENDWHILE.

You might also like