cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Conditional parameter for views:

Former Member
0 Kudos
50

Hi,

I want to use SAP Conditional parameter for views...while using am getting Error "Must Specify table to select From" ... how to resolve it..

FYI:

For Ex,

My View is PurchaseDetails,

My View contains columns like [INVOICE NO],[DATE], [PARTY NAME],[MATERAIL],[HCESS],[SCESS] etc

i tried the following ways:

way 1:

Select T0.INVOICE NO,T0.DATE, T0.PARTY NAME From PurchaseDetails T0 where T0.DATE >='[%0]' and T0. DATE <='[%1]'

way 2:

declare @tt table

(

INVOICE NO nvarchar(100),

DATE Datetime,

PARTY NAME nvarchar(100)

)

insert into @tt

Select T0.INVOICE NO,T0.DATE, T0.PARTY NAME From PurchaseDetails T0 where T0.DATE >='[%0]' and T0. DATE <='[%1]'

Select TT.INVOICE NO,TT.DATE, TT.PARTY NAME from @tt TT

both ways producing the same error...how to resolve...

- Ganesh

Edited by: Ganesh Karunakaran on May 26, 2009 9:26 PM

Edited by: Ganesh Karunakaran on May 26, 2009 9:26 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

HI,

It is a little bit tricky, but do the following:

define your view over the OINV table and in the first line in the query editor enter the following :

if you use "/* ...*/" (sql comment) and enter the a valid query inside, the SAP B1 Gui gets the parameter from the commented sql command.

so example:


declare @PostingDate1 as datetime
declare @PostingDate2 as datetime
set @PostingDate1 = /* Select * from JDT1 T1 where T1.RefDate <= */ '[%0]'
set @PostingDate2 = /* Select * from JDT1 T1 where T1.RefDate >= */ '[%1]'

select @PostingDate1 , @PostingDate2

in this example, you can see the 2 parameters in the selection list.

Now you can use this example in your view !

Regards,

J.