Welcome To My BLOG

This site is to give a brief idea for the abap learners who are looking for some real time programs .It consists of collection of programs from my side . I hope these programs are very much used for all of the learners. Please check the links for any information in ABAP.
Please vote for my Blog. And please input me on this mail addrssess.Email me

Share this link with your friends

http://www.rebtel.com/u/15163104576

For every friend who signs up using this link and makes a payment, we'll give you 8 €!


Wednesday, September 22, 2010

How to Call a Transaction in New Session(Window)

Description :
In SAP Dialog Programming we call transactions using the CALL TRANSACTION statement but it opens up the new Tcode in the same session. Is there any option in CALL TRANSACTION Statement to open a transaction in New Session(window) No ! . But there is a way in which we can attain the same result , its by using the CALL TRANSACTION Statement inside a Remote-Enabled Function Module and then using the STARTING NEW TASK addition while calling the Function Module.
How to create a Remote-Enabled Function module
Its just the same procedure as of ordinary Function module, but in the Attributes Tab, under Processing Type you have to select Remote-Enabled Module instead of Normal Function Module.
Example :
ZFM_CALL_TCODE_IN_NEW_WINDOW
FUNCTION ZFM_CALL_TCODE_IN_NEW_WINDOW.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(TCODE) TYPE SY-TCODE
*" VALUE(SONO) TYPE VBELN
*"----------------------------------------------------------------------
SET PARAMETER ID 'AUN' FIELD SONO.
CALL TRANSACTION tcode AND SKIP FIRST SCREEN.
ENDFUNCTION.
So How Can i call the Function Module to Open the Transaction in New Session
You have to use the following code segment to call that Function Module , and here Sales Document 9000000012 will open for Display in a New Session(Window).
/* E_tcode = 'VA03'.
E_SONO = '9000000012'
CALL FUNCTION 'ZFM_CALL_TCODE_IN_NEW_WINDOW' STARTING NEW TASK 'TEST'
DESTINATION 'NONE'
EXPORTING
tcode = E_tcode
sono = E_SONO. */
Hope the above snippet will be useful for all.

No comments: