‎2007 Apr 16 11:23 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:55 AM
Hai Victor,
It is<b> better to create a database</b> view for your problem because each time the time to run the query takes much larger time.
Coming to the solution ...
Create a database view with the condition
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
The view itself takes the duty of joining and checking the conditions after mensioning the joining conditions:
<b>Reward points if it helps you.</b>
Regds,
Rama chary.Pammi
‎2007 Apr 16 11:55 AM
Hai Victor,
It is<b> better to create a database</b> view for your problem because each time the time to run the query takes much larger time.
Coming to the solution ...
Create a database view with the condition
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
The view itself takes the duty of joining and checking the conditions after mensioning the joining conditions:
<b>Reward points if it helps you.</b>
Regds,
Rama chary.Pammi
‎2007 Apr 16 3:13 PM
Hi,
Create a database view for the tables which you are using. The view itself will propose the join conditions which you can consider. Also you can specify the Where clause conditions in the tab 'select conditions'. This will also helps you to retreive the data at a faster rate in programs.
thanks,
sksingh.