cancel
Showing results for 
Search instead for 
Did you mean: 

length of the field in debugging

Former Member
0 Kudos

Hi,

I have declared the "rate" field like this in a program.

the field "konp-kbetr" is of "CURRENCY" field type and the length is: 11,2.

data: begin of itab occurs 0,

rate like konp-kbetr,

end of itab.

.......................

.......................

select kbetr from konp into itab-rate.

....................

....................

but while dubugging the contents for the "rate" field in itab shows like this:

no component name type length contents

1. rate P 6 0.00

What could be the probelm for that?

please let me know.

thnx.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Dev,

In the attributes of the program,please check the check box "fixed point arithmetic".

Former Member
0 Kudos

phani,

the check box is already "checked".

any other thing causing this?

Former Member
0 Kudos

Ok,then in the debug more check the field as itab-rate ,not just rate..

Former Member
0 Kudos

u r not getting my point.

i'm checking the whole itab itself.

and the problem i'm getting is: if there is a value for that "rate" for eg: 8972452.34 it is showing that as : "*52.34".

this is where i'm getting the problem.

hope it is clear now.

and when i'm checking the program for syntax error, is it showing a message that "The "itab-rate" field should be of type c,n,d,t".

plz tell me how can i declare a currency field as type C,N,D,T?

thnx

former_member188685
Active Contributor
0 Kudos

Hi Deva,

can you show the code where you are moving the data to itab(i mean where you are fetching).

i think you are trying to write or moving it to different type.

can you show the code..

Regards

vijay

Message was edited by: Vijay Babu Dudla

Former Member
0 Kudos

Hi Dev,

I check the code here & its working fine.Why dont you add the key fields to your internal table & check.

data: begin of itab occurs 0,

knumh like konp-knumh,

kopos like konp-kopos,

rate like konp-kbetr,

end of itab.

select knumh kopos kbetr from konp into table itab.

Former Member
0 Kudos

VIJAY,

there are 3 itabs in my prog like this.

1st itab:

data: begin of itab occurs 0,

rate like konp-kbetr,

end of itab.

2nd itab:

data: begin of itab2 occurs 0,

knumh like a505-knumh,

end of itab2.

3rd itab:

data: begin of itab3,

awp like konp-kbetr,

end of itab3.

the code is like this:

select kbetr from konp into itab-rate

where knumh = itab2-knumh.

append itab.

endselect.

loop at itab.

write itab-rate to itab3-awp.

endloop.

when i debug the code, the "rate" field is showing the correct value for the 2nd itab.

but the problem is with the 3rd itab only. it is basically a structure. and in that i want the value eventually.

thnx,

former_member188685
Active Contributor
0 Kudos

loop at itab.

<b>itab3-awp = itab-rate.</b> "since both are same

"after this what are you doing...

endloop.

Vijay

Former Member
0 Kudos

Hi Dev,

Write to is only used for moving to character.

WRITE f TO g.

In contrast to MOVE, the format of the target field g is the same as when outputting to a list with WRITE. The field type C is always used, regardless of the actual data type.

So use Move statement..

loop at itab.

<b>move</b> itab-rate to itab3-awp.

endloop.

Former Member
0 Kudos

i'm writing this all values in that "itab3" to a file.

Former Member
0 Kudos

Hi Dev,

The declare the awp in itab3 as below..

data: begin of itab3,

<b>awp(15),</b>

end of itab3.

former_member188685
Active Contributor
0 Kudos

Hi Deva,

data: begin of itab3,

awp(16), "should be the outputlength

end of itab3.

now you can do

loop at itab.

write itab-rate to itab3-awp.

endloop.

Former Member
0 Kudos

Phani & Vijay,

thank you very much, it solved.

Answers (1)

Answers (1)

suresh_datti
Active Contributor
0 Kudos

Hi,

You must use 'itab-rate' not 'rate'..

Regards,

Suresh Datti