Using a Logical File (FILE) in an External Command (SM69)

I have an external command defined in SM69 that runs a script on the application server. The command is called from within an ABAP program with SXPG_CALL_SYSTEM. It currently works as it should.
The issue is that the external command is defined as:
sh /absolute/path/to/script/file
I have been told to instead set up a logical file in FILE so that the command would be:
sh <MY_SCRIPT_LOGICAL_NAME>
I've gone into FILE and defined MY_SCRIPT_LOGICAL_NAME as:
Logical File = MY_SCRIPT_LOGICAL_NAME
Name = Descriptive Text
Physical File = <SYSID>actualname.scr
Data Format = ASC
App Area = HR
Logical Path = SCRIPT_PATH
where SCRIPT_PATH is also defined in FILE with the physical path of:
/iface/<SYSID>/outboundhr/scripts/<FILENAME>
So when I try executing the command with SM49 as defined as:
sh <MY_SCRIPT_LOGICAL_NAME>
I just get Exception raised: OTHERS
If I define the command as:
ls <MY_SCRIPT_LOGICAL_NAME>
I get the same thing, Exception raised: OTHERS
I'm guessing that the logical file name isn't getting translated. Does anyone know if it should in this instance? Is anyone using a logical file as part of an external command?
Thanks much.

I think you must use FM FILE_GET_NAME to translate the logical file name to a physical one before executing the command.
Like:
DATA: physical_file_name(60),
      my_script_logical_name(60) VALUE 'CLASSIFICATION',
      format(3).
CALL FUNCTION 'FILE_GET_NAME'
  EXPORTING
    logical_filename = my_script_logical_name
  IMPORTING
    file_format      = format
    file_name        = physical_file_name
  EXCEPTIONS
    file_not_found   = 1
    OTHERS           = 2.
Rob
Message was edited by: Rob Burbank

