2007 Nov 29 9:54 AM
Hi Everybody,
I have to compare two fields. Like CDPOS-NEW and CDPOS-OLD. These are character fields. I am getting error in Extended ProgramCheck as following
Greater than/less than comparisons with character type operands may not be portable
(Message can be hidden using: "#EC PORTABLE).
But Actually those 2 field values(CDPOS-NEW and CDPOS-OLD.) in CDPOS table ,are date fields .What I should I do to compare these two fields which are in character format.
Thanks,
Suresh.
Hi
Use the function module to compare two date values rather then comparing them directly
Regards,
Prashant
2007 Nov 29 9:59 AM
hi
DATA : a TYPE char10 VALUE 'DBCD',
b TYPE char10 VALUE '4234',
c TYPE char10 VALUE '3456',
d TYPE char10 VALUE 'ADA',
e TYPE char10 VALUE '234567'.
IF b GT c. "this case checks for numeric values
WRITE 😕 'B is bigger'.
ELSE.
WRITE 😕 'C is bigger'.
ENDIF.
IF a GT d. "this case checks for alphbetical order
WRITE 😕 'A is bigger'.
ELSE.
WRITE 😕 'D is bigger'.
ENDIF.
IF strlen( a ) GT strlen( d ). "this case checks for no of chars
WRITE 😕 'A is bigger'.
ELSE.
WRITE 😕 'D is bigger'.
ENDIF.
IF a GT c. "this case first alph then numerics
WRITE 😕 'A is bigger'.
ELSE.
WRITE 😕 'D is bigger'.
ENDIF.
regards
karthik
2007 Nov 29 10:01 AM
If I got you right, it might work if you move the data to help-fields typed as date and compare these fields instead of the character fields.
2007 Nov 29 10:05 AM
Hi
Use the function module to compare two date values rather then comparing them directly
Regards,
Prashant
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |