‎2010 Jun 15 1:03 PM
I want to fetch data from three tables EKKO, LFA1 and CDHDR. Actually I want to fetch release date from CDHDR.
I am giving release date in selection screen as in input but i am not able to fetch the data according to release date.
Can u please check my select and tell me where i should correct.
SELECT ebeln
bsart
aedat
lifnr
waers
bedat
rlwrt
FROM ekko
INTO CORRESPONDING FIELDS OF TABLE t_ekko
WHERE
bsart IN s_bsart
AND bedat IN s_bedat
AND lifnr IN s_lifnr.
SELECT lifnr
name1
from lfa1
INTO TABLE t_lfa1
FOR ALL ENTRIES IN t_ekko
WHERE lifnr = t_ekko-lifnr.
LOOP AT t_ekko INTO w_ekko.
w_ekko-g_ebeln = w_ekko-ebeln.
n = sy-tabix.
MODIFY t_ekko INDEX N from w_ekko TRANSPORTING g_ebeln.
ENDLOOP.
SELECT objectclas
objectid
tcode
udate
FROM cdhdr
INTO TABLE t_cdhdr
FOR ALL ENTRIES IN t_ekko
where objectclas = 'EINKBELEG'
AND objectid = t_ekko-g_ebeln
AND tcode = 'ME29N'
AND udate in s_udate.
LOOP AT t_ekko INTO w_ekko.
w_final-ebeln = w_ekko-ebeln.
w_final-bsart = w_ekko-bsart.
w_final-lifnr = w_ekko-lifnr.
w_final-waers = w_ekko-waers.
w_final-bedat = w_ekko-bedat.
w_final-rlwrt = w_ekko-rlwrt.
READ TABLE t_lfa1 INTO w_lfa1 WITH KEY lifnr = w_ekko-lifnr.
w_final-name1 = w_lfa1-name1.
READ TABLE t_cdhdr INTO w_cdhdr WITH KEY objectclas = 'EINKBELEG'.
objectid = w_ekko-ebeln.
w_final-udate = g_udate.
APPEND w_final TO t_final.
ENDLOOP.
‎2010 Jun 15 1:22 PM
Hi,
The first thing I would like you to do is to step through your code to see which statement is causing you the issue. ie: which select statement does not retrieve any date, or which read statement that does not find any data. This would help if figuring our your issue.
thanks.
JB
‎2010 Jun 15 2:15 PM
Moderator message - Please see do some work on this yourself before posting. Debug and determine which SEELCT is the problem. Then if you still have problems, post the question again for the SELECT that is causing the problem. And please use code tags Post locked Rob