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

select options

Former Member
0 Likes
850

Hi

As per my requirement when select option contain only exclude parameter(Not equal to) dont want to execute the select statment.

suppose s_matnr contain only one value is ne 'Robert' then i dont want execute the select statment. Can any one let me know the logic for this plsease.

select matnr from mara where matnr in s_matnr.

Regards

Raj.

8 REPLIES 8
Read only

Former Member
0 Likes
823

Hi Kumar Raj,

You have to code the logic before the select query in your report using the Select options internal table. In the table contains "NE" don't execute the select statement.

Hope this helps.

Thanks,

Greetson

Read only

Former Member
0 Likes
823

hi,

do this way ...


loop at s_matnr.
   if s_matnr-option = 'NE'.
      v_flag = 'X'.
     exit.
   endif.
endloop.

if v_flag is initial.
select matnr from mara where matnr in s_matnr.
endif.
 

Read only

Former Member
0 Likes
823

Try with the below.

select matnr

from mara

into i_matnr

where matnr in s_matnr

and matnr CN 'ROBERT.

Thanks,

Srinivas

Read only

Former Member
0 Likes
823

Hi,

Please try this.

If s_matnr-option = 'NE'.

write any error or information or status message

else.

write the select statement from MARA.

endif.

Regards,

Madhu

Read only

matt
Active Contributor
0 Likes
823

>

> Hi

>

> As per my requirement when select option contain only exclude parameter(Not equal to) dont want to execute the select statment.

>

> suppose s_matnr contain only one value is ne 'Robert' then i dont want execute the select statment. Can any one let me know the logic for this plsease.

>

> select matnr from mara where matnr in s_matnr.

>

The problem is not so simple, I think. For example, how can you tell the difference beween someone selecting NE Robert' and someone selecting between A to Q AND between S and Z. Or if patterns are used: e.g. A* and B* and C... AND Q AND S* AND... Z*.

You need to think carefully about what you are trying to achieve. Are you simply trying to ensure that the selected range of data is not "too large".?

If that's the case, you'll have to do a test SELECT, using SELECT COUNT. And only if the count exceeds a level, then deny the operation.

matt

Read only

0 Likes
823

Hi mat,

excellent ans...

u r hit the nail on the head there i guess.

The problem is not as simple as it looks as during the range it is bound to give problems..

so it depends as u have said as to what exactly is tried to be done here.

cheers mat

Read only

matt
Active Contributor
0 Likes
823

You're welcome! The trick is to go beyond what's asked and think about why the poster is asking. ( I did many years ago do 1st line user support, so it's a skill I picked up ).

matt

Read only

Former Member
0 Likes
823