Application Development 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: 

syntax of FIND command ?

TMNielsen
Contributor
0 Kudos

Hi

During upgrade to WAS 7.0 I have to convert a SEARCH command to a FIND command.

int_edidd is a standard tabel.

Old:

SEARCH int_edidd FOR 'E1EDK04'.

New:

DATA: l_segment TYPE STRING VALUE 'E1EDK04'.

FIND FIRST OCCURRENCE OF l_segment IN TABLE int_edidd

MATCH LINE sy-tabix.

Syntax error:

Als Zeilentyp der Tabelle "INT_EDIDD" wurde im CHAR MODE ein zeichenartiges bzw. im BYTE MODE ein byteartiges Feld erwartet.

What is wrong ? Is it a unicode problem ?

best regards

Thomas Madsen Nielsen

9 REPLIES 9

Former Member
0 Kudos

I think we cannot use the addition FIRST OCCURENCE with FIND. It can be used with REPLACE.

-Kiran

0 Kudos

Thanks Kiran

but no - thats not it.

according to documentation the syntax include FIRST OCCURENCE:

FIND [{FIRST OCCURRENCE}|{ALL OCCURRENCES} OF] pattern

IN TABLE itab [table_range]

[IN {BYTE|CHARACTER} MODE]

[{RESPECTING|IGNORING} CASE]

[MATCH COUNT mcnt]

{ {[MATCH LINE mlin]

[MATCH OFFSET moff]

[MATCH LENGTH mlen]}

| [RESULTS result_tab|result_wa] }

[SUBMATCHES s1 s2 ...].

Former Member
0 Kudos

Can you check with:


DATA: l_segment(7) TYPE C VALUE 'E1EDK04'.

rgds,

TM

0 Kudos

Thanks TM

but your solution doesn't work.

Example from documentation using string type

:

DATA: patt TYPE string VALUE `now`,

text TYPE string,

result_tab TYPE match_result_tab.

FIELD-SYMBOLS <match> LIKE LINE OF result_tab.

FIND ALL OCCURRENCES OF patt IN

`Everybody knows this is nowhere`

RESULTS result_tab.

LOOP AT result_tab ASSIGNING <match>.

WRITE: / <match>-offset, <match>-length.

ENDLOOP.

Best regards

Thomas Madsen Nielsen

0 Kudos

I translated the error message from German to English in Google.

The English version of the error is

"As line type of the table “INT_EDIDD” in the CHAR MODE a indication-like and/or in the BYTE MODE a byte-like field was expected. "

Might Help...

-Kiran

Former Member
0 Kudos

hi,

DATA: text TYPE STRING.

text = 'Everyone knows this'.

FIND 'know' IN text.

if sy-subrc = 0.

write:/ 'found'.

endif.

Regards,

Manohar.

0 Kudos

Hi Manohar

Thanks for your reply.

However, i'm not looking for the syntax to search in a text string.

I'm looking for the syntax to search in a table.

best regards

Thomas Madsen Nielsen

0 Kudos

Hi Thomas,

was there any solution for u... i have the same requirement...

--Bernward

0 Kudos

Sorry I don't remember what happende 9 years ago