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

Conversion problem

Former Member
0 Likes
308

Hi friends,

My internal table contains following fields

Net weight type c length 15

Length type c lenth 15.

I am moving length and netweight from vekp to my internal table

So my internal table contains values as

Net weight 15.000

Length 5.000

I need to change above values as 00015.0 (before decimal 5 places and leading zeros if the value is not of length 5). And after decimal only one digit.

Length to 0005 (means no decimal and before decimal 4 places with leading zeros if space is there).

Can any body help on this. I have tried but the values are not changing properly.

Please help me.

Thanks a lot.

1 REPLY 1
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
283

How about something like this.



report zrich_0001 .

data: Net_weight(15) type c value '15.000'.

data: str1 type string.
data: str2 type string.
data: whole(5) type n.
data: dec(1) type n.

split net_weight at '.' into str1 str2.
whole = str1.
dec = str2(1).
concatenate whole dec into net_weight separated by '.'.

write:/ net_weight.

Regards,

RIch Heilman