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

Queries regarding ALV formating

MNaveen
Product and Topic Expert
Product and Topic Expert
0 Likes
513

Hello all,

I have the following queries regarding ALV usage using CL_GUI_ALV_GRID

1. One of the fields in the ALV is actually a URL to a site and the requirment is that when user clicks on it, it must navigate to the

site. Can you tell me how can this be done in ALV?

2. Some of the fields are usually very long for instance a field contains text enterend by user which can vary from 20 characters to 1000 characters. I want to acheive something like for that field the width in the ALV must be set automatically to

the maximum length in that field.

Warm Regards,

Naveen M

Hello all,

I have the following queries regarding ALV usage using CL_GUI_ALV_GRID

1. One of the fields in the ALV is actually a URL to a site and the requirment is that when user clicks on it, it must navigate to the

site. Can you tell me how can this be done in ALV?

2. Some of the fields are usually very long for instance a field contains text enterend by user which can vary from 20 characters to 1000 characters. I want to acheive something like for that field the width in the ALV must be set automatically to

the maximum length in that field.

Warm Regards,

Naveen M

3 REPLIES 3
Read only

Former Member
0 Likes
484

Hi Naveen,

Here are the answers to your queries:-

1) To acheive this, you have to use the attribute HREF_HNDL of the fieldcatalog LVC_T_FCAT.

2) To achieve this, you have to use attribute CWIDTH_OPT ( to optimize the width of the column) of the fieldcatalog

LVC_T_FCAT.

Regards

Abhii

Read only

MNaveen
Product and Topic Expert
Product and Topic Expert
0 Likes
484

Hi abhi,

1. col_opt is the field i guess

2. HREF_HNDL is of type int4? what should be stored here? Can you elaborate a little bit.

Warm Regards,

Naveen M

Read only

Former Member
0 Likes
484

Hi Naveen,

1 ==> Try with HREF_HNDL in fieldcat

Handle to which an URL is assigned. The ALV Grid Control displays all cells of the column as hyperlinks. You must maintain the target address of the hyperlink in a table of type LVC_T_HYPE and pass it using set_table_for_first_display.

[SAP Help|http://help.sap.com/saphelp_erp2004/helpdata/EN/85/ce25c2d7ae11d3b56d006094192fe3/content.htm]

2 ==> Not possible to have more then 128 char in one column in ALV GRID .. Try the same using ALV LIST by providing as it's possible in ALV LIST

FIELDCAT-OUTPUTLEN = '512'. " Length whatever you want.. but still some limitations are there..

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

ilesh Nandaniya