on 01-09-2019 6:01 AM
Hi All,
I want query to show item not used (SQ, SO, PO) upto 2012 Dec, Please Help Me.
Here you go Athul - wrote this during taxi ride to airport.
In order to fullfill your requirements, just add in whatever Line Table you want in the WHERE area of the SQL (for example, INV1 is for AR Invoices, RIN1 is for Credit Memos, IGN1 for Goods Receipts, etc.). Some of them might require DocDate - you can find that out through the usage of the Query Generator. Verification is done with the Inventory Audit Report on the Item Master Data Record...
Best Regards - Zal
SELECT DISTINCT
T0.ItemCode,
T0.ItemName,
T0.FrgnName
FROM OITM T0
WHERE
((T0.ItemCode NOT IN (SELECT T1.ItemCode FROM QUT1 T1 WHERE T1.ShipDate <= '12/31/2016'))
AND (T0.ItemCode NOT IN (SELECT T2.ItemCode FROM RDR1 T2 WHERE T2.ShipDate <= '12/31/2016'))
AND (T0.ItemCode NOT IN (SELECT T3.ItemCode FROM DLN1 T3 WHERE T3.ShipDate <= '12/31/2016')))
ORDER BY
T0.ItemCode
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Athul...with a date that long ago, is hard for me to test it out since most Customers I have are fairly new on SAP B1. So I tried it with 2016 and it worked fine (you can change the year in the code below to suit your needs). Sometimes you need to use different "T" values when using a SELECT in the WHERE area.
Let us know if this works. Regards, Zal
SELECT DISTINCT
T0.ItemCode,
T0.ItemName,
T0.FrgnName
FROM OITM T0
WHERE
T0.ItemCode NOT IN (SELECT T1.ItemCode FROM OINM T1 WHERE T1.DocDate <= '12/31/2016')
ORDER BY
T0.ItemCode
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Morning Athul - more than welcome...
There are some questions you need to answer for everyone trying to help you for several reasons:
Okay - those are the questions in my mind, and I am sure others have the same ones. If you could answer these it would be excellent for those trying to help you out here in SCN.
I head to Europe this afternoon, so after you provide a bit more information, maybe the answer will be there for you...
Many Thanks and Best Regards - Zal
Hi,
Run below query for sales quotation,
SELECT T0.[ItemCode], T0.[ItemName], T0.[FrgnName] FROM OITM T0 WHERE T0.[ItemCode] NOT IN ( SELECT T1.[ItemCode] FROM OQUT T0 INNER JOIN QUT1 T1 ON T0.[DocEntry] = T1.[DocEntry] WHERE T0.[DocDate] >='2013-01-01')
Regards,
Nagarajan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Nagarajan - maybe an idea??? - after Athul provides a list, how about a large WHERE statement like
(((T0.ItemCode NOT IN (SELECT T1.ItemCode FROM QUT1 T1 WHERE T1.ShipDate <= 12/31/2012)) OR (T0.ItemCode NOT IN (SELECT T2.ItemCode FROM RDR1 T2 WHERE T2.ShipDate <= 12/31/2012)) OR....etc...etc
Just thought of this as an alternative - no time for me to test out - what do you think???
Best Regards to You - Zal
I understood you need items that were not used before 2012 Dec? In that case it should be Docdate <= '2013-12-31'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
select itemcode,itemname,frgnname
from
OITM
where
ItemCode not in (select ItemCode from OINM where Docdate>='2013-01-01')
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
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.