Open SQL Enhancement ABAP on HANA - Part 1

 *&---------------------------------------------------------------------*

*& Report zr_opensql_00_syntax_t

*&---------------------------------------------------------------------*

*&

*&---------------------------------------------------------------------*

REPORT zr_opensql_00_syntax_t.


TYPES: BEGIN OF ty_so_amount,

         so_id           TYPE snwd_so-so_id,

         currency_code   TYPE snwd_so-currency_code,

         gross_amount    TYPE snwd_so-gross_amount,

         delivery_status TYPE snwd_so-delivery_status,

       END OF ty_so_amount.


DATA lt_so_amount TYPE STANDARD TABLE OF ty_so_amount.

*

**"using the "old" Open SQL syntax

SELECT so_id

       currency_code

       gross_amount

       delivery_status

  FROM snwd_so

  INTO TABLE lt_so_amount

  UP TO 10 ROWS

  WHERE currency_code = 'EUR'.




*Enhanced Open SQL

*comma  vs blank separated  + host variable @

*Into clause can come at the end

*Fields key word




cl_demo_output=>display(

  EXPORTING

    data = lt_so_amount

*      name =

).

Comments

Popular posts from this blog

AMDP ( ABAP Managed Database Procedure ) Part - 1

Backup all ADT Objects & Other queries RAP Part 10.1

SAP CDS Introduction Part 2 - ABAP on HANA Course