Application Development 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: 

sql query

Former Member
0 Kudos

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

Former Member
0 Kudos

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

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

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

former_member125931
Active Participant
0 Kudos

Use forall entries before where condition.

Former Member
0 Kudos

Hi,

try this...

SELECT SINGLE atflv

FROM ausp

INTO date

WHERE objek = e_cekko-lifnr

AND atinn = 'TODG'

AND klart = '010'.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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