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

sql query

Former Member
0 Likes
946

hi experts

i have this query:

date like ausp-atflv.

SELECT SINGLE ausp~atflv

FROM ausp

INTO date

WHERE ausp~objek = e_cekko-lifnr

AND ausp~atinn = 'TODG'

AND ausp~klart = '010'.

and it doesn't returns any result although i checked the query with the same parameters with se16 and there it returns one row as it supposed to be.

whats wrong here

thanks

Amit

8 REPLIES 8
Read only

Former Member
0 Likes
888

change the query as follows

SELECT SINGLE ausp~atflv

FROM ausp

INTO date

for all entries in e_cekko

WHERE ausp~objek = e_cekko-lifnr

AND ausp~atinn = 'TODG'

AND ausp~klart = '010'.

//Kothand

Read only

0 Likes
888

hi Kothand

my problem is that e_cekko is structure and not a table and it gives me an error when i do what you said.

another problem is that you can't use for all entrys with select single

thanks

Amit

Read only

0 Likes
888

Hi Amit,

Yup i forget the SINGLE

Try this way

if e_cekko-lifnr ne space.

SELECT SINGLE atflv

FROM ausp

INTO ( date )

WHERE objek = e_cekko-lifnr

AND atinn = 'TODG'

AND klart = '010'.

endif.

maybe this will work.

//Kothand

Read only

Former Member
0 Likes
888

Hi Amit,

try the following:

date like ausp-atflv.

SELECT SINGLE atflv

FROM ausp

INTO date

FOR ALL ENTRIES IN e_cekko

WHERE objek = e_cekko-lifnr

AND atinn = 'TODG'

AND klart = '010'.

I dont think there is a need of ~ operator when you are not joining two tables.

Hope this helps you.

Regards,

Chandra Sekhar

Read only

former_member125931
Active Participant
0 Likes
888

Use forall entries before where condition.

Read only

Former Member
0 Likes
888

Hi,

try this...

SELECT SINGLE atflv

FROM ausp

INTO date

WHERE objek = e_cekko-lifnr

AND atinn = 'TODG'

AND klart = '010'.

Read only

Former Member
0 Likes
888

Hi amit walden,

Refer the following Code,that will surely.

data : date like ausp-atflv.

Loop at e_cekko.

SELECT SINGLE atflv

FROM ausp

INTO date

WHERE objek = e_cekko-lifnr

AND atinn = 'TODG'

AND klart = '010'.

Endloop.

Hope it is helps.

Regards,

T.Durai murugan.

Read only

Former Member
0 Likes
888

hi,

if e_cekko is the work area....see if e_cekko-lifnr is populated before the select.

and see the sy-subrc.

regards,

madhu