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 data with select option

Former Member
0 Likes
1,705

Hi Experts,

I am trying to call the selected data that I am entering in the selecting screen but the program call all the data without taking the entering data in to consideration like e.g.

When I enter a company code in the field p_bukrs2 I receive all the company codes.

Can you guide me to receive a specific data for a selected company code and supplier number?

your help well be appreciated.

Jenie

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
1,533

The problem comes from the OR operators in the where clause. Do you guess how the system interpret your clause?

7 REPLIES 7
Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,533

If using prefixes, I'd strongly encourage to use different ones for parameters (p_...) and select options (s_...).

As to the question - from the top of my head, you are not JOINing by all the key fields, so could that be part of the problem? There is also a mix of AND and OR that could be problematic.

You can always run ST05 (SQL Trace) and then use Explain button there to see how exactly the DB interprets your SELECT. Also when I get strange results in JOIN I usually try to separate it into multiple SELECTs or change WHERE conditions to pinpoint the problem.

Read only

DoanManhQuynh
Active Contributor
0 Likes
1,533

I tried your SQL on my system and it work as expected. How did you input into selection option? You can try to build a quick view in SQVI to check your join first.

Read only

1,533

You didn't copy his where clause, I suppose you added some parentheses, else the statement wont respect the criteria for the select-option when ...

Read only

0 Likes
1,533

Yes, sorry. I didnt copy his OR. The problem is because his OR need to be inside ( ).

Read only

0 Likes
1,533

Providing the name is real, it's "her", not "his". 🙂

Read only

RaymondGiuseppi
Active Contributor
1,534

The problem comes from the OR operators in the where clause. Do you guess how the system interpret your clause?

Read only

0 Likes
1,533

Those ORs should in IN ('KM', 'KV', ..., 'SD')