‎2005 Jan 21 8:58 PM
Hi,
I am looking for a way to call external programs (JAva/C++ or Visual Basic ) from a userexit. I need to pass about 10 paramaters to the called program and receive a return code from the called program.
Please help.
‎2005 Jan 21 9:23 PM
Hi Chetan,
One way to do this is to define a logical external command in SAP using transaction code SM69, assuming your external program is straight executable. Here you will enter a 'Z' command name, "Operating system" in which your external program gets executed, "Operating System command", which is your complete path and the name of the executable. Do not enter any "parameters" for the command here, but instead check the "Additional Parameters Allowed" box.
Then in your user exit, call function module 'SXPG_COMMAND_EXECUTE' passing your newly created command and the parameters(all 10 concatenated together in the sequence that the external program is expecting them to be and separated by space).
Hope this helps. Reward and close if it helped.
Srinivas
‎2005 Jan 21 9:41 PM
‎2005 Jan 21 10:12 PM
Hi Srnivas,
Thanks for your help. I created a new entry in SAP using trasaction code SM69. The name I gave is ZNOTEPAD. Gave the complete path c:winnt\notepad.exe and saved the entry. But still after running the function module 'SXPG_COMMAND_EXECUTE' it gives an error saying command not found. Can you help.
Thanks,
Regards.
‎2005 Jan 21 10:24 PM
Hi Chetan,
You cannot call some executable on your desktop without some additional configuration. This function module is RFC function module and you have to give a RFC destination. Your desktop is not accessable to RFC directly. You need to create a RFC destination pointing to your C:\WINNT\ and then use that logical RFC destination while calling the function module.
Also, if I assume that what you entered here is what you entered in SM69, then you are missing '\' between your 'c:' and 'winnt\notepad.exe'.
If you are calling notepad just to test it out, try some executable on your server environment.
Srinivas
‎2005 May 24 8:13 AM
Hi
I want to do the same thing. I have to call a function module passing a parameter in a 3rd party tool which will give me a return value. How did you recieve the return value from the external application.
‎2013 Feb 11 7:15 AM
i have same requirement now if u have solved it please help me to resolve the problem