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

Similar Messages

  • 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

  • File Adapter OS Command Line After processing (UNIX)

    Hi guys,
    I want to run only one line after message processing:
    compress -f %f
    It must be compress seeing as this is the way we use it on our legacy system where it adds the extension .Z.
    It seems crazy to write a shell script for only one line. Is there any way to run this line without using a shell script and if so should I run it in some additional characters?
    Also if this isn't possible, please show me an example of how the shell script would look like, and where on the XI server this shell script should be saved.
    Thanks a million!
    Anneke

    Hi Anneke,
    Check this blog by Sameer
    /people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi
    Should help u out

  • 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

  • File Adapter cannot read from Unix Directory

    Hello Everyone,
    I have created a Bpel process that should read txt files from a Unix directory, but its not doing its job.
    I have tried this process on windows and it works fine.
    I got the following error from the process log in my bpel console.
    my process compiles fine but I am getting this error: The value specified for the input (Physical/Logical)Directory activation parameter has an invalid value "/temp/test"
    Also if there is something wrong with my path, please let me know.
    Thanks in advanced,
    AJ

    Hi,
    The path /temp/test might be wrong. Suppose you have installed SOA at /home/oracle/product/soa/10.1.3.1/<> , where /home is the root folder, and if you have your test folder at /home/temp/test, give the location in file adapter as /home/temp/test.
    Let me know if you still get this error.
    Thanks
    Ramana.

  • FTPS file adapter setup fields not visible after SP13 install

    After installation of SP13, I was looking for file adapter FTPS setup (fields described in SP13 release notes). I could not see any. It's just like the old adapter.
    Java cryptolib is installed, and we checked it is there.
    we recycled the whole thing.
    Any idea what could be missing ?

    Solved. We had applied SP12 file.
    Note that this originates from the SP stack download tool.
    We had followed the generic download process and it did not contain the SP13 tpz file.
    I tried again this morning, when selecting source sp11 target sp13, The selection of packages selects
    SAPBASIS12_0-10002900.zip... and not the SP13 one.
    Watch out if you move two SP up !
    Detailed solution :
    Downloaded the SP13 zip file. the following way.
    service.sap.com  download/entry by app grp/sap content
    process integration (XI content)/ XI_CONTENT_SAP_BASIS/ XI_CONTENT_SAP_BASIS_6.40/DB independant/ selected sp13 from the list
    Unzipped, and put the tpz file in the import directory
    of the repository. file name is XI3_0_SAP_BASIS_6.40_13_02.tpz
    Imported it
    And it works now
    Thanks a lot for your help.

  • Files no longer default to SRGB after processing

    I still have the ICC profile box checked when ave a Jpeg after processing.
    Noticed that there was a bit of color shift on some images viewed on my web site in firefox----
    checked the color space---unassigned!!  That usually only happened the check box inadvertantly
    was not checked.  Now it doesn't save in sRGB unless I assign a profile under the edit menu--not sure that is a good thing to do
    or not.  Wonder how to restore it so the check-box on saving a Jpeg works again.
    Any help greatly appreciated.
    Mike

    usher999 wrote:
    I'll have to figure out an expand ed color gamut workflow for some prints later.Thanks so much!!!
    You're welcome.  Just watch your histograms to make sure you don't clip color channels when converting directly to sRGB.
    For wide-gamut work I convert to ProPhoto RGB.  For combinational stuff, for example where I need a print and web image, I (try to) remember to do Edit - Convert to Profile before saving as a web preview requiring sRGB.  I created an action that embodies the conversion and "bends" the colors at the gamut edges so that the conversion to sRGB doesn't clip color channels.  Finally, I keep a quick photo viewer (IrfanView) on hand set to do no color management, so I'll be able to see in a quick preview visually if I forgot to convert the image to use the sRGB profile.
    -Noel

  • Sender File Adapter - No error, but not generating any message

    I am working on a file to RFC scenario.  The sender file adapter is using content conversion to read a comma delimited file.  The file is being picked up and archived correctly, and the adapter monitor does not show any errors.  However, the process disappears at this point.  I don't see any messages in SXMB_MONI, and there is no sign that the process is reaching the RFC adapter.  Has anyone ever had this happen before?
    I have four line types for Buildings, Additions, Floors, and Rooms.
    I list all four in the recordset structure, and I identify a key for each with the keyFieldValue parameter.  I list a fieldSeparator of ',' and an endSeparator of 'nl' for each row.  And i have a list of the fieldnames in the fieldnames parameter.
    The only thing i'm not sure about is the keyFieldinStructure parameter.  I have specified ignore there, because I don't want that field in my XML.  Do I still need that field in my sender datatype, even if I'm ignoring it, or can I leave it out?
    Thanks for any help.  Please don't just list blogs unless they have something you think is helpful with my specific problem.  I have already read all of the blogs that deal generally with the sender file adapter and file content conversion, and I need more specific help at this point.

    I made one error before, it IS showing up in the Recovered Adapter Audit Log (it took that log about 10 minutes to open that particular tab so I didn't notice them there).
    Here is what it says there:
    2006-06-12 11:22:59 Success Channel CC_S_File_FIPM_Buildings: Entire file content converted to XML format
    2006-06-12 11:22:59 Warning Channel CC_S_File_FIPM_Buildings: Empty document found. Proceed without sending message
    2006-06-12 11:22:59 Success File "/interfaces/one line building.txt" archived after processing
    Here are my parameters in the file content conversion:
    Buildings.fieldNames     RecordType,PLTXT,STORT,STREET,POST_CODE1,CITY1,REGION,PARNR,X_COORD,Y_COORD,ASSIGN_SQ_FT,BLDG_NUM,CAMPUS,GR_SQ_FT,NET_SQ_FT
    Buildings.keyFieldValue     'B'
    Buildings.fieldSeparator     ','
    Buildings.endSeparator     'nl'
    Buildings.keyFieldInStructure     ignore
    Additions.fieldNames     RecordType,ASSIGN_SQ_FT,BLDG_ABBR,CAMPUS,ADDITION,BLDG_USE,BLDG__NUMBER
    Additions.keyFieldValue     'A'
    Additions.fieldSeparator     ','
    Additions.endSeparator     'nl'
    Additions.keyFieldInStructure     ignore
    Floors.fieldNames     RecordType,BLDG_ABBR,CAMPUS,ADDITION,FLOOR,ASSIGNABLE_SQUARE_FOOT,BLDG_NUMBER
    Floors.keyFieldValue     'F'
    Floors.fieldSeparator     ','
    Floors.endSeparator     'nl'
    Floors.keyFieldInStrucutre     ignore
    Rooms.fieldNames     RecordType,SHTXT,MSGRP,ADDITION,ASSIGNED_DEPT,BLDG_ABBV,FLOOR_CAMPUS,AREA,RCD_CODE,DEPT_CODE,BUILDING_NUMBER,ROOM_COMMON_KEY
    Rooms.keyFieldValue     'R'
    Rooms.fieldSeparator     ','
    Rooms.endSeparator     'nl'
    Rooms.keyFieldInStructure     ignore
    And here is my data type:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_FIPM_BuildingUpdate xmlns:ns0="urn:XXXXXX:FIPM:Buildings:SYS">
       <Buildings>
          <PLTXT/>
          <STORT/>
          <STREET/>
          <POST_CODE1/>
          <CITY1/>
          <REGION/>
          <PARNR/>
          <X_COORD/>
          <Y_COORD/>
          <ASSIGN_SQ_FT/>
          <BLDG_NUM/>
          <CAMPUS/>
          <GR_SQ_FT/>
          <NET_SQ_FT/>
       </Buildings>
       <Additions>
          <ASSIGN_SQ_FT/>
          <BLDG_ABBR/>
          <CAMPUS/>
          <ADDITION/>
          <BLDG_USE/>
          <BLDG_NUMBER/>
       </Additions>
       <Floors>
          <BLDG_ABBR/>
          <CAMPUS/>
          <ADDITION/>
          <FLOOR/>
          <ASSIGNABLE_SQUARE_FOOT/>
          <BLDG_NUMBER/>
       </Floors>
       <Rooms>
          <SHTXT/>
          <MSGRP/>
          <ADDITION/>
          <ASSIGNED_DEPT/>
          <BLDG_ABBV/>
          <FLOOR/>
          <CAMPUS/>
          <AREA/>
          <RCD_CODE/>
          <DEPT_CODE/>
          <BUILDING_NUMBER/>
          <ROOM_COMMON_KEY/>
       </Rooms>
    </ns0:MT_FIPM_BuildingUpdate>
    I'm going to recheck everything again, but maybe you guys will see something?  I don't.
    Vanda

  • File adapter: file_name with counter, stable after restart J2EE

    Hello guys,
    we are on XI 7.0.
    in a receiver file channel we have to create file names with a stable counter (7digits).
    The payload is IDOC flat file after ABAP mapping (not XML format).
    The  bad thing with the counter is that it is not stable. After restart of J2EE engine the counter starts again more or less
    from the beginning (also described in a FAQ OSS note).
    Does anybody have an idea how we could realize a stable counter for file names that also increases the counter after restart of J2EE. Is individual programming necessary? module ?
    We thought about SAP number ranges (DB) but how to integrate this in the file channel. Also generating the the number in ERP and send it in the IDOC to XI, but after the ABAP mapping to IDOC flat file we cannot use the payload for variable replacement.
    Every help is appreciated
    best regards
    Hans

    Hello Georg,
    You can achieve this by developing a Customized adapter module,
    Try to maintain the counter in one of the temporary file in the XI system, read the counter number from the temporary file and increment the counter by 1.
    rename the receiver filename with the sufix as counter.
    replace the counter number in the temporary file with the latest counter number i.e increment by '1'.
    regards,
    Chandra Shekhar

  • Batch File not running all commands, MaxL seems to stop them

    I have a batch file that looks like this (removed the part in the middle that does the data extract, this is just for testing)
    E:\Oracle\Middleware\EPMSystem11R1\products\Essbase\EssbaseClient-32\bin\startMaxl.cmd "E:\DataExtract\Scripts\MaxL-StartArchive.txt"
    E:\Oracle\Middleware\EPMSystem11R1\products\Essbase\EssbaseClient-32\bin\startMaxl.cmd "E:\DataExtract\Scripts\MaxL-StopArchive.txt"
    It executes the first MaxL file find, and then in the command prompt says "MaxL Shell Completed" and goes back to the prompt. It is not picking up the second MaxL script.
    We just upgraded to 11.1.2.1 and this worked fine in 11.1.1.3 when using essmsh. Any idea why it doesn't go through the whole script?
    The contents of the two files are:
    MaxL-StartArchive
    login 'admin' identified by 'removedpassword' on 'servername';
    alter database CSHBud.PandL begin archive to file 'E:\DataExtract\CurrentExtracts\Archive-CSHBud-PandL.txt';
    alter database CSHBud.Wrkforce begin archive to file 'E:\DataExtract\CurrentExtracts\Archive-CSHBud-Wrkforce.txt';
    alter database PropBud.NOIStmt begin archive to file 'E:\DataExtract\CurrentExtracts\Archive-PropBud-NOIStmt.txt';
    alter database PropBud.Staffing begin archive to file 'E:\DataExtract\CurrentExtracts\Archive-PropBud-Staffing.txt';
    logout;
    MaxL-StopArchive
    login 'admin' identified by 'removedpassword' on 'servername';
    alter database CSHBud.PandL end archive;
    alter database CSHBud.Wrkforce end archive;
    alter database PropBud.NOIStmt end archive;
    alter database PropBud.Staffing end archive;
    logout;
    exit;

    >
    E:\Oracle\Middleware\EPMSystem11R1\products\Essbase\EssbaseClient-32\bin\startMaxl.cmd "E:\DataExtract\Scripts\MaxL-StartArchive.txt"
    Had this happen at a client that just upgraded
    Try Cmd /C E:\Oracle\Middleware\EPMSystem11R1\products\Essbase\EssbaseClient-32\bin\startMaxl.cmd "E:\DataExtract\Scripts\MaxL-StartArchive.txt"

  • File adapter in comm.channel green, but no message collecting

    Hello,
    looks like this is something really at the roots.
    Ok, we are in NW2004s PI 7.0.
    One IDOC process is successfully implemented.
    Now we started with a file to file communication!
    File sender adapter is configured and shown in status green in comm.channel monitoring which would bring me to the idea that the comm.channel is configured well  (To be sure we changed the directory path in the comm.channel to a wrong one which results in an error. Ok, corrected. Now all lamps are green). Comm channel is activated and polling.
    But... nothing happens. The Adapter is not collecting the file in the source directory (existing) and there is no entry in monitoring on RWB or SXMB_MONI.
    In Adapter monitoring all adapters except the JPR (red) are with a GREY lamp!
    As we had an issue with activating the adapters (adapter monitoring before did not show any adapter (except JPR) ) two days ago we are not sure if the current issue belongs to a mistake in the configuration or in basis environment.
    From XI 3.0 side we would expect that the adapter monitoring should show adapters used in green.
    Do you have experience with such a behaviour?
    Any help is welcome!
    regards
    Dirk

    Hi Bhavesh,
    we are near to bumping our heads against the server.
    In comm.channel:
    directory is :      /      (as simple as possible)
    file name is : *.001
    The file in the directory is named it_test.001 so it should be catched.
    What can we do wrong?
    By the way: If we change the directory to  /out   which is existing we have an (file is in this directory too) error message:  'com.sap.aii.adapter.file.ftp.FTPEx: 550 /out: The system cannot find the file specified. '.
    Cache is fine!
    regards
    Dirk

  • File adapter - Variable Substitution

    Hi all,
    I’m trying to use Variable Substitution functionality in my receiver file adapter. The objective is: During process message XI read the payload of an xml message and picks the value of tag <ORIGEM> coming with the File Name and do the substitution of File Name Schema of receiver file adapter.
    This is what I have donned in the configuration of receiver file adapter:
    File Name Schema: <b>R3%var1%.xml</b> (file construction mode: Add Time Stamp)
    Variable Substitution: <b>Enable</b>
    Variable name: <b>var1</b>     
    Reference: <b>payload:nr1:IfContabilizacao_Source_Log,1,INFO_CONTROLO,1,ORIGEM,1</b>
    The XML Message:
    <?xml version="1.0" encoding="utf-8"?>
      <nr1:IfContabilizacao_Source_Log
    xmlns:nr1="http://xi/XI/InterfaceContabilistico">
        <INFO_CONTROLO>
          <ORIGEM>TESTE</ORIGEM>
          <DESTINO>This is a string 2</DESTINO>
          <IDENTIFICACAO>This is a string 3</IDENTIFICACAO>
          <DATA>1999-01-24</DATA>
          <VERSAO>This is a string 4</VERSAO>
        </INFO_CONTROLO>
        <INFO_DADOS>
          <HEADER_DOCUMENTO>
            <BLDAT>1999-01-24</BLDAT>
            <BLART>C</BLART>
            <BUKRS>C</BUKRS>
            <BUDAT>1999-01-24</BUDAT>
        </INFO_DADOS>
      </nr1:IfContabilizacao_Source_Log>
    When I execute the process both sxmb_moni flags are ok! But in the adapter monitoring I receive this error message:
    2005-12-20 10:51:25 WET: Message processing failed: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var1
    Var1 is the name that I have defined in variable name! Is wrong? Anybody see something wrong in this configuration or something in reference payload of  tags hierarchy… I think that I have checked all…
    Thanks in advance,
    Ricardo.

    Renjith,
    Adapter monitoring continues with this error mesage: VariableDataSourceException: The following variable was not found in the message payload: var1
    This error means that the reference showed bellow have something wrong! But I can't see where is the error!!!
    payload:IfContabilizacao_Source_Log,1,INFO_CONTROLO,1,ORIGEM,1
    Anybody see where is the error of my reference, or any other idea?
    Thanks in advance,
    Ricardo.
    Message was edited by: Ricardo  Quintino

  • Calling unix scripts in File Adapter

    All,
    we have a script recindicator.sh in the root of the unix server. This script take 1 parameter.
    In the File adapter - "Run Operatning System Command After Message Processing" - we put the following,
    recindicator.sh %f
    we see the adapter working, but we are not seeing the effects of the script which is supposed to create 2 different files.
    Can we run scripts in the "Run Operatning System Command After Message Processing" ? If yes, what is wrong with our configuration?
    When we run the script directly on the server, with the parameter - it is working. so no issue in the script.
    Thanks,

    Hi,
    Yes, the script is in XI server. we tried with %F also, it is not working.
    At what directory level is the command that we give in the configuration run? is it in the root? or some other SAP folder like - "/SAP/user/..."?
    Thanks.

  • How to configure File Adapter along with OS command option

    Hello,
    I want to configure a scenario using File Adapter with OS command option.
    How to use that option in channel configuration of File Adapter.
    What is the default path where it is actually runs this OS command?
    Thanks,
    Soorya

    >
    surya venkat wrote:
    > Hello,
    > I want to configure a scenario using File Adapter with OS command option.
    > How to use that option in channel configuration of File Adapter.
    There are two ways to use the Os command in the file adapter.
    Lets talk about the sender File Adapter.
    First: Run operative system Before Message Processing
    Whenever any operation needs to be performed uppon the source file Just before XI picks it up.
    e.g. Calculate any hash code, backup the file to a given location, create a log at os level, etc...
    ... After Message Processing
    After Xi has processed the message, you can trigger a new os level command:
    e.g. Trigger a mail, check if the archiving was successful, etc.
    > What is the default path where it is actually runs this OS command?
    >
    Theres no default path, you assign the desired path in the Comm Channel configuration.
    > Thanks,
    > Soorya
    I hope it helps.

  • Command Line Scripts in File Adapter

    Hi,
    In the file adapter, does the command line script support "PERL" Scripts.
    thanks.
    Krishnan

    YES It will support.
    For clarification check below one.
    /people/sameer.shadab/blog/2005/09/21/executing-unix-shell-script-using-operating-system-command-in-xi
    FTP channel - not processing files, coz one of the files is wrong,

Maybe you are looking for