2008 Jan 23 4:41 AM
Hi Experts
I am using the following query, my input as 'ZSO' only, but now the query is not working properly. what could be the reason. pls help me on this.
SELECT a~aufnr
a~plnbez
a~dispo
b~kdauf
b~kdpos
c~budat
c~werks
INTO CORRESPONDING FIELDS OF TABLE i_FINAL
FROM afko AS a
INNER JOIN afpo AS b ON aaufnr = baufnr
INNER JOIN afru AS c ON aaufnr = caufnr AND arueck = crueck AND armzhl = crmzhl
WHERE b~kdauf IN zso
AND b~kdpos IN zli
AND a~aufnr IN zauf
AND c~budat IN zdat
AND c~werks IN zpl
AND a~plnbez IN zmat.
Thanks in advance.
regards
Rajaram
Hi Experts
I am using the following query, my input as 'ZSO' only, but now the query is not working properly. what could be the reason. pls help me on this.
SELECT a~aufnr
a~plnbez
a~dispo
b~kdauf
b~kdpos
c~budat
c~werks
INTO CORRESPONDING FIELDS OF TABLE i_FINAL
FROM afko AS a
INNER JOIN afpo AS b ON aaufnr = baufnr
INNER JOIN afru AS c ON aaufnr = caufnr AND arueck = crueck AND armzhl = crmzhl
WHERE b~kdauf IN zso
AND b~kdpos IN zli
AND a~aufnr IN zauf
AND c~budat IN zdat
AND c~werks IN zpl
AND a~plnbez IN zmat.
Thanks in advance.
regards
Rajaram
2008 Jan 23 4:47 AM
hi,
try this
SELECT a~aufnr
a~plnbez
a~dispo
b~kdauf
b~kdpos
c~budat
c~werks
INTO CORRESPONDING FIELDS OF TABLE i_FINAL
FROM afko AS a
INNER JOIN afpo AS b ON aaufnr = baufnr
INNER JOIN afru AS c ON aaufnr = caufnr AND arueck = crueck AND armzhl = crmzhl.
reward if its useful
2008 Jan 23 4:49 AM
i have to check the plant, date, sales order, material and production order also, so i need those condition also. what can i do.
Suggest me.
Regards
Rajaram
2008 Jan 23 4:52 AM
hi,
did u delcare these fields in i_final.
WHERE b~kdauf IN zso
AND b~kdpos IN -zli
AND a~aufnr IN zauf
AND c~budat IN zdat
AND c~werks IN zpl
AND a~plnbez IN zmat.
2008 Jan 23 5:01 AM
2008 Jan 23 5:05 AM
Hi Raja,
What is the value for sy-subrc after the query?
You can try to break the SQL statement by first selecting data only from AFKO and AFPO. Then you can add the third table and its join condition (one at a time). This approach will help you identify the condition due to which the query is failing.
I assume there is matching data available in all the three tables (meaning that your where conditions are all satisfied).
Regards,
Shyam
2008 Jan 23 5:25 AM
yea, i have done 3 queries for 3 tables separately, but when execute for input for date, it takes long time.
bcoz,
SELECT AUFNR
POSNR
KDAUF
DAUAT
KDPOS FROM AFPO
INTO CORRESPONDING FIELDS OF TABLE i_afpo
FOR all entries in i_afko
where aufnr EQ i_afko-aufnr And
KDAUF IN ZSO AND
KDPOS IN ZLI.
SELECT AUFNR
BUDAT
ISDD
WERKS
SMENG
ARBID
RUECK
RMZHL
VORNR
LTXA1
GRUND
STOKZ
STZHL
AENAM
AUERU
EXNAM
LMNGA FROM AFRU
INTO CORRESPONDING FIELDS OF TABLE i_AFRU
FOR ALL ENTRIES IN i_afpo
WHERE aufnr EQ i_afpo-aufnr AND
BUDAT IN ZDAT AND
WERKS IN ZPL.
input as 01.01.2007 to 01.03.2007
if the i_afpo has 5000 records, it takes too much time.
how can we solve this.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |