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: 

How to store 10,000 in a currency field of length 15.

Former Member
0 Kudos

Hi Experts

wa_char of type char length 255. Now by some program i am getting 10,000.00 in wa_char.

I had to pass it to a vairable wa_curr of currency type of length 15.

I tried to firs pass to numc type variabl or P type variable then to pass it to wa_curr but ...everytime dump is coming for mismatch....

I think problem is with the comma and dot(10,000.00)..but cant abel to remove it.

Please help.

i will award points to every helpful answer.

thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hello Saurabh,

As far as i have understood,you need to pass a value to a currency field right?.

Try passing the value to a string field and then to a currency field.

If this doesnt work,can you please make ur question clear?

Regards,

Reema.

5 REPLIES 5

Former Member
0 Kudos

Comma separator or decimals are user specific settings.

Please use :

  • Get the user settings

SELECT SINGLE DCPFM

FROM USR01

INTO L_F_DCPFM WHERE BNAME = SY-UNAME.

IF NOT <YOUR_CURRENCY_FIELD> IS INITIAL.

CASE L_F_DCPFM.

WHEN 'Y' OR ' '.

REPLACE '.' WITH ',' INTO <YOUR_CURRENCY_FIELD>.

ENDCASE.

ENDIF.

Please revert if any further help.

Enjoy.

Regards,

A.Singh

Former Member
0 Kudos

Hi,

You declare the variable in this formate

DATA: WA_CHAR(30).

IF HELPFULL REWARD

Former Member
0 Kudos

consider this program, i hope u'll understand the logic

data:

wa_char(255),

wa_amount type dmbtr,

wa_temp type dmbtr.

wa_amount = 10000.

wa_char = wa_amount.

write wa_char.

condense wa_char.

wa_temp = wa_char.

write wa_temp.

Former Member
0 Kudos

Hello Saurabh,

As far as i have understood,you need to pass a value to a currency field right?.

Try passing the value to a string field and then to a currency field.

If this doesnt work,can you please make ur question clear?

Regards,

Reema.

sreenivasa_reddy
Participant
0 Kudos

Please try this

data: w_curr_temp type char15.

wa_curr

write: wa_curr to w_curr_temp currency 'USD'.

it can be USD or EUR.....etc.i.e document currency