Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

adding a new line in a string

Former Member
0 Kudos

Hello Friends,

I am building a web dynpro component where I have created a field called 'New Comments' of type string and other one called 'comments history' of the same type, So the user will enter comments  in the New comments field and upon submission, the comments will be saved to a custom table. In the next step when the user opens the web dynpro component the Comments History field will have the comments that user entered earlier (it reads from the custom table)and the Field New Comments will be available for the new comments and again upon submission the new comments will be appended to the custom table and will be displayed in the comments history field,  Now my issue is I want every time when a user enters a new comment it should appended to the next line, what's happening right now is everything is getting appended to the same line and hence it's unreadable.

Can you please help me with this?

1 REPLY 1

Ryan-Crosby
Active Contributor
0 Kudos

Hi Rajat,

Depending on your platform you can use cl_abap_char_utilites=>newline or cl_abap_char_utilities=>cr_lf to achieve this requirement.  For example:

CONCATENATE lv_oldstr cl_abap_char_utilities=>newline lv_newstr INTO lv_str.

Regards,

Ryan Crosby