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: 

Linking of hotspot in ALV to a program

Former Member
0 Kudos

Hi All...

How can i Navigate to a program from a field of ALV list,

on which Hotspot in selected??

it_t-col_pos = '2'.

it_t-fieldname = 'PROGNAME'.

*IT_T-ref_fieldname = 'P_CODE'.

*IT_T-ref_tabname = 'I_ALL'.

it_t-seltext_m = 'Program Name'.

it_t-hotspot = 'X'.

APPEND it_t.

CLEAR IT_T.

My aim is to naviagte to a program on whcih hotspot is selected..

Thanks in Advance..

Puneet Chopra

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

with the help of user_command it is possible.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
  EXPORTING
    i_callback_program       = sy-repid
    is_layout                = l_layout
    i_callback_user_command  = 'USER_COMMAND' "<--This is must
    it_fieldcat              = it_fieldcat
  TABLES
    t_outtab                 = itab
  EXCEPTIONS
    program_error            = 1
    OTHERS                   = 2.
IF sy-subrc NE 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.

case r_ucomm.
when '&IC1'.
"using the set parameter and call the transaction
 or
"using the record values and SUBMIT and go to another program
SUBMIT SUBMITTABLE with parameter = rs_selfield-value
 and RETURN.

endcase.
  rs_selfield-refresh = 'X'.
  BREAK-POINT.

ENDFORM. "USER_COMMAND

6 REPLIES 6

former_member598013
Active Contributor
0 Kudos

Hi Puneet,

use the user-command event and inside this user command

do one thing.

SET PARAMETER ID " PARAMETER ID".

CALL TRANSACTION <TCODE> .

This will resolve your problem

Thanks,

Chidanand

Former Member
0 Kudos

Hi ,

FORM user_command1 USING v_ucomm

rs_selfield .

CASE v_ucomm.

WHEN '&IC1'.

CALL TRANSACTION 'ZIN01' AND SKIP FIRST SCREEN.

or

submit program <prog name>

In the prog name pass the rs_selfield-value.

ENDCASE.

Edited by: A kumar on Aug 11, 2008 1:50 PM

Former Member
0 Kudos

i have list of programs... and i want to navigate when ever i click on any program name.

regards

SuhaSaha
Advisor
Advisor
0 Kudos

Hello Puneet,

If your are using the FM 'REUSE_ALV_GRID_DISPLAY', there is a parameter 'i_callback_user_command'. You pass the name of the sub-routine for user-command here.

In the user comman routine (f_user_command) try this bit of code:


FORM f_user_command  USING   fp_v_ucomm   TYPE syucomm
                             fp_selfield  TYPE slis_selfield.

  CASE fp_v_ucomm.
    WHEN '&IC1'. "U-Comm for Double Click
      READ TABLE IT_ALV INDEX fp_selfield-tabindex. "IT_ALV - Table for ALV Display
      IF SY-SUBRC = 0.
        SET PARAMETER ID 'RID' FIELD IT_ALV-REPID. "Program Name
        CALL TRANSACTION 'SE38'.
      ENDIF.
  ENDCASE.
ENDFORM.

Hope it is clear to u.

BR,

Suhas

former_member188685
Active Contributor
0 Kudos

with the help of user_command it is possible.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
  EXPORTING
    i_callback_program       = sy-repid
    is_layout                = l_layout
    i_callback_user_command  = 'USER_COMMAND' "<--This is must
    it_fieldcat              = it_fieldcat
  TABLES
    t_outtab                 = itab
  EXCEPTIONS
    program_error            = 1
    OTHERS                   = 2.
IF sy-subrc NE 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.

case r_ucomm.
when '&IC1'.
"using the set parameter and call the transaction
 or
"using the record values and SUBMIT and go to another program
SUBMIT SUBMITTABLE with parameter = rs_selfield-value
 and RETURN.

endcase.
  rs_selfield-refresh = 'X'.
  BREAK-POINT.

ENDFORM. "USER_COMMAND

Former Member
0 Kudos

Hi,

First check the data element for the field you want to use hotspot. go to se11.

enter the data element. Go with display, you will find Parameter Id, Use this parameter ID and follow the above posts for logic.

Regards,

Santosh Kumar M.