Skip to Content

BAPI_CONTRACT_CREATE handling more decimals than 2

Dear all, I'm facing a task in which I have to create a contract in ECC from an external template.

The custom report runs fine as far the contract is in a currency that allows up to 2 decimal places, but when the currency has an higher number of allowed decimal digits I'm stuck on a technical issue.

Basically, from the FM interface I see that values such as the Target Value at header level are defined as CURR 11 2, that means, it allows decimals up to 2 digits. The same limit occours also on prices at item level.
According to what I see from the database tables backend side, values are stored as "multiplied" by a 10 factor in case of currency with three decimals.
An example: from the ME33K I see a price like "123,345" for an item in LYD currency (3 decimal places). But on the DB, I see the value stored as "1233,45".

So far, so good. It seems that a 10^x factor is applied in order to handle physically the value on the CURR11 2 field for currencies allowing more than 2 decimals.

The problem is: how to handle this with the BAPI_CONTRACT_CREATE function module?

I tried to multiply prices in input in order to make them fit in the dataelement CURR11 2, hoping that an auto-calculation inside the FM would automagically recognize that the currency LYD has 3 decimal digits and hence adjust the value in output (ME33k).

But this is not the case: if I pass 1233,45 LYD to the FM, the contract created reports effectively 1233,45 LYD and not 123,345.

I'm sure I'm missing something, can't think the BAPI_CONTRACT_CREATE FM cannot be used in such cases. Any guidance would be highly appreciated.


Add a comment
10|10000 characters needed characters exceeded

Related questions

0 Answers

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.