2007 Aug 22 12:19 PM
Hello friends.
I have a field which has a numeric o?p.
But as the user specification the result should be such that if
a) the data is 100.0000 then it sud display 100
b)the data is 1.600 then it sud display 1.6
c)the data is .1000 then it sud display .1 only.
This data is for only one field not 3 seperate fileds.
So please suggest me some way out.
Regards,
Shweta
2007 Aug 22 12:27 PM
Hi Shweta,
I assume that you are working with a basic list reporting, if so, you can add "NO-ZERO" after your WRITE statement.
If you have any questions, please let me know.
Regards,
Sayan
Hello friends.
I have a field which has a numeric o?p.
But as the user specification the result should be such that if
a) the data is 100.0000 then it sud display 100
b)the data is 1.600 then it sud display 1.6
c)the data is .1000 then it sud display .1 only.
This data is for only one field not 3 seperate fileds.
So please suggest me some way out.
Regards,
Shweta
2007 Aug 22 12:27 PM
Hi Shweta,
I assume that you are working with a basic list reporting, if so, you can add "NO-ZERO" after your WRITE statement.
If you have any questions, please let me know.
Regards,
Sayan
2007 Aug 22 12:30 PM
Hi Shweta
Simple!!!!!!
if u have data in itab like
itab - fld1
100.0000
1.600
.1000
loop at itab.
split itab-fld1 at '.' into str1 str2. str2 = 600
now place ' 'in place of 0 in str2.
replace all occurances of '0' with space in str2.str2 = 6 .
condencs str2. here str2 = 6.
now concatenate str1 and str2 with '.' . 1.6
reward points to all helpful answers
kiran.M
2007 Aug 22 1:00 PM
Hi ,
Execute the logic below for all the values in ur requirement and see if this logic is working for you.I hope this will do .
You have to convert to characters to make this functionality work .
Im expecting some more logics from SDN members Lets wait and see .
data : v1 type p decimals 4.
data : rem(6) type c.
data : v3(13) type c.
data : val1(4) type c.
data : v4(17) type c.
v1 = '100.0000'. "give ur inputs here
v3 = trunc( v1 ).
rem = frac( v1 ).
rem = rem * 100.
val1 = rem.
condense val1 no-gaps.
condense v3 no-gaps.
if val1 is not initial.
concatenate v3 val1 into v4 separated by '.' .
else.
v4 = v3.
endif.
write:/ v4 no-zero.Regards,
Vijay.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |