11-02-2015 9:41 AM
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.
11-02-2015 10:42 AM
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.
11-02-2015 11:15 AM
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.
11-02-2015 11:11 AM
In field catalog add DATATYPE = 'CURR', also insure WAERS has DATATYPE = 'CUKY'.
Regards,
Raymond