Application Development 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: 

how to handle the hyperlink in alv

Former Member
0 Kudos

Hello friends,

I made one alv report by using function.. now i want that on one coloum, if user click than it can fetch the information regarding it. please tell me how i can do.. i made a hyperlink on that coloum but i dont know how i handle it..

Regards,

Reema Jain.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

You can use At line-selection-screen event.

In this event you can write whatever u want to do in reaction to the user-click on a particular line of ALV Display.

Reward if useful,

Regards,

Harsha

8 REPLIES 8

Former Member
0 Kudos

you need to use

FORMAT HOTSPOT ON.

before writing any thing using write statement.

The Hyperlink is called as HOTSPOT.

Goto ABAPDOCU transaction there u will find programs.

In ABAP User Dialogues.

Former Member
0 Kudos

The hotspot (hyperlink) will have to be enabled at a specific field level on the grid. So, for whichever field you want to have this feature, set the HOTPSOT attribute for that field to X in the field catalog.

Then you handle the event of hotspot click for the grid and do the same what you are doing for the radio button now. The following examples show you how to use the events.

With ALV Grid Control - BCALV_TEST_GRID_EVENTS

With REUSE function - BCALV_TEST_FULLSCREEN_EVENTS

Former Member
0 Kudos

Hi,

You can use At line-selection-screen event.

In this event you can write whatever u want to do in reaction to the user-click on a particular line of ALV Display.

Reward if useful,

Regards,

Harsha

0 Kudos

Hii,

Can you please tell me how to get the value of particular coloum on which user click.

Regards,

Reema Jain.

0 Kudos

Hi Reema ,

How are you implementing the ALV , are you using FM or ABAP Objects.

Regards

Arun

0 Kudos
REPORT zdemoab.

TYPE-POOLS: slis.
TABLES: mara.

TYPES: BEGIN OF t_itab,
       matnr TYPE mara-matnr,
       mtart TYPE mara-mtart,
       END OF t_itab.

DATA: itab TYPE TABLE OF t_itab,
      wa_itab like line of itab.

DATA: i_fieldcat TYPE slis_t_fieldcat_alv,
      wa_fieldcat LIKE LINE OF i_fieldcat,
      i_layout TYPE slis_layout_alv,
      g_repid TYPE sy-repid.


SELECT matnr mtart INTO TABLE itab FROM mara UP TO 10 ROWS.


CLEAR: wa_fieldcat.
wa_fieldcat-col_pos = 0.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-tabname = 'MARA'.
wa_fieldcat-hotspot = 'X'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR: wa_fieldcat.

wa_fieldcat-col_pos = 1.
wa_fieldcat-fieldname = 'MTART'.
wa_fieldcat-tabname = 'MARA'.
APPEND wa_fieldcat TO i_fieldcat.
CLEAR: wa_fieldcat.


i_layout-colwidth_optimize = 'X'.
i_layout-hotspot_fieldname = 'MATNR'.

g_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
 EXPORTING
   i_callback_program                = g_repid
   I_CALLBACK_USER_COMMAND           = 'USER_COMMAND '
   is_layout                         = i_layout
   it_fieldcat                       = i_fieldcat[]
  TABLES
    t_outtab                          = itab
 EXCEPTIONS
   program_error                     = 1
   OTHERS                            = 2
          .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

FORM user_command USING r_ucomm LIKE sy-ucomm
                        rs_selfield TYPE slis_selfield.

*   Check field clicked on within ALVgrid report
    IF rs_selfield-fieldname = 'MATNR'.
*     To pass the material no in ME22 transaction
      READ TABLE itab INTO wa_itab INDEX rs_selfield-tabindex.
*     Set parameter ID for transaction screen field
      SET PARAMETER ID 'BES' FIELD wa_itab-matnr.
*     Sxecute transaction ME23N, and skip initial data entry screen
      CALL TRANSACTION 'MM03'.
*
    ENDIF.
ENDFORM.

0 Kudos

You will have that by the following code in user command:

IF rs_selfield-fieldname = 'MATNR'.
*     To pass the material no in ME22 transaction
      READ TABLE itab INTO wa_itab INDEX rs_selfield-tabindex.
*     Set parameter ID for transaction screen field
      SET PARAMETER ID 'BES' FIELD wa_itab-matnr.
......
.....
endif.

anversha_s
Active Contributor
0 Kudos

hi,

Chk this report.

BCALV_EDIT_05

U can use this method

'GET_CELL_VALUE'

to fetch the value of aparticular cell.

Regards

Anversha