0% found this document useful (0 votes)
10 views3 pages

Using Radio Buttons To All Even, Odd, and All

The document is an ABAP report that processes user input through a selection screen with various parameters for generating sequences of numbers based on user-defined criteria (normal/reverse and odd/even/all). It includes multiple conditional blocks that execute loops to display sequences of numbers according to the selected options. The report handles both normal and reverse sequences, as well as odd and even distinctions, based on the input provided by the user.

Uploaded by

jayanthdevathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views3 pages

Using Radio Buttons To All Even, Odd, and All

The document is an ABAP report that processes user input through a selection screen with various parameters for generating sequences of numbers based on user-defined criteria (normal/reverse and odd/even/all). It includes multiple conditional blocks that execute loops to display sequences of numbers according to the selected options. The report handles both normal and reverse sequences, as well as odd and even distinctions, based on the input provided by the user.

Uploaded by

jayanthdevathi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

REPORT zj_kstask18.

DATA: a TYPE i,
b TYPE i,
c TYPE i,
d TYPE I.

SELECTION-SCREEN BEGIN OF BLOCK part2 WITH FRAME.

PARAMETERS: number1 TYPE id.


SELECTION-SCREEN END OF BLOCK part2.
SELECTION-SCREEN BEGIN OF BLOCK part1 WITH FRAME TITLE TEXT-001.

PARAMETERS: normal RADIOBUTTON GROUP rad DEFAULT 'X',


reverse RADIOBUTTON GROUP rad.
SELECTION-SCREEN END OF BLOCK part1.

SELECTION-SCREEN BEGIN OF BLOCK part4 WITH FRAME TITLE TEXT-002.


PARAMETERS: odd RADIOBUTTON GROUP r DEFAULT 'X',
even RADIOBUTTON GROUP r,
all RADIOBUTTON GROUP r.
SELECTION-SCREEN END OF BLOCK part4.

IF normal = 'X' AND all = 'X'.


a = 1.
DO number1 TIMES.
DO a TIMES.
b = b + 1.
WRITE: b.
ENDDO.
WRITE: /.
a = a + 1.
b = 0.
ENDDO.
ENDIF.

IF normal = 'X' AND even = 'X'.


a = 2.
IF number1 MOD 2 <> 0.
d = number1 / 2.
d = d - 1.
ELSE.
d = number1 / 2.
ENDIF.
DO d TIMES.
WRITE: a.
b = a + 2.
DO c TIMES.
WRITE: b.
b = b + 2.
ENDDO.
c = c + 1.
WRITE : /.
ENDDO.
ENDIF.

IF normal = 'X' AND odd = 'X'.


a = 1.
d = number1 / 2.
DO d TIMES.
b = a + 2.
WRITE: a .
DO c TIMES.
WRITE: b.
b = b + 2.
ENDDO.
c = c + 1.
WRITE : /.
ENDDO.
ENDIF.

IF reverse = 'X' AND all = 'X'.


d = number1.
DO d TIMES.
a = 1.
a = a - 1.
DO number1 TIMES.
a = a + 1.
WRITE: a.
ENDDO.
WRITE: /.
number1 = number1 - 1.
ENDDO.
ENDIF.

IF reverse = 'X' AND even = 'X'.

if number1 mod 2 <> 0.


d = number1 / 2.
d = d - 1.
ELSE.
d = number1 / 2.
* D = D - 1.
ENDIF.
number1 = D.
*B = 1.
DO d TIMES.
a = 2.
DO NUMBER1 TIMES.
*a = A + 2.
WRITE: A.
A = A + 2.
ENDDO.
WRITE: /.
*B = B + 1.
NUMBER1 = NUMBER1 - 1.
*C = 2.
ENDDO.
ENDIF.

IF REVERSE = 'X' AND ODD = 'X'.

B = NUMBER1 / 2.
NUMBER1 = B.

DO B TIMES.
A = 1.
DO NUMBER1 TIMES.
*A = A + 2.
WRITE: A.
A = A + 2.
ENDDO.
WRITE: /.
NUMBER1 = NUMBER1 - 1.
ENDDO.

ENDIF.

You might also like