on 12-02-2011 3:21 PM
Dear Experts,
We want to list out closed service calls whose invoice has not made.
For this, I used OSCL and SCL2 tables by linking on CALLID and using QTYTOINV = 0 as a flag. But, wrong result.
Please help me.
I also observed SCL4 table in which all the transactions against a particular service call are recorded. I tred to list the calls against which there is no object (13).
Help needed.
thanking You
Malhaar
Dear Malhaar,
Have you tried:
SELECT Distinct T1.createDate, T1.callID, T1.custmrName,
T1.technician, T0.ItemCode,T0.ItemName,
T0.TransToTec, T0.QtyToInv, T1.status, t3.price,
T2.LastPurPrc,T2.LastPurPrc * T0.TransToTec AS 'Value'
FROM
SCL2 T0 INNER JOIN OSCL T1 ON T0.SrcvCallID = T1.callID
INNER JOIN OITM T2 ON T0.itemCode = T2.ItemCode
INNER JOIN SCL4 T4 ON T0.SrcvCallID = T1.callID AND T4.Object != '13'
LEFT JOIN INV1 t3 ON t3.itemcode = t2.itemcode AND T3.DocEntry = T4.DocAbs
WHERE T0.QtyToInv = 0 and T0.TransToTec > 0 and
T1.status = 1
ORDER BY T1.technician, T1.createDate
What is the result?
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Malhaar,
Judging from your original question that you only want to listing out service call which:
1. Status already closed
2. Invoice not yet created
Try this:
SELECT T0.callID,T0.CreateDate,T0.customer,T0.custmrName FROM OSCL T0
WHERE T0.status=-1
AND T0.callID NOT IN(SELECT DISTINCT SrcvCallID FROM SCL4 WHERE Object=13)
Hope helps.
Best Regards,
Hendry Wijaya
Try:
SELECT Distinct T1.createDate, T1.callID, T1.custmrName,
T1.technician, T0.ItemCode,T0.ItemName,
T0.TransToTec, T0.QtyToInv, T1.status,
T2.LastPurPrc,T2.LastPurPrc * T0.TransToTec AS 'Value'
FROM
SCL2 T0 INNER JOIN OSCL T1 ON T0.SrcvCallID = T1.callID
INNER JOIN OITM T2 ON T0.itemCode = T2.ItemCode
INNER JOIN SCL4 T4 ON T4.SrcvCallID = T1.callID AND T4.Object != '13'
WHERE T0.QtyToInv = 0 and T0.TransToTec > 0 and T1.status != 1
ORDER BY T1.technician, T1.createDate
Hi Henry and Gordon,
I tried all these queries.
Technically all these queries are right. Provided all the service related transactions have punched through
service module -
> Expenses Tab -
> New Documents and so on.
In this case only SAP maintains the qtytoinvoice flag in the SCL2 and object flag in the SCL4 table.
If user creates a stand alone A/R Invoice then System do not pass any reference in the SCL2 and SCL4 tables.
So, inspite of using these flags the query is not giving the desired results.
Thanking You
Malhaar
Hi Malhaar,
Gordon is right. How can you match the standalone invoice with the service call if in SAP you're not even use a feature to relate those two things. There is a broken link here.
If you want to relate standalone invoice with service call, maybe you could consider using Activities in service call, and attached the document using Linked Document feature in activity.
Best Regards,
Hendry Wijaya
User | Count |
---|---|
104 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.