2017 Oct 06 5:56 AM
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";"
2017 Oct 06 6: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.
2017 Oct 06 6: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.
2018 Jun 27 9:04 AM
Hi Michael,
Just to be clear, inside your AMDP method you are selecting against the abapcatalog.sqlViewName generated by the CDS? Or you select directly agains the CDS name?
2018 Jun 27 9:21 AM
Hi Marco,
i used the sqlViewName.... as mentioned, it works now.
2018 Jun 27 7:05 PM
Thanks Michael,
And how do you specify the CDS views parameters from within the AMDP?
2018 Jun 28 7:51 AM
lt_aha = select * from "/VWK/ESPCO600706"( par_one => :local_var_one , par_two => :local_var_two );
i think this should answer your question...
2018 Jun 28 10:53 AM