You are on page 1of 3

Log In


About Us

How to Contribute Welcome Guest

SDN Community
Home Forums Wiki Blogs

BPX Community
Articles eLearning

Business Analytics

University Alliances
Career Center

SAP EcoHub
Events InnoCentive Idea Place

Code Exchange

Added by Hareesh Menon, last edited by Hareesh Menon on Feb 20, 2009 Inserting HYPERLINKS in ALV: ALV provides you a very easy way of inserting hyper links in the grid. Step 1. Create an internal table of type LVC_T_HYPE of line type LVC_S_HYPE.It is the table that contains the HYPERLINKS.

Step 2. Populate the table with the required links. Step 3. Add a field of type int4 to your structure, for each field for which you need to create the hyperlink. These fields contains the handle to get the information from the HYPERLINK table. Step 4. You state the field name which contains handle for each field that will contain hyperlink, in the field catalog by putting the handle name to the "WEB_FIELD" field for each column. Step 5. Populate the data table with the handle number for each field by looping it. Step 6. Pass the table name to the exporting parameter 'it_hyperlink' of the method SET_TABLE_FOR_FIRST_DISPLAY. Example:

ENDIF. INCLUDE STRUCTURE sflight. " USER_COMMAND_0100 INPUT &--------------------------------------------------------------------*& Module LIST OUTPUT &--------------------------------------------------------------------MODULE list OUTPUT.ENDMODULE. &--------------------------------------------------------------------*& Module STATUS_0100 OUTPUT &--------------------------------------------------------------------MODULE status_0100 OUTPUT. ENDMODULE.REPORT zalv_hyperlink. t_itab-carrid_handle = '1' . ENDCASE. CALL METHOD r_grid->set_table_for_first_display EXPORTING i_structure_name = 'SFLIGHT' it_hyperlink = t_hype_link CHANGING it_fieldcatalog = t_fcat it_outtab = t_itab[]. fs_hype_link TYPE lvc_s_hype. CASE sy-ucomm. r_grid TYPE REF TO cl_gui_alv_grid. DATA carrid_handle TYPE int4.CREATE OBJECT r_grid EXPORTING i_parent = r_container. ENDLOOP. DATA: t_fcat TYPE lvc_t_fcat.WHEN 'BACK'. DATA: t_hype_link TYPE lvc_t_hype. DATA: BEGIN OF t_itab OCCURS 0. MODIFY t_itab. DATA: r_container TYPE REF TO cl_gui_custom_container. SELECT * FROM sflight INTO TABLE t_itab. APPEND fs_hype_link TO t_hype_link. " STATUS_0100 OUTPUT &--------------------------------------------------------------------*& Module USER_COMMAND_0100 INPUT &--------------------------------------------------------------------MODULE user_command_0100 INPUT. APPEND fs_fcat TO t_fcat. SET PF-STATUS 'SCREEN1'. fs_hype_link-href = 'www. LOOP AT t_itab . DATA END OF t_itab. ENDMODULE. " LIST OUTPUT Result: List display: . CALL SCREEN 100. LEAVE TO SCREEN 0. fs_fcat TYPE lvc_s_fcat. CREATE OBJECT r_container EXPORTING container_name = 'CONTAINER'. IF t_itab-carrid = 'AA'. fs_fcat-web_field = 'CARRID_HANDLE'.com' .google. fs_hype_link-handle = '1' . fs_fcat-fieldname = 'CARRID'.

Contact Us Site Index Marketing Opportunities Powered by SAP NetWeaver Legal Terms Privacy Impressum .