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: 

Char-Curr

Former Member
0 Kudos
100

I have a pas a value from v_char(254) to v_curr type curr..........

When I do that ending up in short dump...

Let me know how to fix this error.

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
63

For example, here I'm getting rid of the ','



data: v_val(254) type c value '12,345.45'.
data: v_curr type bseg-DMBTR.

translate v_val using ', '.
condense v_val no-gaps.
v_curr = v_val.

write:/ v_curr.

Regards,

Rich Heilman

8 REPLIES 8

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
63

Make sure that the value has the format as 1233455.89 There must not be any commas or thousands separator, and the decimal notication should be a '.'. Make sure to format correct before adding to the currency field.

Regards,

Rich Heilman

0 Kudos
63

can you explain with a example please.

Former Member
0 Kudos
63

hi Alex,

refer to these related threads

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
64

For example, here I'm getting rid of the ','



data: v_val(254) type c value '12,345.45'.
data: v_curr type bseg-DMBTR.

translate v_val using ', '.
condense v_val no-gaps.
v_curr = v_val.

write:/ v_curr.

Regards,

Rich Heilman

Former Member
0 Kudos
63

HI,

I tested it and it is working fine.. check this code.. send your code if does not work..

<b>DATA : LV_char(255) TYPE C,

CURR LIKE /BIC/AZDPS00100-/BIC/ZOKSPA.

LV_char = '12345'.

CURR = lv_char.

*write lv_vbeln to curr .

WRITE CURR.</b>

Cheer's

mahesh

Former Member
0 Kudos
63

hi Alex,

even write to statement works...

write v_char to v_curr.

ferry_lianto
Active Contributor
0 Kudos
63

Hi,

Please try FM CHAR_NUMC_CONVERSION.

Regards,

Ferry Lianto

Former Member
0 Kudos
63

HI Alex,

Check this code.. it is working..

DATA : LV_CHAR(255) TYPE C,

CURR LIKE /BIC/AZDPS00100-/BIC/ZOKSPA.

LV_CHAR = '12,345.00'.

TRANSLATE LV_CHAR USING ','.

replace all occurrences of ',' in lv_char with space.

condense lv_char no-gaps.

CURR = LV_CHAR.

WRITE CURR.

Thanks,

Mahesh