‎2007 Apr 16 11:24 AM
Hi,
I am struck at a point where i have to retrieve data from 4 database table to a single internal table with some conditions. can anyone please help me in resolving this issue. your help will be highly appreciated.
some details are: tables used are-linv,mch1,makt,ausp.
data: begin of t_outtab,--
lgnum LIKE linv-lgnum,
ivnum LIKE linv-ivnum,
werks LIKE linv-werks,
lgtyp LIKE linv-lgtyp,
matnr LIKE linv-matnr,
bestq LIKE linv-bestq,
charg LIKE linv-charg,
maktx LIKE makt-maktx,
vfdat LIKE mch1-vfdat,
atwrt LIKE ausp-atwrt,
END OF t_outtab.
input parameters:-- linv-lgnum and linv-ivnum.
conditions:1. Where MAKT-MATNR = LINV-MATNR and MAKT-SPRAS = logon language user
2. Where MCH1-CHARG = LINV-CHARG AND MCH1-MATNR = LINV-MATNR)
3. SELECT AUSP-ATWRT Where AUSP-OBJEK = MCH1- CUOBJ_BM and MCH1-CHARG = LINV-CHARG AND MCH1-MATNR = LINV-MATNR
Regards
Victor
‎2007 Apr 16 11:34 AM
select <data fields> into it_linv from LINV where LGNUM = linv-lgnum and IVNUM = linv-ivnum.
select <data fields> into it_mch1 from mch1 as a inner join makt as b on aMATNR = bMATNR for all entries of it_linv where amatnr = it_linv-matnr and acharg = it_linv-charg and b~langu = sy-langu.
select <data fields> into it_ausp from ausp for all entries of it_mch1 where AUSP-OBJEK = it_mch1- CUOBJ_BM.
now loop it_linv and use read statement for it_mch1, it_ausp and move data to final table..
Reward and close duplicate threads.
‎2007 Apr 16 11:34 AM
select <data fields> into it_linv from LINV where LGNUM = linv-lgnum and IVNUM = linv-ivnum.
select <data fields> into it_mch1 from mch1 as a inner join makt as b on aMATNR = bMATNR for all entries of it_linv where amatnr = it_linv-matnr and acharg = it_linv-charg and b~langu = sy-langu.
select <data fields> into it_ausp from ausp for all entries of it_mch1 where AUSP-OBJEK = it_mch1- CUOBJ_BM.
now loop it_linv and use read statement for it_mch1, it_ausp and move data to final table..
Reward and close duplicate threads.