cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

sapshcut: Command line and JavaScript

0 Likes
2,861

Hi everybody,

I'm trying to open a SAPGUI window out of a widget.

Therefore I use sapshcut.

My command line statement is something like this:

start sapshcut.exe -snc_name="p:CN=ISX, O=SAP-AG, C=DE" -sid=ISX -command="*ZDM_WIDGET P_INPUT=915CBF7FD8828F4DAD581B66CA887D3D;" -type=Transaction -max

It works fine so.

But when I want to use the

runCommand

function from JavaScript I get an error popup saying:

Microsoft Visual C++ Library

Buffer overrun detected!

Program C:\Program ...\sapgui.exe

A buffer overrun has been detected which has corrupted the program's internal state.

The program cannot safely continue execution and must now be terminated.

I tried several variants...

var sapgui = "start sapshcut.exe -snc_name="p:CN=ISX, O=SAP-AG, C=DE" -sid=ISX -command="ZDM_WIDGET P_INPUT=915CBF7FD8828F4DAD581B66CA887D3D;" -type=Transaction -max";
runCommand("cmd /C " + sapgui);

and also

runCommand('cmd /C start sapshcut.exe -snc_name="p:CN=ISX, O=SAP-AG, C=DE" -sid=ISX -command="*ZDM_WIDGET P_INPUT=915CBF7FD8828F4DAD581B66CA887D3D;" -type=Transaction -max');

Does anyone have an idea what causes this error or even how I can avoid it?

I get the same error when I insert a wrong parameter in the command line in windows.

But it also works if I just call the transaction like this.

runCommand('cmd /C start sapshcut.exe -snc_name="p:CN=ISX, O=SAP-AG, C=DE" -sid=ISX -command="*ZDM_WIDGET" -type=Transaction -max');

So the problem must lay in the parameter...

Best regards

Tobias

View Entire Topic
0 Likes

I finally fixed the issue.

This one works without any error.


var sapgui = 'C:\Program Files\SAP\FrontEnd\SAPgui\sapshcut.exe -snc_name="p:CN=ISX, O=SAP-AG, C=DE" -sid=ISX -command="*ZDM_WIDGET P_INPUT=915CBF7FD8828F4DAD581B66CA887D3D;" -type=Transaction -max';
	
var shell = COM.createObject("WScript.Shell");
shell.Exec(sapgui);