on 09-15-2009 1:26 PM
Hi,
I use
&struc-field(C)&
to hide decimals in a SF.
The type of this field is LGMNG.
This code works for all instances, except when the UOM is type ROL (Role). I have put a break-point in the SF just before the value is output and they are identical.
But the output would be, for example say five units:
a) 5 SH (Correct)
b) 5,000 ROL (incorrect)
Anyone seen this before?
Thanks.
Hi,
The option (C) is used to surpress spaces, not decimals. You need to use (.0) to remove decimals.
What you are seeing is the field being formatted to match the number of decimal places configured against the unit of measure.
Regards,
Nick
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nick,
thanks for the reply. I tried both of these already:
&struc-field(.0)&
&struc-field(C.0)&
And, for both, I am told at runtime that (.0) is not a correct "formatting option for the field struc-field".
I'm going to put a code block in to convert to an integer and display that. It will work - I just thought that (C) or (.0) would work too?
Thanks.
Hi,
u create program lines & declare another variable of type P with decimals as 0, then move the value to this variable & print it.
eg:
data : lv_field(13) TYPE p decimals '0'.
lv_field = struct-field.
P1 &lv_field(C)&
Hope it helps!!
Rgds,
Pavan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Pavan.
I declared a type 'i' and put the value in there. The requirement is to have only an integer value so if it is 123.987 the output should be 123. I used trunc for this.
I will close this now but am curious if anyone had the same issue with (.N) not working at runtime.....
Thanks for your help.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.