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

Former Member
0 Likes
487

hi to all,

help me in this issue,

how to write exclusion range for kunnr in selection statement.

that customers should not appear in output

thanks in advance

kiran kumar

5 REPLIES 5
Read only

Former Member
0 Likes
463

Question is not clear. Where the customer should not appear.

Regards,

Prakash.

Read only

Former Member
0 Likes
463

Hi Kiran,

Try with this code at AT SELECTION-SCREEN.

DATA S_KUNNR TYPE KNA1-KUNNR.

AT SELECTION-SCREEN.

S_KUNNR-OPTION = 'E'.

MODIFY S_KUNRR.

If you want to exclusion of this customer in SELECT statement then use this code.

SELECT KUNNR

FROM KNA1

INTO IT_KNA1

WHERE KUNNR NOT IN S_KUNNR.

Thanks,

Vinay

Read only

Former Member
0 Likes
463

Prepare a range table for the customers that should be in the exclusion.

RANGES : r_kunnr FOR kna1-kunnr.

r_kunnr-option = 'E'.

r_kunnr-sign = 'EQ'.

r_kunnr-low = customer number.

append r_kunnr.

select * from kna1 where kunnr in r_kunnr.

This will list all the customers except the one in the range table.

Read only

0 Likes
463

hi this is select statement

SELECT * FROM BSID

INTO CORRESPONDING FIELDS OF TABLE L_BSID

WHERE BUKRS IN S_BUKRS AND

BUDAT LE S_BUDAT AND

KUNNR ne E_KUNNR.(when i pass the customer no in selection screen that customer should not appear in out put of report.)

thanks in advance

kiran kumar

Read only

0 Likes
463

Hi Kiran,

Use NOT clause in SELECT statement to your requirement. NOT will not consider the customers specified in SELECT-OPTION. It will take INVERSE of the list.

Change the code like this.

SELECT * FROM BSID

INTO CORRESPONDING FIELDS OF TABLE L_BSID

WHERE BUKRS IN S_BUKRS AND

BUDAT LE S_BUDAT AND

<b>KUNNR NOT IN E_KUNNR.</b>

<b>Note: Plz reward all helpful answers.</b>

Thanks,

Vinay