‎2006 Oct 10 11:09 AM
Hi
I have a list displaying using ALV grid.I need to call Standard Transaction transaction when I select Mateial.
another requirement is needs to add button to call antoher transaction which will take material from selection screen.
Please Help me
Alekhya
‎2006 Oct 10 11:12 AM
Check the program given in the link:
http://www.sap-img.com/abap/alv-grid.htm
In the user command get the Sy-ucomm and from selfield get the index ( selfield-tabindex )in which the user clicked and read that line from final internal table, then call the transaction using that material.
Regards,
PRakash.
‎2006 Oct 10 11:18 AM
hi,
I need to call Standard Transaction transaction when I select Mateial.
form user_command using r_ucomm like sy-ucomm
rs_selfield type slis_selfield.
case r_ucomm.
when '&IC1'.
set parameter id 'AUN' field rs_selfield-value.
call transaction 'VA03' and skip first screen.
endcase.
endform. "USER_COMMAND
hope this helps,
do reward if it helps,
priya.
‎2006 Oct 10 11:43 AM
Thanks Priya,
One more doubt, Do I need to call this perform under At line selection?
Since I am using ALV grid
‎2006 Oct 10 11:46 AM
USe the below FM to call the USER_COMMAND
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = lws_repid
i_callback_user_command = 'USER_COMMAND'.
&----
*& Form user_command
&----
Handle User Command
----
FORM user_command USING ws_ucomm LIKE sy-ucomm
selfield TYPE slis_selfield.
CASE ws_ucomm.
WHEN '&IC1'.
CASE selfield-tabname.
WHEN text-091.
ENDCASE.
ENDCASE.
Regrads,
Prakash.
ENDFORM. "user_command
‎2006 Oct 10 11:50 AM
hi,
u can catch the user command like this.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE'
I_callback_user_command = 'USER_COMMAND' "see FORM
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
tables
t_outtab = it_ekko
exceptions
program_error = 1
others = 2.
----
FORM USER_COMMAND *
----
--> R_UCOMM *
--> RS_SELFIELD *
----
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
Check function code
CASE r_ucomm.
WHEN '&IC1'.
Check field clicked on within ALVgrid report
IF rs_selfield-fieldname = 'EBELN'.
Read data table, using index of row user clicked on
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
Set parameter ID for transaction screen field
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
Sxecute transaction ME23N, and skip initial data entry screen
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
ENDCASE.
ENDFORM.
rgds
anver
if hlped mark points