Selecting a Constant

Index

 

ABAP HANA 7.51: Selecting a Constant

Selecting a constant is possible now in a SELECT query. There may be different reasons for selecting a constant, however, in reality, it doesn’t fetch anything from the database. e.g. This can be readily used for existence check.

Sample Source Code: Variant 1

SQL_Select_Constant_Var1_source

 

Explanation:

Here we are selecting a constant ABAP_TRUE which is defined in TYPE-POOL ABAP with type BOOLEAN and value X. If Material number 112 is found in MARA table, nothing is fetched from Database but since the query is successful, LV_EXISTS is set to ‘X’ which is the value of ABAP_TRUE.  Hence, we didn’t fetch any field from Database and selecting a constant helped to do an existence check.

Check the video for Illustration and Example:

Coming Soon!

Index

 

 

Leave a Reply