05-04-2011 5:13 AM
Hi All,
I have a requirement to invoke a tcode in some other system when a program is run in my system. To be more clear,
I would like to write a program and when I execute it in my system i.e with user id abc, then a statement in the program should run a tcode in some other users system logged into SAP.
The requirement is similar to th_popup FM where it sends a popup message to the user specified. In the same way when I specify a user name that should run a tcode in which ever system the user is logged in.
So I would like to know if we can write some FM like the c-functions that would send a popup to the user and on clicking the ok button the tcode is run.
But I have found that c-functions are maintained in internal system tables so can we create any such FMs or is there any other way.
Please provide some hints on this.
Thanks,
Sri.
05-04-2011 6:33 AM
Check the functions TH_SAP_LOGIN & TH_REMOTE_TRANSACTION.
I think TH_SAP_LOGIN should solve your requirement.
05-04-2011 6:33 AM
Check the functions TH_SAP_LOGIN & TH_REMOTE_TRANSACTION.
I think TH_SAP_LOGIN should solve your requirement.
05-04-2011 7:28 AM
Hi Suhas,
Thanks for the inputs.
I have tried TH_SAP_LOGIN FM stand alone and gave TCODE = zabc and USER_KEY = <USERID>.
But that transaction is not being run in the system where that uses is logged in, instead it's run in my system.
Thanks,
Sri.
05-04-2011 8:03 AM
You have to call those FM using the RFC interface. ([CALL FUNCTION - RFC|http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_DESTINATION-.htm], [RFC Destination|http://help.sap.com/abapdocu_70/en/ABENRFC_DESTINATION.htm])
Regards,
Raymond
05-04-2011 8:17 AM
Problem solved.
Used FM 'TH_CREATE_FOREIGN_MODE'.
Thanks
Sri.
Edited by: Sri on May 4, 2011 12:47 PM