Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CDS view syntax error about namespace

0 Likes
2,517

Hi Guys,

currently I meet a CDS view issue, I wrote a table function to get data from table '/CFG/ECA_DELTA‘, but I cannot active the AMDP Class due to syntax error, and the error message is just simply 'SQLError:'.

my Table Function looks like below:

@ClientDependent: false
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Table Function for Ecatt input log'
define table function /CFG/CCP_DELTA_ECATT_TF


returns
{
  RUN_ID    : /cfg/de_ccp_run_id;
  ECA_ID    : /smb/objid;
  FILENAME  : /smb/sba1_filename;
  PRIMKEY   : /cfg/de_ccp_primkey;
  DS_FLD    : /cfg/de_tab_field;
  OLD_VALUE : /smb/de_centraldata_orig_id;
  NEW_VALUE : /smb/de_centraldata_orig_id;
  CHG_TYPE  : /cfg/de_chg_type;
}
implemented by method
  /cfg/ccp_admp_ecatt=>GET_DELTA_INPUT_LOG;
<br>

and the implementation function is:

CLASS /cfg/ccp_admp_ecatt DEFINITION
  PUBLIC
  FINAL
  CREATE PUBLIC .


  PUBLIC SECTION.
    INTERFACES if_amdp_marker_hdb.
    CLASS-METHODS: GET_DELTA_INPUT_LOG FOR TABLE FUNCTION /CFG/CCP_DELTA_ECATT_TF .


  PROTECTED SECTION.
  PRIVATE SECTION.
ENDCLASS.

CLASS /cfg/ccp_admp_ecatt IMPLEMENTATION.


  METHOD get_delta_input_log BY DATABASE FUNCTION FOR HDB LANGUAGE SQLSCRIPT
  OPTIONS READ-ONLY USING /CFG/ECA_DELTA.


    RETURN SELECT eca.run_id  ,
                  eca.eca_id  ,
                  eca.filename  ,
                  eca.primkey  ,
                  eca.ds_fld   ,
                  eca.old_value ,
                  eca.new_value ,
                  eca.chg_type
            from  /CFG/ECA_DELTA  as eca   "<==== here I have syntax error
             where eca.pro_id = :pro_id
            ORDER BY    eca.eca_id  ,
                        eca.filename  ,
                        eca.primkey  ;




  endmethod .


ENDCLASS.<br>

I tried to copy the table /cfg/eca_delta to an local table ZECA_DELTA, and it can work in a local AMDP class, so, I assume this is a namespace error, does anyone has idea regarding how I can fix it? thank you so much for any help I could get 🙂

BR

Vincent Guan

1 ACCEPTED SOLUTION
Read only

0 Likes
1,672

Hi Vincent,

Try placing the table name within double quote like "/CFG/ECA_DELTA" '.

2 REPLIES 2
Read only

0 Likes
1,673

Hi Vincent,

Try placing the table name within double quote like "/CFG/ECA_DELTA" '.

Read only

0 Likes
1,672

Hi Manikumar,

thanks a lot for your help, it resolved my issue. 🙂

BR

Vincent