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: 

CFIELDNAME issue with currency decimal ALV list display

Former Member
0 Kudos

I am using the following code to do the sum of the currency field with currency code in the subtotal place.

But when i am using the cfieldname fieldcat i have the decimal issue in the currency amount column. But i am getting the currency unit in the subtotal column.

* Total amount

  ls_fieldcat-fieldname = 'TOTAL_AMT'.

  ls_fieldcat-tabname = 'LT_TAB'.

  ls_fieldcat-col_pos = 5.

  ls_fieldcat-seltext_l = 'TOTAL PRICE'.

  ls_fieldcat-outputlen = 18.

  ls_fieldcat-do_sum = 'X'.

  ls_fieldcat-cfieldname = 'WAERS'.

  APPEND ls_fieldcat TO lt_fieldcat.

  CLEAR ls_fieldcat.

The currency amount has the type of p  lenght 14 dec 2. Please share your ideas!

Regards,

Pradeep.

3 REPLIES 3

former_member289261
Active Contributor
0 Kudos

Hi,

Please provide a reference table and reference field in fieldcatalog with data type and length as you mentioned.

Or you can provide it in Internal type and length field.

0 Kudos

Hi Prdeep,

Can you check the field catalog type which you are referring should be as mentioned below.

Data: t_alv_fieldcat    TYPE slis_t_fieldcat_alv,


and this cfieldname  type slis_fieldname, " field with currency unit


please follow the below sample stand SAP programs which may help you:


J_1AINFK

J_1AINFW

J_1AINFD


Regards,

Srini.

raymond_giuseppi
Active Contributor
0 Kudos

In field catalog add DATATYPE = 'CURR', also insure WAERS has DATATYPE = 'CUKY'.

  • How did you fill the amount field value (from a CURR standard field)
  • Did you execute The Consistency Check?

Regards,

Raymond