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: 

Problem calling VBSscript

former_member736811
Discoverer
0 Kudos

Hi,

I have a problem calling an external command via CALL FUNCTION 'SXPG_CALL_SYSTEM'.

the command I execute is a visual basic script that opens an html file and exports it as a microsoft word file.
The same script, if executed directly from the server (command line) using the same SAP user (SAPserviceSID) is executed correctly.

Therefore the authorization permission problems are already solved.

Below the log of the function:

The script runs but crashes on the Documents.OPEN statement. Below the instruction (row 42):

would anyone be able to give me suggestions to solve the problem?

Regards,

Davide

5 REPLIES 5

Sandra_Rossi
Active Contributor
0 Kudos

Are you telling us that you have MS Word installed on the server?

former_member736811
Discoverer

yes, microsoft office is reg. installed on the server. As I said before, if I run the script.vbs from command promt, the script works fine. Only if I run it from SAP (abap or .... test script via SM69) it doesn't work.

Regs.,

Davide

Sandra_Rossi
Active Contributor
0 Kudos

Did you make sure there is only one application server?

Are you sure you are passing the parameters correctly? Did you pass quotes around Word file parameter in case it contains spaces (see note 1152084 - Parameter for external commands)

Did you test with a very simple VBS file without any parameter/variable, do you create a Word document?

former_member736811
Discoverer
0 Kudos

below all the tests I did:

- created simple script and executed correctly
- verified that the parameters are correctly executed with quotation marks
- the same script, if executed hardcoded on SAP, goes in error. via Promt command works correctly

Server side, the only behavior I see is that WINWORD.EXE appears in the task management ...... but it stays in "running" state .... without doing anything.

Line 43 is the one that does not execute correctly .... it goes into error .. and I don't know what to do anymore.

former_member736811
Discoverer
0 Kudos

another useful information. On another project | Client, the same ABAP tool calling the same script .... run correctly.