Compare strings and data strings (continued)

Source: Internet
Author: User
Abstr:True. If <F2> belongs to type C, you can use the following wildcard characters in <F2>: _ * For any string _ + for any single character to ignore trailing spaces and be case insensitive. If the comparison result is true, the system word...

True. If <F2> belongs to type C, you can use the following wildcards in <F2>:

_ * Used for any character string

_ + Is used for any single character

Ignore trailing null cells and compare them case insensitive. If the comparison result is true, the system field SY-FDPOS contains <F2>

Offset in <F1>. If false, the SY-FDPOS contains the length of <F1>.

If you want to compare the special characters in <F2>, put the character # in front of it. You can use another code.

Character # specify

_ Font characters

_ Wildcard "*" (input #*)

_ Wildcard "+" (input # +)

_ Changing the code symbol itself (input ##)

_ Space at the end of the string (input #___)

NP (does not contain a pattern)

If <F1> does not contain mode <F2>, the logical expression

<F1> NP <F2>

True. In <F2>, you can use the same wildcard character and codeword character as CP.

Ignore trailing null cells and compare them case insensitive. If the comparison result is true, the system field SY-FDPOS contains

The length of <F1>., if the result is false, the offset of the SY-FDPOS containing <F2> in <F1>.

Data: F1 (5) Type C value <F1>,

F2 (5) Type C value <F2>.

If F1 <operator> F2.

Write:/'comparison true, SY-FDPOS =', SY-FDPOS.

Else.

Write:/'comparison false, SY-FDPOS =', SY-FDPOS.

Endif.

The following table lists the execution results of the program, depending on the operator used and the F1/F2 field.

<F1> <operator> <F2> results SY-FDPOS

'Bd 'co' abcd' true 5

'Bd 'co' abcde' false 2

'Abc12 'cn 'abcd' true 3

'Ababc' CN 'abcd' False 5

'Abcde' ca 'bd 'true 1

'Abcde' ca'bd 'False 5

'Abab' na 'AB' false 0

'Ababa 'A' AB 'true 5

'Abcde' CS 'bc' Zhen 1

'Abcde' CS 'ce 'False 5

'Abcde' NS 'bc' false 1

'Abcde' NS 'ce 'true 5

'Abcde' CP '* B *' true 1

'Abcde' CP '* # B *' False 5

'Abcde' NP '* B *' false 1

'Abcde' NP '* # B *' true 5

Next tip:To compare strings and data strings, you must compare strings (type C) and numeric text (Type N). You can use the following operators in logical expressions. <Operator> meaning CO only contains CN not only contains Ca contains any NA Not contains any CS contain string NS not contain string CP contains mode NP...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.