Former Member

# urgent

dear all,

can anybody tell me the solution for this

INTERNAL TABLE ITAB HAS 100 RECORDS . WRITE LOGIC TO FIND AND

CALCULATE THE SUM OF AN NUMERIC FIELD IN ITAB FOR RECORDS RANGING FROM

POSITIONS 51 TO 57.

10|10000 characters needed characters exceeded

### Related questions

• Posted on Jan 07, 2008 at 09:42 AM

check sy-tabix between 51 and 57,

A.

10|10000 characters needed characters exceeded
• Former Member
Posted on Jan 07, 2008 at 09:45 AM

Hi,

Loop at itab.

if sy-tabix >= 51 and sy-tabix <= 57.

sum = sum + itab-num1.

endif.

endloop.

10|10000 characters needed characters exceeded
• Former Member
Posted on Jan 07, 2008 at 09:48 AM

loop at the internal table....

count = 51

if sy-tabix = count and sy-tabix < 58

sum = sum + itab-netwr.

endif.

count = count + 1.

endloop.

Try the above code

10|10000 characters needed characters exceeded
• Former Member
Posted on Jan 07, 2008 at 09:51 AM

data: cnt type i value '51',

total type i value '0'.

do 7 times.

read table itab into wa index cnt.

total = total + wa-fieldnum1.

cnt = cnt + 1.

enddo.