SAP NEWS-750-ABAP SQL Get Example source ABAP code based on a different SAP table
SAP Help
AB_SQL in ABAP Release 7.50 ITOC
ABAP_MODIFICATION_NN Arrangement of SELECT> Clauses and FROM> Clauses> From ABAP_RELEASE 7.50, the FROM> clause> of a SELECT> statement> can also be specified in front of the SELECT> clause>. In this case, the SELECT> clause must be introduced using the new addition FIELDS>>. This arrangement supports tools such as Code Completion> in ABAP Editor. ABAP_MODIFICATION_NN Unions> From ABAP_RELEASE 7.50, the addition UNION >> creates the union of the results sets of two SELECT >> statements. ABAP_MODIFICATION_NN Host Expressions> From ABAP_RELEASE 7.50, host expressions > with the syntax @( expr )> can be specified in many operand positions in which host variables> are possible. For expr>, all ABAP expressions can calls are possible that can be specified in general expression positions>. Operand positions for host expressions in ABAP_RELEASE 7.50: Arguments of SQL expressions> and hence all operand positions in which these are possible. Operand n> after UP TO>> and PACKAGE SIZE>> in the SELECT>> statement, Right sides of WHERE>>, ON>>, or HAVING >> conditions, except for LIKE> and IN>. Actual parameters> for input parameters of CDS views. In the write statements INSERT>>, UPDATE>>, MODIFY>> , and DELETE>>, the work areas wa> or the internal tables itab> from which the data is taken. Right side of a SET> expression > in UPDATE>. ABAP_MODIFICATION_NN SQL Expressions> The following changes have been made: From ABAP_RELEASE 7.50, SQL expressions> can be specified in the following operand positions (except in the SELECT > list): Left side of any WHERE>> condition Left side of a HAVING>> condition Left side of a complex case distinction> As an operand of a cast expression>. In the SQL expression CASE>>, columns with the built-in dictionary type SSTRING> can now be used. If an SQL expression can be specified, any individual literals, host variables, and host expressions can also be specified. ABAP_MODIFICATION_NN SQL Functions> The following changes have been made: New Numeric Function The new function ROUND>> rounds numeric values. New String Functions The new functions CONCAT>>, LPAD>>, LENGTH>>, LTRIM>>, REPLACE>>, RIGHT>>, RTRIM>>, and SUBSTRING>> perform operations on strings. Coalesce Function Expanded The coalesce function> can now have 255 arguments instead of just two and returns the value of the first argument that does not have the null value. Columns with the built-in dictionary type SSTRING> can now be used as arguments. ABAP_MODIFICATION_NN ON> Conditions> The following is possible from ABAP_RELEASE 7.50: SQL expressions> can be used on the left side of the ON>> condition of any join expression. The expression IS $[NOT$] NULL>> can be used in an ON>> condition of an outer join. The full ON> condition or subconditions of joins> can be specified dynamically as (cond_syntax)>>. This is not possible if the full FROM> clause> is specified dynamically as (cond_syntax)>. ABAP_MODIFICATION_NN Columns Specified After BETWEEN>> From ABAP_RELEASE 7.50, numeric columns can be specified on the right side in an interval condition using BETWEEN>>, providing the name of the database table or view is prefixed using ~>. ABAP_MODIFICATION_NN Subquery as Data Source of INSERT>> In the AB-SQL write statement INSERT>> , a parenthesized subquery> can now be specified as a data source after FROM>. The rows of the results set of the subquery are inserted into the target table directly on the database. No data transport is required between the database and the application server. ABAP_MODIFICATION_NN Access to CDS Entities> The following changes have been made: From ABAP_RELEASE 7.50, the restriction no longer applies that a CDS entity> can only be used together with database tables and classic views in a SELECT>> statement if addressed using its CDS database view>. From ABAP_RELEASE 7.50, CDS views can be addressed using the name of their CDS entity>, even if associated with database tables or classic views using joins> or subqueries>. This makes accesses performed on a CDS using the CDS database view obsolete>. From ABAP_RELEASE 7.50, the new CDS table functions> can also be specified as data sources> of a SELECT>> statement alongside CDS views>. If an input parameter of a CDS entity> is annotated with the new annotation @Environment.systemField>> , AB_SQL can pass the system value that matches the value of the annotation implicitly. The annotation value #CLIENT>> even prevents an actual parameter from being passed to input parameters explicitly that are annotated in this way for client IDs. ABAP_MODIFICATION_NN CDS Path Expressions> From ABAP_RELEASE 7.50, path expressions> can be specified in SELECT> statements that access CDS views with associations published for outside use as follows. Path expressions closed with an element can be specified as columns>. Path expressions closed with a target data source can be used as data sources> of the FROM> clause>. ABAP_MODIFICATION_NN Access to Global Temporary Tables> When the new global temporary tables> in ABAP Dictionary are accessed using AB_SQL , all temporary data stored here is guaranteed to be deleted before the next implicit database commit>, If not, a runtime error occurs. ABAP_MODIFICATION_NN Strict Mode in the Syntax Check> If one the new features listed above (with the exception of dynamic join conditions) is used in an AB-SQL statement, the syntax check is performed in a strict mode>, which handles the statement more strictly than the regular syntax check. ABAP_MODIFICATION_NN CDS Views with Input Parameters> In ABAP_RELEASE 7.50 and higher, the input parameters> of CDS views are supported by all database platforms and can be used in AB_SQL . It is no longer necessary to query property VIEWS_WITH_PARAMETERS> using method USE_FEATURES> of class CL_ABAP_DBFEATURES>>. Querying this property results in a warning check from the syntax check. ABAP_MODIFICATION_NN System Classes> The following changes have been made: The class CL_ABAP_DBFEATURES>> can now be used to check all features of databases that can be integrated in ABAP programming but which cannot be used in all database systems. The new system class CL_DBI_UTILITIES >> contains utility methods for the database interface. The documented method IS_LOGGING_ON> can be used to verify whether logging> is currently switched on for a database table. ABAP_MODIFICATION_NN Access to Replacement Objects> From ABAP_RELEASE 7.50, it is possible to define a CDS view> as a replacement object> in ABAP Dictionary (transaction SE11>>) for a database table or a database view. If a replacement object is defined for a database table or database view specified as a data source> of a SELECT>> statement, the SELECT> statement accesses the CDS view and not the database table or the database view. This change was implemented using an internal tool a kernel patch after ABAP_RELEASE 7.40, SP10.