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

object_not_charlike error in ALV print

former_member125661
Contributor
0 Likes
1,312

I get the object_not_charlike run time error when i use print option in my ALV grid (I used class objects).

I know that it is because of some quant fields & currency field that are in the columns.

I feel i am not referencing them correctly.

The internal table that I am using doesn't have any Uom field or currency type field. So, I was trying to reference to MARA-MEINS and T001-WAERS. I don't think i am getting it right.

My internal table is called Itab.

and the 2 quant fields are MINBE,EISBE and 2 currency fields are 'VERPR,STPRS. Please advice..Thanks.

perform append_catalog using 'MINBE' 'MARC' .
  perform append_catalog using 'EISBE' 'MARC' .

 perform append_catalog using 'VERPR' 'MBEW' .
  perform append_catalog using 'STPRS' 'MBEW' .

form append_catalog using value(p_fname)
                          value(p_tname).

  data : v_fcat type lvc_s_fcat.
  v_fcat-fieldname = p_fname.
  v_fcat-ref_table = p_tname.
*  v_fcat-tabname = 'ITAB'.

  case p_fname.

   when 'EISBE' or 'MINBE'.
    v_fcat-ref_table = 'MARA'.
*    v_fcat-REF_FIELD = 'MEINS'.
    v_fcat-qfieldname    = 'MEINS'.


   when 'VERPR' or 'STPRS'.
    v_fcat-ref_table = 'T001'.
*    v_fcat-REF_FIELD = 'WAERS'.
    v_fcat-cfieldname = 'WAERS'.

  endcase.


  append v_fcat to gi_fieldcat.
endform.                    "APPEND_CATALOG

I even removed qfieldname and cfieldname from the case-endcase, still it dumps while I click on print option (Export to excel work fine).

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,247

Hi

If you want to indicate the reference field for currency and quantity fields, u need to add these reference fields to your output table:

PERFORM APPEND_CATALOG USING 'MINBE' 'MARC' .
PERFORM APPEND_CATALOG USING 'EISBE' 'MARC' .

PERFORM APPEND_CATALOG USING 'VERPR' 'MBEW' .
PERFORM APPEND_CATALOG USING 'STPRS' 'MBEW' .

PERFORM APPEND_CATALOG USING 'MEINS' 'MARA' . "<-------- Unit
PERFORM APPEND_CATALOG USING 'WAERS' 'T001' .  "<-------- Currency

*---------------------------------------------------------------------*
*       FORM append_catalog                                           *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
*  -->  VALUE(P_FNAME)                                                *
*  -->  VALUE(P_TNAME)                                                *
*---------------------------------------------------------------------*
FORM APPEND_CATALOG USING VALUE(P_FNAME)
                          VALUE(P_TNAME).

  DATA : V_FCAT TYPE LVC_S_FCAT.
  V_FCAT-FIELDNAME     = P_FNAME.
  V_FCAT-REF_FIELDNAME = P_FNAME.
  V_FCAT-REF_TABLE     = P_TNAME.
*  v_fcat-tabname = 'ITAB'.

  CASE P_FNAME.

    WHEN 'EISBE' OR 'MINBE'.
      V_FCAT-QFIELDNAME    = 'MEINS'.

    WHEN 'VERPR' OR 'STPRS'.
      V_FCAT-CFIELDNAME = 'WAERS'.

  ENDCASE.


  APPEND V_FCAT TO GI_FIELDCAT.
ENDFORM.                    "APPEND_CATALOG

Max

I get the object_not_charlike run time error when i use print option in my ALV grid (I used class objects).

I know that it is because of some quant fields & currency field that are in the columns.

I feel i am not referencing them correctly.

The internal table that I am using doesn't have any Uom field or currency type field. So, I was trying to reference to MARA-MEINS and T001-WAERS. I don't think i am getting it right.

My internal table is called Itab.

and the 2 quant fields are MINBE,EISBE and 2 currency fields are 'VERPR,STPRS. Please advice..Thanks.

perform append_catalog using 'MINBE' 'MARC' .
  perform append_catalog using 'EISBE' 'MARC' .

 perform append_catalog using 'VERPR' 'MBEW' .
  perform append_catalog using 'STPRS' 'MBEW' .

form append_catalog using value(p_fname)
                          value(p_tname).

  data : v_fcat type lvc_s_fcat.
  v_fcat-fieldname = p_fname.
  v_fcat-ref_table = p_tname.
