2023 Jul 31 3:55 PM
Hi Sapall,
I'm trying to test my program, I want to download my alv report ,when executing this alv report it displays in correct way but the only problem is when i click on the icon(local file) which exists at standard tool bar at the top to download into local excel file it is raising the runtime error as OBJECTS_NOT_CHARLIKE
I tried to add DATATYPE = 'CHAR' to my field catalog, but it didn't work.
here's my code
DATA(LAYOUT) = VALUE SLIS_LAYOUT_ALV( BOX_FIELDNAME = 'LCHECK' ).
DATA(FIELD_CATALOG) = VALUE SLIS_T_FIELDCAT_ALV(
( COL_POS = 1 FIELDNAME = 'LCHECK' TECH = 'X' )
( COL_POS = 2 FIELDNAME = 'MATNR' SELTEXT_M = 'Material' REF_TABNAME = 'TS_PFOUTPUTREPORT' DATATYPE = 'CHAR' NO_ZERO = 'X' Just = 'L' )"INTTYPE = 'N' DATATYPE = 'NUMC'
( COL_POS = 3 FIELDNAME = 'CHARG' SELTEXT_M = 'Batch' REF_TABNAME = 'TS_PFOUTPUTREPORT' DATATYPE = 'CHAR' Just = 'L' )
( COL_POS = 4 FIELDNAME = 'EMPFW' SELTEXT_M = 'Receiving Plant' REF_TABNAME = 'TS_PFOUTPUTREPORT' DATATYPE = 'CHAR' Just = 'L')
( COL_POS = 5 FIELDNAME = 'RESWK' SELTEXT_M = 'Supplying Plant' REF_TABNAME = 'TS_PFOUTPUTREPORT' DATATYPE = 'CHAR' Just = 'L')
( COL_POS = 6 FIELDNAME = 'LGORT' SELTEXT_M = 'SLOC' REF_TABNAME = 'TS_PFOUTPUTREPORT' DATATYPE = 'CHAR' Just = 'L')
( COL_POS = 7 FIELDNAME = 'PRUEFLOS' SELTEXT_M = 'Inspection Lot' REF_TABNAME = 'TS_PFOUTPUTREPORT' DATATYPE = 'CHAR' NO_ZERO = 'X' Just = 'L')
( COL_POS = 8 FIELDNAME = 'STATYPE' OUTPUTLEN = '25' SELTEXT_L = 'Version Number Component' SELTEXT_M = 'Version Number Component' SELTEXT_S = 'Version Number Component' REF_TABNAME = 'TS_PFOUTPUTREPORT' DATATYPE = 'CHAR' Just = 'L')
( COL_POS = 9 FIELDNAME = 'VBEWERTUNG' SELTEXT_M = 'UD Status' REF_TABNAME = 'TS_PFOUTPUTREPORT' DATATYPE = 'CHAR' Just = 'L')
( COL_POS = 10 FIELDNAME = 'CLABS' SELTEXT_M = 'Stocks in UR' REF_TABNAME = 'TS_PFOUTPUTREPORT' DATATYPE = 'CHAR' Just = 'L')
( COL_POS = 11 FIELDNAME = 'CSPEM' SELTEXT_M = 'Stocks in BL' REF_TABNAME = 'TS_PFOUTPUTREPORT' DATATYPE = 'CHAR' Just = 'L')
( COL_POS = 12 FIELDNAME = 'DOCNUM' SELTEXT_M = 'Outbound IDOC Num' REF_TABNAME = 'TS_PFOUTPUTREPORT' DATATYPE = 'CHAR' NO_ZERO = 'X' Just = 'L')
( COL_POS = 13 FIELDNAME = 'COMMENT' SELTEXT_M = 'Comment' REF_TABNAME = 'TS_PFOUTPUTREPORT' DATATYPE = 'CHAR' Just = 'L')
).
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' "'REUSE_ALV_LIST_DISPLAY' "'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = LAYOUT
IT_FIELDCAT = FIELD_CATALOG
I_DEFAULT = 'X'
I_SAVE = 'A'
TABLES
T_OUTTAB = TS_PFOUTPUTREPORT.
regards.
2023 Jul 31 4:24 PM
This is what happens when you use obsolete things -> loss of time.
Why not using CL_SALV_TABLE to get rid of the field catalog forever and avoid all these manual errors?
Use the ALV SOS feature to know the errors in the field catalog.
It will tell you that you defined CLABS and CSPEM of type CHAR, but they are numeric.