‎2008 Apr 15 5:19 PM
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.
‎2008 Apr 15 5:25 PM
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
‎2008 Apr 15 5:26 PM
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.
‎2008 Apr 15 5:34 PM
Try with the below.
select matnr
from mara
into i_matnr
where matnr in s_matnr
and matnr CN 'ROBERT.
Thanks,
Srinivas
‎2008 Apr 15 5:39 PM
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
‎2008 Apr 15 5:41 PM
>
> 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
‎2008 Apr 15 6:01 PM
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
‎2008 Apr 15 6:21 PM
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
‎2008 Apr 16 5:04 AM
Hi,
Check this link.
http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dba71235c111d1829f0000e829fbfe/content.htm
Regards,
Muneesh Gitta.