Friday, September 30, 2016

Code-to-Data approach with ABAP 7.4

Some benefits of new Open SQL:
  • Transparent Optimizations:
    • Fast data access
    • Optimizations of SELECT ... INTO ITAB and of SELECT SINGLE
  • A database oriented programming is supported better by the following:
    • Extended open sql, supporting more of SQL-92 standard
    • Advanced views definition capabilities
  • SAP HANA specific features:
    • Database procedures
    • Column views
New Open SQL

One of the reasons for using Native SQL was that the SQL-92 standard defines features that were not previously available in Open SQL. For example, Open SQL lacked expressions and had limited join types.

As of SAP NetWeaver 7.40 SPS5, the scenarios in which native SQL are necessary are reduced, because Open SQL has been extended.

New Open SQL syntax:

SELECT CARRIDCONNID
 FROM SBOOK
    INTO TABLE @LT_BOOKINGS
 WHERE CUSTOMID @LV_CUSTOMER.

SELECT CARRIDCONNIDFLDATEBOOKIDCUSTOMID,
    CASE SMOKER
      WHEN 'X' THEN
        FLOORLOCCURAM * @LC_SMOKER_FEE )
      ELSE CEILLOCCURAM * @LC_NONSM_DISC )
    END AS ADJUSTED_AMOUNT,
      CASTLOCCURAM  AS FLTP /
      CASTAS FLTP AS HALF,
  LOCCURKEY
 FROM SBOOK
    INTO TABLE @LT_BOOKINGS
 WHERE CUSTOMID @LV_CUSTOMER.
  • ABAP variables/constant escaped with "@"
  • Comma-separated column list
  • Arithmetic expressions using +, -, *,  /, DIV, MOD, ABS, FLOOR, CEIL, CAST
  • Common semantics
  • String concatenation using && operator
  • SQL CASE, COALESCE
  • Right Outer Join now supported
  • Support for UNION and UNION ALL of Open SQL. The result of UNION ALL can contain duplicates, whereas the UNION only contain the distinct.


No comments:

Post a Comment

SAP giới thiệu mã hỗ trợ AI trong ngôn ngữ ABAP riêng của mình

SAP đã ra mắt một loạt tính năng mã hỗ trợ AI trong môi trường phát triển ứng dụng dựa trên đám mây của mình, đồng thời tham gia vào danh sá...