Similar Messages

  • Change status(Active/Inactive) of file adapter by the external command

    Hi, all.
      Is it possible to change status(Active/Inactive) of file adapter by the external command?
      Let's say, like
      "$ switch_file_adapter_status.sh <File Adapter name> <active|inactive>"
    or something like that.
      Actually, we have the following requirement for the file adapter.
      For example, we have many "file adapter to R/3" scenarios and we only want to allow data transfer between 9:00 a.m. to 9:00 p.m.(R/3 service time).
      In order to achieve this requirement, one option would be to switch file adapter status between active and inactive by external command line.
    And this command will be controlled by the job scheduler(like Tivoli).
      Does XI(3.0 or above) have this kind of feature?
      Best Regards.

    Hi,
    I don't think that this is possible.
    But one Solution for your problem could be a job on xi who execute the Queue.
    So that Adapter work the hole time and send the Message to XI Queue which process them not automatically.
    And the XI Queue you can trigger with a Job like normal R/3 Jobs.
    Hope that helps,
    Regards,
    Robin

  • Linux - Execute external Command (SM69, SXPG_COMMAND_EXECUTE)

    Hi experts,
    I've defined in SM69 a external command for our Linux-Host.
    This command I execute with Function Module SXPG_COMMAND_EXECUTE.
    However, I always get the exception 2 - Command not found.
    The test in Sm69 works fine.
    We are also having HP-UX Hosts and on this the command works fine.
    Also other commands works fine on Linux-Host.
    The command is: ls -l (so command = ls, command parameter = -l)
    Does anyone know the reason for this?
    Kind regards

    Do you really need it ?
    could you use kernel function ?  or you really need the SM69 ?
    looks how to use the kernel function of OS command : abap - report to execute os-commands - Code Gallery - SCN Wiki
    regards
    Fred

  • Using AMS and midnam files in Logic

    Anyone know why Logic does not easily recognize external synth files already fully finished in the AMS section of my Mac?
    This is really annoying, unless there is some answer. I tried for hours to build an external synth multi-instrument in the environment window, but my synth requires program change info that the outdated environment window cannot handle on the first tier of programming. What a clusterfudge. I also searched many third-party sites to find that my synths do not have "good samaritan" pre-built patches easily locatable. Fix this, Apple geniuses!

    the great guys at Apple support have answered this question quite nicely!
    What I had to do was go to the environments window and under "options" choose bank commands and relabel two separate bank control lines as the same bank number and then send one with control value 0 and 63 (for Korg) and the other one as value 32 and 0-4 depending on which bank was being used. I also needed Cherry Picker to rip the preset names form the AMS file.
    Cherry picker was also useful for looking at which bank control values were needed to change my banks. It really helped.

  • I am using Windows 8.1 i have an External Hard Disk and one drive is now inaccessible due to sudden power failure few days ago. Now it shows "Data error (Cyclic redundancy check)". I want all my important files and Pics. How ?

    Hi,
    I am using Windows 8.1
    I have an External Hard Disk i have partitioned it to 4 parts.
    One drive is now inaccessible due to sudden power failure while listening Music from that drive few days ago.
    Now it shows "Data error (Cyclic redundancy check)".
    I tried all the procedures provided here like
    chkdsk /f, diskpart, rescan etc
    but no result :( (i mean all processes failed. They could not detect the drive).
    Please help me to get those data, pictures and project files.
    thank you

    Then why aren't you posting this in the Windows 8 forums found @
    http://social.technet.microsoft.com/Forums/windows/en-US/home?category=w8itpro
    This is a Windows 7 forum for discussion about Windows 7.
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. ”

  • Using a Logical File definition in LSMW

    Hi all,
    is there any way that we can use a Logical File (defined in transaction FILE) as an application server file in the "specify files" step, instead of having to enter the physical path/file?
    Thanks in advance,
    Justin

    Hello,
    Check pages 46 and 47 of the following document :
    [http://sapabap.iespana.es/manuales/pdf/lsmw.pdf|http://sapabap.iespana.es/manuales/pdf/lsmw.pdf]
    You can only use a logical filename for subsequent programs (example direct input programs) not for the actual input file of your LSMW.
    Wim

  • I recently reset my computer and copy my music from an external hard drive to my itunes library.  When I click on a song to play i get an error message that says " the song could not be used because the original file could not be found".  need help

    I recently reset my computer and copy my music from an external hard drive to my itunes library.  When I click on a song to play i get an error message that says " the song could not be used because the original file could not be found".  But when I have my external hard drive plug in the song will play with no problem.  What do I need to do to play my music without having the external harddrive plug in ????????  Please help

    Because the location for each song in your library is on your hard drive.  If the hard drive isn't there, how can iTunes play it?
    You'll have to move/copy the music from your hard drive to your computer's hard drive.
    Basically, EASIEST way to do all this, if you don't care about your play counts, etc...
    -Delete EVERYTHING from iTunes, so that your library is now empty.
    -Go to "Advanced" inside of the "Preferences" window, found in the "Edit" drop-down.  You can also access Preferences by pressing Ctrl+, (Press Ctrl and the comma key)
    -Change your iTunes Media Folder Location to something simple, but on your computer. I use C:/iTunes.  Make sure "Keep iTunes Media Folder Organized" and "Copy files to...." are both checked.  You can close Preferences now.
    -Now, drag and drop your music from your hard drive into your iTunes library.  iTunes will automatically add the music to your library, as you would expect, and also creates a copy of each file to place into that iTunes Media Folder you just created.
    Shouldn't have any more problems...

  • I want to take files from my PC (using a Seagate external hard drive) then plug this Seagate External hard drive into my Mac Book Pro and move the files from the Seagate External Hard drive onto my Time Capsule. I do not want to put these files on my Mac

    I want to take files from my PC (using a Seagate external hard drive) then plug this Seagate External hard drive into my Mac Book Pro and move the files from the Seagate External Hard drive onto my Time Capsule. I do not want to put these files on my Mac. How do I do this? Where do I put these files on my Time Capsule? Will it affect the functioning of my Time Capsule?

    Mixing files with data is not always great idea.
    See info here.
    Q3 http://pondini.org/TM/Time_Capsule.html
    Why not just connect the PC directly to the TC by ethernet and copy the files over?
    It is hugely faster and much less mucking around.
    In windows load the airport utility for windows.. if you have not already as this will help you access the drive.
    There is more info here.
    http://support.apple.com/kb/HT1331

  • I have a Windows 7 laptop using I tunes 64 and all my music files are on an external disc. I rarely use I tunes and at one point moved all my files (including the music files) from one external disc to another without considering what affect this wou

    I have a Windows 7 laptop using I tunes 64 and all my music files are
    on an external disc. I rarely use I tunes and at one point moved all my files
    (including the music files) from one external disc to another without
    considering what affect this would have on the I tunes library. When I eventually
    attempted to use I tunes, every selected a song from the library resulted in a
    message stating that the file couldn't be located. After following some of the procedures
    explained in this community I was able to reconnect the library back to where
    the associated music files are presently stored. However, there are still 2
    problems that need to be corrected. 1) Every song file now has a duplicate. One
    file works and the other file will result in the same message stating that the
    file couldn't be located. Before there were 4,000 songs in the library, now
    there are 8,000 songs. I need to eliminate the 4,000 dead song files. 2) All
    the playlists are still associated with the dead song files which makes the
    playlists unusable. Can the playlists be reconnected to the usable files
    without manually having to recreate them? Thanks in advance for the help.
    sdkr

    So am I understanding correctly?
    You used your iPod as a hard drive (drag and drop) instead of having iTunes install the music?
    If you used drag and drop your choices are different than if you used iTunes to transfer.
    Good luck!

  • My partner deleted my itunes (10) library. I use a WD external back-up and retrieved my itunes library, but when i try to play a song i get the message 'could not be used because the original file could not be found Would you like to locate it?'

    My partner deleted, by accident my itunes library. I have an iMac 10.6.7, Itunes 10. I use an WD passport as an external back up and retrieved my itunes library but now get the message "could not be used because the original file could not be found. Would you like to locate it?" so itunes is not recognised the exclamation marked songs, how do i get the retrieved files recognised. At times I get fed-up with Apple blocking files being used, although I like the product its restrictions are so silly!

    You not only have to retrieve the library file from the backup drive but the actual music files (usually stored within the "iTunes Media" folder) as well.

  • I cannot play music from my library on either my external drive or my laptop - keep getting same message "___ song (all of them) could not be used because the original file could not be found. I have tried changing the path in prefernces many times.

    I cannot play music from my libray on either my external drive or my laptop. I keep getting the same message - "___ song (all of them) could not be used because the original file could not be found. Would you like to locate it?" I have changed the path several times under preferences and it still won't recognize any songs from either my laptop hard drive or my external drive. I can't play any music at all.

    I think I've fixed this on my machine.  If you look in the ITunes folder there is a subfolder called Previous iTunes Libraries.  In my case for some reason this contained the one which had always worked and a new one was in the main  folder.  I closed iTunes, deleted the new one, and moved the old one back to the main folder, then opened iTunes.  It then rebuilt the library and it plays correctly.  Hope it works for you.

  • I want to transfer files from a functioning hard drive in a nonfunctioning MacBook Pro to an external drive. I have an IDE/SATA drive adapter. The files won't fit on the drive for a working computer I have. Can I use it to transfer files to the external?

    I want to transfer files from a functioning hard drive in a nonfunctioning MacBook Pro to an external drive. I have an IDE/SATA drive adapter. The files won't fit on the drive for a working computer I have. Can I use it to transfer files to the external drive?

    Good luck and you are welcome.
    Like I said, I bought one of their inexpensive enclosures and now can use the hard drive just as a source for the files that are on it...my external drives are much larger and faster so I just plug that drive in when I need something from it.
    This one is on sale for $16 http://eshop.macsales.com/item/OWC/ES2.5BPU2S/

  • I am using an iMac and i am selling it tomorrow. So i am trying to back up all my files on my transcend external HD 500GB. I am not able to create a folder in the transcend and also even if I try to copy a file in the transcend folder. It just wont happen

    I am using an iMac and i am selling it tomorrow. So i am trying to back up all my files on my transcend external HD 500GB. I am not able to create a folder in the transcend and also even if I try to copy a file in the transcend folder. It just wont happen. Please help !!
    My transcend HD is on read only mode I guess. What to do? I dont have a windows computer to check and I need to create the back up right now..

    Welcome to Apple Support Communities
    It looks like the external disk is formatted in NTFS, a format that OS X can't write in. The solution is to format the external drive in "Mac OS Extended (Journaled)" (if you are going to get a Mac), or "MS-DOS (FAT)" (if you are going to get a PC) as Format in Disk Utility > http://pondini.org/OSX/DU1.html
    Then, you will be able to copy the files you need to the external drive. Note that "MS-DOS (FAT)" doesn't support files bigger than 4 GB.
    <Edited By Host>

  • Using an AIX archive file as a library for an external procedure.

    I cannot use an archive file, created with the ar command, that contains a shared object that was created with the xlc and ld commands as a library for external procedures. I can use the shared object file created with the ld command as a library for an external procedure. Why would I encounter an invalid magic number and what is the resolution?
    Example:
    oracle:@husk21:/home/oracle> ksh -x ./Oracle_demo.ksh
    + rm shell.o shell.so shell.so.exp shell.so.imp
    + make -f /u01/oracle/product/11.1.0.7/db/rdbms/demo/demo_rdbms32.mk extproc_no_context SHARED_LIBNAME=shell.so OBJS=shell.o
    /u01/oracle/product/11.1.0.7/db/bin/oraxlc -q32 -c -I/u01/oracle/product/11.1.0.7/db/rdbms/demo -I/u01/oracle/product/11.1.0.7/db/rdbms/public -I/u01/oracle/product/11.1.0.7/db/plsql/public -I/u01/oracle/product/11.1.0.7/db/network/public -I/u01/oracle/product/11.1.0.7/db/precomp/public shell.c
    generate_export_list() { /bin/nm -X32_64 -B -h -g "$1" | grep -v ' U ' | awk '{print $3}' | egrep -v '^\.|^TOC' | sort | uniq ; }; generate_import_list() { LIB_NAME=$1; IMP_FILE=$2; cat /u01/oracle/product/11.1.0.7/db/rdbms/lib/xa.imp | head -1 | awk '{print $0, "." }' > ${IMP_FILE}; /bin/nm -X32_64 -C -B -h -g ${LIB_NAME} | grep ' U ' | grep -v "::" | grep -v "(" | grep -v "\.cc" | awk '{print $3}' | sed -e "s/\.//g" | grep -v "^_" >> ${IMP_FILE}; }; generate_import_list shell.o shell.so.imp; generate_export_list shell.o > shell.so.exp; /bin/ld -b32 -bnoentry -bM:SRE -bE:shell.so.exp -bI:shell.so.imp -o shell.so shell.o -L/u01/oracle/product/11.1.0.7/db/lib -lc_r -lm
    ld: 0711-224 WARNING: Duplicate symbol: .system
    ld: 0711-224 WARNING: Duplicate symbol: system
    ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more information.
    oracle:@husk21:/home/oracle> ar rv libshell.a shell.so
    ar: Creating an archive file libshell.a.
    a - shell.so
    oracle:@husk21:/home/oracle> ar tv libshell.a
    rwxr-xr-x 3514/3516 1263 Sep 08 10:00 2009 shell.so
    oracle:@husk21:/home/oracle> file shell.so
    shell.so: executable (RISC System/6000) or object module not stripped
    oracle:@husk21:/home/oracle> file libshell.a
    libshell.a: archive (big format)
    SQL> CREATE OR REPLACE LIBRARY shell_lib is '/home/oracle/libshell.a';
    / 2
    Library created.
    SQL> CREATE OR REPLACE PROCEDURE shell(command IN char)
    AS EXTERNAL
    NAME "shell"
    LIBRARY shell_lib
    LANGUAGE C
    PARAMETERS (command string);
    / 2 3 4 5 6 7
    Procedure created.
    SQL> exec shell('ls');
    BEGIN shell('ls'); END;
    ERROR at line 1:
    ORA-06520: PL/SQL: Error loading external library
    ORA-06522: 0509-022 Cannot load module /home/oracle/libshell.a.
    0509-103 The module has an invalid magic number.
    ORA-06512: at "V500.SHELL", line 1
    ORA-06512: at line 1
    SQL> CREATE OR REPLACE LIBRARY shell_lib is '/home/oracle/shell.so';
    2 /
    Library created.
    SQL> exec shell('ls');
    PL/SQL procedure successfully completed

    Using an AIX archive file as a library for an external procedure.

  • Recently got a new computer and installed itunes from external drive - all music shows up in the library, however when i click on a song i receive this message "the song could not be used because the original file could not be found".  What do i do?

    I recently got a new computer and installed itunes from which had been saved onto an external drive - all music shows up in the library, however when I click on a song I receive this message "the song "abc" could not be used because the original file could not be found".  What can I do?

    I was given the option to locate the file where the song is held. If so select "locate" and direct it to the folder / file where the song is and open it. itunes then will give you the option to use this process to update all of your library. OK that as this will do it automatically instead of doing them one by one. I hope this helps.
    Martin

