Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
Concatenate 2 strings in ABAP without using CONCATENATE function
In ABAP you can use && sign to concatenate variables as below ?
Variable Declaration and Assignment
First, declare the variables and assign values to them ?
DATA: hello TYPE string,
world TYPE string,
helloworld TYPE string.
hello = 'hello'.
world = 'world'.
helloworld = hello && world.
The output of the above code is ?
helloworld
Direct String Concatenation
If you want to concatenate strings directly without using variables, you can use ?
helloworld = 'hello' && 'world'.
The output of the above code is ?
helloworld
Adding Spaces Between Strings
If you want to keep space in between concatenated strings, you would require backtick symbol (`) to define string literals as below ?
helloworld = hello && ` and ` && world.
The output of the above code is ?
hello and world
Conclusion
The && operator provides a simple and efficient way to concatenate strings in ABAP without using the CONCATENATE function, and backticks allow you to include spaces and special characters in your concatenated results.
Advertisements
