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

search string exactly-urgent

Former Member
0 Likes
1,628

i have written a program where in using a table names ,and their corresponding field i search for the fields in all Z--object..

the problem here is ,wen i search the strings which are not the exact match are also listed

Eg: if search string is kunnr....... it_kunnr is also listed.....which i dont want ....

i have used read report and then search

i have written a program where in using a table names ,and their corresponding field i search for the fields in all Z--object..

the problem here is ,wen i search the strings which are not the exact match are also listed

Eg: if search string is kunnr....... it_kunnr is also listed.....which i dont want ....

i have used read report and then search

5 REPLIES 5
Read only

Former Member
0 Likes
957

Hi,

Which operator you are using to search the string.

regards

Azad.

Read only

Former Member
0 Likes
957

Hi

You can straight away get that sort of data from the standard tables

DD02L (all Sap Tables) and DD03L (table Fields)

use them and get the required Info

Use SCAN ABAP-SOURCE...command

Or use the fun module

RPR_ABAP_SOURCE_SCAN

<b>Reward points for useful Answers</b>

Regards

Anji

Read only

Former Member
0 Likes
957

hi Renu,

in order to compare strings, you can use CO (Contains Only).

here is quote of help in SAP

CO (Contains Only):

c1 contains only characters from the string c2.

If c1 or c2 is of type C, the comparison takes into account the full length of the field, including blanks at the end.

comparison.

If c1 is of type STRING and empty, the result of the comparison is always positive.

If c2 is of type STRING and empty, the result of the comparison is always negative, unless c1 is also an empty string.

If the result of the comparison is negative, the field SY-FDPOS contains the offset of the first character in c1 which is not also included in c2.

If the result of the comparison is positive, the system field SY-FDPOS contains the length of c1.

The comparison is case-sensitive.

Examples:

'ABCDE' CO 'XYZ' is false; SY-FDPOS = 0.

'ABCDE' CO 'AB' is false; SY-FDPOS = 2.

'ABCDE' CO 'ABCDE' is true; SY-FDPOS = 5.

please award point if helps

eddhie

Read only

0 Likes
957

here but im not comparing two string .....

im searching many report for the desire string ......

so fingding out fdpos is difficult for me ,can u give me a better solution

Read only

Former Member
0 Likes
957

done