2021 Mar 23 12:54 PM
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)
2021 Mar 23 1:14 PM
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.
2021 Mar 25 4:23 PM
Dear Taha Farosh,
Thanks for your information, issue was resolved.
2021 Mar 23 3:38 PM
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?
2021 Mar 23 3:46 PM
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.
2021 Mar 23 3:50 PM
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