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 to add * wild card to a specific field on the selection-screen.

Former Member
0 Kudos

Hello,

How to add a * WIld card to a field in selection screen.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS : S_STCTS FOR G_STCTS OBLIGATORY, "NUMBER SCHEME

S_AT20A FOR G_ATTR20A, "SUBSTANCE ID

SELECTION-SCREEN END OF BLOCK B1.

I need to add Wild card functionality to Number scheme field S_STCTS on selection-screen.

Any suggestions would be apprecaited..

Regards,

Kittu

1 ACCEPTED SOLUTION

SuhaSaha
Advisor
Advisor
0 Kudos

Hello,

Try this code:


INITIALIZATION.
  S_STCTS-sign = 'I'.
  S_STCTS-option = 'CP'.
  S_STCTS-low = 'HU*'.
  APPEND S_STCTS.

BR,

Suhas

3 REPLIES 3

SuhaSaha
Advisor
Advisor
0 Kudos

Hello,

Try this code:


INITIALIZATION.
  S_STCTS-sign = 'I'.
  S_STCTS-option = 'CP'.
  S_STCTS-low = 'HU*'.
  APPEND S_STCTS.

BR,

Suhas

Former Member
0 Kudos

Hi Kittu,

Here is one sample code:-

select-option : s_name like kna1-name1.

start-of-selection.

if s_name-low = '*'.

select * from kna1 into table it_kna1.

elseif s_name-low = 'pat*' or s_name-low = 'pat'.

select * from kna1 into table it_kna1 where name1 like 'Pat%'.

endif.

In case of wild card Select should be :-

select * from <dbtab> where <field> like 'P%'.

You can also use RANGES in your Code.

E.g. RANGES: R_OBJNR FOR JEST-OBJNR

R_OBJNR-SIGN = 'I'.

R_OBJNR-OPTION = 'CP'.

R_OBJNR-LOW = 'K1*'.

R_OBJNR-HIGH = 'K2*'.

Hope this helps.

Thanks & Regards

Jitendra Gujarathi

Former Member
0 Kudos

Hello,

Thank you very much for your response!

Suggestions were really helpful....

Regards,

Kittu