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: 

Select - option

former_member242255
Active Contributor
0 Kudos

if in a select-option for material,if i am entering for example ABC* in low and CDC* in high.

in the select if i am writing on mara or marc,it is fetching only the values for ABC* which is given in the low option of the select-option.

but i want all the materials starting from ABC* to CDC*

15 REPLIES 15

Former Member
0 Kudos

Hi sravan,

1. Have you checked in the database if any data exists with CDC*

2. Can you show your declaration for select option and the select statement

Try to build the select option and check out if it works

s_matnr-sign = 'I'.

s_matnr-option = 'CP'.

s_matnr-low = 'ABC*'.

s_matnr-high = 'CDC*'.

append s_matnr.

clear s_matnr.

Message was edited by:

Chandrasekhar Jagarlamudi

0 Kudos

SELECT-OPTIONS: s_matnr FOR mara-matnr ,

SELECT matnr werks beskz sobsl INTO TABLE i_marc FROM marc

WHERE matnr IN s_matnr

AND werks IN s_werks.

and i have given

low as - 58STA* (for which i am having 29 entries)

high as - 58STX* as per my requirement.

it is fetching only the records for low (i.e. it is fetching only the 29 entries)

0 Kudos

Hi

Had u checked in debugging the values for s_matnr.

Regards,

kumar

0 Kudos

it is showing as BT in the debug mode

0 Kudos

Try with the code in my previous post (changed to CP) and checkout if it works

0 Kudos

YES THAT IS THE PROBLEM YOU CAN USE 'BT' AND 'NB' FOR SPECIFYING THE LOW AND HIGH VALUE BUT YOUR NEED IS TO ADD 'CP' SO YOUR QUERY IS NOT WORKING PROPERLY.

AS I TOLD EARLIER YOU CANNOT ADD 'CP' FOR BY SPECIFYING LOW AND HIGH VALUE.

FOR 'BT' AND 'NB' YOU HAVE TO SPECIFY ACTUAL VALUE NOT PATTERN

REGARDS

SHIBA DUTTA

0 Kudos

so,i have to handle explicitly (for getting all the values between the two ranges) whenever a wildchar( * ) is found in the select-option or any other way to handle this.

0 Kudos

S u have to handle this explicitly, i too had faced the same problem.

CP itself has both include[] adn exclude ][.

Here s_excl is teh select-option fied\ld and based on that exclude or include CP i need to delete values.

Just a sample dont confuse.

      LOOP AT zifritext.
        LOOP AT s_excl.
          IF s_excl-sign = 'E'.
            IF zifritext-sgtxt CP s_excl-low.
              DELETE zifritext.
              EXIT.
            ENDIF.
          ELSEIF s_excl-sign = 'I'.
            IF NOT ( zifritext-sgtxt CP s_excl-low ).
              v_flg = 'X'.
              IF zifritext-sgtxt IN s_excl.
                CLEAR v_flg.
              ENDIF.
            ENDIF.
          ENDIF.
          CLEAR s_excl.
        ENDLOOP.
        IF v_flg = 'X'.
          DELETE zifritext.
        ENDIF.
        CLEAR: zifritext,
               v_flg.
      ENDLOOP. " zifritext

0 Kudos

I DONT THINK THERE IS ANY OTHER WAY BECAUSE IN'CP' YOU CAN ONLY SPECIFY LOW VALUE..

JUST ADD THE VALUES IN THE SELECTOPTION.

I.E.

SOP-LOW = 'ABC*'.

SOP-SIGN = 'I'.

SOP-OPTION = 'CP'.

APPEND SOP.

CLEAR SOP.

SOP-LOW = 'CDC*'.

SOP-SIGN = 'I'.

SOP-OPTION = 'CP'.

APPEND SOP.

CLEAR SOP.

LIKE THAT

REGARDS

SHIBA DUTTA

Former Member
0 Kudos

Sravan,

Give the range as <b>'ABC' to 'CDD'</b>. You will get all the mat between ABC to CDC.

Thanks

sreeramkumar_madisetty
Active Contributor
0 Kudos

Hi

check in debugging whether it is showing eq low value for specified selection parameter or it is showing bt lowvalue highvalue for the specified selection parameter.

Regards,

kumar

Former Member
0 Kudos

Hi,

Check whether the CDC* values are there or not.

the systemt will check the same with db table and then it will retrive the data

regards

Shiva

Former Member
0 Kudos

hI ,

Try this code this works if I give input of abc* and cde*

REPORT ZTEST_MATERIAL.

tables : mara.

select-options : s_matnr for mara-matnr .

data : itab type standard table of mara,

wa type mara.

select * from mara into table itab where matnr in s_matnr.

Please reward if useful.

.

Former Member
0 Kudos

I THINK YOU CAN NOT USE TWO VALUES LIKE THAT FOR SELECT OPTION.

BECAUSE

IN SELECT OPTION YOU CAN NOT DEFINE

S_SOP-LOW = 'ABC*'.

S_SOP-HIGH = 'CDC*'.

S_SOP-SIGN = 'I'.

S_SOP-OPTION = 'CP'.

APPEND S_SOP.

ACTUALLY IT IS DOING THIS THING IN BACKGROUND SO YOU CAN ONLY GIVE LOW VALUE HERE.

REGARDS

SHIBA DUTTA

Former Member
0 Kudos

Hello,

Try with CP in the select-option condition.

Regs,

Venkat Ramanan N