Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

c-functions in SAP

sridhar_meesala
Active Contributor
0 Kudos

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.

1 ACCEPTED SOLUTION

SuhaSaha
Advisor
Advisor
0 Kudos

Check the functions TH_SAP_LOGIN & TH_REMOTE_TRANSACTION.

I think TH_SAP_LOGIN should solve your requirement.

4 REPLIES 4

SuhaSaha
Advisor
Advisor
0 Kudos

Check the functions TH_SAP_LOGIN & TH_REMOTE_TRANSACTION.

I think TH_SAP_LOGIN should solve your requirement.

0 Kudos

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.

0 Kudos

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

0 Kudos

Problem solved.

Used FM 'TH_CREATE_FOREIGN_MODE'.

Thanks

Sri.

Edited by: Sri on May 4, 2011 12:47 PM