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: 

finding text

Former Member
0 Kudos

Hi,

I have G_LINE with char datatype.

In G_LINE i have "REL MSPT GMPS CNF OPGN SETC"

How to find whether G_LINE is having CNF?( using SEARCH or FIND function)?

reward guaranteed

kaki

1 ACCEPTED SOLUTION

Former Member
0 Kudos

data:g_line(30) value 'REL MSPT GMPS CNF OPGN SETC'.

search g_line for 'CNF'.

if sy-subrc = 0.

write sy-fdpos.

endif.

FDPOS gives u start location.

8 REPLIES 8

hymavathi_oruganti
Active Contributor
0 Kudos

try this

SEARCH str STARTING AT p1 ENDING AT p2

0 Kudos

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

IN [section_of] dobj

[IN {BYTE|CHARACTER} MODE]

[{RESPECTING|IGNORING} CASE]

[MATCH COUNT mcnt]

{ {[MATCH OFFSET moff]

[MATCH LENGTH mlen]}

| [RESULTS result_tab|result_wa] }

[SUBMATCHES s1 s2 ...].

or else u can use FIND as SEARCH is obsolete

former_member188685
Active Contributor
0 Kudos

Hi Kaki,


if G_LINE CA 'CNF'.

write: 'CNF Found'.

endif.

Former Member
0 Kudos

data:g_line(30) value 'REL MSPT GMPS CNF OPGN SETC'.

search g_line for 'CNF'.

if sy-subrc = 0.

write sy-fdpos.

endif.

FDPOS gives u start location.

0 Kudos

Thanks abhijit,

Full points alloted

cheers

kaki

0 Kudos

hi kaki,

i hope i told u to use SERCH statement before abhijit, pls check my answer

0 Kudos

Ok,I wll give some points to you.

cheers

kaki

athavanraja
Active Contributor
0 Kudos

if g_line CS 'CNF' .

endif .

Regards

Raja