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

report problem

Former Member
0 Likes
503

hi all,

i m making a report but problem is that when i m passing the single value then its also picking the records for others values also. can anyone tell me the exact prob?

code.

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

SELECT-OPTIONS: KUNNR FOR VBAK-KUNNR,

VKBUR FOR VBAK-VKBUR.

SELECTION-SCREEN END OF BLOCK B1.

SELECT VKBUR KUNNR VTWEG CASSD AUFSD LIFSD FAKSD FROM KNVV INTO CORRESPONDING FIELDS OF TABLE ITAB

WHERE KUNNR IN KUNNR AND VKBUR IN VKBUR

AND CASSD = 'X' OR AUFSD NE '' OR AUFSD NE '' OR LIFSD NE ''

OR FAKSD NE ''.

this is the code.

regards saurabh.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
471

Hi,

Try using the brackets in the select query.

Eg:

SELECT VKBUR KUNNR VTWEG CASSD AUFSD LIFSD FAKSD FROM KNVV INTO CORRESPONDING FIELDS OF TABLE ITAB

WHERE KUNNR IN KUNNR AND VKBUR IN VKBUR

AND ( CASSD = 'X' OR AUFSD NE '' OR AUFSD NE '' OR LIFSD NE ''

OR FAKSD NE '' ).

Regards,

Surinder

3 REPLIES 3
Read only

Former Member
0 Likes
472

Hi,

Try using the brackets in the select query.

Eg:

SELECT VKBUR KUNNR VTWEG CASSD AUFSD LIFSD FAKSD FROM KNVV INTO CORRESPONDING FIELDS OF TABLE ITAB

WHERE KUNNR IN KUNNR AND VKBUR IN VKBUR

AND ( CASSD = 'X' OR AUFSD NE '' OR AUFSD NE '' OR LIFSD NE ''

OR FAKSD NE '' ).

Regards,

Surinder

Read only

Former Member
0 Likes
471

Please check the select-options.

Kindly check if any range is defiined.

the other case in which it will fetch multiple records is when both select-options are empty.

Hope this helps

Raj

Read only

Former Member
0 Likes
471

hai,

it is good to validate select-option in at selection-screen itself.

if select-option range is not in table, then while passing it to select query u will be getting whole record from table.

so try to validate it first.

shan.