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

Dear Experts logic required

Former Member
0 Likes
495

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.

2 REPLIES 2
Read only

Former Member
0 Likes
461

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

Read only

Former Member
0 Likes
461

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