Application Development and Automation 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: 
Read only

Calling External Java/C++ Visual Basic programs form ABAP

Former Member
0 Likes
921

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.

6 REPLIES 6
Read only

Former Member
0 Likes
817

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

Read only

0 Likes
817

Thanks. I am trying it out.

Regards.

Read only

Former Member
0 Likes
817

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.

Read only

0 Likes
817

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

Read only

Former Member
0 Likes
817

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.

Read only

0 Likes
817

i have same requirement now if u have solved it please help me to resolve the problem