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: 

ITAB Sum on Currency field

Former Member
0 Kudos

Hi All,

I am getting a dump with CONVERT_NO_NUMBER. I get this while adding the currency values inside the loop. But why it dumps??

Show the debugger values for reference:

t_kwert Table[2x17]

wa_kwert 0000040814######L

wa_kwert-kwert 11.14

I believe the dump is because the ###### values in the work area, but this comes even after the clear of the work area. Please see my code below.

TYPES : BEGIN OF x_kwert,

knumv TYPE konv-knumv,

kwert TYPE konv-kwert,

END OF x_kwert.

DATA : t_kwert TYPE TABLE OF x_kwert,

wa_kwert like line of t_kwert.

CLEAR wa_kwert.

REFRESH t_kwert.

SELECT knumv kwert

INTO TABLE t_kwert

FROM konv

FOR ALL ENTRIES IN ikschl

WHERE knumv = l_knumv

AND kschl = ikschl-kschl.

CLEAR: wa_kwert.

LOOP AT t_kwert INTO wa_kwert.

l_ksum = wa_kwert + l_ksum .

ENDLOOP.

Thanks,

Senthil

1 ACCEPTED SOLUTION

Former Member
0 Kudos

while use control levell processing statement's like AT NEW fn, AT END Fn etc.... ( Fn is the field name ) after that filed the values will hold ########## while looping move the value to an workarea and use the itab value .... you can notice after endat statement you can see the values. this will solve your problem

6 REPLIES 6

Former Member
0 Kudos

while use control levell processing statement's like AT NEW fn, AT END Fn etc.... ( Fn is the field name ) after that filed the values will hold ########## while looping move the value to an workarea and use the itab value .... you can notice after endat statement you can see the values. this will solve your problem

0 Kudos

Hi,

I dont have AT NEW ENDAT or any control level processing stmts in my loop, But still ### is comming.

0 Kudos

Change to the below code

LOOP AT t_kwert INTO wa_kwert.

=>l_ksum = wa_kwert-kwert + l_ksum .

before you are summing with the whole wa do it for a field.

ENDLOOP.

0 Kudos

Hey thanks, My bad naming convention of the itab put me in trouble. Thanks.

P561888
Active Contributor
0 Kudos

Hi ,

better use the collect or at statements.

Regards,

bharani

Former Member
0 Kudos

Hi,

I have tried with COLLECT stmt, it doesnot work.