cancel
Showing results for 
Search instead for 
Did you mean: 

Wrong display of CURR field in ALV Grid

Missschaaa
Participant
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

rajkumarnarasimman
Active Contributor
0 Kudos

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

Missschaaa
Participant
0 Kudos

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

Regards

Michael

rajkumarnarasimman
Active Contributor
0 Kudos
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)?

kjyothiraditya
Participant
0 Kudos

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/4eb7c9eeb5c5213be10000000...

Regards,

Aditya

Missschaaa
Participant
0 Kudos

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

gaurav_sharan
Explorer
0 Kudos

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

Missschaaa
Participant
0 Kudos

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