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: 

Increase in no of decimal places

Former Member
0 Kudos

Hi,

We had a requirment to have the currecy values up to 5 decimal places. Which is 2 in SAP standard. For that we went for the USDN currecy type of SAP which is already 5 decimal places.

In the application etc we can see its comming 5 decimal. But when we try to create some non-std report or try to fetch in some data by user queries it picks up just two.

Like the net prize is 12.12345.

in table it gets stored as 12123.45. (as netprize dataelement is wertv6) (2 decimal)

in non standard reports and SAP User Queries we get 12,123.45.

whereas we want that even in the NON standrad reports and user queries it should pick up the value as 12.12345.

Please let me know some way by which i can change the no of decimal places in SAP Tables also to 5 decimals. or some setting by which every where in output it shows 5 decimals.

This is really very very urgent.

Thanks,

NC

9 REPLIES 9

Former Member
0 Kudos

Hi NC,

The solution involves the formatting of the data in the output and not the data stored in SAP tables.

When writing the output of the currency data, you should always use the write statement using the option currency 'USDN' (or variable WA_CURR). Check SAP help on the write statement options for details.

With the ALV, you must have a currency field in the field category for it to automatically display correctly.

For interfaces, you can use function module BAPI_CURRENCY_CONV_TO_EXTERN_9.

I hope this helps.

Mike Vondran

0 Kudos

Hi Mike,

Thanks for your immediate response.

I can set in the currency for 2 decimals in the report, but again in the user queries we dont have that option. it just picks up from the table what ever is displayed there.

Any Suggestions

Thanks,

NC

0 Kudos

Hello NC,

You must understand that regardless of whether your program is standard or custom, the data is finally going to be stored in the database. If the data for this field goes to a particular fied in one of the tables whose data element is wertv6, then there's simple no way you can store it in the format you desire.

I hope I have understood your issue correctly. If not then please get back.

Regards,

Anand Mandalika.

0 Kudos

Hi Anand,

I do understand this. But the requirment is as such that i want all the outputs of user queries (SQVI, SQ01) to come in 5 decimal places. in non standrad report i can set in the currency type as 5 decimal, but how can i control the same in the query out put.

Dont we have an exit for the same.

Thanks,

0 Kudos

Hi NC,

you can place some help-variables and

coding in your info-set (SQ02)

e.g.

1) SQ02-Extras-Create-additional field

2) add coding to RECORD PROCESSING:

write bseg-dmbtr to h_val01 currency 'USDN'.

3) insert add.field(1) to your field-group

regards

Andreas

Message was edited by: Andreas Mann

0 Kudos

Hi NC,

when you define your output, you have to use amount and currency.

Example: table KONP. Do not display (or fetch) only field KBETR, but also assigned currency field KONWA. Then output on screen (in general: with output conversion like write) will use customizing behind currency definition, to get correct number of decimals.

Have a look at transaction SE11, when you try to find connections for your tables / structures. In tab currency/quantity fields connection is defined. Correct display in lists can only be expected, if reference field is filled before display (e.g. with 'USDN').

Regards,

Christian

0 Kudos

Hi,

I am trying to fetch the data from table 'MBEW' and few other tables . Here there is no option to add currency, as this field is not there in the table.

We are also using 5 decimals, and i want to get the output of stprs field.

In there a way in SQVI i can change teh currecy output to 5 decimal.

Please help.

0 Kudos

Hi,

just as I explained: in SE11 of MBEW T001-WAERS can be found -> that is default (house) currency of the company. Most times valuation area (BWKEY) is equal company code (BUKRS), otherwise convert with help of T001K-BUKRS.

So you can read currency out of T001-WAERS and fill into additional field.

In case of SQVI -> two additional joins.

Regards,

Christian

0 Kudos

Slight correction (hope I am not offending Christian), BWKEY (Valuation Area) is related to the plant T001W-WERKS and not company code T001-BUKRS.

the correct link is to go thru T001K (mbew-bwkey eq t001k-bwkey) to T001 (t001-bukrs eq t001k-bukrs) to get T001-WAERS for MBEW, but you are right that MBEW-BWKEY, 9 out of 10 times is the plant code (not company code, seems like company code if the company code and the plant code are the same)

Now getting back to the query, if the above join from MBEW to T001K to T001 is done and T001-WAERS selected in your query, the value will come out with the USDN format, provided the currency for the company is USDN

Phew!

Rishi