2007 May 14 7:03 PM
Hi all, I have written the following join:
DATA:
IT_WRKGDATES TYPE STANDARD TABLE OF EINDT.
DATA:
WA_WRKGDATES TYPE EINDT.
SELECT EINDT MENGE
INTO CORRESPONDING FIELDS OF TABLE IT_RELEASE
FROM
EKEK AS A
JOIN EKEH AS B
ON
AEBELN = BEBELN AND
AEBELP = BEBELP AND
AABART = BABART AND
AABRUF = BABRUF
WHERE
A~EBELN = WA_PURDOC-EBELN AND
A~EBELP = WA_PURDOC-EBELP AND
A~ABART = '2' AND
B~EINDT IN IT_WRKGDATES.
I needed to run this query for all records in the internal table IT_WRKGDATES...but the system gives the error "The line structure of the table IT_WRKGDATES is incorrect"..
Can anybody suggest what the problem might be?
2007 May 14 7:09 PM
hi Puri,
do this way
SELECT EINDT MENGE
INTO CORRESPONDING FIELDS OF TABLE IT_RELEASE
FROM
EKEK AS A
JOIN EKEH AS B
ON
AEBELN = BEBELN AND
AEBELP = BEBELP AND
AABART = BABART AND
AABRUF = BABRUF
<b>FOR ALL ENTRIES IN IT_WRKGDATES</b>
WHERE
A~EBELN = WA_PURDOC-EBELN AND
A~EBELP = WA_PURDOC-EBELP AND
A~ABART = '2' AND
<b>B~EINDT = IT_WRKGDATES-EINDT.</b>
2007 May 14 7:09 PM
hi Puri,
do this way
SELECT EINDT MENGE
INTO CORRESPONDING FIELDS OF TABLE IT_RELEASE
FROM
EKEK AS A
JOIN EKEH AS B
ON
AEBELN = BEBELN AND
AEBELP = BEBELP AND
AABART = BABART AND
AABRUF = BABRUF
<b>FOR ALL ENTRIES IN IT_WRKGDATES</b>
WHERE
A~EBELN = WA_PURDOC-EBELN AND
A~EBELP = WA_PURDOC-EBELP AND
A~ABART = '2' AND
<b>B~EINDT = IT_WRKGDATES-EINDT.</b>
2007 May 14 7:46 PM
The error it gives is: The type EINDT has no structure and therefore no component called "EINDT"
2007 May 14 7:51 PM
My requirement is that i need to select all records from this join for all the matching conditions and for each record of the internal table IT_WRKGDATES.
This internal table contains just one field of dates and this date should match the B~EINDT date.
so suppose the internal table has 2 dates(01/01/2001 and 02/02/2002) and there are 4 matching records in the join with dates (01/01/2001,01/01/2001 and 02/02/2002,03/03/2003) then the resultand table IT_RELEASE should have 3 records.
2007 May 14 8:20 PM
Hi Anmol,
Try this..
<b>DATA: BEGIN OF IT_WRKGDATES OCCURS 0,
EINDT TYPE EINDT.
END OF IT_WRKGDATES.
FILL THE IT_WRKGDATES TABLE WITH RECORDS AND ALSO WA_PURDOC WORK AREA.
LOOP AT IT_WRKGDATES.
SELECT BEINDT BMENGE
INTO CORRESPONDING FIELDS OF TABLE IT_RELEASE
FROM
EKEK AS A
JOIN EKEH AS B
ON
AEBELN = BEBELN AND
AEBELP = BEBELP AND
AABART = BABART AND
AABRUF = BABRUF
WHERE
A~EBELN = WA_PURDOC-EBELN AND
A~EBELP = WA_PURDOC-EBELP AND
A~ABART = '2' AND
B~EINDT = IT_WRKGDATES-EINDT.
ENDLOOP.
SORT IT_RELEASE BY EINDT.
DELETE ADJACENT DUPLICATES FROM IT_RELEASE COMPARING EINDT.</b>
Regards
SAB
2007 May 14 9:31 PM
2007 May 14 7:16 PM
Hi
Check the declaration of IT_WRKGDATES
it refers a dataelement EINDT, it is not a table. change it first
DATA IT_WRKGDATES TYPE STANDARD TABLE OF EINDT WITH HEADER LINE .
then this is not a internal table since WITH HEADER LINE is not added to it.
So It stores a single date field in this case.
what's your requirement for this internal table?
You want an internal table with just one date field?
So it is not possible to fetch the values of this declaration in the where condition.
first change the decalaration then put multiple dates in that and use in the where condition.
Reward points if useful
Regards
Anji
2007 May 14 7:20 PM
HI,
<b>LOOP AT IT_WRKGDATES.</b>
SELECT <b>BEINDT BMENGE</b>
INTO CORRESPONDING FIELDS OF TABLE IT_RELEASE
FROM
EKEK AS A
JOIN EKEH AS B
ON
AEBELN = BEBELN AND
AEBELP = BEBELP AND
AABART = BABART AND
AABRUF = BABRUF
WHERE
A~EBELN = WA_PURDOC-EBELN AND
A~EBELP = WA_PURDOC-EBELP AND
A~ABART = '2' AND
B~EINDT <b>= IT_WRKGDATES-EINDT.
ENDLOOP.</b>
Regards
SAB