Application Development 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: 

move char to qty field

Former Member
0 Kudos

The below code short dumps beucase 12,000.00 is recongnised as a number. So is there an easy way to get this value into the quantity field. I can think of replacing the comma, biut it doesnt seem that full proof, just wondered if there was an easier way?

DATA: ls_LTAP_CHK-VSOLM TYPE LTAP_VSOLM,

v_REQTY(12) TYPE C VALUE '12,000.00'.

ls_LTAP_CHK-VSOLM = v_REQTY.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello

Use FM 'MOVE_CHAR_TO_NUM'

5 REPLIES 5

Former Member
0 Kudos

Hi,

As per my knowledge its not possible to move some value of type C to other type (P or I or D or T or N or...) is not possible directly.

I think no way...

We can move other types to type C but vice versa is not possible..

Kiran...

Edited by: kiran vempati on Aug 13, 2009 5:54 PM

Edited by: kiran vempati on Aug 13, 2009 5:57 PM

Former Member
0 Kudos

Hello

Use FM 'MOVE_CHAR_TO_NUM'

0 Kudos

Eliminate the thousand delimiter before assigning.


  replace all occurences of ',' in v_REQTY with ''.

After that you can assign the char to the p variable. No FM needed.

former_member555112
Active Contributor
0 Kudos

Hi,

Use the FM MOVE_CHAR_TO_NUM.

regards,

Ankur Parab

Former Member
0 Kudos

Hi,

try this

data : qty type p decimals 2,

ch(10) type c value '10'.

move ch to qty.

may be this will be helpful to u.

or try the FM

CALL FUNCTION 'CHECK_AND_CONVERT_NUMERICS'

EXPORTING

dmzei = ','

dtype = 'CURR'

efeld = input

IMPORTING

error = error

ifeld = output

messg = messg

msgln = msgln

regards,

Archana