Skip to Content
-2

Wrong display of CURR field in ALV Grid

May 07 at 09:59 AM

64

avatar image

alv.png

Hello guys,

due to problem of rounding I defined for some currency field in ALV grid data element with 31 digits, 14 of them decimals. The calculation works fine but the alv does not display the value correct. Which parameter do I have to set to change this?

Left you see the right value, right the 31 digits value. If I debug the report, I see that the value is stored correctly, so it actually looks like a display problem of the grid?

Regards

Michael

alv.png (839 B)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Gaurav Sharan
May 07 at 11:10 AM
0

Hi Michael,

In order to display Currency in correct format, you need to set Currency key field in the field catalog of Quantity field. Something like WA_FIELDCAT-CURRENCY. Now fill currency key value with your defined currency Key which has 31 digit value. ALV should be able to convert it in display.

Thanks

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Mhh you really mean quantity field?

Field CURRENCY means the real currency value e.g. EUR. Sure you did not mean CFIELDNAME? If so I put the currency field in there, but that does not take any effect.

Regards

Michael

0
Rajkumar Narasimman May 07 at 12:04 PM
0

Hi Michael,

"Field CURRENCY means the real currency value e.g. EUR. Sure you did not mean CFIELDNAME?

In field catalog, we will mention the reference field name only, just map the Currency Field name in CFIELDNAME attribute as like below.

wa_fcat-CFIELDNAME = 'WAERS'.

If you are using SALV class to display ALV, use the method SET_CURRENCY_COLUMN method.

Regards

Rajkumar Narasimman

Show 4 Share
10 |10000 characters needed characters left characters exceeded

I did like this but that was not the cause of the problem.

Regards

Michael

0
The calculation works fine but the alv does not display the value correct.

How are you saying the calculation works fine, did you checked in debug?

Can you share the debug and sap output screenshots with respective code(only calculation code)?

0

Hi Michael/Rajkumar,

I have also faced a similar issue and linking currency value with currency Key field doesnt help as it assumes the currency value field has 2 decimals. May be you will ahve to change the fieldcatalog settings of the ALV to be able to display the total length of 31 chars along with 14 decimal places just like an packed decimal number.

https://help.sap.com/viewer/70396d7dec4c4f19b9ca3b2e47559d12/7.40.17/en-US/4eb7c9eeb5c5213be10000000a42189d.html

Regards,

Aditya

0

Which option should I have to set in fieldcatalog settings? Only tried with decimals_o to set on 2 decimal digits but that has no effect.

@Rajkumar

Yes I debuged it and the field looks right like the left side on my screenshot in first posting. But in grid it looks like the right side.

Regards

Michael

0