hello everyone
am facing a weird situation here , am pretty sure that most of you can help me through it,
i made a layout for Delivery Note and it work fine , the problem is it work only if the document is being added to the system , but b4 add it , the layout show no data , same when the document is pending for approval , it will show no data , so u must approve this document and then add it in order to make the layout work, anyway after a long journey i had this SP , which suppose to fix that , but something is wrong with it , as once u open the layout from sap , it will ask for insert the dockey and object id , if possible to help me with it , or even better if some one can help me to change this SP to be a regular query i'll appreciate it , and just to make sure , a little details about the parameters settings for it , as am confuse if i should make a parameter for object id or no .
--------------------------------------------
USE [MENANewLive]
GO
/****** Object: StoredProcedure [dbo].[Form_PO11] Script Date: 9/2/2014 11:55:48 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
create PROCEDURE [dbo].[MENA_FULLDN]
@Dockey INT,
@ObjectId INT
AS
BEGIN
IF @ObjectId = 112
BEGIN
SELECT odrf.DocEntry, odrf.CntctCode,drf1.SubCatNum, odrf.Address2, drf1.LineNum, odrf.DocType, odrf.CANCELED, odrf.Handwrtten, odrf.DocStatus, odrf.Transfered, odrf.DocDate, odrf.DocDueDate,
odrf.CardCode, odrf.Printed, odrf.CardName, odrf.Address, odrf.NumAtCard, odrf.VatPercent, odrf.VatSum, odrf.VatSumFC, odrf.DiscPrcnt, odrf.DiscSumFC,
odrf.DiscSum, odrf.PaidToDate, odrf.DocTotalFC, odrf.DocTotal, odrf.DocRate, odrf.Comments, odrf.VatSumSy, odrf.DocTotalSy,odrf.NumAtCard, odrf.CreateDate, odrf.DocNum, drf1.U_LCCP,
odrf.TaxDate, drf1.ItemCode, drf1.Dscription, drf1.Price, drf1.DiscPrcnt AS Expr1, drf1.Rate, drf1.Quantity, drf1.StockSum, drf1.unitMsr, drf1.BaseDocNum,drf1.LineTotal, nnm1.seriesname
FROM odrf INNER JOIN
drf1 ON odrf.DocEntry = drf1.DocEntry
inner join nnm1 on odrf.series = nnm1.series
WHERE ODRF.ObjType = 20 and ODRF.DocNum = @Dockey
END
IF @ObjectId = 20
BEGIN
SELECT odln.DocEntry, odln.CntctCode,dln1.SubCatNum, odln.Address2, dln1.LineNum, odln.DocType, odln.CANCELED, odln.Handwrtten, odln.DocStatus, odln.Transfered, odln.DocDate, odln.DocDueDate,
odln.CardCode, odln.Printed, odln.CardName, odln.Address, odln.NumAtCard, odln.VatPercent, odln.VatSum, odln.VatSumFC, odln.DiscPrcnt, odln.DiscSumFC,
odln.DiscSum, odln.PaidToDate, odln.DocTotalFC, odln.DocTotal, odln.DocRate, odln.Comments, odln.VatSumSy, odln.DocTotalSy,ODLN.NumAtCard, odln.CreateDate, ODLN.DocNum, dln1.U_LCCP,
odln.TaxDate, dln1.ItemCode, dln1.Dscription, dln1.Price, dln1.DiscPrcnt AS Expr1, dln1.Rate, dln1.Quantity, dln1.StockSum, dln1.unitMsr, dln1.BaseDocNum,dln1.LineTotal, nnm1.seriesname
FROM odln INNER JOIN
dln1 ON odln.DocEntry = dln1.DocEntry
inner join nnm1 on odln.series = nnm1.series
WHERE odln.DocEntry = @DocKey
end
end