Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Comman Control Statements

Former Member
0 Likes
589

HI! Friends,

I hop u guys learn CO, CN, CA, NA....... comparing statements.

If 'ABCD' CN 'ABC'.

write:/ sy-fdpos.

the condition is true and according to that sy-fdpos contains 1st char(V1) in V2. where V1=ABCD and V2=ABC.

Why the value of sy-fdpos comes to 3? Explain.

regards.

4 REPLIES 4
Read only

ferry_lianto
Active Contributor
0 Likes
549

Hi,

The logical expression

<f1> CN <f2>

is true if <f1> does also contains characters other than those in <f2>. The comparison is case-sensitive. Trailing blanks are included. If the comparison is true, the system field SY-FDPOS contains the offset of the first character of <f1> that does not also occur in <f2>. If it is false, SY-FDPOS contains the length of <f1>.

Please check this link for more detail and sample codes.

http://help.sap.com/saphelp_46c/helpdata/en/fc/eb3516358411d1829f0000e829fbfe/content.htm

Regards,

Ferry Lianto

Read only

0 Likes
549

what u mean by "SY-FDPOS contains the offset of the first character of <f1> that does not also occur in <f2>". what actually Offset means?

thanks.

Read only

0 Likes
549

HI,

If STR1 CN STR2.

write:/ sy-fdpos.

endif.

FDPOS will give the number characters(inSTR1) successfully found as a same string in ur search string(STR2).

rgds,

bharat.

Read only

0 Likes
549

HI!

I got ur point. according to u, sy-fdpos will give the number characters(inSTR1) successfully found as a same string in ur search string(STR2). But, according to the book if condition is true, sy-fdpos contains 1st char(STR1) in STR2. what that mean?