cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Input Parmeters

Former Member
0 Kudos

Hi All,

I am trying to create a SQL based Calculation View.I have a two queries here.

1. I want to calculate the count of employees whose BEGDA <= DATE1 where the user gives the DATE1 as input during the runtime. Used Input Parameters and placeholder to capture this as below.But still i observed that the data is coming for all the dates.i do not know where should i assign this functional check BEGDA <= DATE1

2.If i have to calculate the employee count with the conditions BEGDA <= DATE1 and DATE1 <= ENDDA along with the existing condition STAT2='3' how should i place the Place holders in the script?Will my below script work?

BEGIN

var_out = select  MANDT,

PERNR,

to_Date(BEGDA,'YYYYMMDD') as BEGDA,

to_DATE(ENDDA,'YYYYMMDD') as ENDDA,

STAT2,

case when (STAT2='3' and BEGDA<= '$$DATE1$$' and ENDDA>= '$$DATE_1$$') then count(t1.PERNR) END as EMP_COUNT,

        

from "_SYS_BIC"."Modelling/EMPLOYEE_DETAILS_ATV" (PLACEHOLDER."$$DATE1$$" => :DATE1)

group by MANDT,

       PERNR,

       BEGDA,

       ENDDA,

       STAT2;

END

Thank You all,

DSK

Accepted Solutions (0)

Answers (1)

Answers (1)

pfefferf
Active Contributor
0 Kudos

Hello DSK,

as you are selecting from another view in your scripted view, the operator (e.g. <=) which is used for the filter is/must be defined in a filter expression in the view you select from. As an alternative you could use a simple where-clause. How is the DATE1 parameter used in view EMPLOYEE_DETAILS_ATV?

Your second statement will not work in that way. It has to be solved either by a filter expression in view EMPLOYEE_DETAILS_ATV or by a where clause.

Regards,

Florian