2013 Jun 26 3:46 PM
Hi experts
I have a program in ABAP with many screens that
one of the screens is my main screen.it means i call other
screens from that screen.
now i want to start this program(or actuly the tcode)
in new session.
suppose my main screen is 0200 and there is other screen 0300
and I assigned tcode zt100 to program.
I want to open zt100 in new session
if user click on one button in screen 0300.
please help me how can do it.
regards ,
Reza Rostami
2013 Jun 26 5:44 PM
Hi Reza,
Use FM: ABAP4_CALL_TRANSACTION
with Addition STARTING NEW TASK and DESTINATION NONE.
Sample Code:
DATA: msg_text(80) TYPE c, "Message text
itab_spa TYPE STANDARD TABLE OF rfc_spagpa,
wa_spa TYPE rfc_spagpa.
* Fill out parameters
wa_spa-parid = 'AUN'.
wa_spa-parval = '0006012345'.
APPEND wa_spa TO itab_spa.
* Create a new session
* Asynchronous call to Transaction VA03 -->
CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'SORD'
DESTINATION 'NONE'
EXPORTING
tcode = 'VA03'
skip_screen = 'X'
TABLES
spagpa_tab = itab_spa
EXCEPTIONS
communication_failure = 1 MESSAGE msg_text
system_failure = 2 MESSAGE msg_text.
IF sy-subrc NE 0.
WRITE: msg_text.
ELSE.
WRITE: 'SCN.SAP.COM'.
ENDIF.
Regards,
Anil.
2013 Jun 26 3:55 PM
try using FM:"ABAP4_CALL_TRANSACTION". Please refer to following links:
https://scn.sap.com/thread/584508
https://scn.sap.com/thread/23574
Regards
2013 Jun 26 4:02 PM
Hi
using this function i can call for example MM01 from my program but as i said i need to call tcode z100 while i am i this tcode.it means calling a tcode from one of its screens.
reza
2013 Jun 26 4:32 PM
Hi reza,
Use:-
CALL FUNCTION ABAP4_CALL_TRANSACTION STARTING NEW TASK
EXPORTING
tcode = ' '.
You can check this function module in detail.
2013 Jun 26 5:44 PM
Hi Reza,
Use FM: ABAP4_CALL_TRANSACTION
with Addition STARTING NEW TASK and DESTINATION NONE.
Sample Code:
DATA: msg_text(80) TYPE c, "Message text
itab_spa TYPE STANDARD TABLE OF rfc_spagpa,
wa_spa TYPE rfc_spagpa.
* Fill out parameters
wa_spa-parid = 'AUN'.
wa_spa-parval = '0006012345'.
APPEND wa_spa TO itab_spa.
* Create a new session
* Asynchronous call to Transaction VA03 -->
CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'SORD'
DESTINATION 'NONE'
EXPORTING
tcode = 'VA03'
skip_screen = 'X'
TABLES
spagpa_tab = itab_spa
EXCEPTIONS
communication_failure = 1 MESSAGE msg_text
system_failure = 2 MESSAGE msg_text.
IF sy-subrc NE 0.
WRITE: msg_text.
ELSE.
WRITE: 'SCN.SAP.COM'.
ENDIF.
Regards,
Anil.
2013 Jun 28 1:12 PM
Hi experts
Thank you all. my problem was solved.
but let me say that as I understood this FM works properly if the start screen of TCODE is a dialog
screen(not a selection screen)
REZA ROSTAMI