ABAP Chaining Operator && and how to use it

I am not particularly fond of the excess of the ABAP statements to achieve simple tasks and really like the new adaption to operators and predefined functions to achieve similar or sometimes better results. In line with that, this post is about my favourite, chaining operator or &&.

For folks who have never seen this or want to know more about it,

What is a Chaining Operator?

The chaining operator concatenates two operands in a string expression as a character string. It has the ability to allow string expressions, predefined functions or functional methods, and even method chaining at its operand position. 
To Me, It's an upgrade over the good old CONCATENATE statement.

Syntax: … operand1 && operand2 … .

Below are a few examples of Chaining Operator and its usage.

Simple Concatenation: 

Adding Separator:

Adding Different Separators in a text:

Notice how effortlessly different separators can be embedded in the string.

Using predefined functions:

Dynamic text building Using the functional method and method chaining:

You can also pass the string template to a chaining operator operand position:

Above are a few examples of how you can use the chaining operator. As always, Hope you like the post and it helps you in your day-to-day work.

Popular posts from this blog

ABAP convert internal table to excel (.xlsx) format and Send email or download

ABAP read excel(.XLSX) file to internal table in ABAP using CL_FDT_XL_SPREADSHEET

Application Logging in ABAP