‎2004 Mar 11 7:24 AM
I need to call a transaction in a new session when ever a user clicks a customer in basic list.so could any one tell me how to create a new session(external session).i have tried to see the code that is written by SAP to create a new session, but i could'nt find that button in gui status of any screen in SAP and even there is no code in PAI.so could any one tell me how to do that or else please tell me how to see where the code is written for that.
hope to see some replies on this..
bye
yogi raj
‎2004 Mar 11 10:50 AM
use function module SAPGUI_SET_FUNCTIONCODE
i.e.
CALL FUNCTION 'SAPGUI_SET_FUNCTIONCODE'
EXPORTING
FUNCTIONCODE = '/OSE80'
EXCEPTIONS
FUNCTION_NOT_SUPPORTED = 1
OTHERS = 2
.
‎2004 Mar 11 1:55 PM
You could also call function module ABAP4_CALL_TRANSACTION with the addtion <i>STARTING NEW TASK</i>. When using this function though it's also probably a good idea to check how many sessions the user already has running (use function TH_USER_INFO) and you may need to determine which application server the user is logged on to and set this as well.
Hope this helps....
Rich
‎2004 May 26 11:24 AM
Or you can create a Z_CALL_TRANSACTION function and use STARTING NEW TASK addition. ABAP4_CALL_TRANSACTION will not allow you to skip the first screen and fill the batch input data table in release 4.70.. If you need you can use the source code below: (Simple but it works)
function z_call_transaction.
*"----
""Local interface:
*" IMPORTING
*" VALUE(TRANSACTION_CODE) LIKE SY-TCODE
*" VALUE(I_MODE) LIKE DATATYPE-CHAR0001 DEFAULT 'N'
*" VALUE(I_UPDATE) LIKE DATATYPE-CHAR0001 DEFAULT 'S'
*" EXPORTING
*" VALUE(E_SUBRC) LIKE SY-SUBRC
*" TABLES
*" TBDCDATA STRUCTURE BDCDATA
*" TBDCLOG STRUCTURE BDCMSGCOLL OPTIONAL
*"----
if tbdclog is requested.
call transaction transaction_code using tbdcdata mode i_mode
update i_update
messages into tbdclog.
else.
call transaction transaction_code using tbdcdata mode i_mode
update i_update.
endif.
e_subrc = sy-subrc.
endfunction.