Application Development 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: 

internal table

madan_ullasa
Contributor
0 Kudos

frnds,

i'm using the table control statements at new, at end of..

but the prob. is that, it considers the fields to the left of the column of the field we use in the condition.

eg.

my itab is .

field F1 F2 F3

_______________________

1st row a1 b1 100

2nd row a2 b1 300

3rd row a3 b2 400

now if i use at new F2, or end of F2, and then SUM, still the values on the right are not added. Coz it considers each value of F1 as a new field.

any other method to sum the values on right, at the change of value of the field F2.

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You could look into the ON CHANGE OF statement.

Regard,

RIch Heilman

7 REPLIES 7

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You could look into the ON CHANGE OF statement.

Regard,

RIch Heilman

0 Kudos

hi,

it does not work . coz it considers the change of value at end only.

Former Member
0 Kudos

Try 'ON Change of' field and ENDON clause.

FredericGirod
Active Contributor
0 Kudos

Hi Madan,

you have to play with something like :

F2_old like F2.

if F2_old ne F2.
  move F2 to F2_old.
  write /1 value_of_sum.
  value_of_sum = F3.
else.
  value_of_sum = value_of_sum + F3.
endif.

or you have to create the same table, clear the first colum, and make a quick sum.

Rgd

Frédéric

0 Kudos

Make F2 your farmost right column.:

F1 F3 F2

0 Kudos

That didn't work, cause F3 have the value, so F2 will change each time F3 change.

Fred

Message was edited by: Frédéric Girod

0 Kudos

hey frnd,

i got it ... but will have to make F2 the far most left column..it works :)-:)-

regards,

madan............