Skip to Content
0
Dec 13, 2011 at 01:05 PM

How to use "FIND FIRST OCURRENCE...." with a very long text

54 Views

When I store a certain text in variable p_texto -> FIND FIRST OCURRENCE is ok; sy-subrc = 0.

When Instead of assigning a text I read a long text from an excel into p_texto variable ->

FIND FIRST OCURRENCE is not working; sy-subrc = 4.

DATA: p_texto(5000).

DATA: posicion TYPE match_result.

p_texto = 'HI THIS IS THE FIRST LINE#AND THIS ONE THE SECOND LINE'.

FIND FIRST OCCURRENCE OF '#' IN p_texto RESULTS posicion.

How could I manage this problem?

Thank you very much in advance.