Hi All,
I have a requirement to print the amount as space for thousand seperator and comma for decimals.
I have set the pattern format such that the amount is printing in below format as required.
Locale---Italian.
Space as thousand seperator and comma as decimal seperator.
for example 1 234,45
As some of the Currencies will not have decimals, now users would like to print amount without decimals. For example in my case amount printing in KRW ( Korean currency ) is also similar to the above format which is wrong.
for example Now amount is printing as 55 000,00. But actually it should be 550 000. Similarly for JPY currency also, as it doesnot haves decimals ( checked in TCURX table ).
I have written some logic in the interface. below is the logic.
WRITE:
wa_mhnd1-wrshb to wa_item-wrshb CURRENCY WA_ITEM-WAERS.
*READ TABLE lt_tcurx INTO lwa_tcurx WITH KEY currkey = wa_item-waers BINARY SEARCH.
IF sy-subrc = 0.
IF lwa_tcurx-currdec = '0'.
REPLACE ',' WITH SPACE INTO WA_ITEM-WRSHB.
REPLACE ',' WITH SPACE INTO WA_ITEM-WRSHB.
else.
REPLACE ',' WITH SPACE INTO WA_ITEM-WRSHB.
REPLACE ALL OCCURRENCES OF '.' in wa_item-wrshb WITH ','.
endif.
ENDIF.
a. when the write statement gets executed amount will be in ,. ( 1,234.45 )format. Then my logic gets executed correctly. In this company code is CH10 ( EUR ) and KR10.
b. But sometimes after the write statement gets executed amount will be in ., format ( 1.234.45 ). In this case my logic works, but gives the wrong value. In this case company code is VN10 ( EUR )
In both the cases currency is EUR.
Will the decimal format change accordingly based on the company code code currency.Can anyone please tell me why write statement behaved differently.
Do I need to change any locale in the adobe form, or any other logic to be written in interface. ? I am trying it out from long time, but not able to fix it. I will have to fix it ASAP.
Can anyone kindly please help me how to achieve this ?
Thanks and Regards,
Karthik Ganti.