Inline declaration in SQL

Index

 

ABAP HANA 751 : Inline Field-symbol Declaration

SAP ABAP 7.51 Inline Declaration make it possible to define Internal Table, Work area and Variable on the fly from within the query. There is no need to write a separate line for Internal Table, Work area, and Variable declaration. This construct effectively helps to reduce lines of code and saves costly effort.

Declaring Variables, work areas and internal table inline in SQL statements are emerging as a  good programming practice. This also gives flexibility that if in future programmer plans to select one/more field(s) in the query, in that case, there is no need to adjust internal table’s/work area’s type. This saves effort during maintenance also.

Sample Source Code: Variant 1 – Internal tables

Inline_decl_sql_Var1_source

Output: Variant 1

Inline_decl_sql_Var1_output

Sample Source Code: Variant – Work area and Variable

Check video and GitHub link for inline declarations of Work area and Variable in SQL statements

Check the video for Code and Execution:

 

Find the code on GitHub:

Go to Code

Index

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s