09-17-2008 11:01 AM
hello expert,
i want to compare a character type field without using operator like ge, ne etc.
plz help me if you know.
thanks in advance
09-17-2008 11:07 AM
Hi,
There are special comparisons that you can apply to strings with types C, D, N, and T :
CO Contains Only
CN Contains Not only
CA Contains Any
NA contains Not Any
CS Contains String
NS contains No String
CP Contains Pattern
NP contains No Pattern.
thanx.
Edited by: Dhanashri Pawar on Sep 17, 2008 12:11 PM
09-17-2008 11:07 AM
Hi,
There are special comparisons that you can apply to strings with types C, D, N, and T :
CO Contains Only
CN Contains Not only
CA Contains Any
NA contains Not Any
CS Contains String
NS contains No String
CP Contains Pattern
NP contains No Pattern.
thanx.
Edited by: Dhanashri Pawar on Sep 17, 2008 12:11 PM
09-17-2008 11:08 AM
hi pawar.
i want to compare character type field like low ge high. it works but in codeinspector is not allowed that it shows error......
Edited by: abhishek vishnoi on Sep 17, 2008 12:14 PM
09-17-2008 11:17 AM
09-17-2008 11:20 AM
Hi,
Go through this link
[comparision|http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb3516358411d1829f0000e829fbfe/content.htm]
Regards,
09-17-2008 11:26 AM
helllo expert,
i want to compare 23 & 24 which is character type....
how i comapare that...........if i use ge ne etc it works but code inspector shows as an error
09-17-2008 11:36 AM
Hi,
If it is character type. it will compare like this
For operands with a character-type data type (c, d, n, t, string) the contents are compared from left to right. Based on the order in the code page used, the first different character from the left decides which operand is larger.
let try this example you will get wrong output
data : lv_field1 type char2 value '2',
lv_field2 type char2 value '12'.
if lv_field1 GT lv_field2.
write : / 'test'.
endif.
So assing the values to some integer varaibles and compare then it will work fine.
Hope it will helps
09-17-2008 11:55 AM