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

String value to Quantity value

Former Member
0 Likes
312

Hi All,

Pls resolve my issue.

Here I am writing the code

DATA: l_free1 TYPE string,

l_free2 TYPE string,

l_num TYPE string,

l_freeqty1 type string,

l_freeqty type knrmm.

************************

l_freeqty carries some value from program.

eg : l_freeqty = '3.500'

I have changed the l_freeqty to l_freeqty1 since for condense and split we need to use only C,N,D,T and string...

************************

l_freeqty1 = l_freeqty.

CONDENSE l_freeqty1.

SPLIT l_freeqty1 AT '.' INTO l_free1 l_free2.

MOVE l_free2+0(1) TO l_num.

IF l_num GE '5'.

l_free1 = l_free1 + 1.

l_freeqty1 = l_free1.

l_freeqty = l_freeqty1.

ELSE.

l_freeqty1 = l_free1.

clear l_freeqty.

l_freeqty = l_freeqty1.

My issue : The value in l_freeqty1 = 4

when I am passing it to l_freeqty it is taking as 0.004.

Pls give the way to update the l_freeqty as 4.000... or any other way

Thanks in advance

1 REPLY 1
Read only

Sidh_M
Participant
0 Likes
287

Hi,

declare l_freeqty as

l_freeqty type p decimal 2.

hope this will help you

best regards,

SUDHIR MANJAREKAR