How To Activate Another TCode
From ALV
How to trigger another t-code from ALV report? For example, I have an inventory report and want to check the transaction details in MMBE by clicking on that material no in the ALV report. This is done through a interactive report in normal reporting but in Alv' s this is a object oriented.abap programming by using class cl_gui_grid as a container for data to be displayed in a grid and and to call a transaction write 'call transaction <tcode>' in implementation of class.and for clicking purpose event handler should be used. This is a method for writing: First create a module pool program and later this is the code. ********************
public section.
class lcl_event_handler implementation.
call transaction 'me23n'
create object o_container.
call method o_grid ->set_table_for_first_display
data o_handler type ref to lcl_event_handler.
------------- Another method: *&--------------------------------------------------------------------*
FORM user_command USING ucomm LIKE sy-ucomm
CASE ucomm. WHEN '&IC1'. "Double click on selected line READ TABLE i_final INTO w_final INDEX selfield-tabindex. --------------------------->Internal table u r displaying in ALV CHECK sy-subrc EQ 0. SET PARAMETER ID 'AUN' FIELD w_final-vbeln. -----------------------------------------> give the parameter Id of the field u r double clicking CALL TRANSACTION 'MMBE' AND SKIP FIRST SCREEN. CLEAR w_final. ENDCASE. ENDFORM. "user_command ------->Call the above subroutine in the below function CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' EXPORTING * I_INTERFACE_CHECK
= ' '
i_callback_program = program * I_CALLBACK_PF_STATUS_SET = ' ' i_callback_user_command = 'USER_COMMAND' --------------------------> the above subroutine should be called here
See Also:
Tables
ABAP Books List
Smart Forms
ABAP Menu:
Return to Index:-
(c) www.gotothings.com All material on this site is Copyright.
|