Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

the currency cannot be displayed in ALV if I choose a saved layout

peter_peng
Product and Topic Expert
Product and Topic Expert
0 Kudos
203

I have a currency field in ALV, and I set the currency key for this field,

gr_fieldcat-cfieldname = 'WAERS'.

gr_fieldcat-datatype = 'CURR'.

gr_fieldcat-ctabname = 'ITAB_RESULT'.

please see the following info:

step 0, the original amount is 13.45

step 1, run program, now display the amount correctly, 1.345

step 2, save the layout as 'layout1'

step 3, quit the program

step 4, run program again, now the amount is correct:1.345

step 5, choose the layout 'layout1'

step 6, now, the amount is incorrectly, it is 13.45

it seems the currency key doesn't work now. but I don't know why.

can anybody tell me the reason? thank you!!

5 REPLIES 5

Former Member
0 Kudos
162

Add in field catelog....

CLEAR gs_fcat.

gs_fcat-fieldname = 'CURRENT'.

gs_fcat-ref_table = 'ITAB_RESULT'.

gs_fcat-coltext = 'currency'.

gs_fcat-seltext = 'currency'.

gs_fcat-col_pos = 1.

gs_fcat-outputlen = 13.

gs_fcat-no_zero = abap_true.

gs_fcat-datatype = 'CURR'.

gs_fcat-do_sum = abap_true.

APPEND gs_fcat TO gt_fcat.

Message was edited by:

Minal Nampalliwar

peter_peng
Product and Topic Expert
Product and Topic Expert
0 Kudos
162

Hi, Nampalliwar, I did so, but it didn't work,,,

peter_peng
Product and Topic Expert
Product and Topic Expert
0 Kudos
162

can anybody help me?

it always displays correctly. but if I save a variant and then choose this variant later, the currency cannot be displayed correctly.

0 Kudos
162

Chk the refresh and clear stmnts in u code.

peter_peng
Product and Topic Expert
Product and Topic Expert
0 Kudos
162

hi, Devi, thanks for your words, could you explain more?