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: 

Catching Wildcard in select-option

Former Member
0 Kudos

Hi,

How can I catch if the wildcard '*' only has been entered in a search-option on the selection screen?

So '123' is ok, '123' is ok, 'ABC' is also ok, however '' is not.

if s_lifnr-low co '*' .
write:/'error: you have entered only a *'.
else.
write:/ 'all ok'.
endif.

Thanks.

Edited by: William Lawlor on Sep 3, 2009 7:37 PM

3 REPLIES 3

Former Member
0 Kudos

Hi

U need to check if there's a vlue after wildcard:

 TABLES: LFA1.

SELECT-OPTIONS SO_LIFNR FOR LFA1-LIFNR.

LOOP AT SO_LIFNR.
  IF SO_LIFNR-LOW(1) = '*'.
    IF SO_LIFNR-LOW+1 IS INITIAL.
      WRITE 'Error'.
    ENDIF.
  ENDIF.
ENDLOOP.

Max

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos
if s_lifnr-sign = 'I'
  and s_lifnr-option = 'EQ'
  and s_lifnr-low = '*' .
write:/'error: you have entered only a *'.
else.
write:/ 'all ok'.
endif.

Regards,

Rich Heilman

0 Kudos

Hi Rich,

AFAIK wildcards are automatically marked as patterns, isnt't it?

loop at s_lifnr where option = 'CP'
                  and low = '*'.
message ...
endloop.

Kind regards,

Clemens