Call a transaction in New Session from ALV Hotspot.
We can use FM ABAP4_CALL_TRANSACTION for this. But from SCN, I found an excellent way to do so.
Create a Remote enable function module:
ZFM_CALL_TCODE_IN_NEW_WINDOW :
-----------------------------------------------------
function zfm_call_tcode_in_new_window.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(TCODE) TYPE SY-TCODE
*" VALUE(VBELN) TYPE VBELN
*" VALUE(PARAID) TYPE MEMORYID
*"----------------------------------------------------------------------
set parameter id paraid field vbeln.
call transaction tcode and skip first screen.
endfunction.
---------------------------------------------------------------
Call the FM from the program:
You have to use the following code segment in program to call that Function Module ,
-------------------------------------------------
lv_tcode = 'VA43'. "Tcode to Call
lv_vbeln = gs_out-vbeln.
lv_paraid = 'KTN'.
call function 'ZFM_CALL_TCODE_IN_NEW_WINDOW' starting new task 'TEST'
destination 'NONE'
exporting
tcode = lv_tcode
vbeln = lv_vbeln
paraid = lv_paraid
.
------------------------------------------------
*Ref: https://wiki.scn.sap.com/wiki/display/Snippets/How+to+Call+a+Transaction+in+New+Session+Window
We can use FM ABAP4_CALL_TRANSACTION for this. But from SCN, I found an excellent way to do so.
Create a Remote enable function module:
ZFM_CALL_TCODE_IN_NEW_WINDOW :
-----------------------------------------------------
function zfm_call_tcode_in_new_window.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(TCODE) TYPE SY-TCODE
*" VALUE(VBELN) TYPE VBELN
*" VALUE(PARAID) TYPE MEMORYID
*"----------------------------------------------------------------------
set parameter id paraid field vbeln.
call transaction tcode and skip first screen.
endfunction.
---------------------------------------------------------------
Call the FM from the program:
You have to use the following code segment in program to call that Function Module ,
-------------------------------------------------
lv_tcode = 'VA43'. "Tcode to Call
lv_vbeln = gs_out-vbeln.
lv_paraid = 'KTN'.
call function 'ZFM_CALL_TCODE_IN_NEW_WINDOW' starting new task 'TEST'
destination 'NONE'
exporting
tcode = lv_tcode
vbeln = lv_vbeln
paraid = lv_paraid
.
------------------------------------------------
*Ref: https://wiki.scn.sap.com/wiki/display/Snippets/How+to+Call+a+Transaction+in+New+Session+Window
No comments:
Post a Comment