Application Development and Automation 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: 
Read only

OBJECTS_NOT_CHARLIKE : ALV export to local file

former_member125661
Contributor
0 Likes
2,749

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

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

5 REPLIES 5
Read only

former_member194669
Active Contributor
0 Likes
1,118

I think you need to fill up


 if p_fname eq 'QUANTITY' or p_fname eq 'TOTAL_QUANTITY' .
    v_fcat-quantity = <UOM value> ." Fill up the UOM for quantity
  endif.

Read only

0 Likes
1,118

Did that earlier, filling the quantity UoM and currency UoM did not help.

Read only

Former Member
0 Likes
1,118

Hi Shareen,

If you change all the fields of your itab that you are passing to the Reuse_ALV RFC to type 'Char' or 'String' then the dump problem won't occur.

Try that and lemme kno if it works...I dunno if this is the right way to do it.But mine worked when i did this.

Read only

0 Likes
1,118

Hi,

You can use the SAP Standard table name in the Place of FIELDNAME. The dump will not come.

Read only

0 Likes
1,118

while creating the field catalog u using only field ref_table. but ur also use ref_fieldname. Otehrwise u can not use both.

if ur using ref_table and not ref_fieldname program does not understand which field it refers to. so it may change to get the dumps.

Thanks,

Pavan.