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

Need help on SQL query

karthik_narayan2
Explorer
0 Likes
809

Hi ,

I am trying to pull the data from 2 tables TBCTO and TBTCP using Inner join condition, but i am not able to get the result.

can anyone please help me out. below is the query.

SELECT tbtcojobname tbtcostrttime tbtcoprdmins tbtcoprdhours

tbtcoprddays tbtcoprdweeks tbtcoprdmonths tbtcoperiodic

tbtco~eventid

tbtcpprogname tbtcpvariant

INTO CORRESPONDING FIELDS OF TABLE git_jblst

FROM tbtco

INNER JOIN tbtcp

ON tbtcojobname = tbtcpjobname

AND tbtcojobcount = tbtcpjobcount

WHERE tbtco~jobname LIKE s_jbname.

Thanks,

KN

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
674

Hi,

Try to change your where clause to:


WHERE tbtco~jobname IN s_jbname. "instead of LIKE as yours

regards,

3 REPLIES 3
Read only

Former Member
0 Likes
675

Hi,

Try to change your where clause to:


WHERE tbtco~jobname IN s_jbname. "instead of LIKE as yours

regards,

Read only

0 Likes
674

Thanks, it works.

Read only

Former Member
0 Likes
674

Please check parameter s_jbname, IN ABAP OPEN SQL,Wildcard characters can be used to create the pattern in dobj, where "%" represents any character string, even an empty one, and "_" represents any character. Captilatization is taken into account. Blank characters at the end of dobj are ignored. This is also valid in particular for data objects of the type string with closing blank characters that are otherwise taken into account in ABAP.

You can refer to the following code:

PARAMETERS srch_str TYPE c LENGTH 20.

DATA text_tab TYPE TABLE OF doktl.

CONCATENATE '%' srch_str '%' INTO srch_str.

SELECT *

FROM doktl

INTO TABLE text_tab

WHERE doktext LIKE srch_str.

Edited by: Jack Wu on Sep 17, 2010 11:36 AM