Executing external commands(vbscript from network drive)
Hello All,
There is a client requirement where a certain number of steps need to be automated as a background job. The current manual process is such that first a vbscript is run, which creates a temporary folder and connects to a FTP location and pick data and dump it into this temporary folder on the network drive. Then a standard SAP program uses this file from the defined path and is executed. Then another vbscript is run, which basically archives the files to a different folder. These steps need to be automated.
Now we can use the cscript command in DOS to execute a .vbs script file. but this will not work with GUI_EXEC as this will fail in background. Will SXPG_COMMAND_EXECUTE/SXPG_CALL_SYSTEM fucntion modules work in this case ? I have not used them, so will they execute the command on the presentation server as I am guessing these work on the application server with the command created in SM69 ?
Thanks and Regards,
Sachin
hi all,
You don't have to create a System Commands in transaction SM69 to be able to execute the VBScript or other script within the program in background mode.
When calling function "WS_EXECUTE" just add the "In Background Task" at the end to execute the VBscript or other scripts.
This extra line "In backround task" should not raise the exception
CL_GUI_FRONTEND_SERVICES======CP.
it should look like this.
data: commandline(1000).
commandline = 'P:\sapfrontend.vbs'.
call function 'WS_EXECUTE' in BACKGROUND TASK
exporting
commandline = commandline
program = 'WSCRIPT.EXE'
exceptions
frontend_error = 1
no_batch = 2
prog_not_found = 3
illegal_option = 4
others = 5.
Similar Messages
-
Error 801 when executing external command on
Hello,
I have installed CCMS agents and CCMS ping in my system yesterday. And activated the CPH BGD jobs for SL reporting purpse. Now I am getting an error "Error 801 when executing external command on" under class LC 2. I am not able to find any relevant note or help for this error. Any idea why this happens? How can I solve this? The details as follows:
EXTERNAL COMMAND: rc = Error 801
SXPG_COMMAND_EXECUTE(LONG):
<timestamp>: 20100310144206
COMMANDNAME: PING
ADDITIONAL_PARAMETERS: s-sapcae
LONG_PARAMS:
OPERATINGSYSTEM: AIX
TARGETSYSTEM: sapasmc1
DESTINATION:
SY-SUBRC: 801
Regards,
RajeevHi,
I have activated the trace level to 3 and now I get some messages in dev_cp which is as follows:
Trace file of control program (trace level 3)
< Function: BtcTrcInit> Function: main SAPXPG 720
2010-03-11 08-52-09 : Before BtcXpgDetach
> Function: BtcXpgDetach < Function: BtcXpgDetach Accept RFC connection from R/3 system
2010-03-11 08-52-09 : Before RfcAccept
2010-03-11 08-52-09 : RfcAccept returned OK
Begin of check_if_security_list
security check switched OFF
End of check_if_security_list
Begin of check_trace_option
End of check_trace_option
Install RFC call SAPXPG_START_XPG
Install RFC call SAPXPG_START_XPG_LONG
Install RFC call SAPXPG_END_XPG
Wait for RFC call SAPXPG_START_XPG or SAPXPG_START_XPG_LONG
2010-03-11 08-52-09 : Before first call of RFCDispatch
Security: rfcexec_logon_check
rfcexec_logon_check: logon_user = TT4WNUC
sapxpg_logon_check: rfc_attr.user = TT4WNUC
rfcexec_logon_check: client = 100
2010-03-11 08-52-09 : After first call of RFCDispatch
2010-03-11 08-52-09 : Before call of RfcClose (sequencing error)
2010-03-11 08-52-09 : After call of RfcClose (sequencing error)
< Function: main
2010-03-11 08-52-09 : End of SAPXPG: main
I think the issue is with the user TT4WNUC. Could you please let me know from where I can change this user?
Rajeev -
Sm_SolmanSID error 503 when executing external command
Hello,
On one of my managed system (my productive ECC),
I have the following error ,everyday at 20:00,
for the user SM_SolamnSID.
"Error 503 when executing external command on (xpgid=0,convid=.)"
The role ZSAP_SOLMAN_READ has been given to this user.
Could you tell me what I should perform to avoid this problem?
Regards,Hi Benoit,
Pls refer below threads for external error of 503,
Cannot run SM69 external commands from application server
Cannot run SM69 external commands from application server,&nbsp;SM21&nbsp;|&nbsp;ABAP,&nbsp;SAP,&nbs…
Regards
K.N -
Quicktime 7.2 (and up) slow playout from network drive
Does anybody has a problem with all versions of Quicktime 7.2 (and up) where Quicktime Player doesn't play or open files very slowly from network drives? 7.1.6 works fine. This happens on all my machines.
Hey Germac,
For me these invisible files were not stored on the desktop as the files i was working with were on an external drive but i guess if the file you are converting is located there or if the desktop happens to be where the resulting file is saved, it's likely these invisible .QT temp files will be created on the desktop.
I've sent info of this to apples quicktime feedback so hopefully they'll look into it.
Here are some apps that will allow you to view invisible files without using the terminal, i've been using the InvibliX app as it seemed to be the most recent and/or up to date but there are plenty to choose from.
http://www.macupdate.com/search.php?arch=intel&keywords=invisible&os=macosx -
LC 2 Error 1003 when executing external command brconnect on (xpgid=0,con
Dear all,
I am getting error in sm21.Please suggest .
Details Page 2 Line 23 System Log: Local Analysis of clusa 1
Time Type Nr Clt User TCode Grp N Text
10:00:32 DIA 000 600 DDIC LC 2 Error 1003 when executing external command brconnect on (xpgid=0,convid=.)
Error 1003 when executing external command brconnect on (xpgid=0,convid=.)
Details
Recording at local and central time........................ 10.05.2010 10:00:32
Task...... Process User...... Terminal Session TCode Program Cl Problem cl Package
06952 Dialog work process No. 000 DDIC 1 SAPMSSY1 S Operation Trace SBTC
No documentation for syslog message LC 2 exists
Parameter
1 .... xpgid=0,convid=.
Technical details
File Offset RecFm System log Grp N variable message data
224 260640 LC 2 brconnect & &Error 1003 & & &
Regards,
KumarDear Juan,
Please find the logs.Please suggest.
dev_cp log
Trace file of control program (trace level 3)
< Function: BtcTrcInit> Function: main SAPXPG 720
2010-05-10--09-33-29 : Before BtcXpgDetach
> Function: BtcXpgDetach < Function: BtcXpgDetach Accept RFC connection from R/3 system
2010-05-10--09-33-29 : Before RfcAccept
2010-05-10--09-33-29 : RfcAccept returned OK
Begin of check_if_security_list
security check switched OFF
End of check_if_security_list
Begin of check_trace_option
End of check_trace_option
Install RFC call SAPXPG_START_XPG
Install RFC call SAPXPG_START_XPG_LONG
Install RFC call SAPXPG_END_XPG
Wait for RFC call SAPXPG_START_XPG or SAPXPG_START_XPG_LONG
2010-05-10--09-33-29 : Before first call of RFCDispatch
Security: rfcexec_logon_check
rfcexec_logon_check: logon_user =
sapxpg_logon_check: rfc_attr.user = BASIS
rfcexec_logon_check: client =
> Function: BtcXpgStartXpgLong
2010-05-10--09-33-29 : Beginning of BtcXpgStartXpgLong
> Function: BtcXpgStartXpgImportLong > Function: BtcXpgParam < Function: BtcXpgParam > Function: BtcXpgParam < Function: BtcXpgParam > Function: BtcXpgParam < Function: BtcXpgParam > Function: BtcXpgParam < Function: BtcXpgParam > Function: BtcXpgParam < Function: BtcXpgParam > Function: BtcXpgParam < Function: BtcXpgParam > Function: BtcXpgParam < Function: BtcXpgParam > Function: BtcXpgParam < Function: BtcXpgParam > Function: BtcXpgTable < Function: BtcXpgTable < Function: BtcXpgStartXpgImportLong
BtcXpgStartXpgLong: special_trace_flag = <6>
> Function: BtcXpgStartXpgInt > Function: BtcXpgItTransfer Content of source log table:
Line Text
<No StdOut/StdErr output reported>
Target log table is not identical to source
ItGetLine terminated with NULL
< Function: BtcXpgItTransfer > Function: BtcTrcReset < Function: BtcTrcReset Call mode: VIA RFC
Input arguments of BtcXpgStartXpg:
External program: brtools
tracecntl = : 6
Display of Parameter string switched off !!
Contents of control flags:
StdIn control flag: redirect StdIn
StdOut control flag: store StdOut output in memory
StdErr control flag: store StdErr output in memory
Trace control flag: unknown contents
Termination control flag: control program will wait for termination
> Function: BtcXpgCheck > Function: BtcXpgArgv
parameter number 1:
parameter number 2:
parameter number 3:
parameter number 4:
parameter number 5:
parameter number 6:
parameter number 7:
Total number of arguments scanned: 7
Argument argv[0]: brtools
< Function: BtcXpgArgv < Function: BtcXpgCheck > Function: BtcXpgSigInst < Function: BtcXpgSigInst > Function: BtcXpgStart Rearrange stderr to be collected in memory
Rearrange stdout to be collected in memory
Redirect stdin, read from NUL:
> Function: BtcTrcInit< Function: BtcXpgStartStart status of external program: external program successfully started
Id of external process: 0000005296
StdOut/StdErr collected in memory
Line Text
<No StdOut/StdErr output reported>
< Function: BtcXpgStartXpgInt> Function: BtcXpgStartXpgExport > Function: BtcXpgParam < Function: BtcXpgParam > Function: BtcXpgParam < Function: BtcXpgParam > Function: BtcXpgParam < Function: BtcXpgParam< Function: BtcXpgStartXpgExport
2010-05-10--09-33-29 : End of BtcXpgStartXpgLong
< Function: BtcXpgStartXpgLong
2010-05-10--09-33-29 : After first call of RFCDispatch
Wait for RFC call SAPXPG_END_XPG
2010-05-10--09-33-29 : Before second call of RFCDispatch
Security: rfcexec_logon_check
rfcexec_logon_check: logon_user =
sapxpg_logon_check: rfc_attr.user = BASIS
rfcexec_logon_check: client =
> Function: BtcXpgEndXpg
2010-05-10--09-33-29 : Beginning of BtcXpgEndXpg
> Function: BtcXpgStartXpgExport > Function: BtcXpgTable < Function: BtcXpgTable < Function: BtcXpgEndXpgImport > Function: BtcXpgEndXpgInt > Function: BtcXpgItTransfer Content of source log table:
Line Text
<No StdOut/StdErr output reported>
Target log table is not identical to source
ItGetLine terminated with NULL
< Function: BtcXpgItTransfer > Function: BtcXpgReadChild Output of external command not written to log !!
Process executing external program has terminated
< Function: BtcXpgReadChild > Function: BtcXpgEnd < Function: BtcXpgEnd Termination status of external program: no errors reported
StdOut/StdErr collected in memory
< Function: BtcXpgEndXpgInt > Function: BtcXpgEndXpgExport > Function: BtcXpgParam < Function: BtcXpgParam > Function: BtcXpgParam < Function: BtcXpgParam < Function: BtcXpgEndXpgExport
2010-05-10--09-33-30 : End of BtcXpgEndXpg
< Function: BtcXpgEndXpg
2010-05-10--09-33-30 : After second call of RFCDispatch
2010-05-10--09-33-30 : After call of RfcClose (wait)
< Function: main
2010-05-10--09-33-30 : End of SAPXPG: main
dev_xpg
Trace file of External Program (trace level 3)
< Function: BtcTrcInit> Function: BtcXpgStart External program: brtools -sid prd -F printout alert_log 20100401000000 0128
Regards,
Kumar -
How to execute unix command line from cocoa?
how to execute unix command line from cocoa?
for example, if I want to call "ping" from cocoa, how should I do it? and how can I obtain the return value?
thank you.
Power G5 Quad Mac OS X (10.4.3)The following article may also help:
http://cocoadevcentral.com/articles/000025.php
Mihalis.
Dual G5 @ 2GHz Mac OS X (10.4.6) -
How to execute Dos Command 'Pause' from Java ?
How to execute Dos Command 'Pause' from Java ?
I have read the article in javaworld for Runtime.exec() anomalies.
Can someone please give an insight on this?Thanks Buddy!
That was very useful. Even though its a simple
solution, I never thought about that.Bullshit! Reread reply #7 of http://forum.java.sun.com/thread.jspa?threadID=780193 -
Executing external command and program in background
Hi,
how to execute external command and external program in background.
please provide me some tips on the same.
while creating external command, what is the significance of "operating system command" and "parameters for operating system command".
Thanks,
Dinesh.Hi,
You can define external commands using transaction code SM69.
External commands are commands which would be executed at your operating
system with or without parameters.
Operating system commands are those which you execute at OS level like
mkdir, cat, rm, cp, ls
Parameters are options that you add to os commands to get more functionalities.
like, < ls -l > : will give you a long listing of files where " l " is the parameter
< ls -lt > : will give you a long listing with last changed file at top where " lt " is the parameter.
You can mention these in SM69 when you define the external commands.
Now, in order to execute these in your background job. In the steps click on "external command" and give your command name in SM36 while creating your job.
" Points for solution ".
Thanks and Regards,
Sandeep. -
Error 801 when executing external command
Dear all,
One of our PRODcution system (PI) system getting lot of below error in SM21.
00:07:17 sappip_PIP_03 BTC 038 400 BASIS LC 2 Error 801 when executing external command on (xpgid=0,convid=.)
00:07:17 sappip_PIP_03 BTC 038 400 BASIS LC 2 Error 801 when executing external command on (xpgid=0,convid=.)
00:07:17 sappip_PIP_03 BTC 038 400 BASIS LC 2 Error 801 when executing external command on (xpgid=0,convid=.)
00:07:17 sappip_PIP_03 BTC 038 400 BASIS LC 2 Error 801 when executing external command on (xpgid=0,convid=.)
00:07:17 sappip_PIP_03 BTC 038 400 BASIS LC 2 Error 801 when executing external command on (xpgid=0,convid=.)
00:07:17 sappip_PIP_03 BTC 038 400 BASIS LC 2 Error 801 when executing external command on (xpgid=0,convid=.)
00:07:17 sappip_PIP_03 BTC 038 400 BASIS LC 2 Error 801 when executing external command on (xpgid=0,convid=.)
00:07:17 sappip_PIP_03 BTC 038 400 BASIS LC 2 Error 801 when executing external command on (xpgid=0,convid=.)
00:07:17 sappip_PIP_03 BTC 038 400 BASIS LC 2 Error 801 when executing external command on (xpgid=0,convid=.)
OS : HP-UX , DB : Oracle and sapnetweaver2004s
Kindly advise and let me know what should i check SM49 ?
Thanks
Edited by: satheesh0812 on Aug 18, 2011 4:37 PMHi,
Perhaps the steps and solution in this thread could help.:
Error 801 when executing external command on
Regards,
Srikishan -
Error1006 when executing external command mv ...
This error concerns one of the several daily batch most critical. It was not detected before because even if there is an error the program won't never fail (we will review for sure this program).
The error appears at the call of an external command ZRENAME that corresponds to the OS command "mv" to rename a physical file on directory /interface.
This error seems corresponds to a timeout when the SAP system tries to call the mv command on the OS level ...
ERROR:
Time Type Nr Clt User TCode Priority Grp N Text
12:00:51 BTC 034 120 BUSER_HK20 LC 2 *Error1006 when executing external command mv on %_TCPIP_%1 (in=R,out=M,err=M,trc=0,trm=C. strtstat=,xpgid=0,convid=. msg:timeout during a)*
Thanks in advance for helpHello
Check note #1406178 Error 1006 occurs when you execute an external
Regards
Mark -
How to execute external command from SAP
Hi gurus,
i need to execute an external command from a Sap (rel ECC.5.0) to a server UNIX (no SAP); precisely i have to write a file into a directory in unix server.
I see transaction SM49 and Sm69 but i don't know how can i use these features.
Please coul'd you help me or give me a documentation.
Thank's in advance
Maurizio Ortolani
email. [email protected]Hi Maurizio,
i do it in this way:
CONSTANTS: CMD_LS(50) VALUE 'ls -al /transfer/sap'.
DATA: BEGIN OF ITAB_LS OCCURS 0,
LINE(200),
END OF ITAB_LS.
CALL 'SYSTEM'
ID 'COMMAND' FIELD CMD_LS
ID 'TAB' FIELD ITAB_LS-SYS.
How do you write the file, via an UNIX-COMMAND than try the above call
with your command.
Another way is to write the file via OPEN DATASET ..., TRANSFER ... TO ..., CLOSE DATASET.
If you mean this i can give you an example.
Hope it helps.
Regards, Dieter -
Word and Excel hang "downloading" file from network drive - copy file to be able to open it
Word or Excel hang trying to open files on a network drive maybe after an untidy close.
Symptoms: pick the file from a pinned entry on recent list or even direct from File!Open... or by double clicking on the file from file explorer. Word/Excel show in the middle of the status line a comment "Downloading:filename "
a progress bar, that shows no progress, and a white cross on a red circle to close. Some minutes later may Excel/Word say could not open filename.
I have removed any temporary copies of the file prefixed with the ~. However there are no documents shown in any document recovery pane.
If I rename the original file the problem is still there.
I can only clear the problem by working on a copy of the file. It works with either a new name of if the copy is used to replace the original file.
It seems file explorer's "copy" is clearing something within the file that is causing this problem.
I have seen the same issue with both Excel and Word documents in native Office 2010 format.
Is there a better way to clear this issue?
ThanksHi,
It doesn't hang/crash, does it?
If you could provide the exact error message, it would be preferred to determine the cause.
You can also try the steps below to modify the registry, as mentioned in this thread:
http://social.technet.microsoft.com/Forums/en-US/ba5114e0-98dd-4b44-a078-373df8899048/word-2007-issue-slow-opening-files?forum=word
Note your 12.0 represents Office 2007, 14.0 is for Office 2010.
Important
This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the
registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry,
http://windows.microsoft.com/en-US/windows7/Back-up-the-registry
Word
HKEY_CLASSES_ROOT\Word.Document.14\Shell\Open\Command
Rename Subkey “Command” to “Old_Command”
Rename Key “ddeexec” to “Old_ddeexec”
Using FileType Manager change .xls from Word.Sheet.8 to Word.Sheet.14 In the Open Command append “%1”
.docx In the Open Command append “%1”
Excel
HKEY_CLASSES_ROOT\Excel.Document.14\Shell\Open\Command
Rename Subkey “Command” to “Old_Command”
Rename Key “ddeexec” to “Old_ddeexec”
Using FileType Manager change .xls from Excel.Sheet.8 to Excel.Sheet.14 In the Open Command append “%1”
.xlsx In the Open Command append “%1”
If the issue persists, you can also read this KB below and let me know if it is helpful:
http://support.microsoft.com/kb/313937/en-us
Regards,
Melon Chen
TechNet Community Support -
Newbie - loading music to itunes from Network drive
I just bought my first mac and I'm attempting to start using itunes with my Ipod touch and load music from a network drive that I have both of my PC's music backed up to.
In itunes, it sees some of the music from the network drive but not all of it. The folders/music are all available and I can see them in Finder but Itunes doesn't find all of the music.
Is there anyway to point itunes to the appropriate folder so I can add the music?Welcome to the Forums, Scott!
You can add a folder of music to iTunes by pressing Command-O or going to iTunes-> Add To Library...
Hope this helps!
-Nate -
Problem importing from network drive???HELP
I have all my photos on a networked drive (pc network)
I want to be able to access the photos from my ibook wihtout putting them on the internal mac HD (would fill it in no time flat).
When I try to import the files i get an error "The volume for "@#!@#" cannot be found....Insert the disk or connect to the server volume and wait for it to appear on the desktop, then try again." The drive is accessable from the mac, and is on the desktop, and if I keep hitting 'cancel' for the error message about 8 times the photo loads.
I have over 7500 photos, that is almost 50,000 times to hit 'cancel'
PLEASE HELP!!!
Nate
ibook Mac OS X (10.4.8) networked to win xpI've had similar problems, I'll see if this advanced setting thing will help. My objective is to have my "Master iLibrary" on an external hard drive connected to a new airport extreme wireless network in my house. Then all three household laptops can access our extensive ilibrary without using hard drive space on the laptops, and wirelessly to boot. In addition I want to be able to connect all three ipods (and hopefully an iphone come June:) to any one of the three laptops to access this very large music library (50GB). It seems to me that by trying to protect copyright for the artist the honest end consumer gets hosed. I can't seem to get the album art for many of my songs seemingly because of my unwillingness to re-import hundreds and hundreds of CDs that I have boxed up in the attic. The album art isn't anything more than an issue of asthetics where as deleteing ten thousand songtitles when itunes repopulates my library is enough to make a laptop grow wings and fly across the room. I hope that technology heads toward more continuity for music junkies. I've been trying to find the right device, software and format for my extensive collection of music. I started with musicmatch jukebox and got agrivated then used WMP out of forced convinience. Now I have moved to itunes because apple "seems" to be developing what the consumer wants instead of telling the consumer what they are going to get. I haven't even begun to convert my cassettes, vinyl, or 8 tracks. That is a nightmare waiting in the wings. Anyone with advice in the way of a turnkey operation for my planned setup? I believe that what I am trying to do is very likely the desire of most consumers. If Apple gets this worked out and user friendly I'd bet they'll take over the majority marketshare as fast as they can handle it if not faster.
-
Executing external commands problem
Hi,
I have the following problem. I need to execute an external command on Linux (ffmpeg for example), but I want it to keep running even after my program exits.
Any ideas how this could be done? I thought Runtime.exec() is the way to go, but as soon as my program terminates, so does the execution.
Thanks in advance,
Stefan GueorguievThat was a good idea. Didn't know about nohup. I
tried it but it doesn't seem to work.
The command starts to execute but the program doesn't
continue its execution.
this is what I have so far
myCommand = "nohup " + myCommand;
ps9= Runtime.getRuntime().exec(myCommand);Where myCommand is a huge string with a lot of
command line options.
Any clues as to why that won't work?
And is there a native java way to do this, without
nohup.
Thanks,
StefanI tried to say that you should place that in a script file, and execute the script file from your application. (The script file can take arguments)
Description of nohup:
"Run a command immune to hangups, runs the given COMMAND with hangup signals ignored, so that the command can continue running in the background after you log out."
The & after the command means that the process should run in the background.
/Kaj
Maybe you are looking for
-
Error While doing the Asset Credit Memo -ABGL
HI, While doing the Asset Credit Memo -ABGL,i am getting the below error.Kindly help me with your inputs. Balance for transaction type group 10 negative for the area 01 Message no. AA629 Asset affected: 406000000004-0000 Diagnosis With the transactio
-
My bb Z10 just went completely blacked while i was using it this afternoon. It had above 70%charge while i was using it. i removed the battery and checked again a number of times. I even tried with another z10 battery properly working and found that
-
HELP PLEASE WITH UPGRADING FROM FINAL CUT PRO TO FINAL CUT STUDIO 2
I HAVE BEEN TRYING TO UPDATE FINAL CUT AND GETTING THE FOLLOWING MESSAGE Final Cut Pro and Boris Calligraphy titling generator. Upgrading is required if an older version is already installed. SO WHEN I GO TO UPDATE FINAL CUT AND COMPRESSOR ARE GREYED
-
A user that consumes a Web service is authorized to use then in BackEnd?
Hello, I need to help me please Can you validate that a user that consumes a Web service is authorized to use this service?. I mean, I have a backend system, which has an RFC, which we published in PI as Web Services, and a third application consumes
-
Communication tab in PO header
*In communication tab in PO header, the fields Your reference and our reference are non editable for PO type Local PO. Is it possible to make it editable ?* *Is it possible by customizing through SPRO or is there some development required?* *I have c