*  v_fcat-tabname = 'ITAB'.

  case p_fname.

   when 'EISBE' or 'MINBE'.
    v_fcat-ref_table = 'MARA'.
*    v_fcat-REF_FIELD = 'MEINS'.
    v_fcat-qfieldname    = 'MEINS'.


   when 'VERPR' or 'STPRS'.
    v_fcat-ref_table = 'T001'.
*    v_fcat-REF_FIELD = 'WAERS'.
    v_fcat-cfieldname = 'WAERS'.

  endcase.


  append v_fcat to gi_fieldcat.
endform.                    "APPEND_CATALOG

I even removed qfieldname and cfieldname from the case-endcase, still it dumps while I click on print option (Export to excel work fine).

8 REPLIES 8
Read only

Former Member
0 Likes
1,247

in the Note 166681 - Use of ALV components not released externally

When you use the REUSE_ALV_LIST_DISPLAY and REUSE_ALV_HIERSEQ_LIST_DISPLAY

function modules, you can perform a consistency check which closes when an

error log is output.

As an alternative to this (for example, if a short dump occurs before the

list is output), set I_INTERFACE_CHECK = 'X' parameter in the source

code when you call up the function modules.

if you do this the ALV show tou you error

Read only

0 Likes
1,247

I am using class method not REUSE.... FM.

Read only

0 Likes
1,247

You can send the code of the call

Read only

0 Likes
1,247
PERFORM APPEND_CATALOG USING 'MINBE' 'MARC' .
PERFORM APPEND_CATALOG USING 'EISBE' 'MARC' .
 
PERFORM APPEND_CATALOG USING 'VERPR' 'MBEW' .
PERFORM APPEND_CATALOG USING 'STPRS' 'MBEW' .

*---------------------------------------------------------------------*
*       FORM append_catalog                                           *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
*  -->  VALUE(P_FNAME)                                                *
*  -->  VALUE(P_TNAME)                                                *
*---------------------------------------------------------------------*
FORM APPEND_CATALOG USING VALUE(P_FNAME)
                          VALUE(P_TNAME).
 
  DATA : V_FCAT TYPE LVC_S_FCAT.
  V_FCAT-FIELDNAME     = P_FNAME.
  V_FCAT-REF_TABLE     = P_TNAME.

ENDFORM.
Read only

Former Member
0 Likes
1,248

Hi

If you want to indicate the reference field for currency and quantity fields, u need to add these reference fields to your output table:

PERFORM APPEND_CATALOG USING 'MINBE' 'MARC' .
PERFORM APPEND_CATALOG USING 'EISBE' 'MARC' .

PERFORM APPEND_CATALOG USING 'VERPR' 'MBEW' .
PERFORM APPEND_CATALOG USING 'STPRS' 'MBEW' .

PERFORM APPEND_CATALOG USING 'MEINS' 'MARA' . "<-------- Unit
PERFORM APPEND_CATALOG USING 'WAERS' 'T001' .  "<-------- Currency

*---------------------------------------------------------------------*
*       FORM append_catalog                                           *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
*  -->  VALUE(P_FNAME)                                                *
*  -->  VALUE(P_TNAME)                                                *
*---------------------------------------------------------------------*
FORM APPEND_CATALOG USING VALUE(P_FNAME)
                          VALUE(P_TNAME).

  DATA : V_FCAT TYPE LVC_S_FCAT.
  V_FCAT-FIELDNAME     = P_FNAME.
  V_FCAT-REF_FIELDNAME = P_FNAME.
  V_FCAT-REF_TABLE     = P_TNAME.
*  v_fcat-tabname = 'ITAB'.

  CASE P_FNAME.

    WHEN 'EISBE' OR 'MINBE'.
      V_FCAT-QFIELDNAME    = 'MEINS'.

    WHEN 'VERPR' OR 'STPRS'.
      V_FCAT-CFIELDNAME = 'WAERS'.

  ENDCASE.


  APPEND V_FCAT TO GI_FIELDCAT.
ENDFORM.                    "APPEND_CATALOG

Max

Read only

0 Likes
1,247

What if i dont have fields waers,meins ?

Read only

former_member125661
Contributor
0 Likes
1,247

I think I was doing the right thing. The issue was another field that I had used which was a ratio of quantity field/quantity field and I was not refering it correctly.

Read only

0 Likes
1,247

Hi

U should consider if you output table has amount or quantity field, u should add the reference fields for currency and unit.

Max