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: 

Multiple lines in single column (ALT + ENTER)

Former Member
0 Kudos

Hello Experts,

I would like to know , is there any way we can put multiple lines into single Cell of the excel

(Like we do ALT + Enter In the cell of excel and Type next Line). I tried using new line characters,line feeds but not successful.

I searched the whole forum but did'nt get my answer. There are some answers but they did not help me.

Any help on this would be appriciated.

Thanks

Regards,

Charan

1 ACCEPTED SOLUTION

amy_king
Active Contributor
0 Kudos

Hi Krishna,

The solution may depend on what version of Excel you are using, but try wrapping your string in single quotes and using the newline character...

CONCATENATE ''''
               lv_string1
               cl_abap_char_utilities=>newline
               lv_string2
               ''''
               INTO lv_string3.

Cheers,

Amy

5 REPLIES 5

amy_king
Active Contributor
0 Kudos

Hi Krishna,

The solution may depend on what version of Excel you are using, but try wrapping your string in single quotes and using the newline character...

CONCATENATE ''''
               lv_string1
               cl_abap_char_utilities=>newline
               lv_string2
               ''''
               INTO lv_string3.

Cheers,

Amy

Former Member
0 Kudos

Hi Amy,

Thanks for your help, I am using the Microsoft Excel 2010.

I tried your code, multiple lines are displaying in separate lines with quotes but not in single column.  

Any idea on abap character for ALT + ENTER or any alternate way of doing would be helpful .

Regards.

Charan.

kesavadas_thekkillath
Active Contributor
0 Kudos

You can try it with OLE, So set the cell property WrapText = True thorugh OLE

This is what I got when I recorded a macro to wrap the text.

.HorizontalAlignment = xlGeneral

.VerticalAlignment = xlBottom

.WrapText = True

.Orientation = 0

.AddIndent = False

.IndentLevel = 0

.ShrinkToFit = False

.ReadingOrder = xlContext

.MergeCells = False

0 Kudos

Hi Kesavadas,

Thanks for your reply,

I am completely not aware about OLE. if you can explain it in more detail that would be greateful.

I am using open dataset to download the tab delimited text file to app. server and trying to open it in Microsoft Excel 2010.

Regards,

Charan

0 Kudos

OLE with application server is incompatible. I do not have any idea how to include word wrap while using open dataset

Regarding OLE, please search in SCN, there are lot of content available.