Application Development and Automation 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: 
Read only

Output display problem....Urgent.!!!

Former Member
0 Likes
614

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
595

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

3 REPLIES 3
Read only

Former Member
0 Likes
596

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

Read only

Former Member
0 Likes
595

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

Read only

Former Member
0 Likes
595

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.