‎2013 Oct 29 9:46 AM
Hi All,
I am extracting data from two tables (EKKO,EKPO)using Function module. I have created extract structure on these tables, there is component AEDAT in both tables with same name and I am not able to create field in structure with same name. So I created one as zAEDAT, If I create one with zAEDAT than I am not able to use select as there is not standard component as ZAEDAT.
Can some please tell me the select statement to fetch both of these dates in single select, below statement will not work as there is no component as ZAEDAT. I am using cursors to fetch this data, not using any internal tables.
Please suggest.
SELECT EKKO~EBELN EKKO~AEDAT EKPO~ZAEDAT
FROM EKKO
INNER JOIN EKPO ON EKKO~EBELN= EKPO~EBELN
Where EKKO~EBELN IN PONO.
Regards,
Ray
‎2013 Oct 29 9:49 AM
Hi
SELECT EKKO~AEDAT as ZAEDAT
FROM ekko
INNER JOIN EKPO ON EKKO~EBELN= EKPO~EBELN
Where EKKO~EBELN IN PONO.
Regards
Shaik
‎2013 Oct 29 9:52 AM
SELECT EKKO~EBELN EKKO~AEDAT as ZEDAT EKPO~ZAEDAT as ZEDAT1
FROM EKKO
INNER JOIN EKPO ON EKKO~EBELN= EKPO~EBELN
Where EKKO~EBELN IN PONO.
‎2013 Oct 29 10:01 AM
Hello Ray,
first thing is you can create a field AEDAT in your table or structure with same name .
i dono why you going with zaedat field .
As above suggested you can use,
SELECT EKKO~AEDAT as ZAEDAT
FROM ekko
INNER JOIN EKPO ON EKKO~EBELN= EKPO~EBELN
Where EKKO~EBELN IN PONO.
‎2013 Oct 29 10:02 AM
types : begin of ty_tab,
ebeln type ebeln,
aedat type aedat,
zaedat type aedat,
end of ty_tab.
data: itab type standard table of ty_tab.
since AEDAT is in both tables u can write join as below
SELECT EKKO~EBELN EKKO~AEDAT EKPO~AEDAT
FROM EKKO
INNER JOIN EKPO ON EKKO~EBELN = EKPO~EBELN
INTO TABLE itab
WHERE EKKO~EBELN IN PONO.