Crystal Report Schulung bei SAP

Schulung

Serien&Chargennummern

Fracht

sub_fracht_20180706.rpt

USE [SBODemoCH]
GO
 
/****** Object:  StoredProcedure [dbo].[[Print_DocLineFracht]]    Script Date: 06.07.2018 11:39:21 ******/
SET ANSI_NULLS ON
GO
 
SET QUOTED_IDENTIFIER ON
GO
 
 
 
 
CREATE PROCEDURE [dbo].[Print_DocFracht]
	@DocKey@ INT,
	@ObjectId@ INT
AS
 
------------------------------------------
DECLARE @object NVARCHAR(4000)
 
		IF (@ObjectId@=13) SET @object = 'INV'
ELSE	IF (@ObjectId@=14) SET @object = 'RIN'
ELSE	IF (@ObjectId@=15) SET @object = 'DLN'
ELSE	IF (@ObjectId@=16) SET @object = 'RDN'
ELSE	IF (@ObjectId@=17) SET @object = 'RDR'
ELSE	IF (@ObjectId@=18) SET @object = 'PCH'
ELSE	IF (@ObjectId@=19) SET @object = 'RPC'
ELSE	IF (@ObjectId@=20) SET @object = 'PDN'
ELSE	IF (@ObjectId@=21) SET @object = 'RPD'
ELSE	IF (@ObjectId@=22) SET @object = 'POR'
ELSE	IF (@ObjectId@=23) SET @object = 'QUT'
ELSE	IF (@ObjectId@=24) SET @object = 'RCT'
ELSE	IF (@ObjectId@=25) SET @object = 'DPS'
ELSE	IF (@ObjectId@=46) SET @object = 'VPM'
ELSE	IF (@ObjectId@=58) SET @object = 'INM'
ELSE	IF (@ObjectId@=59) SET @object = 'IGN'
ELSE	IF (@ObjectId@=60) SET @object = 'IGE'
ELSE	IF (@ObjectId@=67) SET @object = 'WTR'
ELSE	IF (@ObjectId@=68) SET @object = 'WKO'
ELSE	IF (@ObjectId@=69) SET @object = 'IPF'
ELSE	IF (@ObjectId@=112) SET @object = 'DRF'
ELSE	IF (@ObjectId@=132) SET @object = 'CIN'
ELSE	IF (@ObjectId@=140) SET @object = 'PDF'
ELSE	IF (@ObjectId@=162) SET @object = 'MRV'
ELSE	IF (@ObjectId@=163) SET @object = 'CPI'
ELSE	IF (@ObjectId@=164) SET @object = 'CPV'
ELSE	IF (@ObjectId@=165) SET @object = 'CSI'
ELSE	IF (@ObjectId@=166) SET @object = 'CSV'
ELSE	IF (@ObjectId@=191) SET @object = 'SCL'
ELSE	IF (@ObjectId@=198) SET @object = 'FCT'
ELSE	IF (@ObjectId@=199) SET @object = 'MSN'
ELSE	IF (@ObjectId@=202) SET @object = 'WOR'
ELSE	IF (@ObjectId@=203) SET @object = 'DPI'
ELSE	IF (@ObjectId@=204) SET @object = 'DPO'
ELSE	IF (@ObjectId@=321) SET @object = 'ITR'
ELSE	IF (@ObjectId@=140000009) SET @object = 'OEI'
ELSE	IF (@ObjectId@=140000010) SET @object = 'IEI'
ELSE	IF (@ObjectId@=540000006) SET @object = 'PQT'
ELSE	IF (@ObjectId@=1470000113) SET @object = 'PRQ'
ELSE	IF (@ObjectId@=254000065) SET @object = 'SFI'
ELSE	IF (@ObjectId@=254000066) SET @object = 'SFC'
 
--SELECT @object,@DocKey@
--EXEC('SELECT * FROM '+@object+'3 WHERE DocEntry = '+@DocKey@)
EXEC('SELECT T1.ExpnsName, T0.* FROM '+@object+'3 T0 JOIN OEXD T1 ON T0.ExpnsCode =T1.ExpnsCode WHERE T0.DocEntry = '+@DocKey@)
 
 
GO
1)
1/8