2020 Aug 24 10:30 AM
HI,
i try merge between 2 variables with new row.
my code:
CONSTANTS: c_delimiter(1) TYPE c VALUE cl_abap_char_utilities=>newline.
DATA: var1 TYPE string,
var2 TYPE string,
varout TYPE string.
var1 = 'hi'.
var2 = 'hello'.
CONCATENATE var1 var2 INTO varout SEPARATED BY C_DELIMITER.
WRITE varout.
and i get result like this:
and i want get:
hi
hello.
thanks.
HI,
i try merge between 2 variables with new row.
my code:
CONSTANTS: c_delimiter(1) TYPE c VALUE cl_abap_char_utilities=>newline.
DATA: var1 TYPE string,
var2 TYPE string,
varout TYPE string.
var1 = 'hi'.
var2 = 'hello'.
CONCATENATE var1 var2 INTO varout SEPARATED BY C_DELIMITER.
WRITE varout.
and i get result like this:
and i want get:
hi
hello.
thanks.
2020 Aug 24 10:30 AM
Hi and welcome to the SAP Community!
Thank you for visiting SAP Community to get answers to your questions. Since you're asking a question here for the first time, I recommend that you familiarize yourself with https://community.sap.com/resources/questions-and-answers (if you haven't already), as it provides tips for preparing questions that draw responses from our members. For example, you can outline what steps you took to find answers (and why they weren't helpful) and share screenshots of what you've seen/done. The more details you provide, the more likely it is that members will be able to assist you.
Should you wish, you can revise your question by selecting Actions, then Edit (although once someone answers your question, you'll lose the ability to edit the question -- but if that happens, you can leave more details in a comment).
Finally, if you're hoping to connect with readers, please consider adding a picture to your profile. Here's how you do it: https://www.youtube.com/watch?v=F5JdUbyjfMA&list=PLpQebylHrdh5s3gwy-h6RtymfDpoz3vDS. By personalizing your profile with a photo of you, you encourage readers to respond.
Cheers,
Julia
SAP Community Moderator
2020 Aug 24 10:46 AM
Hi,
Try with below code
CONSTANTS: c_delimiter(1) TYPE c VALUE cl_abap_char_utilities=>cr_lf.
DATA: var1 TYPE string,
var2 TYPE string,
varout TYPE string.
var1 = 'hi'.
var2 = 'hello'.
CONCATENATE var1 var2 INTO varout SEPARATED BY C_DELIMITER.
WRITE varout.or sy-uline also can help...
2020 Aug 24 10:53 AM
Hello alon121
The result you get is correct. # in the result represent a non-visible character, in this case a new line. WRITE statement prints multi line texts in one line. Just as it did in your result.
If you want to print a new line you need to use WRITE /.
Kind regards,| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |