Application Development and Automation 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: 
Read only

Multiple Lines in ALV Cell

Former Member
1,494

Hi,

I need to enter multiple lines (of Equipment long text) in an ALV cell, in order to display single fields (Classification Characteristic values) and long text in the cells of a single ALV row.

The result would look something like this (looks better in Courier font):

----------+--


+

Val1

Val2

Text line 1

Text line 2

----------+--


+

Val3

Val4

Text line 3

Text line 4

Text line 5

----------+--


+

etc

The same effect is achieved in an Excel cell by typing <Alt-Enter> at the end of each line.

I was thinking of using a String variable for the long text, with line-feed characters to split the lines. Is there an equivalent in ABAP to the Excel/ASCII line-feed character, or is there another way?

Thanks,

Chris.

Hi,

I need to enter multiple lines (of Equipment long text) in an ALV cell, in order to display single fields (Classification Characteristic values) and long text in the cells of a single ALV row.

The result would look something like this (looks better in Courier font):

----------+--


+

Val1

Val2

Text line 1

Text line 2

----------+--


+

Val3

Val4

Text line 3

Text line 4

Text line 5

----------+--


+

etc

The same effect is achieved in an Excel cell by typing <Alt-Enter> at the end of each line.

I was thinking of using a String variable for the long text, with line-feed characters to split the lines. Is there an equivalent in ABAP to the Excel/ASCII line-feed character, or is there another way?

Thanks,

Chris.

5 REPLIES 5
Read only

Nawanandana
Active Contributor
0 Likes
946

hai

i think u can use the command of concatanate

ex:-

data : w_fricharge type c,

w_fric type c,

w_freight(70).

concatenate 'Freight ' w_fricharge w_fric into

w_freight

separated by space.

then u can write the code...

....

....

...

fieldcatalog-fieldname = 'VBELN'.

fieldcatalog-key = 'X'.

fieldcatalog-seltext_m = ' w_freight '.

fieldcatalog-col_pos = 1.

fieldcatalog-outputlen = 5.

fieldcatalog-edit = ''.

i think it wil be help full to u

regard

nawa

Read only

0 Likes
946

Thanks Nawa, I'm not sure how that helps though. What I want to do is include any number of lines (as you would find in long text) into a single ALV cell, to appear as separate lines. With Equipment the line length is 72 characters, so I need to handle records with zero to any number of lines, each of which has a length between zero and 72 characters.

I guess I could read the contents of the long text into an internal table, loop through the table and concatenate all the lines into a string variable, but that does not preserve the line breaks, which are important. I need to include some kind of line break character at the end of each line.

Read only

0 Likes
946

Hi Chris

You can not have multiple lines in same cell.

This functionality is not provided in ALV.

Regards

Navneet

Read only

Former Member
0 Likes
946

Hi Chris,

use REUSE_ALV_HIERSEQ_LIST_DISPLAY

regards Dieter

Message was edited by:

Dieter Gröhn

Read only

0 Likes
946

Thanks Dieter - I'll give it a try.