2014 Aug 26 8:54 AM
Dear all,
Recently when I run a Z program in background, it will raise an error: OBJECTS_NOT_CHARLIKE. But when I run in , it can show the result.
I debug find the <field> value is 10.000-
How do I correct this error.
Here is my ALV code:
DEFINE APPEND_COL_TIT.
COL_POS = COL_POS + 1.
CLEAR WA_FIELD.
WA_FIELD-COL_POS = COL_POS.
WA_FIELD-FIELDNAME = &1.
WA_FIELD-REPTEXT_DDIC = &2.
WA_FIELD-FIX_COLUMN = &3.
WA_FIELD-JUST = &4.
WA_FIELD-DATATYPE = &5.
WA_FIELD-CHECKBOX = &6.
WA_FIELD-EDIT = &7.
WA_FIELD-FIX_COLUMN = &8.
IF WA_FIELD-FIELDNAME = 'GJAHR1' OR WA_FIELD-FIELDNAME = 'GJAHR2'
OR WA_FIELD-FIELDNAME = 'GJAHR3' OR WA_FIELD-FIELDNAME = 'GJAHR4'.
WA_FIELD-NO_ZERO = 'X' .
ELSE.
ENDIF.
APPEND WA_FIELD TO ITAB_FIELD.
END-OF-DEFINITION.
APPEND_COL_TIT 'KWMENG_MO_GR' TEXT-034 'X' 'L' 'NUMC' '' '' ''. (This is the problem field)
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PF_STATUS_SET = 'ALV_PF_STATUS'
I_BACKGROUND_ID = 'ALV_BACKGROUND'
IT_FIELDCAT = ITAB_FIELD
I_CALLBACK_PROGRAM = L_REPID
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = IS_LAYOUT
IT_EVENTS = ITAB_EVENT
TABLES
T_OUTTAB = ALV_OUTPUT
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
Thanks for your sincerely answer.
2014 Aug 26 9:03 AM
Can you see in the dump information which field the message is talking about. And also can you post the section of source code where this message is raised ?
I do not think that this error should /can occur only in the background because a datatype cannot change just because a program is run in the background.
If the field KWMENG_MO_GR is based on the field KWMENG then there is your answer. This field is type QUANT (decimals) and not type NUMC as you want to add it to your fieldcatalogue
Dear all,
Recently when I run a Z program in background, it will raise an error: OBJECTS_NOT_CHARLIKE. But when I run in , it can show the result.
I debug find the <field> value is 10.000-
How do I correct this error.
Here is my ALV code:
DEFINE APPEND_COL_TIT.
COL_POS = COL_POS + 1.
CLEAR WA_FIELD.
WA_FIELD-COL_POS = COL_POS.
WA_FIELD-FIELDNAME = &1.
WA_FIELD-REPTEXT_DDIC = &2.
WA_FIELD-FIX_COLUMN = &3.
WA_FIELD-JUST = &4.
WA_FIELD-DATATYPE = &5.
WA_FIELD-CHECKBOX = &6.
WA_FIELD-EDIT = &7.
WA_FIELD-FIX_COLUMN = &8.
IF WA_FIELD-FIELDNAME = 'GJAHR1' OR WA_FIELD-FIELDNAME = 'GJAHR2'
OR WA_FIELD-FIELDNAME = 'GJAHR3' OR WA_FIELD-FIELDNAME = 'GJAHR4'.
WA_FIELD-NO_ZERO = 'X' .
ELSE.
ENDIF.
APPEND WA_FIELD TO ITAB_FIELD.
END-OF-DEFINITION.
APPEND_COL_TIT 'KWMENG_MO_GR' TEXT-034 'X' 'L' 'NUMC' '' '' ''. (This is the problem field)
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PF_STATUS_SET = 'ALV_PF_STATUS'
I_BACKGROUND_ID = 'ALV_BACKGROUND'
IT_FIELDCAT = ITAB_FIELD
I_CALLBACK_PROGRAM = L_REPID
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IS_LAYOUT = IS_LAYOUT
IT_EVENTS = ITAB_EVENT
TABLES
T_OUTTAB = ALV_OUTPUT
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
Thanks for your sincerely answer.
2014 Aug 26 9:03 AM
Can you see in the dump information which field the message is talking about. And also can you post the section of source code where this message is raised ?
I do not think that this error should /can occur only in the background because a datatype cannot change just because a program is run in the background.
If the field KWMENG_MO_GR is based on the field KWMENG then there is your answer. This field is type QUANT (decimals) and not type NUMC as you want to add it to your fieldcatalogue
2014 Aug 27 8:53 AM
Yes,you are right, After I change the NUMC to QUAN, the program can be run in background.
2014 Aug 26 9:08 AM
Hi
but which is the line of your code where the dump is? in ALV?
That dump should be as you're trying a statament for a string but the field is not char; if it's in ALV your field is defined as NUMC (so a char) but probably you're moving a number (I mean you're transfer not integer or positive number)
Max
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |