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

selection problem

Former Member
0 Likes
610

Hi,

I need to selct particular fiels from a database table into an internal table where key_field = abc*.

How do I do it?

Eg.

consider i have a DB table 'XYZ' with the fields -

name date class

the entries are say:

name date class

welcome_a 12.12.1980 10

welcome_b 01.11.1980 10

welcome_c 23.03.1980 10

select date class from XYZ into itab where name = welcome*.

This didn't work.

Plese help.

Thankyou

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
594

Hi Joy,

You need to use it this way to get the data.

DATA: srch_str TYPE string.

CONCATENATE '%' 'welcome' '%' INTO srch_str.

select date class

from XYZ

into itab

where name LIKe srch_str.

Now you will get it.

Please award points if useful.

Thanks,

Ananth

5 REPLIES 5
Read only

Former Member
0 Likes
594

Hi,

u can select data by:-

select * from dbtable into table itab where name LIKE 'WELCOME*'.

i think it will work.

Read only

Former Member
0 Likes
595

Hi Joy,

You need to use it this way to get the data.

DATA: srch_str TYPE string.

CONCATENATE '%' 'welcome' '%' INTO srch_str.

select date class

from XYZ

into itab

where name LIKe srch_str.

Now you will get it.

Please award points if useful.

Thanks,

Ananth

Read only

0 Likes
594

Hi Joy,

One more correction.

DATA:

BEGIN OF itab OCCURS 0,

date LIKE xyz-date,

class LIKE xyz-class,

END OF itab.

DATA: srch_str TYPE string.

CONCATENATE ' 'welcome' '%' INTO srch_str.

select date class

from XYZ

into table itab

where name LIKE srch_str.

Now you will get it.

Please award points if useful.

Read only

0 Likes
594

Hi,

Thankyou.

It did work.

Read only

Former Member
0 Likes
594

Hi,

we cant put * in where condition of select statement.we have to give the correct values in where conditions.

try this,

select date class

from XYZ

into table itab

where name EQ 'WELCOME_A'

or name EQ 'WELCOME_B'.

reward point if it s useful

regards,

thasneem