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

finding text

Former Member
0 Likes
995

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
Read only

Former Member
0 Likes
965

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
Read only

hymavathi_oruganti
Active Contributor
0 Likes
965

try this

SEARCH str STARTING AT p1 ENDING AT p2

Read only

0 Likes
965

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

Read only

Former Member
0 Likes
965

Hi Kaki,


if G_LINE CA 'CNF'.

write: 'CNF Found'.

endif.

Read only

Former Member
0 Likes
966

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.

Read only

0 Likes
965

Thanks abhijit,

Full points alloted

cheers

kaki

Read only

0 Likes
965

hi kaki,

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

Read only

0 Likes
965

Ok,I wll give some points to you.

cheers

kaki

Read only

athavanraja
Active Contributor
0 Likes
965

if g_line CS 'CNF' .

endif .

Regards

Raja