Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Type I 's Range

Former Member
0 Likes
867

Program as following :

=========================================

DATA: BEGIN OF LINE,

COL1 TYPE I,

COL2 TYPE I,

END OF LINE.

DATA ITAB LIKE LINE OCCURS 10.

DO 40 TIMES.

LINE-COL1 = SY-INDEX.

LINE-COL2 = SY-INDEX ** 2.

APPEND LINE TO ITAB.

ENDDO.

DELETE ITAB FROM 3 TO 38 WHERE COL2 > 20.

LOOP AT ITAB INTO LINE.

WRITE: / LINE-COL1, LINE-COL2.

ENDLOOP.

其输出为:

1 1

2 4

3 9

4 16

39 1.521

40 1.600

==========================================

why square of 39 is 1.521 and square of 40 is 1.600 but not 1521 and 1600 ?

is it limited by type i ?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
847

Hi

Don't worry your program is working fine. Its not 1.521 its 1,521.

Imean to say its not '.' its comma ",".

EX. 1,00,00,000

Regards

Aditya

7 REPLIES 7
Read only

Former Member
0 Likes
848

Hi

Don't worry your program is working fine. Its not 1.521 its 1,521.

Imean to say its not '.' its comma ",".

EX. 1,00,00,000

Regards

Aditya

Read only

0 Likes
847

DELETE ITAB FROM 3 TO 38 WHERE COL2 > 20.

====this sentence has been delete rows where cols>20.

1521 and 1600 are both larger than 20 ,why didn't delete them ?

Read only

0 Likes
847

Hi,

U mentioned it to delete from 3 to 38 .39 and 40 are out of range .hence they were printed

Regards

Read only

0 Likes
847

DELETE ITAB FROM 3 TO 38 WHERE COL2 > 20.

UR deleting ITAB entries from 3 to 38 where COL2 > 20.

The other two are out of range .. 39 and 40 .. hence they ate not

deleted

Read only

0 Likes
847

thanks all ,it's my careless.

Read only

Former Member
0 Likes
847

I think its the user settings ..

Check

System > user profile> Own data

In Defaults tab .. check for the decimal notification ..

It should be 1,234,567.89 ...

your current settings are 1.234.567,89

Read only

Former Member
0 Likes
847

Hi

Instead Of I type, use P since I has smaller size and P is used to contain larger value .

Rewards Points If Helpful.