We have added search box. Key in SAP issue keyword to search
TopBottom

Announcement: wanna exchange links? contact me at sapchatroom@gmail.com.

RE:[sap-dev] Amount in FM : CONVERT_TO_LOCAL_CURRENCY

Posted by Admin at
Share this post:
Ma.gnolia DiggIt! Del.icio.us Yahoo Furl Technorati Reddit

Reply from john.louk on Oct 26 at 11:35 AM
It is correct if you test these kind of FMs through SE37 the parameters will be considered a character type (type c). and this gives some problems. It also means that general numeric editing will take place in the output parameter.

Essentially, with these function modules that do not type there parameters, you need to test them by writing a program and calling them from it. It do the testing be writing a quick local ABAP program.

I call these kinds of function module with fields that I have defined like the fields from the tables that I am using. For example, lets say I am looking at my Sales document line's net value (VBAP-NETWR). I would define my variables that go into this function module and out of it like "<variable> type NETWR_AP." this would make sure that my data is in a numeric field and when the fm transfer the values it should be OK.

If I then need this in an edited format (such as an IDoc field which should be a type CHAR), I would execute a WRITE statment in my code and include the CURRECNY clause. If you do not use the CURRENCY clause then you will not get the correct number of decimal places.

So, if the FM "CURRENCY_AMOUNT_SAP_TO_IDOC" you mention does the same thing as the WRITE, then you definitely have it.

Cheers



John

---------------Original Message---------------
From: Chidori0127
Sent: Thursday, October 25, 2012 8:22 PM
Subject: Amount in FM : CONVERT_TO_LOCAL_CURRENCY

Thank you very much for your kind advice!
Unfortunately I can't get the source code.
But my trouble is solved by your advice.

My questions is ...
Execute FM CONVERT_TO_LOCAL_CURRENCY in SE37 and I get the following result.
1.00 USD -> 115 JPY
1.00 USD -> 120GBP
JPY looks fine, but GBP must be 1.20, not 120.
But it is because of parameter type.
If I execute FM in SE37, the foreign_amount and local_amount has CHAR(200).
So the result is SAP internal format, but it looks external format because of lack of comma.

In SAP standard program, the amount is transported with internal format.
So I should use internal format in FM CONVERT_TO_LOCAL_CURRENCY,
and I need to chagne external format with CURRENCY_AMOUNT_SAP_TO_IDOC if necessary.
Is it right?

 
Reply to this email to post your response.
 
__.____._
Manage Settings | Unsubscribe | Create FAQ | Send Feedback
  
Copyright © 2012 Ziff Davis, Inc. and message author.
Ziff Davis, Inc. 28 E 28th Street New York, NY 10016
john.louk  

Workflow Designer
12 achievements
 
Mark as helpful
View this online
Ask a new question
 
In the Spotlight
Toolbox.com for iPhone & Android: Ask Questions & Get Answers Anywhere. Download the Free App

_.____.__

0 comments:

Post a Comment

T r a n s l a t e to your language