2008 Mar 19 11:01 AM
Hi Frds
Im displaying the material details based on Plant and Storage.
while executeing the program ,its taking too much time to select the material .
I hv put inner join for the table MARA,MARD,MAKT,MARC,MLGN. For displaying ROL,UOM,Warehouse,Material Code,Material Desc.,
This is my select statement ,pls correct my mistake.
SELECT MARAMATNR MARAMEINS
MAKT~MAKTX
MARC~MINBE
MARDWERKS MARDLGORT
MLGN~LGNUM
INTO CORRESPONDING FIELDS OF TABLE IMAT
FROM MARA INNER JOIN MAKT ON MAKTMATNR = MARAMATNR
INNER JOIN MARC ON MARCMATNR = MARAMATNR
INNER JOIN MARD ON MARDMATNR = MARAMATNR
INNER JOIN MLGN ON MLGNMATNR = MARAMATNR
WHERE MARA~MATNR IN MATERIAL AND
MARD~WERKS IN PLANT AND
MARD~LGORT IN STORAGE.
IF SY-SUBRC <> 0.
message 'No data Found for the selection ' type 'E'.
EXIT.
ENDIF.
Thanks
Pari
Hi Frds
Im displaying the material details based on Plant and Storage.
while executeing the program ,its taking too much time to select the material .
I hv put inner join for the table MARA,MARD,MAKT,MARC,MLGN. For displaying ROL,UOM,Warehouse,Material Code,Material Desc.,
This is my select statement ,pls correct my mistake.
SELECT MARAMATNR MARAMEINS
MAKT~MAKTX
MARC~MINBE
MARDWERKS MARDLGORT
MLGN~LGNUM
INTO CORRESPONDING FIELDS OF TABLE IMAT
FROM MARA INNER JOIN MAKT ON MAKTMATNR = MARAMATNR
INNER JOIN MARC ON MARCMATNR = MARAMATNR
INNER JOIN MARD ON MARDMATNR = MARAMATNR
INNER JOIN MLGN ON MLGNMATNR = MARAMATNR
WHERE MARA~MATNR IN MATERIAL AND
MARD~WERKS IN PLANT AND
MARD~LGORT IN STORAGE.
IF SY-SUBRC <> 0.
message 'No data Found for the selection ' type 'E'.
EXIT.
ENDIF.
Thanks
Pari
2008 Mar 19 11:05 AM
Hi,
are you sure, that you have datas inside MLGN?
Regards
Nicole
2008 Mar 19 11:07 AM
first u use inner join for 2 table MARA,MARD and then for other table use for all entries in i_mara_mard( join of 2 table nmara & mard)
it will solved ur problem and improve the performance also
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |