Skip to Content

How to select an CDS View from AMDP

Hi,

i have written many ABAP CDS Views. They work great.

Now i reached the point where i have to use AMDPs.

My problem: i can't select from the CDS views i created.

CLASS /vwk/cl_esp_cats_amdp DEFINITION
  PUBLIC
  FINAL
  CREATE PUBLIC .


  PUBLIC SECTION.
  INTERFACES if_amdp_marker_hdb.
  class-METHODS get_hierarchy_configurations for table function /vwk/ESPCO_6007HIERARCHY.
  PROTECTED SECTION.
  PRIVATE SECTION.
ENDCLASS.






CLASS /vwk/cl_esp_cats_amdp IMPLEMENTATION.
  METHOD get_hierarchy_configurations BY DATABASE FUNCTION FOR HDB LANGUAGE SQLSCRIPT options read-only using /VWK/espco600706 
  .
lt_aha = select * from /VWK/ESPCO600706;
  ENDMETHOD.


ENDCLASS.


i' ll get the message "SQLSCRIPT: sql syntax error: incorrect syntax near "/""

and when i do it like this:

lt_aha = select * from "/VWK/ESPCO600706";

it says "lt_aha = select * from "/VWK/ESPCO600706";"

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Oct 06, 2017 at 05:37 AM

    I see... because of the parameters of the view, there is a wrong message. after adding the parameters to the select, it works.

    Add comment
    10|10000 characters needed characters exceeded