Syntax error while creating Calculation view script based

Hi Folks,
I'm creating Calc view based on script and drafted a simple code but I'm getting syntax error.
Its just fetching few coloumns from two tables products and purchaseorderitem.
/********* Begin Procedure Script ************/
BEGIN
  var_out = select productid , category, nameid, currency, grossamount, quantity
  FROM sap.hana.democontent.epm.data.products AS P , sap.hana.democontent.epm.data.purchaseorderitem AS B
  where P.productid = B.productid;
END /********* End Procedure Script ************/
Could you pls take a look and let me know what wrong I'm doing?
Error logs are:-
sap.hana..package.project.folder.mytest.CALCSCRIPTVIEWInternal deployment of object failed;Repository: Encountered an error in repository runtime extension;Internal Error:Deploy Calculation View: SQL: sql syntax error: incorrect syntax near "democontent": line 5 col 18 (at pos 439)nSet Schema DDL statement: set schema "SYSTEM"nType DDL: create type "_SYS_BIC"."sap.hana..package.project.folder.mytest/CALCSCRIPTVIEW/proc/tabletype/VAR_OUT" as table ("PRODUCTID" NVARCHAR(10), "CATEGORY" NVARCHAR(2), "NAMEID" NVARCHAR(10), "CURRENCY" NVARCHAR(5), "GROSSAMOUNT" DECIMAL(15,2), "QUANITYT" DECIMAL(13,3))nProcedure DDL: create procedure "_SYS_BIC"."sap.hana.package.project.folder.mytest/CALCSCRIPTVIEW/proc" ( OUT var_out "_SYS_BIC"."sap.hana.package.project.folder.mytest/CALCSCRIPTVIEW/proc/tabletype/VAR_OUT" ) language sqlscript sql security definer reads sql data as n /********* Begin Procedure Script ************/ n BEGIN n t var_out = select productid , category, nameid, currency, grossamount, quantityn t FROM sap.hana.democontent.epm.data.products AS P , sap.hana.democontent.epm.data.purchaseorderitem AS Bn t where P.productid = B.productid;nnEND /********* End Procedure Script ************/n

Hi Rubane,
I don't have EPM installed here but based on this Table User Defined Functions( Table UDF ) in HANA  you are not properly defining the source table.
In your case missing 1) schema of EPM, 2) not using double quotes, 3) separation of package and view, 4) missing camel case on purchaseOrderItem:
FROM sap.hana.democontent.epm.data.products AS P , sap.hana.democontent.epm.data.purchaseorderitem AS B
On blog:
from "SAP_HANA_EPM_DEMO"."sap.hana.democontent.epm.data::businessPartner" as a
SAP_HANA_EPM_DEMO is the schema
sap.hana.democontent.epm.data is the package
businessPartner is the view
Start simple... before the seletion try it out on Studio SQL.
Regards, Fernando Da Rós

