Regarding purchasing report
Hi all,
i need to have report for finding best vendors which is supplying desired supply...........so what r the issues to be taken to find out the above......and also..............can any one explain what is purchsing group,material group,........in purchasing and what r the data sources and tables related to above...........what r the reports can we get through that data sources..........
thanks in advance,
swathi
Look at BC Queries
http://help.sap.com/saphelp_nw70/helpdata/en/c5/a26f37eb997866e10000009b38f8cf/frameset.htm
<b>Purchasing Group</b>
A key for a buyer or group of buyers responsible for certain purchasing activities.
The purchasing group is:
Internally responsible for the procurement of a material or a class of materials
The principal channel for a company's dealings with its vendors
<b>Material Group</b>
A grouping of materials and services according to their characteristics.
<a href="http://help.sap.com/saphelp_nw70/helpdata/en/c5/a26f37eb997866e10000009b38f8cf/frameset.htm">Glossary</a>
<b>For datasources & tables</b>
http://help.sap.com/saphelp_nw70/helpdata/en/c5/a26f37eb997866e10000009b38f8cf/frameset.htm
Similar Messages
-
CR2008 Purchasing Report needed
Hi
Has anyone created a Purchasing report in Crystal Reports 2008 based on AP Invoices and AP Credit Notes. I have created a WPA (Weekly Purchase Analysis) report but based off AP Invoice table (OPCH & PCH1), now the company is wanting to have Credit Notes added to this report.
I have created a UDF called WPA on the OPCH form which is a Mandatory field so when running the WPA Report you can run it by WPA # and Project to get your results (Parameter), now how will I acheive this by adding the AP Credit Note fields ORPC & RPC1 to the report so if I create x2 Invoice's (different suppliers) for say WPA # 1010 and I Credit one, on the WPA Report I will want to see Invoice 1 (NumCard = 1) = R100, Invoice 2 (NumCard = 2) = 100, Credit Note 1 (NumCard = 2) = -100, Total = 100.
Any suggestions or ideas will be most helpful.
Regards
Kurt WaltersHi Kurt,
That is possible using "Shared Variable".
Check this link: [Sub-report data in report|Sub-report data in report].
1.Initialize a shared variable in Report.
2.Pass the Credit memo value to the 'Shared variable' in Sub-report
3.Now create a formula in Report like
Sub-total = {Invoice total} - {SharedVariable}
In order to know more about shared variable, post a separate question in [SAP Crystal Reports Design - Forum|SAP Crystal Reports;.
Hope this helps.
Regards,
Bala -
All SAP Gurus,
Is there any Purchasing report available which gives the information regarding:
Plant, Purchasing group, material type, PO, GR No., vendor, amount (all in single report only).
Regards,Hi,
Refer following reports;
ME2N - List of PO Documents (In selection Screen use Scope of List - ALLES)
ME80FN - General Analysis (Here in Output, select option "PO History" by clicking on the button at extreme right) -
Change BI report links in Purchasing reports ?
Hi,
We are in SRM 7.0.
I want to hide some of the links in portal under the buyer role.
Purchasing reports : In this , i want to hide some links.
There is change launch pad option is available , but i want to hide for all the users.
Could you please let us know whether that is poassible or not.
For better understanding : Link : [http://img1.uploadscreenshot.com/images/orig/1/500101326-orig.jpg]
Regards
Venkatesh P
Edited by: Venkatesh Padarti on Jan 6, 2011 6:10 AMThere is one transaction LPD_CUST.
In that i have done the changes.
Regards
Venkatesh P -
Hi ,
0vtype is used to differentiate a keyfigure with respect to its value type like actual value and planned value.
But what is the use of 0vtype as a filter in Purchasing Reports where there are no planned values and why is it always 10 - does it mean that its always actual value?
Thanks,
JBHi JB,
I think in case of Controlling module, we have to specify 0VTYPE in query level , as in r/3 we define budget, planning figures for a period/fiscal year.
And for purchasing it should be actuals only.
Hope that helps.
Regards
Kapadia
***Assigning points is the way to say thanks in SDN.*** -
Purchase Report Requirement from Auditors
Dear All
I have a query from audit department for Purchase Reprots as follows, They require reports in one consilidated format and not to do anything in EXCEL
requirement as follows
a) one material--having different rates
b) different vendorssame materialdifferent rates
They want this report at plant, company level.
Please guide me ASAP
Regards
ManojHi,
There is SAP Standard Report for PR - ME5A
Just check in this.
Here in the selection screen of the reports, enter Scope of List as "ALV". And then execute the report and download to excel.
If Scope of List as "ALV" is not there in the list then you can create the same in SPRO > MM > Purchasing > Reporting > Maintain Purchase Requisition Lists > Define Scope of List > Here select "A" and copy to "ALV", for "ALV" activate indicator "ALV grid control"
Then go to SPRO > MM > Purchasing > Reporting > Maintain Purchase Requisition Lists > Define Default Values for Transactions > Here enter Scope of List "ALV" as default for the above reports. -
Hi Experts
I would like to creat a report that shows all items purchased from a specific supplier
amount and price sum per item
I try using the default purchase report in the system but it doesnt show the frozen/non active items.
could you help me with this issue?
thanks & regards.
d.Medalion.Hi........
You need to use Union All function.......
SELECT T0.DocEntry, T0.[DocNum] As 'PO No.', T0.[DocDate], T0.[DocDueDate],
T5.DocEntry 'DownPayment No.', T0.[CardCode], T0.[CardName], T0.[NumAtCard],
T1.[ItemCode], T1.[Dscription], T1.FreeTxt,T1.[Quantity], T1.Price as 'PO Price',
T4.[PymntGroup] 'Payment terms', T3.DocNum As 'GRN No.', T2.Quantity As 'Total Rcvd',
T1.[OpenQty], T1.ShipDate FROM OPOR T0 INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry
LEFT Join PDN1 t2 On T1.DocEntry=T2.BaseEntry and T1.LineNum=T2.BaseLine LEFT Join OPDN T3 On T2.DocEntry=T3.DocEntry Left Join OCTG T4 On T0.GroupNum = T4.GroupNum LEFT JOIN DPO1 T5 On T5.BaseEntry=T0.DocEntry LEFT JOIN ODPO T6 On T5.DocEntry=T6.DocEntry
Where (T0.Docstatus='[%0]' or '[%0]'='') And (T1.LineStatus='[%1]' or '[%1]'='')
And (T6.Canceled != 'Y' or T6.Canceled Is Null) And T0.CardName='[%2]'
Group By T0.[DocNum], T0.[DocDate], T0.[DocDueDate], T0.[CardCode], T0.[CardName],
T0.[NumAtCard], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[OpenQty], T3.DocNum,
T2.Quantity, T1.Price, T4.[PymntGroup], T1.FreeTxt, T0.DocEntry, T1.ShipDate, T5.DocEntry
Union All
SELECT Null, T0.DocNum, Null, Null,
Null 'DownPayment No.', Null, '', '',
Null, Null, '', Sum(T1.[Quantity]) , Sum(T1.LineTotal)/Sum(T1.[Quantity]) as 'PO Price',
Null, Null, Sum(T2.Quantity) As 'Total Rcvd',
Sum(T1.[OpenQty]), Null FROM OPOR T0 INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry
LEFT Join PDN1 t2 On T1.DocEntry=T2.BaseEntry and T1.LineNum=T2.BaseLine LEFT Join OPDN T3 On T2.DocEntry=T3.DocEntry Left Join OCTG T4 On T0.GroupNum = T4.GroupNum LEFT JOIN DPO1 T5 On T5.BaseEntry=T0.DocEntry LEFT JOIN ODPO T6 On T5.DocEntry=T6.DocEntry
Where (T0.Docstatus='[%0]' or '[%0]'='') And (T1.LineStatus='[%1]' or '[%1]'='')
And (T6.Canceled != 'Y' or T6.Canceled Is Null) And T0.CardName='[%2]'
Group By T0.[DocNum]
Order By T0.DocNum
Regards,
Rahul -
Query Purchasing Report per Project
Dear all,
I want to make query that can give me information about purchasing report per project. The data should come from AP invoice and AP credit memo (item and service type). I use project code field in the form to filter data.
Thanks before for your kind helpHai!
Try this
Declare @project as nvarchar(30)
set @Project = (select max(S0.PrjCode) from OPRJ S0 where S0.PrjCode='[%0]')
Select
a.Itemcode,
max(a.Name) Name,
sum(a.quantity) Quantity,
sum(a.price) Price,
sum(a.linetotal) Line_Total from (
SELECT
T1.ItemCode,
max(T1.Dscription) Name,
sum(T1.Quantity) Quantity,
sum(T1.Price) Price,
sum(T1.LineTotal) LineTotal
From
PCH1 T1,OPRJ P0
where
T1.Project=P0.PrjCode and
T1.Project = @Project
Group By
T1.ItemCode
UNION All
SELECT
T1.ItemCode,
max(T1.Dscription) Name,
sum(T1.Quantity) Quantity,
sum(T1.Price) Price,
sum(T1.LineTotal) Line_Total
From
RPC1 T1,OPRJ P0
where
T1.Project=P0.PrjCode and
T1.Project = @Project
Group By
T1.ItemCode) a
Group By
a.ItemCode
Regards,
Thanga Raj.K -
Attach Query Report to Purchase Report.
Hello Xperts....
I have executed a query report regarding purchase orders. Now I want to attach that query report in my purchase Reports(Modules -> Purchase A/P -> Purchase Reports) but not in My Menu.
Plz reply...Thanx..Hi Papil.....
You can not only import the query report on Main Menu Purchase report.
If you have SAP 8.8 then you have to create a Crystal report and then from Administration> Setup> General--> Report and layout --> Import.
Regards,
Rahul -
How do i get purchase Report.
Hello All
u201CHow do I get a purchase report from u2013 to date. The report should be display each individual row itemu2019s quantity, unit price, Assessable value, Base amount, tax amount . i.e BED amount, Cess , HSCess, VAT, CST etc.u201D
Regards
Santhosh.KTry this
Select T0.docnum,
(select seriesname from nnm1 where series=T0.series) as InvSeries,
T0.DocDate,T0.CardName,T0.NumatCard as 'Customer Reference',
(select T8.TaxId11 from pch12 T8 where T8.docentry=T1.docentry) as 'TIN No.',
T1.ItemCode,T1.Dscription,T1.AssblValue,
CAST(T1.Quantity as Decimal(10,3)) as Quantity,T1.unitMsr as UOM,
T1.currency,
T1.PriceBefDi as 'Unit Price',T1.DiscPrcnt as 'Row Discount',
CAST(T1.Price as Decimal(10,2)) as Price,
CAST(T1.LineTotal as Decimal(14,2)) as Basic,
T0.DiscPrcnt as 'Doc Discount',
isnull((select sum(O1.Transvalue) from OINM O1,PDN1 N1,OPDN N0
where
N0.Docentry=N1.docentry and O1.Itemcode=N1.Itemcode and N1.TrgetEntry=T0.Docentry
and O1.Warehouse=N1.WhsCode
and O1.BASE_REF=N0.Docnum
and O1.TransType = 20 and
N1.Targettype=18),0) as 'GRPO Price',
isnull((select sum(O1.Transvalue) from OINM O1
where
O1.Itemcode=T1.Itemcode
and O1.Warehouse=T1.WhsCode
and O1.BASE_REF=T0.Docnum
and O1.TransType = 18),0) as 'Price Difference ',
isnull((select sum(O1.Transvalue) from OINM O1,OIPF L0 inner join
IPF1 L1 on L0.Docentry=L1.Docentry,PDN1 N1
where
O1.Itemcode=T1.Itemcode
and O1.Warehouse=T1.WhsCode
and O1.BASE_REF= L0.DocNum and
L1.BaseEntry = N1.Docentry and
N1.TrgetEntry=T0.Docentry
and O1.TransType = 69),0) as 'Lande Cost',
(SELECT T6.[BaseDocNum]
FROM OPDN T5 INNER JOIN PDN1 T6 ON T5.DocEntry = T6 .DocEntry
Where(T5.[DocType]='I') and (T5.[DocNum]=T1.[BaseDocNum]) and (T6.[DocEntry] = T1.[BaseEntry])
and (T6.[LineNum]=T1.[BaseLine]) and (T6.[BaseType]='22')
) as PONumber,
(SELECT T7.[DocDate] FROM OPOR T7 WHERE T7.[DocEntry]=(SELECT T6.[BaseEntry]
FROM OPDN T5 INNER JOIN PDN1 T6 ON T5.DocEntry = T6 .DocEntry
Where(T5.[DocType]='I') and (T5.[DocNum]=T1.[BaseDocNum]) and (T6.[DocEntry] = T1.[BaseEntry])
and (T6.[LineNum]=T1.[BaseLine]) and (T6.[BaseType]='22')
) ) as PODate,
isnull((select sum(taxsum) from pch4 where pch4.docentry=T0.docentry and pch4.LineNum=T1.Linenum and
pch4.statype=-90 ),0) as BasicExcise,
isnull((select sum(taxsum) from pch4 where pch4.docentry=T0.docentry and pch4.LineNum=T1.Linenum and
pch4.statype=-60 ),0) as ExciseCess,
isnull((select sum(taxsum) from pch4 where pch4.docentry=T0.docentry and pch4.LineNum=T1.Linenum and
pch4.statype=7 ),0) as Excisecess_he,
isnull((select Min(BaseSum) from pch4 where pch4.docentry=T0.docentry and pch4.LineNum=T1.Linenum
and pch4.statype not in (-90,-60,7)),0) as TaxableTurnover,
isnull((select sum(taxsum) from pch4 where pch4.docentry=T0.docentry and pch4.LineNum=T1.Linenum and
pch4.statype=4 and taxrate=10),0) as cst10,
isnull((select sum(taxsum) from pch4 where pch4.docentry=T0.docentry and pch4.LineNum=T1.Linenum and
pch4.statype=4 and taxrate=12.5),0) as cst12,
isnull((select sum(taxsum) from pch4 where pch4.docentry=T0.docentry and pch4.LineNum=T1.Linenum and
pch4.statype=4 and taxrate=3),0) as cst3,
isnull((select sum(taxsum) from pch4 where pch4.docentry=T0.docentry and pch4.LineNum=T1.Linenum and
pch4.statype=4 and taxrate=2),0) as cst2,
isnull((select sum(taxsum) from pch4 where pch4.docentry=T0.docentry and pch4.LineNum=T1.Linenum and
pch4.statype=4 and taxrate not in (10,12.5,3,2)),0) as cst_others,
isnull((select sum(taxsum) from pch4 where pch4.docentry=T0.docentry and pch4.LineNum=T1.Linenum and
pch4.statype=1 and taxrate=4),0) as VAT4,
isnull((select sum(taxsum) from pch4 where pch4.docentry=T0.docentry and pch4.LineNum=T1.Linenum and
pch4.statype=1 and taxrate=12.5),0) as VAT12,
isnull((select sum(taxsum) from pch4 where pch4.docentry=T0.docentry and pch4.LineNum=T1.Linenum and
pch4.statype=1 and taxrate=0),0) as VAT0,
isnull((select sum(taxsum) from pch4 where pch4.docentry=T0.docentry and pch4.LineNum=T1.Linenum and
pch4.statype=1 and taxrate not in (4,12.5,0)),0) as VAT_others,
isnull((select sum(taxsum) from pch4 where pch4.docentry=T0.docentry and pch4.LineNum=T1.Linenum and
pch4.statype=9),0) as tcs,
isnull((select sum(linetotal) from pch3 where pch3.docentry=T0.docentry and
T1.linenum=(Select Max(Linenum) from PCH1 T3 where T3.DocEntry=T0.DocEntry)),0 ) as Other_expenses,
T1.Gtotal as Itemwise_grossTotal,
isnull(( select Rounddif from OPCH T4 where T4.docentry=T0.Docentry and
T1.linenum=(Select Max(Linenum) from PCH1 T3 where T3.DocEntry=T0.DocEntry)),0) as Inv_RoundDiff,
isnull(( select DocTotal from OPCH T5 where T5.docentry=T0.Docentry and
T1.linenum=(Select Max(Linenum) from PCH1 T3 where T3.DocEntry=T0.DocEntry)),0) as Inv_grosstotal
from Opch T0, pch1 T1,OITM M1 INNER JOIN OITB B1 ON M1.ItmsGrpCod=B1.ItmsGrpCod
where (T0.DocType='I') and T0.docentry=T1.docentry and (T0.DocDate between '[%0]' and '[%1]')
Union All
Select
T0.docnum,
(select seriesname from nnm1 where series=T0.series) as InvSeries,
T0.DocDate,T0.CardName,T0.NumatCard as 'Customer Reference',
(select T8.TaxId11 from RPC12 T8 where T8.docentry=T1.docentry) as 'TIN No.',
T1.ItemCode,T1.Dscription,T1.AssblValue,
CAST(T1.Quantity as Decimal(10,3)) as Quantity,T1.unitMsr as UOM,T1.currency,
T1.PriceBefDi as 'Unit Price',T1.DiscPrcnt as 'Row Discount',
-1*CAST(T1.Price as Decimal(10,2)) as Price,
-1*CAST(T1.LineTotal as Decimal(14,2)) as Basic,
T0.DiscPrcnt as 'Doc Discount',
0 as 'GRPO Price',
-1*isnull((select sum(O1.Transvalue) from OINM O1
where
O1.Itemcode=T1.Itemcode
and O1.Warehouse=T1.WhsCode
and O1.BASE_REF=T0.Docnum
and O1.TransType = 19),0) as 'Price Difference ',
0 as 'Landed Cost',
(SELECT T6.[BaseDocNum]
FROM OPDN T5 INNER JOIN PDN1 T6 ON T5.DocEntry = T6 .DocEntry
Where(T5.[DocType]='I') and (T5.[DocNum]=T1.[BaseDocNum]) and (T6.[DocEntry] = T1.[BaseEntry])
and (T6.[LineNum]=T1.[BaseLine]) and (T6.[BaseType]='22')
) as PONumber,
(SELECT T7.[DocDate] FROM OPOR T7 WHERE T7.[DocEntry]=(SELECT T6.[BaseEntry]
FROM OPDN T5 INNER JOIN PDN1 T6 ON T5.DocEntry = T6 .DocEntry
Where(T5.[DocType]='I') and (T5.[DocNum]=T1.[BaseDocNum]) and (T6.[DocEntry] = T1.[BaseEntry])
and (T6.[LineNum]=T1.[BaseLine]) and (T6.[BaseType]='22')
) ) as PODate,
-1*isnull((select sum(taxsum) from RPC4 where RPC4.docentry=T0.docentry and RPC4.LineNum=T1.Linenum and
RPC4.statype=-90 ),0) as BasicExcise,
-1*isnull((select sum(taxsum) from RPC4 where RPC4.docentry=T0.docentry and RPC4.LineNum=T1.Linenum and
RPC4.statype=-60 ),0) as ExciseCess,
-1*isnull((select sum(taxsum) from RPC4 where RPC4.docentry=T0.docentry and RPC4.LineNum=T1.Linenum and
RPC4.statype=7 ),0) as Excisecess_he,
-1*isnull((select Min(BaseSum) from RPC4 where RPC4.docentry=T0.docentry and RPC4.LineNum=T1.Linenum
and RPC4.statype not in (-90,-60,7)),0) as TaxableTurnover,
-1*isnull((select sum(taxsum) from RPC4 where RPC4.docentry=T0.docentry and RPC4.LineNum=T1.Linenum and
RPC4.statype=4 and taxrate=10),0) as cst10,
-1*isnull((select sum(taxsum) from RPC4 where RPC4.docentry=T0.docentry and RPC4.LineNum=T1.Linenum and
RPC4.statype=4 and taxrate=12.5),0) as cst12,
-1*isnull((select sum(taxsum) from RPC4 where RPC4.docentry=T0.docentry and RPC4.LineNum=T1.Linenum and
RPC4.statype=4 and taxrate=3),0) as cst3,
-1*isnull((select sum(taxsum) from RPC4 where RPC4.docentry=T0.docentry and RPC4.LineNum=T1.Linenum and
RPC4.statype=4 and taxrate=2),0) as cst2,
-1*isnull((select sum(taxsum) from RPC4 where RPC4.docentry=T0.docentry and RPC4.LineNum=T1.Linenum and
RPC4.statype=4 and taxrate not in (10,12.5,3,2)),0) as cst_others,
-1*isnull((select sum(taxsum) from RPC4 where RPC4.docentry=T0.docentry and RPC4.LineNum=T1.Linenum and
RPC4.statype=1 and taxrate=4),0) as VAT4,
-1*isnull((select sum(taxsum) from RPC4 where RPC4.docentry=T0.docentry and RPC4.LineNum=T1.Linenum and
RPC4.statype=1 and taxrate=12.5),0) as VAT12,
-1*isnull((select sum(taxsum) from RPC4 where RPC4.docentry=T0.docentry and RPC4.LineNum=T1.Linenum and
RPC4.statype=1 and taxrate=0),0) as VAT0,
-1*isnull((select sum(taxsum) from RPC4 where RPC4.docentry=T0.docentry and RPC4.LineNum=T1.Linenum and
RPC4.statype=1 and taxrate not in (4,12.5,0)),0) as VAT_others,
-1*isnull((select sum(taxsum) from RPC4 where RPC4.docentry=T0.docentry and RPC4.LineNum=T1.Linenum and
RPC4.statype=9),0) as tcs,
-1*isnull((select sum(linetotal) from RPC3 where RPC3.docentry=T0.docentry and
T1.linenum=(Select Max(Linenum) from RPC1 T3 where T3.DocEntry=T0.DocEntry)),0 ) as Other_expenses,
-1*T1.Gtotal as Itemwise_grossTotal,
-1*isnull(( select Rounddif from ORPC T4 where T4.docentry=T0.Docentry and
T1.linenum=(Select Max(Linenum) from RPC1 T3 where T3.DocEntry=T0.DocEntry)),0) as Inv_RoundDiff,
-1*isnull(( select DocTotal from ORPC T5 where T5.docentry=T0.Docentry and
T1.linenum=(Select Max(Linenum) from RPC1 T3 where T3.DocEntry=T0.DocEntry)),0) as Inv_grosstotal
from ORPC T0, RPC1 T1,OITM M1 INNER JOIN OITB B1 ON M1.ItmsGrpCod=B1.ItmsGrpCod
where (T0.DocType='I') and T0.docentry=T1.docentry and (T0.DocDate between '[%0]' and '[%1]') -
HT1541 Does anyone know who to contact regarding purchasing bulk iTunes cards in NZ
Does anyone know who to contact regarding purchasing bulk iTunes cards in NZ for a promotion and get a discount.. All these 0800 numbers and no one can help..
Retailers are aways offering 2 x $20.00 itune cards for $30.00... How do they do this without a discount...
Any help appreciatedAre you a member of the developer forums?
Have you tried submitting feedback from within Logic? There is a direct email link named Provide Logic Express Feedback within the Logic Express item on the Menu bar.
Some people have reported being contacted by Apple development staff after using this process.
Good luck.
x -
Help needed regarding ALV report
Hi,
I have a query regarding ALV report.
The requirement is as follows:-
When the user executes the ALV report and if he sums one numeric field column values and filters out some of the field columns ( for example there r 5 columns in the report and the user has filtered out 2 of them and viewing only 3 columns)
and now the requirements is that when the user runs the report later he should see the modified report ( i mean only 3 cloumns and the total value of the column which he has made) but not the original output which was there when the report was developed.
First of all i wanna know is it possible to do r not. If yes then how
Hope u have got what i want.
eagerly waiting for ur reply.
regards,
maqsoodHi
Yes you can! You have to manage the layout variant.
So when you call your ALV you have to set the parameter I_SAVE = 'A'.
In this way you'll allow the user to save the variants for layout.
After you has to have a chance to choose the variant in selection-screen.
See the demo program BCALV_GRID_11 to manage the variant in selection-screen.
Max -
Reg:Vendor Sales & purchase report
Dear All,
We need one customzied report which is having the details about Vendor Sales & purchase transactions , if we are giving the input vendor or customer , fiscal year, comapany code, & fiscal period as the input means we need the details about the vendor sales and purchase report.
Thanks,
Sanakar MYou can purchase the custom report from vendors called consultants or employees with developer keys.
If you input the type as ABAPER, then you have the options and (hopefully) a good quality report.
I am sure this will work....
Cheers,
Julius -
In Import Purchase process how to get the report for division wise purchase,
some material from USA some from France, and some other countries
we need to get country wise purchase reports. how it will be possible in sapUse report MC$4,here enter purchase organization,_vendor country_,vendor,plant & finally period.
-
Purchasing Report Errors - Please Help
Hey everyone!
I am an SAP newb so bear with me please. I am having issues with a the Purchasing report on our system.
The report takes parameters determining the time period for which the report is to be run, ex: from Jan 1 2008 - Aug 1 2008.
The values returned by the report are:
Item code
Vendor
Item Name
Purch Unit
Available units
Units on Order (how many are currently dedicated to an already placed order)
Purchase Factor
Purchase Price
Purchase Currency
Avg Price
Price
Stock Value
MonthToDate Sales (calculates total sales for item within time period)
Average Sales (calculates the average sale for item within time period)
Sales Factor
Month on Order
Month on Stock
The Problems are occuring with: Month to Date Sales and Average Sales. As well as Month on Order and Month on Stock, however these are secondary.
The report in SAP is as follows:
BEGIN
declare @FrmWhs varchar(8),
@ToWhs varchar(8),
@WhsLst varchar(254),
@GroupCode int,
@FrmItm varchar(20),
@ToItm varchar(20),
@MthAgo int,
@GroupName varchar(20),
@HistStart varchar(6),
@HistEnd varchar(6),
@ShowInactive varchar(1)
SELECT @FrmWhs = T0.U_FrmWhs,
@ToWhs = T0.U_ToWhs,
@WhsLst = T0.U_WhsLst,
@GroupCode = T1.ItmsGrpCod,
@FrmItm = T0.U_FrmItm,
@ToItm = T0.U_ToItm,
@MthAgo = T0.U_MthAgo,
@HistStart = T0.U_Hist1,
@HistEnd = T0.U_Hist2,
@ShowInactive = T0.U_Inact
FROM dbo.@XXPURCH T0, dbo.OITB T1
WHERE T0.U_FrmWhs = '%0'
AND T0.U_ToWhs = '%1'
AND T0.U_WhsLst = '%2'
AND T1.ItmsGrpNam = '%3'
AND T1.Locked = 'X'
AND T0.U_FrmItm = '%4'
AND T0.U_ToItm = '%5'
AND T0.U_MthAgo = %6
AND T0.U_Hist1 = '%7'
AND T0.U_Hist2 = '%8'
AND T0.U_Inact = '%9'
SET @GroupName = '%3'
IF @GroupName = ''
SET @GroupCode = 0
ELSE
SELECT @GroupCode = T2.ItmsGrpCod
FROM dbo.OITB T2
WHERE T2.ItmsGrpNam = @GroupName
SET @FrmWhs = '%0'
SET @ToWhs = '%1'
SET @WhsLst = '%2'
SET @FrmItm = '%4'
SET @ToItm = '%5'
SET @MthAgo = %6
SET @HistStart = '%7'
SET @HistEnd = '%8'
SET @ShowInactive = '%9'
exec dbo.xxPurchReport @FrmWhs,@ToWhs,@WhsLst,@GroupCode,@FrmItm,@ToItm,@MthAgo,@HistStart,@HistEnd,@ShowInactive
I do not fully understand how the SQL query (the stored procedure) dbo.xxPurchasing Report calculates these numbers. If it is helpful, I could post the SQL query in its entirety or in part.
Thank you very much for your willingness to help. It is quite frustrating for me and it is so great to have knowledgeable people here to help
-HarrisonThanks. That makes sense.
I am not a database guy, but from my limited knowledge, so here is the query in its entirety:
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
ALTER proc xxPurchReport (
@FromWhs varchar(8) = null,
@ToWhs varchar(8) = null,
@WhsList varchar(255) = null,
@GroupCode int = null,
@FromItem varchar(20) = null,
@ToItem varchar(20) = null,
@MonthsAgo int = 1,
@HistStart varchar(6) = null,
@HistEnd varchar(6) = null,
@ShowInactive char(1) = 'Y')
AS
begin
set NOCOUNT ON
DECLARE @StartDate datetime,
@EndDate datetime,
@Today datetime,
@Periods int
CREATE TABLE #tempwhs(WhsCode varchar(8))
if @WhsList is null or LTRIM(RTRIM(@WhsList)) = ''
BEGIN
if @FromWhs is null
set @FromWhs = ''
if @ToWhs is null or LTRIM(RTRIM(@ToWhs)) = ''
set @ToWhs = 'ZZZZZZZZ'
insert into #tempwhs
select WhsCode
from OWHS
where WhsCode between @FromWhs and @ToWhs
END
ELSE
BEGIN
set @WhsList = ',' + @WhsList + ','
insert into #tempwhs
select WhsCode
from OWHS
where charindex(',' + WhsCode + ',',@WhsList) > 0
END
if @GroupCode = 0
set @GroupCode = null
if @FromItem is null
set @FromItem = ''
if @ToItem is null or LTRIM(RTRIM(@ToItem)) = ''
set @ToItem = 'ZZZZZZZZZZZZZZZZZZZZ'
if @MonthsAgo is null
set @MonthsAgo = 0
if @MonthsAgo > 0
set @MonthsAgo = @MonthsAgo * -1
select @StartDate = dateadd(mm,@MonthsAgo,cast(cast(year(getdate()) as varchar(4)) + right(cast(month(getdate()) + 100 as varchar(3)),2) + '01' as datetime)),
@EndDate = dateadd(mi,-1,dateadd(mm,@MonthsAgo,dateadd(mm,1,cast(cast(year(getdate()) as varchar(4)) + right(cast(month(getdate()) + 100 as varchar(3)),2) + '01' as datetime)))),
@Today = cast(convert(varchar(8),getdate(),112) as datetime)
if isnull(@HistStart,'') = '' or isnull(@HistEnd,'') = ''
select @HistEnd = left(convert(varchar(8),@StartDate - 1,112),6),
@HistStart = left(convert(varchar(8),dateadd(yyyy,-1,@StartDate),112),6)
select @Periods = count(distinct period)
from XXSalesHistory
where period between @HistStart and @HistEnd
select itemcode,whscode,cast(round(cast(sum(totsale) as decimal(12,5)) / @Periods,2) as decimal(12,5)) as AvgSale,
cast(round(cast(sum(totqty) as decimal(12,5)) / @Periods,0) as int) as AvgQty
into #tmpavg
from XXSalesHistory
where period between @HistStart and @HistEnd
group by itemcode,whscode
order by 1
Select ItmGrp.ItmsGrpNam,lines.ItemCode,lines.WhsCode,
items.CardCode as DefaultVendor,items.ItemName,
whs.OnHand,items.SalUnitMsr as SaleUnit,items.BuyUnitMsr as PurchUnit,whs.IsCommited,
(whs.OnHand - whs.IsCommited) as Available,whs.OnOrder,items.PurFactor2,
isnull(purprc.Price,0) as PurchasePrice,
isnull(purprc.Currency,'USD') as PurchCurrency,
cast(whs.OnHand / (CASE WHEN items.PurFactor2 = 0 THEN 1 ELSE items.PurFactor2 END) as decimal(16,2)) as CS,
whs.AvgPrice,prc.Price,isnull(prc.Currency,'USD') as Currency,isnull(whs.StockValue,0) as StockValue,
cast(sum(case lines.usebaseun
when 'Y' then Lines.OpenCreQty
else ( Lines.OpenCreQty * Items.NumInSale) end) as integer) as MtdSales,
isnull(hst.AvgQty,0) as AvgSales,items.SalFactor2
into #temprpt
From OINV Main,
INV1 Lines,
OITM Items,
OITB ItmGrp,
OITW whs
left outer join #tmpavg hst
on hst.ItemCode = whs.ItemCode and hst.WhsCode = whs.WhsCode,
ITM1 prc,
ITM1 purprc
Where Main.DocDate between @StartDate and @EndDate
And Main.Instance = 0
And Main.Canceled = 'N'
and Main.DocEntry = Lines.DocEntry and lines.LineTotal <> 0
and lines.ItemCode between @FromItem and @ToItem
and lines.whscode collate database_default in (select WhsCode from #tempwhs)
and Items.ItemCode = Lines.ItemCode
and items.PrchseItem = 'Y'
and (@ShowInactive = 'Y' or Items.frozenfor = 'N')
and ItmGrp.ItmsGrpCod = Items.ItmsGrpCod
and ItmGrp.ItmsGrpCod = isnull(@GroupCode,ItmGrp.ItmsGrpCod)
and whs.ItemCode = lines.ItemCode and whs.WhsCode = lines.WhsCode
and prc.ItemCode = items.Itemcode
and prc.PriceList = (CASE WHEN whs.whscode = '02' THEN 6 else 2 END)
and purprc.ItemCode = items.Itemcode
and purprc.PriceList = (CASE WHEN whs.whscode = '02' THEN 10 else 1 END)
Group BY
ItmGrp.ItmsGrpNam,lines.ItemCode,lines.WhsCode,
items.CardCode,items.ItemName,
whs.OnHand,items.SalUnitMsr,items.BuyUnitMsr,whs.IsCommited,whs.OnOrder,items.PurFactor2,purprc.Price,isnull(purprc.Currency,'USD'),
cast(whs.OnHand / (CASE WHEN items.PurFactor2 = 0 THEN 1 ELSE items.PurFactor2 END) as decimal(16,2)),
whs.AvgPrice,prc.Price,prc.Currency,isnull(whs.StockValue,0),hst.AvgQty,items.SalFactor2
union
select grp.ItmsGrpNam,itm.ItemCode,whs.WhsCode,itm.CardCode as DefaultVendor,
itm.ItemName,whs.OnHand,itm.SalUnitMsr as SaleUnit,itm.BuyUnitMsr as PurchUnit,
whs.IsCommited,
(whs.OnHand - whs.IsCommited) as Available,whs.OnOrder,itm.PurFactor2,purprc.Price,
isnull(purprc.Currency,'USD') as PurchCurrency,
cast(whs.OnHand / (CASE WHEN itm.PurFactor2 = 0 THEN 1 ELSE itm.PurFactor2 END) as decimal(16,2)) as CS,
whs.AvgPrice,prc.Price,isnull(prc.Currency,'USD') as Currency,isnull(whs.StockValue,0) as StockValue,0,
isnull(hst.AvgQty,0) as AvgSales,itm.SalFactor2
from OITM itm,
OITB grp,
OITW whs
left join(INV1 lines inner join OINV main
on lines.DocEntry = main.DocEntry and lines.LineTotal <> 0
and main.Canceled = 'N' and main.instance = 0
and Main.DocDate Between @StartDate and @EndDate)
on whs.ItemCode = lines.ItemCode and whs.WhsCode = lines.WhsCode
left outer join #tmpavg hst on hst.ItemCode = whs.ItemCode and hst.WhsCode = whs.WhsCode,
ITM1 prc,
ITM1 purprc
where itm.ItemCode between @FromItem and @ToItem
and itm.PrchseItem = 'Y'
and (@ShowInactive = 'Y' or itm.frozenfor = 'N')
and grp.ItmsGrpCod = itm.ItmsGrpCod
and grp.ItmsGrpCod = isnull(@GroupCode,grp.ItmsGrpCod)
and whs.ItemCode = itm.ItemCode
and whs.WhsCode collate database_default in (select WhsCode from #tempwhs)
and main.DocEntry is null
and prc.ItemCode = itm.Itemcode
and prc.PriceList = (CASE WHEN whs.whscode = '02' THEN 6 else 2 END)
and purprc.ItemCode = itm.Itemcode
and purprc.PriceList = (CASE WHEN whs.whscode = '02' THEN 10 else 1 END)
group by grp.ItmsGrpNam,itm.ItemCode,whs.WhsCode,itm.CardCode,
itm.ItemName,whs.OnHand,itm.SalUnitMsr,itm.BuyUnitMsr,whs.IsCommited,whs.OnOrder,itm.PurFactor2,itm.LastPurPrc,purprc.Price,purprc.Currency,
cast(whs.OnHand / (CASE WHEN itm.PurFactor2 = 0 THEN 1 ELSE itm.PurFactor2 END) as decimal(16,2)),
whs.AvgPrice,prc.Price,prc.Currency,isnull(whs.StockValue,0),hst.AvgQty,itm.SalFactor2
select r.*,
cast((CASE WHEN r.OnOrder = 0
THEN 0
ELSE (CASE WHEN r.AvgSales = 0
THEN (CASE WHEN r.MtdSales = 0 THEN 999 ELSE r.OnOrder / r.MtdSales END)
ELSE r.OnOrder / r.AvgSales
END)
END) as decimal(9,1)) as MonthsOnOrder,
cast((CASE WHEN r.Available <= 0 THEN 0
ELSE (CASE WHEN r.AvgSales <= 0 THEN 999
ELSE r.Available / r.AvgSales END) END) as decimal(9,1)) as MonthsInStock
from #temprpt r
order by 1,2,3
end
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
I hope that is not too overwhelming, it is for me so any help you have to offer is truly appreciated. I am not trained in SAP but they have no one else. Thanks alot everyone!
Maybe you are looking for
-
How do you change the Apple ID for my iPhone 4?
How do you change the Apple ID for my iPhone 4. I am able to access my iTunes account using my new ID and password on my computer; however, my iphone has a different Apple ID and I do not have cannot access iTunes on this phone.
-
How to get the page number that which have page item?
i used Ilayouttarget .By using the selection target to get page number that which page have item to be.
-
XML Schema mapping error when generating web service
I have created a method in java that returns an array of an object type (a user defined class). When tried to generate a web service JDeveloper did not allow me to select the method, giving the following "Why not.." explanation: "One or more paramete
-
Sorting albums within an artist
Okay so I used to be able to sort my different albums by the same artist within the order that I set by going into "get info" and saying the albums were disc 1 through 10 or what have you. For example, if I had Linkin Park in my iTunes, I could say h
-
EM12c and GC11g Agent for Windows 2003 R2 64 bit
Hello Everyone, I have setup a GC 11g on Oracle Linux 64 bit to monitor the servers in the data center. The problem is, I'm having difficulties installing an agent in Windows 2003 R2 64 bit. Few months ago when I checked the certification matrix for