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
Similar Messages
-
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 -
Report on Purchase Order, Delivery Date etc
Friends,
Do we have a standard report with the following info :-
Purchase Order No and Date
Delivery date as per PO
GR Number
GR Date
Vendor
Please let me know if there is standard report else which are the tables to be used for a query.
Regards> But system responds "Scope of list BEST_ALV not defined". What is the "BEST" solution for this.. (I am using 6.0)
You Can Define your Own Scope of List ie BEST_ALV in the Following Path:
SPRO-MM-Purchasing-Reporting-Maintaining Purchasing Lists-Scope Of Lists-Define Scope of List
Just Copy the BEST Scope of List and Rename it to BEST_ALV and Save. Now Double Click on BEST_ALV and in Settings for ALV Grid Control Tab Put tick mark against Use ALV Grid Control and Save. -
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! -
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. -
Query of Default Documents/Reports
Dear All,
I want to get the Query of Default Documents/Reports , like Purchase Analysis (Purchasing Reports), Open Item List (Sales Reports) etc.
Thanks,
Ghazanfar AhmedHai!
To view System Report Queries (Purcahse Analysis,TB ..)
You can able to see this through SQL Trace.
Open SQL Management Studio.
Open Tools>Sql Server Profiler.
Open File>New Trace.
This will continously trace the changes done in SQL.
Open the Purcahse analysis report now in SAP B1. U will get the query from Trace Window
Regards,
Thanga Raj.K -
Hey guys,
I am new to SAP, so bear with me...
There is a Purchasing Report on our system 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
END -- for browse
My first questions is:
How do I locate and view at the "dbo.xxPurchReport" being executed? (called in the 4th line from the bottom.
Thanks alot to you all.I thought this section of the SQL query was most pertinent, let me know if posting the entire stored procedure would be more beneficial.
Thanks again everyone.
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 -
Down payment report by purchase order
Hi,
Is there any report available to see the down payment/down payment requests by purchase order.
I am trying to execute the transaction code ME2DP but it does not exist. We are in ECC 6.
Please note we cannot use FBL1N (noted item/sp GL) as there is no PO in selection.
Regards
ShanifHI,
You can try using Transaction code: ME2N with Scope of List 'BSET' and Selection Parameter which has option Down payment validation. If such selection parameter is not available in your system than you can create it using below path:-
SPRO - Materials Management -Purchasing -Reporting -Maintain Purchasing Lists -Selection Parameters
Please find below screen shot for the same:-
ME2N
SPRO Path- (Selection Parameters)
Regards,
Anand Raichura -
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 -
Report for purchase orders - like ME80FN
Hello,
is there a way to get a report of purchase orders which have been released for stock and for customer orders.
I tried ME80FN, but there is no column available such like account-assignment-category where I could separate the orders for stock from the customer ones.
Any ideas?
Thx a lot!
Cheers Wolf.account assignment category is available in dynamic selection
So you can at least execute ME80FN per account assignment category, even the field itself is not shown in the final report. -
List of Standard Reports in Purchasing and Inventory
Pls send me list of Standard reports for Purchasing and inventory.
Thanks-ManjuThis is duplicate thread (NO POINTS required)
Hello Manjula,
Go to transaction code SAP1, this will show all the reports functional area-wise.
For purchasing reports : Go to Material management --> Purchasing
For Inventory management reports : Go to Material management --> Inventory management
Hope this helps
Regards
Arif Mansuri -
ALV Report for Purchasing Each Vendor
Hi Anybody,
I am developing Purchasing Report. But I want display records in ALV Report based Vendor ID and Name.
Like Standard Report ME2M.
Ex:
Vendor ID : A0002 Name : UMS SEMICONDUCTOR PTE LTD.,
sNO po no item Price Qty
1. 10001 10 12.30 10
2. 10002 20 30.30 50
3. 10003 30 40.30 150
Vendor ID : X0012 Name : ALPHA PTE LTD.,
sNO po no item Price Qty
1. 10004 10 1.30 10
2. 10005 20 50.30 50
3. 10006 30 620.30 150
How to I will do?. Anybody please tell me.
Tks
S.Muthu.
IT Dept.hi..follow this code..
===================================================================
===================================================================
report .
========================== Global definitions ====================
Data Types
type-pools: slis.
types: begin of tp_data,
lifnr like ekko-lifnr,
end of tp_data,
tp_tbl_data type standard table of tp_data.
Constants
Data objects (variable declarations and definitions)
Report data to be shown.
data: it_data type standard table of tp_data.
Heading of the report.
data: t_heading type slis_t_listheader.
======================= Selection Screen ==========================
selection-screen: begin of block b1 with frame title text-t01.
DATA: w_aux_lifnr like ekko-lifnr.
SELECT-OPTIONS s_lifnr for w_aux_lifnr
DEFAULT LIFNR .
selection-screen: end of block b1.
======================== Event Blocks =============================
at selection-screen.
start-of-selection.
perform get_data using it_data.
end-of-selection.
perform build_alv using it_data t_heading.
======================== Subroutines ==============================
*& Form get_data
Gets the information to be shown in the report.
form get_data using t_data type tp_tbl_data.
SELECT ekko~lifnr
INTO CORRESPONDING FIELDS OF TABLE t_data
FROM ekko as ekko
WHERE ekko~lifnr in s_lifnr
endform. " get_data
*& Form build_alv
Builds and display the ALV Grid.
form build_alv using t_data type tp_tbl_data
t_heading type slis_t_listheader.
ALV required data objects.
data: w_title type lvc_title,
w_repid type syrepid,
w_comm type slis_formname,
w_status type slis_formname,
x_layout type slis_layout_alv,
t_event type slis_t_event,
t_fieldcat type slis_t_fieldcat_alv,
t_sort type slis_t_sortinfo_alv.
refresh t_fieldcat.
refresh t_event.
refresh t_sort.
clear x_layout.
clear w_title.
Field Catalog
perform set_fieldcat2 using:
1 'LIFNR' 'LIFNR' 'EKKO' space space space space space space space space space space space space t_fieldcat .
Layout
x_layout-zebra = 'X'.
Top of page heading
perform set_top_page_heading using t_heading t_event.
Events
perform set_events using t_event.
GUI Status
w_status = ''.
w_repid = sy-repid.
Title
w_title = <<If you want to set a title for
the ALV, please, uncomment and edit this line>>.
User commands
w_comm = 'USER_COMMAND'.
Order
Example
PERFORM set_order USING '<field>' 'IT_DATA' 'X' space space t_sort.
Displays the ALV grid
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = w_repid
it_fieldcat = t_fieldcat
is_layout = x_layout
it_sort = t_sort
i_callback_pf_status_set = w_status
i_callback_user_command = w_comm
i_save = 'X'
it_events = t_event
i_grid_title = w_title
tables
t_outtab = t_data
exceptions
program_error = 1
others = 2.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
endform. " build_alv.
*& Form set_top_page_heading
Creates the report headings.
form set_top_page_heading using t_heading type slis_t_listheader
t_events type slis_t_event.
data: x_heading type slis_listheader,
x_event type line of slis_t_event.
Report title
clear t_heading[].
clear x_heading.
x_heading-typ = 'H'.
x_heading-info = ''(001).
append x_heading to t_heading.
Program name
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'Program: '.
x_heading-info = sy-repid.
append x_heading to t_heading.
User who is running the report
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'User: '.
x_heading-info = sy-uname.
append x_heading to t_heading.
Date of execution
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'Date: '.
write sy-datum to x_heading-info.
append x_heading to t_heading.
Time of execution
clear x_heading.
x_heading-typ = 'S'.
x_heading-key = 'Time: '.
write sy-uzeit to x_heading-info.
append x_heading to t_heading.
Top of page event
x_event-name = slis_ev_top_of_page.
x_event-form = 'TOP_OF_PAGE'.
append x_event to t_events.
endform.
*& Form set_events
Sets the events for ALV.
The TOP_OF_PAGE event is alredy being registered in
the set_top_page_heading subroutine.
form set_events using t_events type slis_t_event.
data: x_event type line of slis_t_event.
Example
clear x_event.
x_event-name = .
x_event-form = .
append x_event to t_event.
endform.
*& Form set_order
Adds an entry to the order table.
FORM set_order USING p_fieldname p_tabname p_up p_down p_subtot
t_sort TYPE slis_t_sortinfo_alv.
DATA: x_sort TYPE slis_sortinfo_alv.
CLEAR x_sort.
x_sort-fieldname = p_fieldname.
x_sort-tabname = p_tabname.
x_sort-up = p_up.
x_sort-down = p_down.
x_sort-subtot = p_subtot.
APPEND x_sort TO t_sort.
ENDFORM. "set_order
*& Form set_fieldcat2
Adds an entry to the field catalog.
p_colpos: Column position.
p_fieldname: Field of internal table which is being described by
* this record of the field catalog.
p_ref_fieldname: (Optional) Table field / data element which
* describes the properties of the field.
* If this field is not given, it is copied from
* the fieldname.
p_ref_tabname: (Optional) Table which holds the field referenced
* by <<p_ref_fieldname>>.
If this is not given, the parameter
<<p_ref_fieldname>> references a data element.
p_outputlen: (Optional) Column width.
p_noout: (Optional) If set to 'X', states that the field is not
* showed initially. If so, the field has to be
included in the report at runtime using the display
options.
p_seltext_m: (Optional) Medium label to be used as column header.
p_seltext_l: (Optional) Long label to be used as column header.
p_seltext_s: (Optional) Small label to be used as column header.
p_reptext_ddic: (Optional) Extra small (heading) label to be
* used as column header.
p_ddictxt: (Optional) Set to 'L', 'M', 'S' or 'R' to select
whether to use SELTEXT_L, SELTEXT_M, SELTEXT_S,
or REPTEXT_DDIC as text for column header.
p_hotspot: (Optional) If set to 'X', this field will be used
* as a hotspot area for cursor, alolowing the user
* to click on the field.
p_showasicon: (Optional) If set to 'X', this field will be shown
as an icon and the contents of the field will set
* which icon to show.
p_checkbox: (Optional) If set to 'X', this field will be shown
as a checkbox.
p_edit: (Optional) If set to 'X', this field will be editable.
p_dosum: (Optional) If set to 'X', this field will be summed
(aggregation function) according to the grouping set
by the order functions.
t_fieldcat: Table which contains the whole fieldcat.
FORM set_fieldcat2 USING
p_colpos p_fieldname p_ref_fieldname p_ref_tabname
p_outputlen p_noout
p_seltext_m p_seltext_l p_seltext_s p_reptext_ddic p_ddictxt
p_hotspot p_showasicon p_checkbox p_edit
p_dosum
t_fieldcat TYPE slis_t_fieldcat_alv.
DATA: wa_fieldcat TYPE slis_fieldcat_alv.
CLEAR wa_fieldcat.
General settings
wa_fieldcat-fieldname = p_fieldname.
wa_fieldcat-col_pos = p_colpos.
wa_fieldcat-no_out = p_noout.
wa_fieldcat-hotspot = p_hotspot.
wa_fieldcat-checkbox = p_checkbox.
wa_fieldcat-icon = p_showasicon.
wa_fieldcat-do_sum = p_dosum.
Set reference fieldname, tablenam and rollname.
If p_ref_tabname is not given, the ref_fieldname given
is a data element.
If p_ref_tabname is given, the ref_fieldname given is a
field of a table.
In case ref_fieldname is not given,
it is copied from the fieldname.
IF p_ref_tabname IS INITIAL.
wa_fieldcat-rollname = p_ref_fieldname.
ELSE.
wa_fieldcat-ref_tabname = p_ref_tabname.
IF p_ref_fieldname EQ space.
wa_fieldcat-ref_fieldname = wa_fieldcat-fieldname.
ELSE.
wa_fieldcat-ref_fieldname = p_ref_fieldname.
ENDIF.
ENDIF.
Set output length.
IF NOT p_outputlen IS INITIAL.
wa_fieldcat-outputlen = p_outputlen.
ENDIF.
Set text headers.
IF NOT p_seltext_m IS INITIAL.
wa_fieldcat-seltext_m = p_seltext_m.
ENDIF.
IF NOT p_seltext_l IS INITIAL.
wa_fieldcat-seltext_l = p_seltext_l.
ENDIF.
IF NOT p_seltext_s IS INITIAL.
wa_fieldcat-seltext_s = p_seltext_s.
ENDIF.
IF NOT p_reptext_ddic IS INITIAL.
wa_fieldcat-reptext_ddic = p_reptext_ddic.
ENDIF.
IF NOT p_ddictxt IS INITIAL.
wa_fieldcat-ddictxt = p_ddictxt.
ENDIF.
Set as editable or not.
IF NOT p_edit IS INITIAL.
wa_fieldcat-input = 'X'.
wa_fieldcat-edit = 'X'.
ENDIF.
APPEND wa_fieldcat TO t_fieldcat.
ENDFORM. "set_fieldcat2
======================== Subroutines called by ALV ================
*& Form top_of_page
Called on top_of_page ALV event.
Prints the heading.
form top_of_page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
i_logo = <<If you want to set a logo, please,
uncomment and edit this line>>
it_list_commentary = t_heading.
endform. " alv_top_of_page
*& Form user_command
Called on user_command ALV event.
Executes custom commands.
form user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
Example Code
Executes a command considering the sy-ucomm.
CASE r_ucomm.
WHEN '&IC1'.
Set your "double click action" response here.
Example code: Create and display a status message.
DATA: w_msg TYPE string,
w_row(4) TYPE n.
w_row = rs_selfield-tabindex.
CONCATENATE 'You have clicked row' w_row
'field' rs_selfield-fieldname
'with value' rs_selfield-value
INTO w_msg SEPARATED BY space.
MESSAGE w_msg TYPE 'S'.
ENDCASE.
End of example code.
endform. "user_command -
How to improve the query performance in to report level and designer level
How to improve the query performance in to report level and designer level......?
Plz let me know the detail view......first its all based on the design of the database, universe and the report.
at the universe Level, you have to check your Contexts very well to get the optimal performance of the universe and also your joins, keep your joins with key fields, will give you the best performance.
at the report level, try to make the reports dynamic as much as you can, (Parameters) and so on.
and when you create a paremeter try to get it match with the key fields in the database.
good luck
Amr -
Pre-Purchase Question - Deploying Crystal Report to SSRS Report Server
Our company has recently installed a SQL 2005 server for our accounting system. I had intended going down the path of using SQL Reporting Services as our reporting tool and deploying them to the builtin Report Server. However, I've been using Crystal Reports for years and find it much more user friendly for a non-programmer to use. I can actually write a report in Crystal, SSRS took me 3 days to achieve very little, I believe it requires too much SQL reporting knowledge for a beginner.
After spending many hours trawling the net looking for a solution to this problem, I found that Crystal comes as part of Visual Studio. However, I also believe the version of Visual Studio that comes with SQL2005 is the basic version, and I'd need the Pro version to get the Crystal add on.
To this end, I've downloaded the trial version of Crystal 2008 and installed it. I find I can write a report in Crystal, and then I can manually add that report to a SSRS project. When I open the Crystal Report within Visual Studio I can see all the correct Crystal toolbars and menus etc, so it would appear that the installation of Crystal for Visual Studio has integrated properly. I can then deploy that report to the Report server and see the report on the web page. However clicking to open the report then opens the full Crystal Reports application, instead of just displaying the report in the web page.
I've been unsuccessful in finding a solution to the above deployment problem. I'm seeking a solution so that my users can just see the report without Crystal itself opening up. I've been advised that there is a Crystal Report Server that I can purchase, but I don't wish to go to that expense when we already have this functionality built into our SSRS server.
Can you please advise if it's possible to deploy the Crystal report to the SSRS Report Server and then open the report within the web page without opening the full Crystal app, and if so what steps I would need to take to implement this.
If this issue can be resolved, I'll be more than happy to purchase the full Crystal 2008 package and forget SSRS as a bad idea.
Sorry to be so long winded, I wanted to be clear what the issue is. Any information /advice would be very much appreciated.Hello Diane,
I would not know if Crystal Report can be used with SSRS but I know for sure that you can use the embedded Crystal Reports Version with comes with VS 2005 or VS 2008 to create reports and to display them in web and windows application.
We have lots of samples how to do this in our [dev community|https://boc.sdn.sap.com/].
Also, you can use [Crystal Reports 2008|https://boc.sdn.sap.com/developer/library/CR2008SDK] with MS SQL 2005.
Other products like Crystal Reports server can also use MS SQL 2005.
Please see our [supported platforms for CR 2008|http://service.sap.com/~form/sapnet?_SHORTKEY=01100035870000712280&_OBJECT=011000358700000675322008E] on windows.
Hope this helps
Falk
Maybe you are looking for
-
Calculation of Unpaid Leave in UK Payroll.
One Employee was on Unpaid Leave of absence for 8 hours in Feb 2006.His weekly work schedule is 37 hours.His hourly rate is GBP 7.26.His deduction was sent for updation for Apr 06 Payroll.An amount of GBP 45.05 has been deducted from his April Payro
-
How to call a schema name using substitution name?
Hi All, How to call a schema name using substitution menthod in odi? I was trying but I got the following error.. ODI-1227: Task XXX(Procedure) fails on the source ORACLE connection YYY. Caused By: java.sql.SQLException: Missing IN or OUT parameter a
-
ORA-01555 error when assigning values based on geometry
Hello, I have a table with 220,000+ records with street information, and I am trying to assign a municipal area (stored in another table) based on the geometry of the road line and the geometry of the municipal boundary. CREATE TABLE TEMP AS SELECT A
-
Hi All, I have a requirement where in i need to create a BAPI as a separate interface and then call this BAPI in a BPM created in another interface. This BAPI interface is to be created in a genaralized format for reusability. Is it possible to achie
-
Lenovo ix4-300d free space left
Hello, I have an Lenovo ix4-300d, 8TB. My free space on the servers tells me that there is left 3.8TB, when I look in my Share there is almost no space left. What can I do to get more space in my shares? Now I receive the following message: The amoun