Similar Messages

  • Getting Error while creating Calculation view.

    Hi Expert,
    I was trying to create one simple calculation view using SQL script but getting below error.
    /********* Begin Procedure Script ************/
    BEGIN
    create type var_out1 as table (ebeln varchar(10),menge decimal);
            var_out  = CE_COLUMN_TABLE ("SAPEH2"."EKKO",[EBELN,AEDAT] );
            var_out1 = CE_COLUMN_TABLE ("SAPEH2"."EKPO",[EBELN,MENGE] );
            var_out2 - CE_UNION_ALL (:var_out1,:var_out2);
    END
    /********* End Procedure Script ************/
    I thought , i might need to declare a table type for output table var_out1 and var_out2. I tried by declaring table like below couldn't get any success.
    create type var_out1 as table (ebeln varchar(10),menge decimal);
    create type var_out2 as table (ebeln varchar(10), aedat DATE ,menge decimal);
    error:
    Message :
         Internal deployment of object failed;Repository: Encountered an error in repository runtime extension;Internal Error:Deploy Calculation View: SQL: sql syntax error: CREATE TYPE is not allowed in SQLScript: line 5 col 2 (at pos 277)nSet Schema DDL statement: set schema "SAPEH2"nType DDL: create type "_SYS_BIC"."pkg-sapuser03.test_giri/CA_SALES1/proc/tabletype/VAR_OUT" as table ("EBELN" VARCHAR(10), "AEDAT" DATE, "MENGE" DECIMAL(13,3))nProcedure DDL: create procedure "_SYS_BIC"."pkg-sapuser03.test_giri/CA_SALES1/proc" ( OUT var_out "_SYS_BIC"."pkg-sapuser03.test_giri/CA_SALES1/proc/tabletype/VAR_OUT" ) language sqlscript sql security definer reads sql data as  n /********* Begin Procedure Script ***********/ n BEGIN n n create type var_out1 as table (ebeln varchar(10),menge decimal);n create type var_out2 as table (ebeln varchar(10), aedat DATE ,menge decimal);n n t   var_out  = CE_COLUMN_TABLE ("SAPEH2"."EKKO",[EBELN,AEDAT] );n t   var_out1 = CE_COLUMN_TABLE ("SAPEH2"."EKPO",[EBELN,MENGE] );n t   var_out2 - CE_UNION_ALL (:var_out1,:var_out2);nnEND /******** End Procedure Script ************/n
    Could you please help me to understand the cause of this?
    Thanks,
    Girdhari

    Hi Lars,
    Thanks for the reply.
    If i understood correctly , you are suggesting to create var_out1 and var_out2 in output ? If yes can you please guide me on how to do that? I tried but did not find anything suitable to declare table.
    Thanks,
    Girdhari

  • Invalid column Index error - While consuming Calculation view via Native SQL

    Hi Experts,
    I am trying to consume a Calculation view (sql script one) , which has input parameters, via Native SQL in a ABAP program .
    Code snippet for the same would be as follows , Upon execution, it throws an error "Invalid Column Index (8) error " . Can anyone help what could be the issue here ?
    Thanks in Advance,
    Suma
    REPORT ZTEST_HANA2.
    *Report to consume Calculation view (script based) from ABAP
    PARAMETERS: ip_docnr type BELNR_D,
                ip_gjahr type GJAHR,
                ip_bukrs type BUKRS,
                ip_blgr type FAGL_RLDNR.
       DATA: LO_SQL_STMT TYPE REF TO CL_SQL_STATEMENT,
              LO_CONN     TYPE REF TO CL_SQL_CONNECTION,
              LO_RESULT   TYPE REF TO CL_SQL_RESULT_SET,
              LV_SQL      TYPE STRING,
              LR_DATA     TYPE REF TO DATA.
        DATA: LX_SQL_EXC           TYPE REF TO CX_SQL_EXCEPTION,
              LT_SEPMAPPS_CLSDINV  TYPE TABLE OF SEPMAPPS_CLSDINV,
              LV_TEXT              TYPE STRING.
        TRY.
    lv_sql = |SELECT * FROM "_SYS_BIC"."DEMO-ABAP/CA_GET_FI_DATA" | &&
                     |WITH PARAMETERS ('placeholder'= ('$$p_DOCNR$$','{ ip_docnr }'),| &&
                      |'placeholder'=('$$p_GJAHR$$','{ ip_gjahr }')| &&
                      |,'placeholder'= ('$$S_BUKRS$$','{ ip_bukrs }')| &&
                      |,'placeholder'= ('$$p_base_ledger$$','{ ip_blgr }') )| .
             LO_CONN = CL_SQL_CONNECTION=>GET_CONNECTION( ).
             "Create an SQL statement to be executed via the connection
              LO_SQL_STMT = LO_CONN->CREATE_STATEMENT( ).
             "Execute the native SQL query
             LO_RESULT = LO_SQL_STMT->EXECUTE_QUERY( LV_SQL ).
             "Read the result into the internal table lt_sepmapps_clsdinv
             GET REFERENCE OF LT_SEPMAPPS_CLSDINV INTO LR_DATA.
             LO_RESULT->SET_PARAM_TABLE( LR_DATA ).
             LO_RESULT->NEXT_PACKAGE( ).
             LO_RESULT->CLOSE( ).
             LO_CONN->CLOSE( ).
        CATCH CX_SQL_EXCEPTION INTO LX_SQL_EXC.
             LV_TEXT = LX_SQL_EXC->GET_TEXT( ).
             MESSAGE LV_TEXT TYPE 'E'.
        ENDTRY.

    Hi Suma,
    Post the SQL you success run directly on Studio together with error message (even if is the Invalid column index error).
    Check there if the parameters case is working properly... Is it really this confusing options:
    p_GJAHR
    S_BUKRS
    p_base_ledger
    Why not all lower or all upper? Anyhow you must test and find which option works according your modeling
    Regards, Fernando Da Rós

  • Error while creating parameterise view

    I m getting below error while creating parameterise view
    CREATE OR REPLACE VIEW rdr_le_info_view (v_run_number , v_isin_cob )
    AS
    SELECT l.strategic_le
    ,cun.ucn cunucn
    ,cun.date
    ,cccs.ucn ucn
    ,cccs.agr_num
    FROM strat_le l
    ,ucn_name cun
    ,customer_setup cccs
    WHERE l.gfa_until_dt = '31-dec-9999'
    AND l.glas_until_dt = '31-dec-9999'
    AND l.int_until_dt = '31-dec-9999'
    AND cccs.run_num = v_run_num
    AND cccs.ucn_lead_office = cun.ucn
    AND cun.OID = l.client_oid;
    AND cccs.run_num = v_run_num
    ERROR at line 13:
    ORA-00904: "V_RUN_NUM": invalid identifier
    Plese help me in above.

    Try
    CREATE OR REPLACE VIEW rdr_le_info_view
    AS
    SELECT l.strategic_le
    ,cun.ucn cunucn
    ,cun.date
    ,cccs.ucn ucn
    ,cccs.agr_num
    FROM strat_le l
    ,ucn_name cun
    ,customer_setup cccs
    ,cccs.run_num run_num
    WHERE l.gfa_until_dt = '31-dec-9999'
    AND l.glas_until_dt = '31-dec-9999'
    AND l.int_until_dt = '31-dec-9999'
    AND cccs.ucn_lead_office = cun.ucn
    AND cun.OID = l.client_oid;Then call it like:
    select *
    from rdr_le_info_view
    where run_num = v_run_num;

  • Error While Creating Materialized View

    Hello,
    I am getting error ORA-22818: subquery expressions not allowed here while creating materialized view. I am using Oracle9i Enterprise Edition Release 9.2.0.1.0. Below pasted is my SQL Script.
    Any help is highly appreciable.
    Thanks
    *********SQL************
    select distinct(id),NAME,(select count(GRADE) from employees where
    nationality like '%US%'and id=a.organization_id and grade=a.grade
    group by ID,GRADE) US,(select count(GRADE) from employees where
    nationality not like '%US%' and organization_id=a.organization_id and grade=a.grade
    group by ORGANIZATION_ID,GRADE) NON_US,grade from employees a
    where grade is not null
    group by GRADE,ID,name
    order by to_number(grade) desc

    Hi,
    This is a documented restriction on MVs. You cannot have a scalar express (i.e a select statement) in the select list.
    You can get round this by joining your select count(grade).. expression in as an inline view in your FROM clause. Or you can create a normal view without the scalar expression, create your MV as a select from this view, then re-define your view to contain the query you want.
    Hope that helps,
    Rod West

  • Error while creating a view

    Hi All,
    I am getting the below errors while creating view.
    ORA-03135:connection lost contact
    ORA-03134:not connected to ORACLE
    Please suggest. Thanks
    AJR

    check this link... even this can also be a reason
    Ravi Kumar

  • Syntax error while creating a standard order

    Hi All,
    I created a projet in CMOD and than added the enhancement  V45A0002.The components shown as EXIT_SAPMV45A_002(Predefined sold to party when making the standard order),i double click on the exit and entered into the function module.After that i double clicked on the include ZXVVZU04 and entered in and wrote E_KUNNR=100171
    While activating i got error msg 'The last statement is not complete (period missing)." & i have saved inspite the error .After that i tried to create a order and program terminated error came after entering sold to party no. in sales order
    so now i have deactivated the project which i created in CMOD & deleted it aswell,than also i am getting the syntax error while making the order thru VA01.I want to come out of this please.
    I would be great ful if somebody helps me *** out of this syntax error.
    Thanks
    Rishi

    Hi Rishi
    As you are getting message that "The last statement is not complete (period missing)", check in your assigned project in CMOD the last statement , what is the last statement maintained in that project
    Secondly also check the closing period and the current period. as it is giving in the message that "The last statement is not complete (period missing)".So check the  current period and check the period maintained in the CMOD
    It would be better if you take ABAP'ers help . So  post in ABAP forum
    Regards
    Srinath

  • Error while creating Materialized View step 3 of 6 using wizard

    have oracle 9i Rel 1 on Windows 2000 server. Master Site has been setup. Database links are created at Materialized view site. But while creating Materialized View Group using wizard there is following error on step 3 of 6.
    Statement:----------------
    /*OracleOEM*/ SELECT 1 FROM SYS.dba_constraints@masterdbname WHERE OWNER='username' and table_name='tabname' AND constraint_type='P'
    Stack Trace:----------------
    ORA-00942: table or view does not exist.
    ORA-02063: preceding line from masterdbname.
    All parameters for replication are correct.
    Please help me early.
    Thanks

    Hello,
    In the masterdbname, logging as sys user, you must grant select permission on sys.dba_constraints view to mvadmin_dbname user (where dbname is the replicated database name).
    Regards,

  • Error while creating Materialized View step 3 of 6

    I have oracle 9i Rel 1 on Windows 2000 server. Master Site has been setup. Database links are created at Materialized view site. But while creating Materialized View Group there is following error on step 3 of 6.
    Statement:----------------
    /*OracleOEM*/ SELECT 1 FROM SYS.dba_constraints@masterdbname WHERE OWNER='username' and table_name='tabname' AND constraint_type='P'
    Stack Trace:----------------
    ORA-00942: table or view does not exist.
    ORA-02063: preceding line from masterdbname.
    All parameters for replication are correct.
    Please help me early.
    Thanks

    Hello,
    In the masterdbname, logging as sys user, you must grant select permission on sys.dba_constraints view to mvadmin_dbname user (where dbname is the replicated database name).
    Regards,

  • Error while creating the view from one instance to another instance

    Hi Experts
    I want to Create a view which reside in one instance for example xxx Instance . I want to create the same view which reside in xxx instance to another instance for example YYY Instance How to acheive this ?
    I tried desc the View take the view script from XXX instance and copied the view script to YYY instance when I compiled Iam getting an Error
    For Example My view in XXX Instance
    CREATE OR REPLACE FORCE VIEW xxx.sample
    First_name,
    last_name
    as
         select "F_NAME",
                 "L_NAME"
         FROM  EMP;When try to copy and compile the same view in my YYY Instance
    i am getting error
    ORA: table or view does not exist
    Advance Thanks
    AT

    A.T wrote:
    Hi Experts ,
    Thanks For all your valuable information I amTrying Of DB Link i think so
    As per My understanding If wrong anywhere please advice me
    Here Instance is Like : One DB 10g divided into several Instance like (test , devlopement , production Instance)
    Now hope i ll make my req clear .
    Coming to my reqirement
    the actual table EMP is in xxi.TEST (Here xxi => Schema and test is an Instance )
    I want to create the view which is based on by table EMP which in my test instance to devoplment instance
    For example xxo.development (here xxo => Schema and development is an Instance )
    Need to access the xxi schema in Test Instance How can I create a DB Link please share your ideas and advice me
    Advance Thanks
    ATIt's still not at all clear, but let me outline what I think you are after
    Given a database, ORCL_A
    In database ORCL_A we have a schema, HALFTRACK
    User HALFTRACK has a table, MYSTUFF
    Given a database, ORCL_B
    In database ORCL_B we have a user GREENBRASS
    User GREENBRASS needs to be able to query the table HALFTRACK.MYSTUFF.
    In database ORCL_B, as user GREENBRASS
    create database link mylink
    connect to halftrack identified by halftracks_pswd
    using ORCL_A;
    select * from mytable@mylink;The db link defines a connection specification to ORCL_A, using the credentials of a user on ORCL_A. The target of the USING clause in the link definition must be an entry in the tnsames.ora file on the server hosting database ORCL_B.
    When querying through the link, database ORCL_B is simply acting as a client to ORCL_A, no different that a sqlplus session on ORACL_B's server. As far as ORCL_A is concerned, ORCL_B is just another client requesting a connection, connecting with the credentials defined in the link definition.

  • Syntax error while creating Derieved table in universe

    Hi Guru,s
    I really need help here.
    I am trying to create relational universe based on oracle 10g and while creating one of the derieved table when I am writing a SQL sysntax it gives me an Invalid prompt defination error , first of all here is the SQL syntax"
    SELECT
      ITEM.ID,
      ITEM.AMOUNT,
      ITEM.POSTEDORISSUE
    FROM
      ACCOUNT,
      ITEM,
      ITEMTYPES,
      ACCOUNTPOOL,
      COMPANY
    WHERE
      ( ACCOUNT.COMPANYID=COMPANY.ID  )
      AND  ( ACCOUNT.POOLID=ACCOUNTPOOL.ID  )
      AND  ( ACCOUNT.ID=ITEM.ACCOUNTID  )
      AND  ( ITEMTYPES.ID=ITEM.DCIP  )
      AND
       COMPANY.NAME  =  'MLC BA Cat Accounting PRD1'
       AND
       ITEM.POSTEDORISSUE  BETWEEN  @Prompt('Start Date','D','Date\Post Date',mono,free,persistent,{'01-10-2011 00:00:00'},'1')  AND  @Prompt('End Date','D','Date\Post Date',mono,free,persistent,{'01-10-2011 00:00:00'},'2')
    Now thw error I get is that when I trying to parse or validate the query.
    "Invalid Prompt defination" (WIS 00005)
    Seems like its not validating the query through database.
    I have checked the prompt sysntax and nothing seems to be wrong, Can anyone pls look into this and advise what am I doing wrong interms of syntax, I would really appreciate your help.
    Regards.
    MD

    Hi,
    I am getting the correct results, when i can use like below
    @prompt('Enter Product Equal','A',{'TTTT','YYYYY','oooo'},Mono,Constrained,Persistent,User:1,Optional)
    @prompt('Enter Product Not Equal','A',{'TTTT','YYYYY','oooo'},Mono,Constrained,Persistent,User:2,Optional)
    If i can start using like below, not getting the correct results, Any suggestion why?
    @prompt('Enter Product Equal','A','Table_Name\Product',Mono,Constrained,Persistent,User:1,Optional)
    @prompt('Enter Product Not Equal','A','Table_Name\Product',Mono,Constrained,Persistent,User:2,Optional)
    I am thinking something issue with class name/Object Name  in BI 4.0. In XIR3  I changed the same derived table with class name and object name, it;s working fine.
    Any suggestions/advice please
    Praveen

  • Informix ODBC driver error while creating a view in Designer

    I nedd to ceate a view in a universe (Business Objects XI R2) that is connected to an Informix database. I use the 3.34 ODBC Informix driver.
    When I write the select statement (select column from table) and check the syntax I have the following error:
    "Exception: DBD, [Informix][Informix ODBC Driver][Informix]A syntax error has occurred.State: 42000"
    Is there anybody who has solved this problem??
    Thanks in advance to anyone who can give me hints on how to solve problem.
    Fabrizio

    Hi Fabrizio,
    The error state 42000 indicates that there is a syntax error or access violation. If you are using an Informix native client connection then add the following parameter <Parameter Name>"Force SQLExecute">Always</Parameter> in the informix.sbo file. Restart Designer and then try to create a derived table with a simple select statement.
    If you are using an ODBC connection, then add the above mentioned parameter in the Generic section of odbc.sbo file.
    Regards
    Arun Sasi

  • Error while creating cluster view

    Hi all,
    Requirement is to create cluster view copying cluster view VC_TABWU01  into custom view.
    CV VC_TABWU01 has two data base views V_T093C_10 and V_T093U_01 I copied them both in to ZT093U_01 and ZT093C_10 and created a CV Z_TABWU01. Field dependence is set, when I am activating view I am getting message that screen 300 of ZT093U_01 is modified. I changed all possible options as standard view, kindly help me activating cluster view.
    Error: The flow logic of the screen ZT093U_01 0300 is not that of a generated view maintenance list screen. Either the screen has been considerably modified manually, or the view which it is based on has no maintainable key.
    Thanks
    Krishna.

    Need to add events in TMG. Solved with help of standard CV

  • Syntax error while creating tax codes for sales n purchases

    Hi all,
    While creating the tax codes for sales and purchases, i got the below error:
    Report RB13A003 has a syntax error.
    What should be done?
    Thank you

    Hi,
    I believe, it's RV13A003 report and not RB13A003... What is the exact error message (or is it a dump)?
    Regards,
    Eli

  • Error while creating Materialized Views

    I tried creating Materialized views with set operator, and Oracle throws up an error message
    ORA-30370: set operators are not supported in this context
    The script,
    CREATE MATERIALIZED VIEW ORADBA2.MV_GP_AGG_00055_MMR1
    PCTFREE 0 TABLESPACE GPMTSPOC
    STORAGE (INITIAL 128K NEXT 128K MAXEXTENTS UNLIMITED)
    BUILD IMMEDIATE
    REFRESH COMPLETE
    ENABLE QUERY REWRITE
    AS
    SELECT * FROM tb_gp_agg_00055r1_01
    WHERE srce_sys_cd = 15
    UNION ALL
    SELECT * FROM tb_gp_agg_00055r1_02
    WHERE srce_sys_cd = 15
    UNION ALL
    SELECT * FROM tb_gp_agg_00055r1_03
    WHERE srce_sys_cd = 15;
    Will Oracle support UNION clause in Materialized Views?? Any work arounds ?? Thanks.
    null

    SET operators cannot be used in MATERIALIZED VIEWS.
    A workaround is that you create a table AS SELECT using the SET operators and then create the materialized view from that table.
    But then you'll not be able to take advantage of QUERY REWRITE AND AUTOMATIC REFRESH.
    But if you would still like to have the materialized view then this will work!!

