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

Curreny issue

Former Member
0 Likes
989

hi Frnds,

I facing some problem in converting the currency .

The amount value is populated in a character object of length 15

for eg amt = 4,233.89

after uploading the value becomes 4.233.89

hence once while moving this value to a packed value with decimal 2 points , i am facing a dump since ther are decimal points at 2 places.

please help me in solving the issue.

regards,

Khushboo

1 ACCEPTED SOLUTION
Read only

gopi_narendra
Active Contributor
0 Likes
970

You can use this code to change the decimals

This does not involve changing the user settings. This is dynamic and will not effect the user settings.

Hope this works, try it

  select single * from USR01 where BNAME = SY-UNAME.

  case USR01-DCPFM.
    when 'X'.
      translate L_AMT1 using ',.'.
      translate L_AMT2 using ',.'.
    when ' ' .
      translate L_AMT1 using '.,'.
      translate L_AMT2 using '.,'.
    when others.

  endcase.

Regards

Gopi

hi Frnds,

I facing some problem in converting the currency .

The amount value is populated in a character object of length 15

for eg amt = 4,233.89

after uploading the value becomes 4.233.89

hence once while moving this value to a packed value with decimal 2 points , i am facing a dump since ther are decimal points at 2 places.

please help me in solving the issue.

regards,

Khushboo

8 REPLIES 8
Read only

varma_narayana
Active Contributor
0 Likes
970

Hi..

You can try this command to Move ur Char field to Pack field.

PACK <CHARFIELD> TO <PACK FIELD>.

<b>Reward if Helpful</b>

Read only

0 Likes
970

thanks for the reply but issue is that there are 2 points of decimal which are not correct . how to overcome this problem . 4,236.89 is converted to 4.236.89 which is a problem.

<b>reward will be given to the best answer</b>

Read only

gopi_narendra
Active Contributor
0 Likes
971

You can use this code to change the decimals

This does not involve changing the user settings. This is dynamic and will not effect the user settings.

Hope this works, try it

  select single * from USR01 where BNAME = SY-UNAME.

  case USR01-DCPFM.
    when 'X'.
      translate L_AMT1 using ',.'.
      translate L_AMT2 using ',.'.
    when ' ' .
      translate L_AMT1 using '.,'.
      translate L_AMT2 using '.,'.
    when others.

  endcase.

Regards

Gopi

Read only

Former Member
0 Likes
970

Hi Tyagi,

Once Go for Menubar settings> user profile-> own data> Defaults.

check there for ur Decimal notation Might be here is the problem.

Try it once.

same problem i have faced but at tat time i do changes in type declaration i didnt remember exactly it might be(i,c)

Thanks

Naveen khan

Message was edited by:

Pattan Naveen

Read only

0 Likes
970

i need to do somethng genral cannnot change user's own data settings

Read only

Former Member
0 Likes
970

how u are uploading data into SAP ?

Read only

0 Likes
970

read dataset thats from application server

Read only

0 Likes
970

Hi,

Try using the REPLACE command.

Regards,

Yogesh