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 with Native SQL

Former Member
0 Likes
1,789

Hi,

Is there any way that I can retrieve data from an external Oracle DB table using native SQL and 2 select-options as 'where' criteria?

select-options: s_bukrs for ekko-bukrs,

s_bsart for ekko-bsart.

*-- connection to ext db

@$#

exec sql perform write_ln

select ebeln

from zext_ekko

into :wa

where [?!?!?!?] "Should retrieve data based on sel-optins

endexec

Thanks in Advance

Somesh

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,088

where condition may not work for native sql query's

4 REPLIES 4
Read only

Former Member
0 Likes
1,088

If the low & high are mentioned in select-option then you can use BETWEEN as log operator in condition, i suppose. But if there are multiple values entered then it wont work. You can very well mention a parameter or a field of structure as conditon in WHERE clause of Select stmt in native SQL.

Reward if its useful.

Regards,

Sail

Read only

0 Likes
1,088

Thanks for the reply Sail.. true it fails incase of multiple values..

I came across this SELECT * FROM SCARR WHERE ... CLIENT SPECIFIED..... CONNECTION con. But SAP help says, we are not allowed to use that option.. ne idea y? This makes the current coding a lot more easy.

Thanks

Somesh

Read only

0 Likes
1,088

restrict the selcet options to EQ and BT

Read only

Former Member
0 Likes
1,089

where condition may not work for native sql query's