File adapter command

I am running a command after message processing is complete.  If the UNIX command fails, is there way to have that show up as a failure in SXMB_MONI?
Thanks
Skip Ford

Hi,
You will not see any status in SXMB_MONI, since the message has been sent successfully to the file adapter.
However, in RWB, for adapter message monitoring, there will be a warning indicating the command has failed.
Regards,
Bill

Similar Messages

  • Receiver file adapter command line

    hi,
    i am just wondering how to use command line on receiver file adapter.
    i am not clear how to use this.
    please modify on the following command!
    anyway, i have to call java application after put some files by receiver file adapter.
    cmd.exe %Fjava ./javacalltest
    it did not work..
    please guide me.
    Command Line
    An operating system command specified here is executed before or after a file has been successfully processed. The default value is an empty character string (no command).
    When the operating system command is called, the file name currently being processed can be specified with the following placeholders:
    %f (file name)
    %F (absolute file name including path)

    Hi Ogawa and Laurence,
    Have look at :: /people/michal.krawczyk2/blog/2007/02/08/xipi-command-line-sample-functions
    1)Windows batch Commands::
    http://labmice.techtarget.com/articles/batchcmds.htm
    2)Linux:
    /people/michal.krawczyk2/blog/2005/08/17/xi-operation-system-command--error-catching
    Note:: First try using the comands on O.S if they work then only use them in Adapters.
    Hope it will help.
    regards
    Piyush
    Pl:reward some points if it is usefull.

  • Can XI produce a PDF format files using a file adapter

    Hi,
    Currently I have a requirement to send a PDF file to the legacy system. I'm not sure whether XI has the capability to do this. Appreciate if somebody could help me on this. The requirement is like from SAP we will send a data stream to XI and XI has to produced a form in PDF by populating the data on the PDF layout.
    Appreciate if somebody have any experienced with this development can share with me.
    Thanks
    Zab

    Hi,
    there's a number of command line tools
    that you can trigger using the file adapter - command line paramater (even with "output format management" )
    like:
    http://www.xmlpdf.com/xmlpdf-examples-net.html
    http://www.yeslogic.com/prince/guide/command-line
    just go to google and you'll find many more:)
    BTW
    form help.sap.com
    When the operating system command is called, the file name currently being processed can be specified with the following placeholders:
    - %f (file name)
    - %F(absolute file name including path)
    Regards,
    michal

  • File renaming in Sender file adapter usins OS command

    Hi Guys ,
    Can anyone explain on how to use the rename command in Sender file adapter using OS command parameter.
    Thanks,
    KC.

    Hey
    run the following OS command
    mv <originalFileName> <newFileName>
    This command will copy the <originalFileName> to a new file called <newFileName> and will delete the <originalFileName>
    There is no rename command in Unix,mv is used to rename the files
    Thanx
    Aamir

  • Receiver File Adapter Not Executing OS Command

    Hello All!
    We are currently running PI 7.1 and wish to use a Receiver File Adapter to FTP a file to a mainframe and override the FTP system defaults.
    Tried using the 'quote site recfm=fb lrecl=80' OS command but discovered that this would not work as the Adapter Engine is NOT on the mainframe.
    Regrouped a bit and made a second attempt which involved writing a Unix script to ftp a file and override rthe system defaults.   The idea was to use the File Adapter to FTP the data to the server, invoke the script and get the file to the mainframe with the proper attributes.    The script when executed on the server works perfectly.   
    However, when the IDoc comes thru PI, the File Adapter ftp's the file ok but the script is never executed.
    Any ideas why this is so or any suggestions?    
    Thank you.

    Hi Ken,
    Script only executes at Network File sharing (NFS) only. It dont work at FTP level.
    So you can better write the file on NFS and then within the script to connect to ftp and do your processing.
    Regards,
    ---Satish

  • File Adapter: Run OS command unix after processing message

    Hi,
    in file adapter configuaration, after processing message, I've configured the channel that it has to call an unix script.
    The sintax in configuration is:
    sh /XS0/usr/sap/XS0/DVEBMGS01/work/TEST_FILE_XI/OUT/rename_lib_contabili.sh <variable>.
    I tried also without the entire path and without the sh command at start of it.
    We have a XI 3.0 sp20.
    I don't understand, What other I have to do.
    Regards,
    Antonello

    Hi Carme,
    I found a warning that "describes" the error...
    2009-09-29 13:36:15     Success     Write to file "/XS0/usr/sap/XS0/DVEBMGS01/work/TEST_FILE_XI/OUT/LIBROGIORNALE_test_mov.zip" as binary, size 7248 bytes
    2009-09-29 13:36:15     Success     Execute OS command "/home/xs0adm/scripts/rename_lib_contabili.sh LIBROGIORNALE_test_mov.zip"
    2009-09-29 13:36:15     Warning     Error when executing OS command "/home/xs0adm/scripts/rename_lib_contabili.sh LIBROGIORNALE_test_mov.zip"
    2009-09-29 13:36:15     Success     File processing complete
    2009-09-29 13:36:15     Success     MP: Leaving module processor
    2009-09-29 13:36:15     Success     The message was successfully delivered to the application using connection
    File_http://sap.com/xi/XI/System.
    2009-09-29 13:36:15     Success     The message status set to DLVD.
    if I try to execute this script from Unix schell or ABAP OS shell this working fine.
    You have any idea?!
    Thanks,
    Antonello

  • File Adapter 7.11 - set operating system command line dynamically

    Hi,
    is there any way to set the "Operating System Command Line" in the file adapter as ASMA / dynamic attribute?
    I need to set  a command line exec depending on some XSL mapping values.
    thx
    holger

    hi,
    >>>is there any way to set the "Operating System Command Line" in the file adapter as ASMA / dynamic attribute?
    >>>I need to set a command line exec depending on some XSL mapping values.
    think about this approach:
    you put the XSL values into the filename after the real name of the file
    in the batch script you use those values in order to execute a dynamic exe command
    after processing you just change the name of the file in the script by removing the xsl values
    simple ? I think so
    Regards,
    Michal Krawczyk

  • OS Command in File Adapter

    Hi All,
    I am trying to encrypt a file from XI and FTP to a different location. I am using PGP software for encryption and decryption. I am able to encrypt/decrypt the file from the OS level. The command I am using at OS level is:
    pgp --home-dir /.pgp --encrypt test.txt --recipient 0xC483S9E6
    If I use the same command in Sender File adapter in Run Operating System Command After Processing it is not encrypting. But I am using the same above command:
    pgp --home-dir /.pgp --encrypt test.txt --recipient 0xC483S9E6
    Now if I run the scenario the file is writing but it is not encrypting the file. Can you guys tell me where I am exactly going wrong.
    ---Korobee

    Hi,
    Try this, write all you OS command in a BATCH file say "encrypt.bat" and then call the batch script from File adapter. Also make sure you are giving the full path for all the files that you are refering to like
    \serverfolderpgp --home-dir /.pgp --encrypt \serverfoldertest.txt --recipient 0xC483S9E6
    Any more help let me know.
    Thanks,
    Prakash

  • OS commands in File adapter

    Hi Experts,
    I have a requirement to move the xml file(size 2GB)  across the FTP server. I thought of zipping the file due to huge size before picking it up and unzip before dropping at the receiver FTP.
    I know we can use Run Operating System command before and after message processing option in File adapter, but can you please guide me how can really use this option.
    Thanks in advance,
    MK

    hi mk
    check the below blogs
    *OS COMMAND     *                    
    Executing Unix shell script using Operating System Command in XI                         
    Executing Unix shell script using Operating System Command in XI                                   
    Performing FTP Commands From ABAP                                   
    Performing FTP Commands From ABAP          
    regards
    kummari

  • OS Command for receiver file adapter

    Hi Guys,
    I have a requirement that in the target folder before putting the file, I have to rename the exisitng file then put the file. The target folder is in another machine and I have to use FTP option to send file.
    is it possible to use OS command after processing option in the receiver file adapter to do this? please let me know how to handle this.
    Thanks
    Mukesh

    Mukesh,
    You cannot rename the file in the FTP folder. What you can do is write a OS script where it logs in into the FTP site and renames the file. Then use this OS script before message processing so that it renames the file before you write the actual file.
    If you want to rename a file which is on the applicaiton server using NFS then you can directly rename it from the command prompt.
    Regards,
    ---Satish

  • File adapter OS command line - Calling a command remotely ??

    Hi,
    We have a scenario where in which receiver file adapter after putting a file on the FTP  , a subsequent XML loader needs to be called which would load data into the client legacy ERP system.
    There seems to be some idea about doing it through file adapter OS command line.
    The problem is the how to call this loader command remotely from our file adapter OS command line.
    Any help would be appreciated ???

    >> The problem is the how to call this loader command remotely from our file adapter OS command line.
    The below link might be helpful ...
    http://wiki.sdn.sap.com/wiki/display/XI/SAPXIFileAdapterOSCommandLine+Feature

  • OS command error=13, Permission denied in File Adapter

    Hi All,
    I am trying to call the OS commands in File adaper, when i check the Audit log i am getting Error exectuting the command. the same command when i check in OS its working fine.
    i have collected the debug log and i can see the message saying
    Catching #1#java.io.IOException: java.io.IOException: error=13, Permission denied
         at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
         at java.lang.ProcessImpl.start(ProcessImpl.java:65)
         at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
         at java.lang.Runtime.exec(Runtime.java:591)
         at java.lang.Runtime.exec(Runtime.java:429)
         at java.lang.Runtime.exec(Runtime.java:326)
         at com.sap.aii.af.lib.util.system.CommandLauncher.exec(CommandLauncher.java:64)
         at com.sap.aii.adapter.file.util.OSCommand.exec(OSCommand.java:58)
         at com.sap.aii.adapter.file.util.OSCommand.exec(OSCommand.java:33)
         at com.sap.aii.adapter.file.File2XI.processFileList(File2XI.java:991)
         at com.sap.aii.adapter.file.File2XI.invoke(File2XI.java:622)
         at com.sap.aii.af.lib.scheduler.JobBroker$Worker.run(JobBroker.java:500)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:169)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:266)
    I hope the problem with problem XI communication with OS level, Could you pls suggest me the problem?
    Thanks,
    Venkat

    Hello!
    You can see more information about os command using the file adapter in SAP note:
    #841704 - XI File & JDBC Adapter: Operating system command
    o  The command line of an operating system command run through the
       File and JDBC Adapter is interpreted slightly different compared
       to common operating system shells. E.g. quotes and apostrophes
       are handled differently. If in doubt, check if the command can be
       successfully run through the Java Runtime.exec(...) API. Also
       note that the command is run as user "<sid>adm" (Unix) /
       "SAPService<SID>" (Windows).
       Under Windows, this especially means that you cannot use any
       shell commands interpreted by teh command processor (such as
       "copy", "ren" or "del") using the operating system command.
    Best regards,
    Franklin

  • PI Sender File Adapter OS Commands not working

    Hi Guys,
    I have very simple scenario. we are using PI 7.1 with EHP1 on HP hardware with JDK 1.5.2*.
    We are processing XML files through Sender File Adapter(NFS) to Idocs. We also need to move some pdf documents to target folders on the same box (basically Sender and Receiver files/foders are mounted to PI OS hence I am using NFS)
    I am trying to put a simple OS command copy and mov command.
    in the Before Message Processing: cp /tmp/*.pdf /tmp/out/
    And in the After Message Processing: mv /tmp/*.pdf /tmp/archive/
    In the Adapter Audit logs says these commands are executed but I don't see any effect and there is no error/Traces available even in the Server logs also.
    I have been using these OS commands since XI 3.0 I never had any issue.
    I have gone through SDN but no luck, Please share your experiences.
    Thanks,
    Laxman
    Edited by: Laxman  Molugu on Feb 3, 2010 11:58 AM
    Edited by: Laxman  Molugu on Feb 3, 2010 11:59 AM

    hi ,
    As i understand your requirement you just want to take the pdf file from one folder of XI server and put it to another..
    for this u do not need a OS command..
    This requirement is simple ..infact u do not need any IR components as well..
    u just have to develop the ID part and wherever it asks for namespace or message interface u can give a dummy one..
    this would jst take the pdf file from one folder and send it to another

  • 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

  • File adapter operating system command exit code

    Hello,
    If you call an operating system command in the file adapter, how is the exit code of the command handled? The documentation says nothing about this.
    If I call 'true', I expect the file adapter to succeed.
    If I call 'false', I expect the file adapter to fail.
    Hope someone can calrify.
    Best regards
    /Otto Frost

    Hi, Yes, you are rigth, it spawns a subprocess, that runs without control.
    In java you use Runtime.exec().
    It returns a process.
    process.exitValue() returns an int.
    The process is already used to terminate the process after timeout I suppose.
    You would like to be able to have the fileadapter succeed or fail depending on this exitValue.
    Depending on the command you execute, the exit code is different. RTFM on unix.
    You would like to define which codes should be treated as success, and which ones that should be treated as failure.
    true typically returns 0 and false not 0
    However, a comparison command could for example return 0 for equal, -1 if the frist argument is smaller and 1 if the first argument is larger.
    For the diff command, Exit status is 0 if inputs are the same, 1 if different, 2 if trouble.
    Thanks
    /Otto

Maybe you are looking for