2009 Dec 17 12:23 PM
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
2009 Dec 17 12:31 PM
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
2009 Dec 17 12:47 PM
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
2009 Dec 17 12:53 PM
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
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |