Skip to content

Commit 29ba9ff

Browse files
committed
running sum
1 parent 3d414fc commit 29ba9ff

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

src/z_lc_power_of_2.prog.abap

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
*&---------------------------------------------------------------------*
2+
*& Report Z_LC_POWER_OF_2
3+
*&---------------------------------------------------------------------*
4+
*&
5+
*&---------------------------------------------------------------------*
6+
REPORT z_lc_power_of_2.
7+
8+
DATA: num TYPE i VALUE 1.
9+
10+
PARAMETERS: p_input TYPE i.
11+
12+
13+
WHILE p_input > num .
14+
15+
16+
num = num * 2.
17+
18+
19+
ENDWHILE.
20+
21+
IF p_input = num.
22+
23+
WRITE: / 'Power of two'.
24+
ELSE.
25+
WRITE: / 'Not a Power of two'.
26+
ENDIF.

src/z_lc_power_of_2.prog.xml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<abapGit version="v1.0.0" serializer="LCL_OBJECT_PROG" serializer_version="v1.0.0">
3+
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
4+
<asx:values>
5+
<PROGDIR>
6+
<NAME>Z_LC_POWER_OF_2</NAME>
7+
<SUBC>1</SUBC>
8+
<RLOAD>E</RLOAD>
9+
<FIXPT>X</FIXPT>
10+
<UCCHECK>X</UCCHECK>
11+
</PROGDIR>
12+
<TPOOL>
13+
<item>
14+
<ID>R</ID>
15+
<ENTRY>Report Z_LC_POWER_OF_2</ENTRY>
16+
<LENGTH>22</LENGTH>
17+
</item>
18+
</TPOOL>
19+
</asx:values>
20+
</asx:abap>
21+
</abapGit>

0 commit comments

Comments
 (0)