Using Unix command in ABAP
Hi guy,
I am using " Call 'SYSTEM' id 'COMMAND' field UnixCommand id 'TAB' field itFiles-SYS" to read number of files in folder, it works fine if number of line are around 200 but if its more then that it doesn't any file.
UnixCommand = 'ls -ld'.
UnixCommand+7(45) = /abap/.
call 'SYSTEM' id 'COMMAND' field UnixCommand
id 'TAB' field itFiles-SYS.
Thanks
Atul
Hi,
DATA: L_DIRNAME LIKE EPSF-EPSDIRNAM,
L_FILEMASK LIKE EPSF-EPSFILNAM.
CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
EXPORTING
dir_name = l_dirname
file_mask = l_filemask
* IMPORTING
* DIR_NAME =
* FILE_COUNTER =
* ERROR_COUNTER =
TABLES
dir_list = pi_filelist
EXCEPTIONS
invalid_eps_subdir = 1
sapgparam_failed = 2
build_directory_failed = 3
no_authorization = 4
read_directory_failed = 5
too_many_read_errors = 6
empty_directory_list = 7
OTHERS = 8.
Try with this
Similar Messages
-
Hi All,
I need to use unix command (MOVE) in ABAP code for transfering a file from one directory to another directory.
Can any one help with how to used unix commands in ABAP?
Thanks in advance.
Regards,
HemendraThe recommended approach always used to be to use transaction SM69 to define a "soft" command name to the operating system command so that it could be configured to work across Windows, Unix etc. For example:
Command name OS Type OS command Parameters for operating system command
Z_FILE_MOVE SunOS Customer mv ? ?
You can then call function module SXPG_COMMAND_EXECUTE (quite well documented) to actually perform the command passing in the appropriate number of parameters.
Jonathan -
Hi,
I need to call the following unix command in ABAP to encrypt a file on the app server .
crypt password <org filename> new_filename
1 But when i run it using call 'SYSTEM' .. i get message security risk , command not executed ..
2 I also created the command in SM69 and tries to run it but same error.
3 I also created a shell script , but i get another message when i try to run sh ...
Please help to find out a way to make it work ..
KunalHi kunal,
1. probably ur basis team might be able to help u.
2. even if we have authorisations thru sap
to run external os command,
the actual OS user on application server
must have the right for it
and access/write/read/modify
for the files (provided thru the command)
in question.
3. Due to this , the systems gives the message
of SECURITY RISK.
regards,
amit m. -
I want to execute UNIX COMMAND in ABAP
Hi All,
I want to execute a UNIX XOMMAND sh <scriptname> <filename> to replace divsion codes.in ABAP.
But, I came to know that we can't (2) or try the following program but unfortunately the command CALL SYSTEM is not supported by SAP. If you are on R/3 2.1 - 2.2x you can get some idea's from the program SAPMSOS0.
REPORT ZUNIXCOM .
DATA: U_COMMAND(200).
Table for system messages
DATA: BEGIN OF RT OCCURS 100 ,
LINE(100) ,
END OF RT .
START-OF-SELECTION .
MOVE 'unix command' to U_COMMAND .
REFRESH RT.
CALL 'SYSTEM' ID 'COMMAND' FIELD U_COMMAND
ID 'TAB' FIELD RT-SYS .
LOOP AT RT.
WRITE : / RT-LINE .
ENDLOOP.
So please can u help me how to call a unix command from ABAP. it is very urgent. I want complete details and all possible solutions
<removed_by_moderator>
Thanks,
gyanaraj
Edited by: Julius Bussche on Aug 26, 2008 11:29 AMSelvaraj Gyanaraj wrote:>
> So please can u help me how to call a unix command from ABAP.
I was about to help you.
>it is very urgent.
I changed my mind.
>I want complete details and all possible solutions
I'm glad I changed my mind.
>Points are surely rewarded.
Too late. -
Terminal - how to find my external hard drive using unix commands
just discovered terminal and using cd and ls commands, which are the only commands i know, i realized that i can't find my external hard drive. i thought it would be listed on my desktop, as it is in the OSX interface, but it isn't there.
not that im skilled enough to use terminal yet, but i thought the first step would be being able to navigate the computer's files.
really curious as to where my external hard drive is and how i can find it using unix commands in terminal.
i was trying to figure it out myself, then i thought surely someone knows this and could tell me in a sec.
thanks.
ibook Mac OS X (10.4.4)
ibook Mac OS X (10.4.4)"ls /Volumes" will list all volumes, including internal and external hard drives and mounted disk images. I find "disktool -l" more useful in scripts, as it tells you which volume names correspond to which "mount points" under /Volumes. Usually they're the same, but if you have two volumes with the same name, or you try to remount a removable volume before it is fully unmounted, you'll end up with a mount point that consists of the volume name with a numerical suffix.
-
Using UNIX command to copy desktop files/folders
Hello All. I need help using UNIX command(s) to copy text documents and or folders from my lab computers to my desktop at home. Since I have such a slow connection, I think this will work best. I need help with the cp command and the path mostly. Since all files would be in folders on the desktop (including documents (that "missed" the folders), I believe I could simply copy desktop contents? Thanks, J Langlois
What you want to do is SCP (secure copy) your documents to your remote host.
send this command to the computer with the documents
scp ~/Desktop/FILEOR_FOLDERNAME USERNAME@REMOTE_COMPUTER:~/Desktop/
Replace all the stuff in UPPERCASE with the correct vales for your situation.
Mini (Intel Core Duo) Mac OS X (10.4.8) -
Execute graph using unix command
I am new to endeca3.1
is there any way available to run the graph using unix command?
how can i schedule the graph in cron tab?Take a look at the Integrator ETL Server Guide (CloverETL Server), Chapter 6, Scheduling and also Chapter 14 on the Simple HTTP API. This should allow you to schedule or invoke ETL Graphs published on the server.
http://docs.oracle.com/cd/E40518_01/integrator.311/IntegratorServerGuide.pdf -
How to move folders from one server to another serve using unix command
Hi All,
How to move the folders from one server to another server using unix command.
scp -r armops@sjarmprd01:/ARM/scripts [email protected]:/ARM/scripts/
but it is giving an error like not a regular file .. what it means .. please let me know if any one knows about it
Thanks
Sreedharnot a regular file .. what it meansProbably you have some fifo (named pipe) files...
Said that this has nothing to do with database (you should post on some nix forum, for example http://forums.oracle.com/forums/forum.jspa?forumID=135), you may try rsync* command (man rsync). -
Java , abab stack restart by using unix commands
hi experts,
i need steps to restart java , abab stack restart by using unix commands.
plz any one give me clear steps.
thanks& regards,
Xi reddyHi,
Check following
http://help.sap.com/saphelp_nw04/helpdata/en/5d/c4dd9b9d91dd458e9e5c0386edeb86/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/fe/40a04270600d31e10000000a1550b0/frameset.htm
http://help.sap.com/saphelp_nw04s/helpdata/en/85/24a64201e7c511e10000000a1550b0/frameset.htm
regards,
kaushal -
Convert .fmb and .rdf files to .txt using unix commands
I want to know how to convert .fmb and .rdf files to .txt using unix commands
Example ACCT_ACCOUNTS_ADMIN.fmb ---> ACCT_ACCOUNTS_ADMIN.txt
agent_balances.rdf ---> agent_balances.txt
NOTE: i don't want to use form builder or report builder.
is there anyone who can help me
Regards
HarshThanks it helped and Just to add little bit on it
for i in `ls *.fmb`
do
f60gen module=$i userid=$unpw forms_doc=yes batch=yes
done
Might help someone too.
Thanks -
Im creating a webserver in java and I want to use UNIX commands to access another directory and run a CGI script. Im trying to cd into the cgi-bin directory and run the script using the Process and Runtime classes but it doesn't seem to change to the cgi-bin directory. Is there another way I'm supposed to do this in java?
Read this: http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
-
Using Unix Command Line to force logoff of other users
Hello - I am the administrator for my family's Mac (OS X - 10.4.8). Four of us in the family share the system. Frequently, my family members forget to logoff. I would like to be able to force them off via the Unix command line. Can't I sign on as root and execute a "forced logoff" type of command?
Thanks to Mihalis and Jarik for the additional info.
I'm back now with a question. I have a user named "visitor" logged on. I issued a killall command which killed all the users processes except one. Using /Applications/Activity Monitor.app, I can see the process is "loginwindow" and it is owned by visitor.
However,
ps -u visitor
reveals no running processes. Assuming I only had command-line access (no GUI to use Activity Monitor.app) and had multiple users logged in, how can I discover which loginwindow PID belongs to visitor?
msq
EDIT: I went ahead and sudo kill PID the loginwindow process owned by visitor and realized that
ps -axj | grep visitor
worked to reveal the loginwindow process owned by visitor. But when I logged visitor in (Fast User Switching) and ran sudo killall the Activity Monitor.app identifies the loginwindow as being owned by root but ps -axj | grep visitor shows the process belonging to visitor.
Something weird in the depths of Leopard's UNIX land, but I think I can find my way around now.
Thanks, everyone.
Message was edited by: mistersquid -
Software Updates using Unix command hangs
Every time I try to do a software update to my OS 10.6.4, 10.6.8 iMacs, the process stays an/or hangs and I have to cancel it. This is the last message in the log:
Writing files… Running package scripts… Removing old files… Optimizing system for installed software… Moving items into place…
I have left it there for 24 hours and it stills never finishes. When I check an individual machine, the updates are still outstanding, except the combo 10.6.8 on the machines that are running 10.6.4
Any help on this? I am running a Snow Leopard server with the software update service and doing local updates on the machines. I have sent already a unix command to the machines to do a local update with my server ip.
Thanks,
Elizabeth Rodriguez
Rancho Dominguez PrepIf your using ARD , you should be able to send, and copy & run the installer on your client computers without needing to directly interact with the computers.
ie:
download the 10.6.8 combo updaters v1.1.dmg onto your ARD computer
double click on the dmg so your computer mounts it.
open ard
select one or more client that need to update
click on install icon from the ard toolbar (it should be right next to unix) (altertively
a dialog box will pop up asking what you want to install
click the +
select the 10.6.8 combo update v1.1.pkg from the mounted disk image
set restart after install to attempt or force restart.
click install
it's a good idea to send this installer to computers physicaly in the same location at one time. IE send the installer to 1 lab of computers, then the next lab. for classrooms you might find it better to do 1 classroom or one building at a time. -
Hi all,
I am trying to upload a file from SAP to a folder in another server.
Here they want us to use SFTP port 22 which is not supported by SAP by default i guess.
Could any one give me clear procedure and commands to be used in program in order to upload the in file in the server.
If you could give the methods and FMs and unix commands used it would be great.
I went through lot of threads but very few are talking about SFTP and i am not the clear about how to go with it.
Few say that we need to create and external command in SM59.
IF it is so can you tell what exactly are the parameter to be given for ex i want to put a file so what would be the parameters and how do we use this command in my program
Any sample code which puts the file another server???
ThanxCheck if your able to do sftp at command line from the server where BPEL is running.
--Prasanna -
How to run an applescript using unix command
Hi All,
Can any one help me in giving me the command for running an apple script thru postupgrade shell file in other words i wana run an apple script while running my new installer that will upgrade the old version of application but while installing i want to run an applescript so as i know ill have to give that applescript path in the postupgrade script but how to run it while installation and where to keep it (is it postupgrade). May be in short how can i run apple script thru unix command.Use the osascript command.
In my installer, I use the DropDMG program to build my DMG disk image. It doesn't quit automatically, so I have to do the following:
osascript -e "tell application \"DropDMG\" to quit"
Type "man osascript" for more information.
Maybe you are looking for
-
Can anyone tell me what apple hardware test error code apple hardware 4MOT/4/40000002: Exhaust-1153 or 1209 means? I am running a MacBook Pro
-
My photos are not showing up in icloud
i cannot get any photos to show on my ipad,ipod or computer after i joined icloud?
-
I cannot download a PDF file by right-clicking and "save link as"
I think that previously I could do this, and I still can in IE (ugh!), but in Firefox, when I try to "save link as" from a Google search, Firefox tries to download "url."
-
RFC XI WebService on TomcatApplication Server
In my sxenario I have to connect a R3 System to a Webservice. The Webservice is running on a TomCat WebApplication Server. My Problem is the connection between XI and TomCat. If I want to create a communication channel I need a business system. I t
-
Unable to start service IfsDefaultService
Hello, I am having a problem with HTTP DAV access of IFS. This is a new install of IFS on a SuSe 7.2 Linux box. When starting Apache and JServ, the jserv.log shows an error complaining that the IfsDefaultService cannot be started, followed by other e