Questions on CDS Views with input parameters

Dear Experts,
1. Can we call a CDS View (or generated database view) with input parameters inside an AMDP? I am looking for something similar to the feature in HANA where we can consume calculation view with filters inside SQL Script?
2. I understand we can next CDS Views, but how we can next (call) a CDS View with input parameters inside another CDS View?
Thanks,
Giri

Hi Thomas,
I get the below error that the CDS View's generated table function cannot take field from AMDP.
I have a requirement to query the CDS View using 2 timestamps (start & end). So, in AMDP I have used the TIME_STAMP and try to pass it to the CDS View
View code:
define view Z_Ngi_Cag_A
with parameters start_ts:abap.dec( 15, 0 ) , end_ts:abap.dec( 15, 0 )
as select from table {
resource_key
where
(begtstmp > $parameters.start_ts or endtstmp > $parameters.start_ts )
and
(begtstmp < $parameters.end_ts or endtstmp < $parameters.end_ts )
I am calling using the below AMDP:
DECLARE iv_start_date TIMESTAMP;
DECLARE iv_end_date TIMESTAMP;
SELECT CURRENT_TIMESTAMP INTO iv_start_date from dummy;
SELECT ADD_DAYS(CURRENT_TIMESTAMP, 30) INTO iv_end_date from dummy;
et_data =      SELECT * FROM ZMR_H_CA ( start_ts => iv_start_date, end_ts =>  iv_end_date );
What could be wrong ? Is this not supported?
Thanks,
Giri

Similar Messages

  • Error when using Analytic view with Input Parameters

    Hi,
    I am trying to create an info space based on my Analytic view which has input parameters. The infospace is validated and indexed without any issue. However when I ran the view, I get an error (50011) as it is unable to fetch any results. I tried using an infospace based on Calculation view with input parameters and the explorer view works without any issue.
    Has anyone faced similar issues?
    We are using HANA SP 6 rev 67 and BI 4.0 SP 4.
    Also is there a way to enable input prompts for the users when they refresh the BO Explorer view? If not currently available is there any work around ?
    Thanks

    Hello George,
    I don't have any personalization set on the info space. Also I am using mapped Account in BI to connect to HANA. The confusing part is that it is able to validate the infospace with the input parameters and index it. However query does not return any results. I even tried running the same query which explorer sends to HANA in the SQL editor and there too the same results,the query does not return anything. The model does return data when I do a data preview and if accessed from other tools like AAO.
    Also when I use SSO connection to HANA, indexing of the infospace fails. Where can I see the error log?
    Thanks,

  • Call a Graphical Calc view with input Parameters from a Script Based Calc View

    Hi All.
    I am trying to call a graphical calculation view with input parameters from a script based calculation view as below but getting syntax error:
    SESSION_SAMPLE = SELECT SESSION_CREATE_DATE,SHA256,CA_MEASURE
                                 FROM "_SYS_BIC"."WILDFIRE/CV_SESSION_SAMPLE"
                                 WITH PARAMETERS  ('PLACEHOLDER' = ('$$IP_START_DATE$$',:START_DATE),
                                     'PLACEHOLDER' = ('$$IP_END_DATE$$',:END_DATE));
    START_DATE  and END_DATE are input parameters of the script based calculation view.
    Can anyone please help me with the correct syntax for accomplishing this?
    Thanks,
    Goutham

    Hi Gautham,
    One more option  what i would like you to try is the below option , here i have just changed the order of passing nothing else.
    SESSION_SAMPLE = SELECT SESSION_CREATE_DATE,SHA256,CA_MEASURE
                                 FROM "_SYS_BIC"."WILDFIRE/CV_SESSION_SAMPLE"
                                   ('PLACEHOLDER' = ('$$IP_END_DATE$$','$$END_DATE$$'),
                                  'PLACEHOLDER' = ('$$IP_START_DATE$$','$$START_DATE$$'))
    Regards,
    Vinoth

  • Calculated view with input parameters

    Hello there.
    I've created a calculated view with input parameters, which I am going to call  it  'VIEW_A'.
    This view has been working just fine.
    But now I have to create another calculated view and import the last one(VIEW_A) in a projection.
    But I got a error when trying to see the data content. 
    It says :
    Error: SAP DBTech JDBC: [2048]: column store error: search table error:  [6968] Evaluator: syntax error in expression string;expected TK_ID,parsing '"DT_DOC_MES_ANO" >= [here]and "DT_DOC_MES_ANO" <='
    At the 'Problems' panel it says the all the input parameters are unmapped.
    What Am I doing wrong?  Sorry but I am kind new at SAP world.

    http://scn.sap.com/message/15489475Hello Tiago,
    Could you please let me know if you're able to resolve your issue, I'm getting the similar error when I'm passing alpha numeric values as parameter via my SP.
    Thanks for your help in advance!
    Regards,
    Sathish

  • Error while creating a BO Universe (using IDT) on top of SAP HANA Calculation View with Input Parameters

    Hi All..
          We are trying to create a Universe (using IDT-Version4.0) on top of the HANA Calculation view. The Calculation view has 4 input parameters, So
    in Universe side we have created the respective prompts. For the creation of derived table we have used the following code
    SELECT *
    FROM "_SYS_BIC"."<schema_name>.<CV_Calculation_View_test>"
    'PLACEHOLDER'=('$$IP_A$$','@Prompt(A)'),
    'PLACEHOLDER'=('$$IP_B$$','@Prompt(B)'),
    'PLACEHOLDER'=('$$IP_C$$','@Prompt(C)'),
    'PLACEHOLDER'=('$$IP_D$$','@Prompt(D)')
    While validating the above code we are getting an error.
    I have attached the snapshot of that error for your reference. Please find the attachment and help me in resolving it.
    Thanks in advance.

    Hello George,
    I don't have any personalization set on the info space. Also I am using mapped Account in BI to connect to HANA. The confusing part is that it is able to validate the infospace with the input parameters and index it. However query does not return any results. I even tried running the same query which explorer sends to HANA in the SQL editor and there too the same results,the query does not return anything. The model does return data when I do a data preview and if accessed from other tools like AAO.
    Also when I use SSO connection to HANA, indexing of the infospace fails. Where can I see the error log?
    Thanks,

  • Calculation view with input parameters

    Hello there.
    I got a calculation with that expects 2 input parameters.
    But now I have to created another calculation view that import this calculation view.
    How can I pass these 2 parameters using sqlscript?
      My script so far
      cv1 = CE_CALC_VIEW("_SYS_BIC"."calc_1",["CR"],'"COMPANY"=''7000''');
    I must pass 2 parameters in this  "_SYS_BIC"."calc_1" table

    Hi Tiago,
    as I am aware, you cannot pass input parameters to CE function.
    You can try using regular SQL syntax:
    SELECT "CR" FROM "_SYS_BIC"."calc_1"
    WHERE "COMPANY" = 7000
    (PLACEHOLDER."$$PARAM_1$$" => VALUE_1,
    PLACEHOLDER."$$PARAM_2$$" => VALUE_2)

  • How to write XSJS Select Query with input parameters

    Hello Experts,
    I am creating a xsjs file and in that file I am trying to write a Select Query based on a Calculation View
    I have tried it the following way:
    var query = 'SELECT TOP 100 \"Name\", \"Address\", \"City\", \"Country\" FROM \"_SYS_BIC\".\"Test.HL/AddressView\"'
        + 'WITH PARAMETERS(\'PLACEHOLDER\' = (\'$$P_Name$$\', \' Akhil \'),'
      + '\'PLACEHOLDER\' = (\'$$P_City$$\', \' Lucknow \'))';
    But it gives me the "Mixed spaces and tabs error".
    How should I write XSJS Select Query with input parameters?
    Regards,
    Rohit

    >But it gives me the "Mixed spaces and tabs error".
    Mixed spaces and tabs has nothing to do with the syntax of the statement. You used both spaces and the tab in the content - which JSLint doesn't like.  Remove the beginning spaces of each line and use only one or the other.
    The actual syntax of your statement doesn't look right.  The problem is that you are escaping the \ when you don't need to if you are using ' instead of " for your string.  You escape with \" in the first line but then escape with \' in the 2nd and 3rd line.  That is going to cause serious parsing problems with the command.

  • How to write a SQL query in SAP B1 2007 B with input parameters?

    How to write a SQL query in SAP B1 2007 B with input parameters, on execution of which will ask for some input value from the user and the values will be selected from a list such as item list?

    The syntax like
    SELECT * FROM OITM T0 WHERE T0.ItemCode = '[%0\]'
    Thanks,
    Gordon

  • Oracle Views with input

    Oracle Version:Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64
    Hi Experts,
    Is it possible to write a view with input and with IN clause in where cluase ....For Example I want to create a view like Below ..
    The below query may be syntactically wrong , but my intension of writing is similary to this. And the query should contain a IN caluse and A union as below...
    create or replace VIEW view_name (col1,col2, P_inputparam VARCHAR2)
    as
    SELECT Col1,Col2
    FROM table_name1
    where any_column11 in (
    &P_inputparam
    UNION
    SELECT Col1,Col2
    FROM table_name2
    where any_column22 in (
    &P_inputparam
              Thanks In advance.
    Edited by: 883279 on May 10, 2013 1:41 AM

    883279 wrote:
    Oracle Version:Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64
    Hi Experts,
    Is it possible to write a view with input and with IN clause in where cluase ....For Example I want to create a view like Below ..
    The below query may be syntactically wrong , but my intension of writing is similary to this. And the query should contain a IN caluse and A union as below...
    create or replace VIEW view_name (col1,col2, P_inputparam VARCHAR2)
    as
    SELECT Col1,Col2
    FROM table_name1
    where any_column11 in (
    &P_inputparam
    UNION
    SELECT Col1,Col2
    FROM table_name2
    where any_column22 in (
    &P_inputparam
              Thanks In advance.
    Not like that... no.
    What you're using as "input" there are SQL*Plus substitution variables. Those values are requested by SQL*Plus before the code is sent to the database and compiled. Code that runs on the database has no way of interacting with a client keyboard or screen, so you cannot get stored code to prompt for user input.
    See: {message:id=10744582}
    It's possible to use SYS_CONTEXT to get a view to pick up a value that has been previously assigned before the view is used, though I rarely find a need to do this myself.

  • Using calculation view in excel with input parameters

    Hello
    I have a calculation view which receives 2 input parameters for a range of dates, when i create the connecction with Excel i get the error "sql processing error: Hierarchy source query: SQL: column store error: search table error: [34092] search on calculation model requires parameters: Required variable $$MyVariable$$ is not set"
    I would like to know how can i pass the parameteres from excel to my calculation view??
    Thanks

    I doubt this can be achieved with a native Excel connection. Try SAP Advanced Analysis for Office. (I believe it may now just be called Analysis for Office).

  • REST Web Reference with Input Parameters

    I am using  APEX 4.2.0
    I was integrating with remote oracle database with API (Restful)
    it's working me fine from APEX Page items with username and password
    with static contents that located in the:
    Home >Application Builder >Application 179 >Shared Components >Web Service Reference> Edit
    Name
    URL
    Test
    View
    Updated By
    Updated
    Created By
    Created
    GAAS
    http://remotehost:port/api/registered
    username
    47 minutes ago
    in the region of:
    REST Input Parameters
    With the option of 
    Specified Body with Substitutions
    The content is located as static in the source item and I have copied to the below section:
    <?xml version='1.0' encoding='UTF-8' standalone='yes' ?>
    <registerRequested>
        <requestType>register</requestType>
        <firstName>IBRA</firstName>
        <lastName>ADAM</lastName>
        <msisdn>699502112</msisdn>
    </registerRequested>
    So my question is how can I change the above static that I have received from remote side  into the input items
    Example
    :P95_FIRST_NAME
    :P95_LAST_NAME
    :P95_MSISDN
    Thanks in advance

    The APEX forum is here : Application Express
    I'm sure you'll get more help there.

  • Issue with Input Parameters & Variables

    Hello Gurus,
    I have a situation where, when the user enter “Parent Company”   say for ex: ABC, then the over all
    Result should filter by ‘ABC’, and then there is key figure column where I need to consider not equal to ABC and then sum the key figure.
    In HANA, here both variables and Input patemters are mutually exclusive. Is there any way that I can pass the value of the variable to the input parameters without writing the code in Analytical or calculation views.
    If it’s BW-bex, it was very straight forward, I can create the variable for parent company ‘ABC’, put it as global filter, so that whenever the user selects ‘ABC” it should display on ABC data in the out put.
    I can also use the same variable and crate calculated column in BEx and attach the variable to the key figure and say the sum the key figure but exclude the Parent company “ABC’.
    I have tried the projection view and try to put filter on it, but it did not work. My requirement is
    Whenever the user selects ABC, it should display only ABC data, only 10 records out of 100 records and for one key figure column; I need to aggregate but excluding the Parent company “ABC”.
    Can I pass the Variable value to input parameters without writing the code?
    Regards
    Ramakrishnan Ramanathaiah 

    How about the following:
    Assuming you have 2 characteristics (Plant and Parent company) and 1 KF (Net Sales).
    Now let's create a projection with Filter using Input parameter on Parent company (with user input value as ABC), which might give the output as:
    Plant
    comp
    Net Sales
    P1
    ABC
    10
    P2
    ABC
    5
    Now, let's create a second projection with the Calc KF "Net Sales calculated" with the formula as:
    if comp = $input_value$, then 0 else Net_Sales.. this way you can simulate the EXCLUDE functionality.
    Plant
    comp
    Net sales
    P1
    ABC
    0
    P1
    BCD
    15
    P2
    ABC
    0
    Now union both the projections with two diff KFs, Net Sales and Net Sales Calculated.
    Plant
    Net Sales
    Net Sales Calc
    P1
    10
    15
    P2
    5
    0
    Subsequent model depends on your reporting drilldown requirement. If you drilldown Parent company also in the rows, then you will see the split in the values.
    Please try this and let us know if it works or what other issues come up.. we can try resolving the issues..
    Ravi

  • GP and VC problem with input parameters

    Hi
    I have a problem with my GP dynamic approvals..
    I am trying to pass the parameters from one level to another level in GP using Visual COmposer screen with input and output parameters.
    When I see in NWA, I can see the ouput parameters of Screen1 is passed to input of Screen2 but I am not able to get the values in VC Screen.
    This scenario was working fine earlier.
    THe VC screen is same for all the approvals , I am doing dynamic approvals using predefined conditional callable  object and looping it.
    any suggestions..

    I have solved myself, I am sending html tags from one level to another level like <html></html> - these tags are not allowing VC screen to get all the parameters and they are blocked. I removed the tags, then I am able to get the parameters passed.

  • Execute javascript with input parameters of a taskflow

    Using JDev 11g PS4
    I have a taskflow that uses some javascript. When the taskflow has been loaded, I need to execute a javascript function that uses 2 input parameters of my taskflow.
    I don't really know how I can execute the javascript with my input parameters.
    As a test, I have added a commandButton in my taskflow that will do the job:
    <af:commandButton id="btnRefresh" text="Open">
                <af:clientAttribute name="long" value="#{pageFlowScope.pLong}"/>
                <af:clientAttribute name="lat" value="#{pageFlowScope.pLat}"/>
                <af:clientListener method="doNavigate" type="click"/>
            </af:commandButton>How do I do the same when the taskflow loads instead of needing to push the button.

    Please find attached sample based on your use-case:
    http://adfsampleapplications.googlecode.com/svn/trunk/JavascriptOnLoadSample.rar
    It invokes a javascript function on pagefragment load by passing the input parameters from the taskflow.
    Thanks,
    Navaneeth

  • Oracle Developer Tools Stored Procedures with input parameters.

    I have created packages with stored procedures that contain input parameters. Am I required to write my own VB code in visual studio .net to define input parameters and their values in using these packages or am I able to drag and drop the packages and use the wizards.

    If you drag and drop a procedure that has input parameters the wizard will generate code that creates parameter objects. You will need to assign appropriate values to those parameters after they are created to use them.
    - Mark

Maybe you are looking for

  • XML Publisher errors with pdf template workd perfectly with rtf template

    Hi there, I hope you are well. I am having a problem with pdf templates in XML publisher. I have a report which outputs XML, this works very well with an rtf template. However I am trying to create a pdf xml publisher template (using the concurrent p

  • Deleting standard Function, subroutine, ....

    Hi experts,    Can I delete standard Function, subroutine, .... of SAP ECC 6 !? If can, what authorization do I have to ?    In case, I created some function group,function, ... at report painter, or copy from standard program, function, ... and then

  • Is there any open sourse java grid component based swing?

    Hello everyone, I've try to google in many ways,but can't find any. If some body knows,Could you tell me the ? Thanks a lot!

  • Where has my itunes folder gone??

    Hi there, I recently opened a new itunes folder for my sister's music and now I don't know what has happened to my own folder and all my music. Can someone please tell how I am able to access my itunes folder/library? Any help would be appreciated! T

  • Method BUS2012 - Release  not executing in the workflow

    hi all! I hope you can help me out with the following: I have created a workflow to release a PO. The approver will see a decision task with Approve and Decline. When he approves the PO, the workflow should release the PO in the background with the m