I have a run time error 'OBJECTS_NOT_CHARLIKE ' when trying to export the ALV grid to a local file.
It works fine when I use the option 'Export to spread sheet'.
I have a few quantity fields and currency fields in the grid.Now, I don't want to change all these fields into character fields. I feel that there is something in the field catalog that I need to do and that I cannot recall now.
Any tips will be useful. Thanks.
PS : Quantity is a quan type field in table '/BIC/APCA_O0100' and Balance is a currency type field in the same table. I am trying to use these fields as my reference field ,because I also need to do auto summation on some fields by referencing them.QUANTITY ,Sales & Balance are the only real fields in the DDIC table /BIC/APCA_O0100. Rest are just fields of the internal table - total_quantity,total_sales,cash,gascard.
perform append_catalog using 'QUANTITY' '/BIC/APCA_O0100' 'Qty' .
perform append_catalog using 'SALES' '/BIC/APCA_O0100' 'Sales' .
perform append_catalog using 'TOTAL_QUANTITY' '/BIC/APCA_O0100' 'Total Qty' .
perform append_catalog using 'TOTAL_SALES' '/BIC/APCA_O0100' 'Total Sales' .
perform append_catalog using 'CASH' '/BIC/APCA_O0100' ' Cash $' .
perform append_catalog using 'GASCARD' '/BIC/APCA_O0100' 'Gas Card $' .
form append_catalog using value(p_fname)
value(p_tname)
value(p_coltext).
data : v_fcat type lvc_s_fcat.
v_fcat-fieldname = p_fname.
v_fcat-ref_table = p_tname.
if p_fname eq 'QUANTITY' or p_fname eq 'TOTAL_QUANTITY' .
v_fcat-ref_field = 'QUANTITY' .
v_fcat-do_sum = 'X'.
endif.
if p_fname eq 'GASCARD' or p_fname eq 'SALES' or p_fname eq 'TOTAL_SALES' or p_fname eq 'CASH'.
v_fcat-ref_field = 'BALANCE' .
v_fcat-do_sum = 'X'.
endif.
v_fcat-coltext = p_coltext.
append v_fcat to gi_fieldcat.
endform. "APPEND_CATALOG