Maybe you are looking for

  • FI Posting of Invoice at the Line Item Level.

    Hi All Client has requirement of posting at the invoice line item level.But standard FI-AR posts at the Invoice Header level. E.g If invoice has two line items of $20 and $30 respectively. On the standard FI-AR side,one accounting document of $50 wil

  • Having some Issues After Installing Windows Vista

    I just recently installed Windows Vista Ultimate 32 Bit SP1 on my Intel iMac running OS 10.6. I thought everything was good until I noticed 2 things. 1. I did not have a Boot Camp icon in the system try, nor could I find it listed in control panels.

  • My question hasn't appeared in the forum ...

    Earlier today I posted a question on this forum - now, there's no sign of it; not in the general forum, or listed in my stuff.  This is the first time I've used this forum and I'm wondering if I'm doing something wrong?  My post was there immediately

  • Ipod Touch Crashed, I think....

    All it shows on my Ipod is the familiar apple insignia on the black screen, but it's been like this for quite a while, and when I connect it to itunes, it stays the same, and itunes becomes unresponsive. Any suggestions? Note: This may be because I h

  • Flash Player for IE7 and Vista

    TRY THIS it may solve the problem. I have just upgraded to vista and when I tried to install flash player nothing happend, then I went to vista's discussion forum and found this. "go to http://www.adobe.com/support/flashplayer/downloads.html and then