Maybe you are looking for

  • Can´t copy vector from Illustrator to Edge Animate

    In the newest version this should be a function, but nothing happens for me when I copy the object in Illustrator and try to paste it in Edge Animate. Any help? Another question would be why the filters are even among the tools in Edge when they don´

  • Get document from DMS to VB

    Hello, does anyone know how to get the document from DMS to a local drive, while using VB Code (with SAP Connector) or .NET? I tried to use the 'CVAPI_DOC_CHECKIN' but it didn't work. maybe it's the wrong function to use... I've also tried to examine

  • Can't see text on a PDF that has text and graphics.

    I create a monthly newsletter for a small non-profit and we send it out via email.  The original file is a publisher file then saved as a pdf.  When I tried to read it on my iPad, I couldn't see the text - only pictures.  However - everything is clea

  • MSR 2.0 Mobile Sales R/3 Synchronization do not work properly

    Hi to all there, we want to use the MSR 2.0 scenario with MI 2.1 SP03 Patch 06. Unfortunately the synchronization with the client do not work. We made some settings in TCO MSR_SELECT on the R/3 backend system. The corresponding data reached the table

  • Advance to a capital PO

    Hi Frnds, When i am making an advance to a vendor for capital PO (Asset) , the system is directly debiting the asset account and not the vendor a/c ? Is there any way that the system debits the vendor a/c. and not the asset a/c. and give the PO numbe