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

Text table in ALV Column

ankeshjindal
Participant
0 Likes
4,953

Hi,

I need to display 5 column in alv , in which 4 column are ok but in 5th column I need to display full internal table which contain text of customer packing instructions.

So 1st four column Customer, SO, DC, Division , Lang is fine but in 5th column it would be a big column which will contain standard text.

Please suggest!

Regards,

Ankesh Jindal

Hi,

I need to display 5 column in alv , in which 4 column are ok but in 5th column I need to display full internal table which contain text of customer packing instructions.

So 1st four column Customer, SO, DC, Division , Lang is fine but in 5th column it would be a big column which will contain standard text.

Please suggest!

Regards,

Ankesh Jindal

11 REPLIES 11
Read only

former_member185613
Contributor
0 Likes
3,480

Hi Ankesh,

From the picture you provided, your requirement is to wrap the Text column so that entire text is displayed in ALV. Text wrapping functionality is not available in ALV and the entire text would be displayed in a single row.

An alternate way is to provide a button for each cell in the text column which upon clicking will display customer packing instruction in a text window. This will give you the flexibility of having large length instructions and avoiding scrolling/resizing of Text column to read the data.

Hope it helps,

~Athreya

Read only

Former Member
0 Likes
3,480

Hi Ankesh ,

I too had the same requirement(using ztable) but for adding remarks so what I did was created a field(zremark) in the ztable and then used the following codes:

data: begin of tab occurs 0.

      include structure ztable.

data: end of tab.

parameters:

            s_rem(200) type c.



if tab is not initial.

loop at tab  into wa_tab.

if s_rem is not initial.

wa_tab-zremark = s_rem.

modify tab from wa_tab transporting zremark.

modify ztable from wa_tab.

  endif.

endloop.

endif.


I hope this may help you if you are using a ztable as it has worked in my case but here you have to enter the text as a parameter and it will get updated in ztable.May be I am wrong if you are trying a different approach.


Regards

Nav

Read only

Former Member
0 Likes
3,480

Hi ,

DATA: TEXT(300) TYPE C.

**CONSIDERING I_TAB TABLE FIELD CONTAINS THE TEXT INFO***

LOOP AT I_TAB where .....

     CONCATENATE I_TAB-FIELD1

                               I_TAB-FIELD2 ....... INTO TEXT SEPERATED BY SPACE.

    **Pass the text to final table**

endloop.

Thanks,

Dhivya N.

Read only

SwadhinGhatuary
Active Contributor
0 Likes
3,480

Hi Ankesh,

In our ALV at max  you can display only 128 char.for your requirement you have to use text Warping functionality which I don't like personally because of it's look. I face same issues just few day before

so I suggest put a button or simply a icon with hotspot feature on click display the long text by using

FM 'TERM_CONTROL_EDIT'.

Reference link

ABAP Custom Text Editor Pop UP - Code Gallery - SCN Wiki

for use of FM.

Hope this Help You to solve your  issues

Read only

ankeshjindal
Participant
0 Likes
3,480

The Issue is user need to download this excel as well , so if I provide hot spot then there will be issue with the download. So the only option left is to create all fields in single excel. I need to see the workaround how to do this.

Please inform me guyz if you get some other idea?

Ankesh

Read only

0 Likes
3,480

Hi,

In that scenario we do excel conversion manually

Normally create internal table and fetch long text per column  prior to display with help performance along with reduce fetch time as alternative to read_text use select query

Row one Represent Data At internal table level

mean while second represent data presentation at ALV display.

When user want download to excel provide custom button at pf status. generate Excel by using function module and other Fm for download data to presentation sever.

Hope this help to resolve your issue

Read only

former_member184158
Active Contributor
0 Likes
3,480

Hi Ankesh Jindal,

I think, you can not, the ALV does not support this funciton Word Wrap, so I suggest that you can use Button to display a whole text in pop msg as Athreya has written.

If you face a problem with this button and Pop msg just let us to know

Regards

Ibrahim

Read only

Former Member
0 Likes
3,480

Hello Ankesh,

You can use word wrap for displaying multiple lines in an ALV column.

Please refer the below link. Refer the sample program given.

Word Wrap Functionality in ALV

Regards,

Read only

0 Likes
3,480

hi

I have tried this code, but it does not work

Read only

ankeshjindal
Participant
0 Likes
3,480

Hi swadhin ghatuary/Ibrahim Hatem / Rojer R



Ya it's not working, I am surprised to notice SAP ALV does not having any wrap text functionality. It's is very common thing and they should upgrade their tool with this scenario as well.

I got another workaround but that is not efficient like below make Customer/SO/DC/Division & Language as key and append text 11  times and sort the ALV with these fields so it will display like this as it is coming below but via this , during downloading of excel there would be issue as each text will come in different line.

Rgds,

Ankesh

Read only

0 Likes
3,480

Hi,

Still I am confused.Weather u follow my approach or not.

second after downloading the excel how it look like attach here or our observation.

we can also take help of OLE in sap for excel download , do some search on this.