‎2020 Apr 02 5:52 PM
Hi,
Instead of 90.900 its coming as 90.900,00 after using currency_amount_sap_to_display function module.
Please let me know as its an urgent change to be fixed.
Regards,
Aniket Narayan.
‎2020 Apr 02 8:08 PM
Post your code if it's urgent and you want to be helped. Explain the context too.
‎2020 Apr 03 4:44 AM
aniket1989,
We can only understand how the FM behaves from your post but to provide the solution we want to know cause of the issue. Only with your clear issue explanation and code that is used we will be able to help you further.
Regards!
‎2020 Apr 03 6:45 AM
Hi Sandra/Satish,
Please see the below code for the reference and finally using ALV FM data is being displayed:
For Tax code D3 and D2 they need summation value to be displayed on the other line, its old code so they are using REUSE_ALV_GRID_DISPLAY FM.
Loop at t_ivat into ls_ivat where mwskz = 'D3'
or mwskz = 'D2'.
ls_ivatt = ls_ivat.
append ls_ivatt to lt_ivat.
clear ls_ivatt.
AT END OF belnr.
SUM.
ls_ivatt = ls_ivat.
clear ls_ivat.
p_intval = ls_ivatt-hwbas.
call function 'CURRENCY_AMOUNT_SAP_TO_DISPLAY'
EXPORTING
currency = 'VND'
amount_internal = p_intval
IMPORTING
amount_display = g_disval
EXCEPTIONS
internal_error = 1
OTHERS = 2.
ls_ivat-hwbas = g_disval.
ls_ivat-bldat = abap_false.
ls_ivat-item = abap_false.
append ls_ivat to lt_ivat.
clear ls_ivat.
ENDAT.
ENDLOOP.
This is where i am doing the summations.
Regards,
Aniket Narayan.
‎2020 Apr 03 7:11 AM
Hi Aniket.
Could you check the user id decimal notification in the transaction code SU01, refer the below screen shot

Regards
SS
‎2020 Apr 03 8:46 AM
I don't know what does CURRENCY_AMOUNT_SAP_TO_DISPLAY, but usually you don't need this kind of function module to display the right number of decimals (0 in your case).
How many decimals has P_INTVAL?
VND is a currency without decimals, so the standard ALV feature for currencies should work. Search the forum for more information how it works.
‎2020 Apr 03 1:27 PM
I looked at CURRENCY_AMOUNT_SAP_TO_DISPLAY, and I confirm it's completely useless.
By the way, it's important that you explain what value you expect.
The best solution in your case is to use the ALV feature of currencies.
If you don't have time to search in the forum, use this:
DATA(p_intval) = CONV WMTO_S-AMOUNT( '90.9000' ). " 4 decimals
DATA(string) = |{ p_intval CURRENCY 'VND' }|. " 0 decimals
ASSERT string = |909000|. " but is it what you expect?
‎2020 Apr 03 1:53 PM
‎2020 Apr 03 2:14 PM
BAPI_CURRENCY_CONV_TO_EXTERNAL is useful only for non-ABAP programs (it can be called by RFC). In ABAP programs, you usually don't need it because there are more efficient and shorter ABAP statements.
‎2020 Apr 04 7:23 AM
Hi Sandra,
My requirement is to display the sum of Tax-code(MWSKZ) field with values of 'D3' and 'D2' only. There are so many tax codes currently being displayed. My query is how to achieve this requirement as 'do_sum' in fieldcatalog will for columns instead of values in the field.
I hope i was able to explain you the requirement.
Please let me know incase you need for clarifications on this.
‎2020 Apr 04 2:53 PM
Is the question about "do_sum" or about "zeroes after decimal point"?
‎2020 Apr 04 3:04 PM
Can you tell us what value you have in debug for P_INTVAL and ls_ivatt-hwbas? 90.9000 and 90.900? (only number of decimals should vary)
What is the name of the variable which contains the corresponding currency code?
Thank you.
‎2020 Apr 04 4:39 PM
‎2020 Apr 04 6:01 PM
‎2020 Apr 04 6:14 PM
Dear Aniket
First of all you do not need to use this function - because you can handle it in ALV field catalog itself to display as Sandra mentioned. However, if you still want to use this function try to use the export parameter in sync with the data type as below.
data : p_discur like TCURC-WAERS,
p_intval like WMTO_S-AMOUNT,
gd_disval like WMTO_S-AMOUNT. "Display Amount
p_discur = 'VND'.
p_intval = ls_ivatt-hwbas.
CALL FUNCTION 'CURRENCY_AMOUNT_SAP_TO_DISPLAY'
EXPORTING
currency = p_discur
amount_internal = p_intval
IMPORTING
AMOUNT_DISPLAY = gd_disval
EXCEPTIONS
INTERNAL_ERROR = 1
OTHERS = 2.
See if it works.
You can refer to this similar question - which I answered 6 years back..
https://answers.sap.com/questions/10510579/how-to-set-currency-display-format.html
Regards,
Venkat
‎2020 Apr 04 7:07 PM
Hi Venkat
I have tried this piece of code as well but still issue persists. Even i am planning to use ALV features as do_sum for summation but how can we do summation only for few taxcodes. Help me on this.
Hi Sandra,
In p_intval value i can see during debugging is 9090.9100 and in g_disval is 909091.0000. But when again assigning it back to
ls_ivat-hwbas = g_disval the value being append is 909091.00 .
So finally what i am getting as a value is 909.091,00 instead of 909.091, extra ',00' has been added after displaying. It happens for all the values. Is this happening because of using Control level statement or different amount fields?