Hi All, Can anyone help me with the fixing the below code excerpt: I have just created an attribute view in the HANA Studio and using the public synonym to access the view from my ABAP program. I have defined a calculated attribute called 'Route' within the attribute view that calculates the route of the flight. The problem I am facing is whenever I use route within my SQL query I encounter a syntax generation error. Do you know why is that happening and how do I resolve the issue? REPORT zdemo_adbc. TYPES: BEGIN OF ty_data, carrid TYPE s_carr_id, connid TYPE s_conn_id, fldate TYPE s_date, route TYPE string, END OF ty_data. CONSTANTS: c_view TYPE string VALUE 'ZDEMO_HANA_ABAP::ZAT_FLIGHT_BASIC'. DATA: lt_data TYPE STANDARD TABLE OF ty_data. * - Access to the Attribute View DATA(lv_statement) = | SELECT CARRID, CONNID, FLDATE, Route | && | FROM "{ c_view }" | && | WHERE mandt = '{ sy-mandt }' ORDER BY FLDATE, Route |. TRY . * - Preparing Native SQL connection & statement DATA(lo_result_set) = cl_sql_connection=>get_connection( )->create_statement( tab_name_for_trace = CONV #( c_view ) )->execute_query( statement = lv_statement ). * - Get Statement lo_result_set->set_param_table( EXPORTING itab_ref = REF #( lt_data ) ). lo_result_set->next_package( ). lo_result_set->close( ). CATCH cx_sql_exception INTO DATA(lo_exec). WRITE: |{ lo_exec->get_text( ) }|. ENDTRY. Many Thanks, Tanmoy
↧