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: 

ALV -- Handling hotspot

Former Member
0 Kudos

Hi,

In ALV If the user clicks on a column say Purchase order

It must take him to the respective transaction(ME23N).

I have defined the hotspot on EBELN and written for the corresponding OKcode("&IC1") in user command subroutine.

The problem here is when i click that Purchase Order ,I am not getting to that transaction ,Instead It is displaying a pop up window "Detail:Display"(of that row).

At user command of a standard pgm is getting executed and displaying that pop up window.

I dont know why it is executing the STD pgm..

Plz guide me regarding this..

Thanks

Albert

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hai,

Refer to the folowing link.

Regards,

Umasankar

7 REPLIES 7

Former Member
0 Kudos

Hi Albert,

TO make hotspot, enable that in the fieldcatalog as

if w_fieldcat-fieldname = 'EBELN'

w_fieldcat-hotspot = 'X'.

endif.

APPEND w_fieldcat TO i_fieldcat.

CLEAR w_fieldcat.

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

read table i_output into w_output index rs_selfield-tabindex.

lv_ebeln = w_output-ebeln.

SET PARAMETER ID 'EBE' FIELD lv_ebeln.

CASE sy-ucomm.

when '&IC1'.

CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN .

Clear: lv_ebeln.

ENDFORM.

Former Member
0 Kudos

TRY THIS EXAMPLE:

....

....

it_evt-name = 'USER_COMMAND'.

it_evt-form = 'PROCESS_USER_COMMAND'.

...

.....

FORM process_user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

CLEAR ist_strv1.

CASE r_ucomm.

WHEN '&IC1'.

IF rs_selfield-tabname = 'IST_STRV1'.

IF rs_selfield-tabindex > 0.

READ TABLE ist_strv1 INDEX rs_selfield-tabindex.

SET PARAMETER ID 'AN1' FIELD ist_strv1-anln1.

SET PARAMETER ID 'AN2' FIELD ist_strv1-anln2.

SET PARAMETER ID 'BUK' FIELD ist_strv1-bukrs.

CALL TRANSACTION 'AS03' AND SKIP FIRST SCREEN.

ENDIF.

ENDIF.

ENDCASE.

ENDFORM.

0 Kudos

Thanks for the response guys.

Defining hotspot and handling the okcode is fine.

But the problem is when i click on that hotspot,The control is never coming to my pgm(even in debug mode).

It is executing the std pgm SAPLKKBL(inc->LKKBLF00),In other words it is displaying secondary list of that row and not calling the transaction.

0 Kudos

Hi Albert,

If possible please send your code.I just want to go through it.

0 Kudos

Mukesh,

plz go thru this snippet.

...

...

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = REPNAME

I_STRUCTURE_NAME = 'IT_TAB'

IS_LAYOUT = LAYOUT

IT_FIELDCAT = FIELDTAB

I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

I_DEFAULT = 'A'

I_SAVE = G_SAVE

IS_VARIANT = G_VARIANT

IT_EVENTS = EVENTS[]

TABLES

T_OUTTAB = IT_TAB.

....

....

FORM SET_PF_STATUS USING RT_EXTAB TYPE SLIS_T_EXTAB .

SET PF-STATUS 'STANDARD'.

ENDFORM.

...

...

FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE SLIS_SELFIELD.

DATA w_tab LIKE it_tab.

IF R_UCOMM EQ '&IC1'.

READ TABLE it_tab INTO w_tab INDEX RS_SELFIELD-TABINDEX .

IF RS_SELFIELD-FIELDNAME EQ 'EBELN'.

SET PARAMETER ID 'BES' FIELD W_TAB-EBELN.

CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.

ENDIF.

ENDIF.

endform.

...

...

when i click on the hotspot,the control is never coming to my pgm, inturn not calling the transaction.

Former Member
0 Kudos

Hai,

Refer to the folowing link.

Regards,

Umasankar

Former Member
0 Kudos

Hi

Have u modified your event table to have form name corrseponding to your user_command instead of std prg user_command??

Thanks