Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Views

SET ANSI_NULLS ON

GO

SET QUOTED_IDENTIFIER ON

GO

/*select u_Tor, u_IssDt, * from oinv where docdate = '04/11/2011'*/

ALTER view [dbo].[ExciseDetailHeader]

as

SELECT ShipTo.Address, OINV.Address AS ShipAddr, ShipTo.U_CERange, ShipTo.U_CEDivis, ShipTo.U_CEComRate, ShipTo.U_BECC, ShipTo.U_CERegNo, ShipTo.U_BVAT,

ShipTo.U_BCST, BillTo.Address AS BillToAddress, OINV.Address2, BillTo.U_CERegNo AS BillCERegNo, BillTo.U_BECC AS BillECC, BillTo.U_BVAT AS BillVAT,

BillTo.U_BCST AS BillCST, NNM1.SeriesName, OINV.DocNum, OINV.DocDate, NFN1.SeqName, OINV.Serial, OINV.U_LRN, OINV.U_LRD, OINV.U_Delivery, OINV.U_FR,

OINV.U_TRANS_1, OINV.U_MOT, OINV.U_VE, OINV.U_PN, OINV.U_NoOfPack, OINV.U_TWEIGHT, OINV.DocTotal, CASE WHEN len(oinv.doctime)

= 3 THEN LEFT(OINV.Doctime, 1) + ':' + RIGHT(OINV.Doctime, 2) ELSE LEFT(OINV.Doctime, 2) + ':' + RIGHT(OINV.Doctime, 2) END AS DateOfRemoval, OINV.NumAtCard,

dbo.ufn_numtowords(OINV.DocTotal) AS Totalinwords, OCTG.PymntGroup, OINV.DiscSum, OINV.Discprcnt, OINV.Comments

FROM OINV INNER JOIN

CRD1 AS ShipTo ON OINV.ShipToCode = ShipTo.Address AND OINV.CardCode = ShipTo.CardCode INNER JOIN

CRD1 AS BillTo ON OINV.PayToCode = BillTo.Address AND OINV.CardCode = BillTo.CardCode INNER JOIN

NNM1 ON OINV.Series = NNM1.Series INNER JOIN

NFN1 ON OINV.SeqCode = NFN1.SeqCode INNER JOIN

OCTG ON OINV.GroupNum = OCTG.GroupNum

WHERE (BillTo.AdresType = 'B') AND (ShipTo.AdresType = 'S')

--AND (OINV.DocNum = 12100719)

GO

SET ANSI_NULLS OFF

GO

SET QUOTED_IDENTIFIER OFF

GO

Former Member
Not what you were looking for? View more on this topic or Ask a question