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: 

Different amount filed format in Development & Quality server

0 Kudos
296

Hi,

I am facing the issue while fetching the data based on amount filed (DMBTR). I observed that in development server amount filed stores data like - 60.000,00, where as same data was stored in Quality server like - 60,000.00. Please suggest how to handle this error to fetch the data using select query.

DATA : lv_bal_amnt(13) type c.

IF lt_balance[] IS NOT INITIAL.

CLEAR ls_balance.
LOOP AT lt_balance INTO ls_balance.

CLEAR : ls_payment, lv_bal_amnt.
READ TABLE lt_payment INTO ls_payment WITH KEY utr_number = ls_balance-utr_number
customer_code = ls_balance-customer_code
company_code = ls_balance-company_code.
IF sy-subrc EQ 0.

lv_bal_amnt = ls_balance-amount.
REPLACE ALL OCCURRENCES OF '.' IN lv_bal_amnt WITH space.
REPLACE ALL OCCURRENCES OF ',' IN lv_bal_amnt WITH '.'.
CONDENSE lv_bal_amnt NO-GAPS.

CLEAR : wa_bsid.
SELECT SINGLE * FROM bsid INTO wa_bsid WHERE bukrs = 'MIL' AND
belnr = ls_payment-clearing_doc AND
gjahr = ls_payment-fiscal_year AND
zuonr = ls_balance-ori_document AND
blart = 'KC' AND
dmbtr = lv_bal_amnt. " ls_balance-amount.

ENDLOOP.

Please suggest any faction module to resolve my issue.

Development Data: (Amount Filed - 500.000,00)

Quality Data: (Amount Field - 12,205.64)

5 REPLIES 5

former_member736527
Active Participant
233

That setting is present in your user profile in SU01D tcode

Also, I am not sure why you're doing those REPLACE ALL OCCURENCES string operations. If your LS_BALANCE-AMOUNT is of type DMBTR, then you can pass it as it is to the select query.

0 Kudos
233

Dear Taha Farosh,

Thanks for your information, issue was resolved.

raymond_giuseppi
Active Contributor
233

Don't do those explicit conversion from currency amount to text and implicitly back conversion in the WHERE clause. The internal value of the field can be used in the where criteria, your conversion may result in wrong amount conversions related to number of decimal for the currency code.

If you actually require the cleared items/amounts related to a clearing document, look at some FMs such as GET_CLEARED_ITEMS 'Cleared items for a payment document'.

Or can you explain your exact requirement?

Sandra_Rossi
Active Contributor
0 Kudos
233

Please edit your question, select your code and press the "CODE" button to make it correctly colorized/indented, so that it's easier for us to analyze it. Thank you.

Sandra_Rossi
Active Contributor
233

Comma and dot are rendered almost the same in SAP Community, except if you use Code button. For people who wonder which one has decimal separator comma or dot, here is the question better formatted:

development server amount filed stores data like

- 60.000,00

where as same data was stored in Quality server like

- 60,000.00