cancel
Showing results for 
Search instead for 
Did you mean: 

SQL Syntax error

Vincent801
Explorer
0 Kudos

Dear Experts,

I am trying to create a AMDP class to get the current date as the output of the class. And i need to call this class in the BW transformations. Please find the sample code that i wrote.

 

CLASS Today_date DEFINITION
  PUBLIC
  FINAL
  CREATE PUBLIC .
  PUBLIC SECTION.

  INTERFACES if_amdp_marker_hdb.
  class-methods amdp_procedure
  exporting
  value(i_sydat) type dats.
  PROTECTED SECTION.
  PRIVATE SECTION.
ENDCLASS.

CLASS Today_date IMPLEMENTATION.
METHOD amdp_procedure by database procedure
                   for hdb
                   language sqlscript
                   options read-only.
                  
i_sydat = (cl_abap_context_info=>get_system_date( ));
ENDMETHOD.
ENDCLASS.

 

 I am getting the syntax error in Line number 21. The error is SQLSCRIPT: sql syntax error: incorrect syntax near "=>" . Could you please help on, how to correct this error. And also how to call this clss inside BW transformation ?

And in the transformation,

ZLOADING_DATE = CALL "TODAY_DATE=>AMDP_PROCEDURE(i_SYDAT)

Pls correct me, if i am wrong.

Sandra_Rossi
Active Contributor
0 Kudos
Inside AMDP with "language sqlscript", you can enter HANA SQLScript language only, not ABAP. Why do you want to use AMDP from this transformation, why don't use an ABAP transformation directly?

Accepted Solutions (0)

Answers (1)

Answers (1)

Vincent801
Explorer
0 Kudos

Thank you for your reply. As advised, I entered HANA SQL script in the below Code.

METHOD amdp_procedure by database procedure for hdb language HANA sqlscript options read-only.

I am getting the error as "HANA" is not valid. All BW transformations are AMDP procedures and i feel i need to create AMDP class to use it in BW transformations.

If possible, pls provide a sample Code.

Thanks.