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: 

how could I find if itab-txt contains a 'string'

Former Member
0 Kudos

Hello

How could I find if itab-txt contains a 'string'

Kindest regards

1 ACCEPTED SOLUTION

Former Member
0 Kudos

you can use


SEARCH dobj FOR pattern  [IN { BYTE | CHARACTER } MODE] 
       [STARTING AT p1] [ENDING AT p2] 
       [ABBREVIATED] 
       [AND MARK]. 

7 REPLIES 7

Former Member
0 Kudos

Hi,

There is one keyword CS which will be useful for this

eg - IF 'ABCDE' CS 'CD' is true; SY-FDPOS = 2.

The comparison is not case-sensitive.

So give all the alpahbets ABCD...Z in a string and do the comparison

Cheers

Kothand

former_member181995
Active Contributor
0 Kudos

tina,

check with sy-abcde.

Amit.

Former Member
0 Kudos

Hi ,

Use "Isinitial" key word.

Example:

if not itab-txt isinitial.

Write the required logic.

endif.

Regards,

Jaya Vani

former_member182354
Contributor
0 Kudos

IF GV_VARIABLE CA ' '.

ENDIF.

Raghav

0 Kudos

Hi Tina,

Yes this is a better way as said by others.

if itab-text CA sy-abcde.

endif.

Cheers

Kothand

Former Member
0 Kudos

try it with using describe field statement.

Former Member
0 Kudos

you can use


SEARCH dobj FOR pattern  [IN { BYTE | CHARACTER } MODE] 
       [STARTING AT p1] [ENDING AT p2] 
       [ABBREVIATED] 
       [AND MARK].