09-11-2009 5:33 PM
Hi All
I am displaying ALV report.
I want to make it interactive. After clicking on REFBN (COBK-REFBN) it should open FB03 transaction.
I am using followng code:
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
I_STRUCTURE_NAME =
IS_LAYOUT =
IT_FIELDCAT = it_fieldcat
TABLES
T_OUTTAB = it_final
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 F_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
READ TABLE it_final INDEX rs_selfield-tabindex INTO wa_final.
CASE F_UCOMM.
WHEN '&IC1'.
IF wa_final-refbn is not initial.
SET PARAMETER ID 'BLR' FIELD wa_final-REFBN.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ENDCASE.
ENDFORM.
This code is not working. When I am double clicking on the REFBN field in my report nothing is happening.
Please help.
Thanks & Regards
Deepti
09-11-2009 5:38 PM
Hi,
Uncomment I_CALLBACK_PROGRAM and pass SY-REPID.
put a break point in USER_COMMAND subroutine and debug the code
Regards
Krishna
09-11-2009 5:39 PM
Hi,
Uncomment the following line:
i_callback_program = sy-repid
Regards,
Subramanian
09-11-2009 6:28 PM
Hello,
Try the below code
" while building the field catalog set the field HOPSPOT for the field REFBN
data: w_repid type syrepid.
w_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = it_fieldcat
TABLES
t_outtab = it_final
EXCEPTIONS
program_error = 1
others = 2.
IF SY-SUBRC = 0.
ENDIF.
FORM user_command USING f_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE f_ucomm.
WHEN '&IC1'.
IF rs_selfield-value IS NOT INITIAL.
SET PARAMETER ID 'BLR' FIELD rs_selfield-value.
CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
Hope this helps you.
Regards,
Sachinkumar Mehta
09-11-2009 6:55 PM
Don't use SY-REPID directly. Instead declare a constant of type sy-repid and set its value to your main program name and use it in the call function.
09-11-2009 11:38 PM
1. Use a variable for sy-repid.
data:gv_repid type sy-repid.
v_repid = sy-repid.
i_callback_program = v_repid
2. I think the parameter id is 'BLN' not 'BLR' not sure if this was a typo error.
09-14-2009 6:48 AM
Hi Deepti,
at first uncomment the I_CALLBACK_PROGRAM .
Don't pass sy-repid directly to this parameter.
you decleare one variable & then pass sy-repid to it.
For interactive events in alv , you have to use this parameter.
code like:
data: w_repid type sy-repid.
Initialization.
w_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = w_repid.
Hope this can solve your problems.
Regards,
Tutun