‎2008 Jul 08 2:14 PM
Hi,
Can any Please provide the more Detailed information and
Example Programs on Logical Expressions Operators( CO, CA, CN ,NA .... )
Regards,
‎2008 Jul 08 2:18 PM
hi,
*Contains any (ca) case sensitive *
If u2018SAPu2019 ca u2018ABAP/4u2019.
Write:/ u2018Trueu2019.
Else.
Write:/ u2018Falseu2019.
Endif.
Output True
Contains only (co) case sensitive
If u2018SAPu2019 co u2018ABAP/4u2019.
Write:/ u2018Trueu2019.
Else.
Write:/ u2018Falseu2019.
Endif.
Output False
Contains string (cs) not case sensitive
If u2018ABAP/4u2019 cs u2018Abu2019.
Write:/ u2018Trueu2019.
Else.
Write:/ u2018Falseu2019.
Endif.
Output True
Contains pattern (cp) not case sensitive
If u2018ABAP/4u2019 cp u2018*aP++u2019.
Write:/ u2018Trueu2019.
Else.
Write:/ u2018Falseu2019.
Endif.
Output True
Regards,
Santosh
‎2008 Jul 08 2:17 PM
‎2008 Jul 08 2:18 PM
hi,
*Contains any (ca) case sensitive *
If u2018SAPu2019 ca u2018ABAP/4u2019.
Write:/ u2018Trueu2019.
Else.
Write:/ u2018Falseu2019.
Endif.
Output True
Contains only (co) case sensitive
If u2018SAPu2019 co u2018ABAP/4u2019.
Write:/ u2018Trueu2019.
Else.
Write:/ u2018Falseu2019.
Endif.
Output False
Contains string (cs) not case sensitive
If u2018ABAP/4u2019 cs u2018Abu2019.
Write:/ u2018Trueu2019.
Else.
Write:/ u2018Falseu2019.
Endif.
Output True
Contains pattern (cp) not case sensitive
If u2018ABAP/4u2019 cp u2018*aP++u2019.
Write:/ u2018Trueu2019.
Else.
Write:/ u2018Falseu2019.
Endif.
Output True
Regards,
Santosh
‎2008 Jul 08 2:19 PM
Hii!
Check out this link
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3516358411d1829f0000e829fbfe/content.htm
Regards
Abhijeet Kulshreshtha
‎2008 Jul 08 2:19 PM
‎2008 Jul 08 2:20 PM
Hi,
Follo wthe link-
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3516358411d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3516358411d1829f0000e829fbfe/content.htm
Regards,
Sujit
Edited by: Sujit Pal on Jul 8, 2008 3:20 PM
‎2008 Jul 08 2:20 PM
Hi Friend,
Check these following links.
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3516358411d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3516358411d1829f0000e829fbfe/content.htm
Regards,
Chandra Sekhar
‎2008 Jul 08 2:21 PM
hi,
Please refer to this link.
[http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3516358411d1829f0000e829fbfe/content.htm]
Hope this will help.
Regards
Sumit Agarwal
‎2008 Jul 08 2:26 PM
‎2008 Jul 08 2:28 PM
thanku all
actually i have one string data object
my requirement is
if it contains only ',' s i need to put in differnt count.
if it contains any values other than ',' s i need to put in differnt count.
so i will try .
‎2008 Jul 08 2:29 PM
Hi,
Logical expressions
A logical expression compares the value in one field with the value in another field. Although the most common logical expressions compare the contents of two numeric fields, string fields can also be compared. It is important to understand (and remember) the different types of logical expression for strings as they can make it much easier to work within the string processing model.
A logical expression would be:
if logical expression.
code goes here
endif.
There are 8 relational operators for strings
CO - contains
Use this to test if field a contains field b. For example:
CUSNM = 'Mrs. Johnson'
TEST = 'Mrs.'
CUSNM CO TEST returns a true value.
Note:Test that CUSNM contains a value. If the field is blank ABAP returns a false true.
if ( p_matnr co ' 0123456789' ).
shift p_matnr right deleting trailing ' '.
overlay p_matnr with '00000000000000000'.
else.
shift p_matnr left deleting leading ' '.
endif.
CN - does not contain
Inverse of contains
CA - contains any
NA - contains none
Inverse of contains any
CS - contains string
NS - does not contain string
Inverse of contains string
CP - contains pattern
Allow you do do some rudimentary pattern matching. Use "" to match any string and "+" to match a single character. "#" is used as the escape character, allowing you to match "","+" or "#" itself. The comparison is not case-sensitive.
CN - does not contain pattern
Inverse of contains pattern
Regards,
Sravanthi
‎2008 Jul 08 2:32 PM
Hi,
The one and only one SAP HELP: Here's the link->
http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3516358411d1829f0000e829fbfe/content.htm
and
http://help.sap.com/saphelp_46c/helpdata/en/fc/eb3523358411d1829f0000e829fbfe/frameset.htm
http://www.abap2java.com/String_Comparison_Operator
Regards
Harsh
Edited by: Harsh Dave on Jul 8, 2008 7:02 PM
Edited by: Harsh Dave on Jul 8, 2008 7:05 PM