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 statement not working

Former Member
0 Likes
1,253

hi to all,

I am trying to write use inner joining . here is code

DATA:tabname LIKE dd02L-tabname,

table_disc LIKE dd02t-ddtext.

SELECT dd02ltabname dd02tddtext INTO (tabname,table_disc)

FROM dd02l INNER JOIN dd02t on dd02ltabname = dd02ttabname

WHERE dd02tddlanguage = 'E' AND dd02ltabclass = 'TRANSP'

AND dd02L~tabname = 'ZANKI*'.

endselect.

write : tabname.

I also checked in tables dd02t and dd02l for the table zanki* and data available in both table . but here select statement not working .do u have any idea about this. thank you

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,194

Hello


AND dd02L~tabname LIKE 'ZANKI%'. " instead of AND dd02L~tabname = 'ZANKI*'.

10 REPLIES 10
Read only

Former Member
0 Likes
1,194

Hi,

Change dd02tddlanguage = 'E' to dd02tddlanguage = 'EN".

Regards

Vinod

Read only

Former Member
0 Likes
1,195

Hello


AND dd02L~tabname LIKE 'ZANKI%'. " instead of AND dd02L~tabname = 'ZANKI*'.

Read only

0 Likes
1,194

HI Dzed Maroz ,

I used that one . but i did't get . any idea . thank you

Read only

0 Likes
1,194

ZANKI* can not be a table name because The name ZANKI* contains a non-alphanumeric character

, Please check your table name.

Read only

0 Likes
1,194

Hi,

I executed the ur inner join conditin by commenting 'z*' it's working fine.

I think where condition is not getting satisfied so u r not getting any data.

Please conform in where condition you need * 'AND'* or OR

I change decalration as below.


DATA:tabname    type TABNAME,
      table_disc type AS4TEXT.

SELECT dd02l~tabname
       dd02t~ddtext  INTO (tabname, table_disc)
 FROM dd02l  INNER JOIN dd02t on dd02l~tabname = dd02t~tabname
WHERE dd02t~ddlanguage = 'E' AND
      dd02l~tabclass = 'TRANSP'AND
    dd02L~tabname = 'ZANKI*'.
endselect.

write : tabname.

Regards,

Pravin

Read only

Former Member
0 Likes
1,194

Hi,

Do: dd02L~tabname LIKE 'ZANKI%'.

But your code will show you the last tabname in the database starting with ZANKI...

Sanghamitra

Read only

Former Member
0 Likes
1,194

Run the following code its work


DATA:tabname LIKE dd02L-tabname,
table_disc LIKE dd02t-ddtext.

SELECT A~tabname B~ddtext INTO (tabname,table_disc)
FROM dd02l AS A INNER JOIN dd02t AS B
on A~tabname = B~tabname

WHERE
B~ddlanguage = 'EN'
AND A~tabclass = 'TRANSP'
AND A~tabname LIKE  'ZANKI%'.
endselect.


write : tabname.

Read only

Former Member
0 Likes
1,194

No tablename can have non-alphanumeric character. Check the tablename in the select query.

Regards

Vinod

Read only

0 Likes
1,194

HI to all,

my problem was solved. thanks to all

Read only

former_member418469
Participant
0 Likes
1,194

hi,

Try this

select single atabname bddtext INTO (tabname,table_disc)

from dd02l as a

join DD02T AS b

on atabname = btabname

where b~DDLANGUAGE = sy-langu

and a~tabclass = 'TRANSP'

AND a~TABNAME like 'A14%'.