‎2007 Aug 24 12:59 PM
Hi friends,
basically i'm not a ABAPER, but i have to write this code.. and fetch the data .. i want to extract data from three tables <b> INOB</b> (CUOBJ ,OBJEK ), <b>AUSP</b>(OBJEK ,ATINN ,ATWRT ,ATFLV ) and ,<b>CABN</b> (ATINN, ATNAM)
these fields i want to extract so, can one give me the exact select statement with using inner join based on above common fields..
i need it urgent... answers will be highly appriciated..
regards
Babu
‎2007 Aug 24 1:12 PM
select a~CUOBJ
a~objek
B~ATINN
B~ATWRT
B~ATFLV
c~ATNAM
from INOB as a
INNER JOIN AUSP as b
ON aOBJEK = bOBJEK
INNER JOIN CABN as c
ON bATINN = cATINN
into table <your final table>
where <your conditions>.
But using inner joins on three tables is not preferable
you can code like this also
Use innre join on two tables and then for all entries on third table.
rewards if useful,
regards,
nazeer
Message was edited by:
'Nazeer'
‎2007 Aug 24 1:09 PM
IF GT_IMAK[] IS NOT INITIAL.
SELECT A~POSNR
A~OBJNR
B~PRNAM
B~POSID
B~GJAHR
FROM IMZO AS A
INNER JOIN IMPR AS B ON
APOSNR = BPOSNR
INTO CORRESPONDING FIELDS OF TABLE GT_INVT
FOR ALL ENTRIES IN GT_IMAK
WHERE A~OBJNR = GT_IMAK-OBJNR1.
ENDIF.
try this sample code , u have to join in Primary keys.
Regards
Peram
‎2007 Aug 24 1:12 PM
select a~CUOBJ
a~objek
B~ATINN
B~ATWRT
B~ATFLV
c~ATNAM
from INOB as a
INNER JOIN AUSP as b
ON aOBJEK = bOBJEK
INNER JOIN CABN as c
ON bATINN = cATINN
into table <your final table>
where <your conditions>.
But using inner joins on three tables is not preferable
you can code like this also
Use innre join on two tables and then for all entries on third table.
rewards if useful,
regards,
nazeer
Message was edited by:
'Nazeer'
‎2007 Aug 24 1:14 PM
Hi..
Declare ITAB with all these fields:
SELECT INOBCUOBJ INOBOBJEK
AUSPATINN AUSPATWRT AUSP~ATFLV
CABN~ATNAM
FROM INOB
INNER JOIN AUSP
ON INOBOBJEK = AUSPOBJEK
INNER JOIN CABN
ON AUSPATINN = CABNATINN
INTO TABLE ITAB.
<b>Reward if Helpful.</b>
‎2007 Aug 24 1:14 PM
Hi,
DATA: begin of itab occurs 0,
INCLUDE STRUCTURE INOB.
DATA:ATINN TYPE CAMN-ATINN,
end of itab.
SELECT * FROM INOB INNER JOIN AUSP ON INOB~OBJEK = AUSP~OBJEK
INNER JOIN CABN ON INOB~ATINN = CABN~ATINN into corresponding fields of table itab.
Regards,
Sesh