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

char to quantity field conversion

Former Member
0 Likes
4,860

Hi All,

Please suggest somebody some function module name to convert char field to quanity field.I want to move char field to MENGE field which is of type quantity.

Regards

Mahesh

Hi All,

Please suggest somebody some function module name to convert char field to quanity field.I want to move char field to MENGE field which is of type quantity.

Regards

Mahesh

3 REPLIES 3
Read only

Former Member
0 Likes
1,621

Hi,

Hi check this code :

code

data: q_data type p decimals 3,

c_data(17) type c.

c_data = '122352387.123'.

move c_data to q_data.

write:/ q_data.

[/code]

Also you can build a FM for this purpose

FUNCTION Z_CONV_POINT_TO_COMMA.

*"----


""Local interface:

*" IMPORTING

*" VALUE(NUM1)

*" EXPORTING

*" VALUE(STR1)

*"----


data:i type i,

length type i,

stest(16),

sakt(1).

stest = num1.

length = strlen( stest ).

while i < length.

sakt = stest(1).

if sakt = '.'.

sakt = ','.

endif.

shift stest.

concatenate str1 sakt into str1.

i = i + 1.

endwhile.

ENDFUNCTION.

Regards,

Raj.

Read only

Former Member
0 Likes
1,621

Hi,

try the FMs below

C14W_CHAR_NUMBER_CONVERSION,

C14W_NUMBER_CHAR_CONVERSION,

CHAR_INT_CONVERSION

FM CONVERT_FROM_CHAR_SORT_RFW

Reward Points if found helpfull..

Cheers,

Chandra Sekhar.

Read only

Former Member
0 Likes
1,621

Hi,

Use function module MOVE_CHAR_TO_NUM.

or

data: V_char(15).

data: v_menge type menge_d.

V_char = '11'.

v_menge = V_char.

write: / v_menge.

https://forums.sdn.sap.com/click.jspa?searchID=11857678&messageID=4900229

Regards

Kiran Sure