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.

Similar Messages

  • FCC receiver file adapter new line 'nl' is not working

    Hi Experts,
    I am doing idoc to file scenario,i have to creart a text file in which each line will have a record.
    i am using
    Recordset Structure -->DeliveryRecords
    DeliveryRecords.addHeaderLine 0
    DeliveryRecords.fieldFixedLengths 4,25,3,10,10,10,8,18,40,10,13,15,10,4
    DeliveryRecords.fieldSeparator '0x09'
    DeliveryRecords.endSeparator  'nl'
    but new line is not working every thing is coming in the same line.i have also tried with '0x0A' , this is also not working.
    Pls suggest what can be done.??

    Hi
    You have to use either fieldFixedLength or fieldSeparator.
    You should not mix together.
    DeliveryRecords.addHeaderLine 0
    DeliveryRecords.fielNames aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn
    DeliveryRecords.fieldFixedLengths 4,25,3,10,10,10,8,18,40,10,13,15,10,4
                       or
    DeliveryRecords.addHeaderLine 0
    DeliveryRecords.fielNames aa,bb,cc,dd,ee,ff,gg,hh,ii,jj,kk,ll,mm,nn
    DeliveryRecords.fieldSeparator '0x09'
    DeliveryRecords.endSeparator 'nl'
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
    /people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion

  • New Line in EBCDIC file created by receiver file adapter

    Hi mates,
    I've configured the receiver file adapter to create a file in EBCDIC format by specifyin the File encoding 'Cp037'. When the file is viewed on the AS400 system using the command DSPPFM, it appears as a continuous text instead of line-by-line. I've tried specifying 0x0D(CR), 0x0A(LF), 'nl' as the endSeparator for the record type in content conversion, but no luck. Still the file looks like a continuous text.
    I learnt from the following links that the New Line character (NL or NEL) in AS400 is Unicode '0x85'.
    <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4867251">OutputStreamWriter/InputSreamReader convert NEL to linefeed with Cp037 encoding</a>
    <a href="http://search.cpan.org/~guido/libintl-perl-1.16/lib/Locale/RecodeData/IBM037.pm#CHARACTER_TABLE">CHARACTER TABLE</a>
    But when I specify this '0x85' as the endSeparator, I get the error below as 0x85 (decimal equivalent 133) is not part of the standard ascii code i.e. basic 127 codes
    <i>Conversion initialization failed: java.lang.Exception: java.lang.NumberFormatException: Value out of range. Value:"85" Radix:16</i>
    Is there any way I can produce the EBCDIC file with new line as end separator for records?
    I appreciate your inputs.
    thx in adv
    praveen

    Instead of using binary mode for FTP and specifying encoding, endSeparator, I used the text mode and left the translation to the FTP server on AS400 system.
    Desirably, it generated the file with right encoding and new line characters.
    praveen

  • 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

  • Receiver file  adapter creates an innecesarry extra line

    Hi,
    I have an issue with an extra line that add the receiver file adapter with the content conversion.
    The file XML that the file adapter has to convert, is the next;
    <root>
    <cofig>
      <FileName>NameOfTheFile.txt</FileName>
      </cofig>
    <lines>
    <line>
      <data>BBBBBBBBBBBBBBBBBBBBBB</data>
      <data>Aaaaaaaaaaaaaaaaaaaaaa</data>
    </lines>
    </root>
    Because FileName is not necessary, I remove it with:
    cofig.fieldFixedLengths 0
    cofig.fixedLengthTooShortHandling CUT
    but it leaves an empty line that i don't want. that is, the text in the file start in the second line.
    Any help?
    Thank you in advance.

    Can you do a small change in your mesg. structure ?
    change it to....
    <root>
    <lines>
    <line>
    <data>BBBBBBBBBBBBBBBBBBBBBB</data>
    <data>Aaaaaaaaaaaaaaaaaaaaaa</data>
    </lines>
    <i><b><cofig>
    <FileName>NameOfTheFile.txt</FileName>
    </cofig></b></i>
    </root>
    and then use
    cofig.fieldFixedLengths 0
    cofig.fixedLengthTooShortHandling CUT
    followed by
    endSeparator 0
    Ref: Suppressing Field In Receiver File Adapter for more details.

  • 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

  • Multiple Header line in Receiver File adapter

    Hi,
    I have an issue in Receiver File adapter with multiple header lines. I am able to get only 1 header lines in the receiver file but not multiple header lines with 'nl' since it is static in file mode
    [CommunityTag:Header]
    empNo,EmpName,Age
    [CommunityTag]
    I tried with the below in content conversion one as below with no luck
    Root.addHeaderLine=1
    Root.headerLine=[CommunityTag:Header] 'nl' empNo,EmpName,Age 'nl' [CommunityTag]
    Root.fiedSeparator=,
    Root.endSeparator='nl'
    I am getting the Header line as same row as static text.
    Can you advise this.

    Hi Gabriel, I suggest to produce the header lines from additional nodes in the message payload. That means you need to modify the data type of the target message in order to generate an extra structure in the payload. Use constants in message mapping to generate the header column names, e.g.
    <Header>
      <H1>CommunityTag:Header</H1>
      <H2>empNo,EmpName,Age</H2>
      <H3>CommunityTag</H3>
    </Header>
    In content conversion you have to convert the Header row with
    Header.endSeparator='nl'
    You won't need parameter addHeaderLine anymore then.
    Regards, Martin

  • PI 7.1 Receiver file adapter - Spaces are truncated at end of each line

    In Receiver file adapter, I specified file content conversion parameters. My file structure is as below:
    Header
      Field1  10
      Field2  20
      Field3  8
      Filler   20
    Detail
      Field1  10
      Field2  8
      Filler    8
    In both Header and Details structures I have to fill 20 and 8 spaces at end of each line. In XML (Payload) I can view the spaces. But when the text file is created all the spaces are truncated.
    Could you please solve this issue.
    Regards

    Recordset Structure: ns1:MT_SAP,REC,Header,Detail
    ns1:MT_SAP.fieldSeparator          '0'
    ns1:MT_SAP_PNC_PPAY.fieldContentFormatting     nothing
    REC.fieldContentFormatting          nothing
    REC.fieldSeparator               '0'
    REC.processConfiguration               FromConfiguration
    Header.fieldFixedLengths               10,20,8,20
    Header.endSeparator               'nl'
    Header.fixedLengthTooShortHandling          Ignore
    Header.fieldNames               Field1,Field2,Field3,Filler
    Header.fieldContentFormatting          nothing
    Detail.fieldFixedLengths               10,8,8
    Detail.endSeparator               'nl'
    Detail.fieldNames               Field1,Field2,Filler
    Detail.fieldContentFormatting          nothing
    Detail.fixedLengthTooShortHandling          Ignore

  • Blank line in receiver file adapter content conversion

    Hi,
    I am using a receiver file adapter. Everything is working fine. Except that a blank line is put by the file adapter between each records. It is a flat file format.
    I have used the stting below. How do we remove the blank line?
    Recordset : ACCTHDR,BATCHDR,TRANSREC,BATCHTLR,FILETLR
    ACCTHDR.fieldFixedLengths 1,7,4,9,8,665
    ACCTHDR.absoluteRowWidth  694
    ACCTHDR.addHeaderLine 0
    Thanks
    Sachin K

    Hi,
    .endSeparator
    The default value is a line break (no explicit separator after the last column; instead the structures are arranged line-by-line).
    If you enter a character string here, the system adds it to the last column as a closing character. You can also make this specification in addition to NameA.fieldFixedLengths. To include a line break following the closing character, you must explicitly define it by attaching ´nl´ (including the quotation marks) to the string.
    Regards
    Agasthuri Doss

  • Archiving files in the Receiver File Adapter

    Hi All,
    I am trying to archive the file created in the Receiver File adapter. Reading from the link below,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    I gave the command cp %F <target dir> in the Command Line of "Run Operating System Command After Message Processing". As well as I tried cmd.exe copy %f <target file>
    But it does not work. Can anyone please help me out?
    Thanks
    Shivanjali

    Hi Aamir,
    For my case its not feasible to make a bat file...
    I want to write a direct OS command in adapter only.
    Do you know what is the basic difference for running OS command before processing and after processing.
    In my opinion if i use a OS command after file processing then it ll take a file name with timestamp so there may be a problem...
    thanks
    Shivanjali

  • Receiver File Adapter - XML

    Hi
    I have configured a receiver file adapter to send an XML message to a file directory.
    The structure is
       <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_SiteDetails_MM xmlns:ns0="urn:Retail.net:SiteDetails">
    - <ROWSET>
    - <ROW>
      <ext_cust_id>0003009996</ext_cust_id>
      </ROW>
      </ROWSET>
      </ns0:MT_SiteDetails_MM>
      How do I get the line - <ns0:MT_SiteDetails_MM xmlns:ns0="urn:Retail.net:SiteDetails">
    out of the message. Is it possible.
    Can I use file content conversion.
    any help is appreciated.
    Joe

    Hi,
    >>>  have configured a receiver file adapter to send an XML message to a file directory
    If i understand it correctly, you need to send X.XML to some directory you configured and you want to do something with <ns0:MT_SiteDetails_MM xmlns:ns0="urn:Retail.net:SiteDetails">.. If i am right, you can use Run OS command after processing option at receiver file adapter.
    Write one Shell script and do whatever you want to do with this file. Remove line, add something or anything.
    Regards
    Aashish Sinha

  • Output CSV File Naming Convention - Receiver File Adapter

    Dear SAP experts,
    I need help regarding my scenario.
    My scenario is this, Customer will send EDI message to XI. XI will then translate the message and convert it into XML.. After, a Receiver File Adapter will receive the XML then convert it into .csv file.
    I've already configured the Receiver File Adapter to convert the XML into .csv file.
    But, my problem now is how will I configure to have my output .csv file has a File Naming Convention.
    The output .csv file must be "CustomerName_YearMonthDate".
    From the EDI message, there is indicated Sender GLN in which, each customer has its own Sender GLN.
    E.g., Globus --> 200, Karstadt --> 300,  Metro --> 400.
    How will I configure so that I can have an output .csv file of,
    If Globus sends the EDI message, the output .csv file is Globus_20080304.csv.
    If Karstadt, Karstadt_20080304.csv.
    If Metro, Metro_20080304.csv.
    Kindly advise for a clear and complete solution.
    Thank you very much for your usual support.
    Fred

    Hi Nisar,
    My target message (XML) in the mapping is this,
    - <ns0:CSV>
        -  <SLI>
               <PERIO> </PERIO>
               <ILN> </ILN?
               <EAN> </EAN>
    perio, iln, and ean was rooted on SLI field. and the CSV is the rootnode of the target message.
    I have created a UDF on the message mapping to accomodate the output customer name, here is the codes:
    String fname="";
    if(GLN.equals("23456"))
    fname ="Globus" +dat;
    else if(GLN.equals("5678"))
    fname ="Karstadt"+dat;
    else if(GLN.equals("6789"))
    fname ="Metro"+dat;
    DynamicConfiguration conf = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(
        "http://sap.com/xi/XI/System/File",
        "FileName");
        conf.put(key,fname );
    E.g.,
    Globus --> 23456 (Sender GLN)
    Karstadt --> 5678 (Sender GLN)
    Metro --> 6789 (Sender GLN)
    This UDF i've made in the Message Mapping was mapped in the root node CSV.
    Is this UDF correct?
    Then on the File Receiver Configurations, here are the configs,
    Transport Protocol: File System (NFS)
    Message Protocol: File Content Conversion
    Adapter Engine: Integration Server
    File Access Parameters
    Target Directory: /var/opt/gsss/sample/csv
    File Name Scheme: .csv
    Processing Parameters
    File Construction Mode: Create
    - Overwrite Existing File
    Write Mode: Directly
    File Type: Text
    Variable Substitution --> ???
    Adapter Specific Message Attributes
    - Use Adapter-Specific Message Attributes
    - Fail if Adapter-Specific Message Attributes Missing
    - File Name
    Run Operating System Command After Message Processing
    Command Line: chmod 664%F
    Content Conversion Parameters
    Recordset Structure: SLI
    SLI.addHeaderLine: 3
    SLI.headerLine: PERIO;ILN;EAN
    SLI.fieldSeparator: ;
    SLI.endSeparator: 'nl'
    Adapter Status:
    Status: Active
    Kindly advise if my configs are correct.
    Thank you very much!
    Fred

  • Receiver File Adapter - FTPEx: 550 Access denied

    Hi Experts,
    In my receiver file adapter scenario I'm getting 550 Access denied in RWB.
    I am a little confused here because I could access the FTP client from my desktop using the same User and Password informed in the Receiver CC. I also could drag and drop a file there.
    Here you have Detail Display in RWB, it seems that at least the user is working fine for PI also:
    Success: Connecting to FTP server "<FTP IP>"
    Success: Write to FTP server "192.168.10.85", directory "\Transportadoras\10326750000101\",   file "Nfe_teste.xml"
    Success: Transfer: "TXT" mode, size 8881 bytes, character encoding UTF-8
    Error: Attempt to process file failed with An error occurred while connecting to the FTP server '192.168.10.85:21'. The FTP server returned the following error message: 'com.sap.aii.adapter.file.ftp.FTPEx: 550 Access denied.'. For details, contact your FTP server vendor.
    Error MP: Exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: An error occurred while connecting to the FTP server '192.168.10.85:21'. The FTP server returned the following error message: 'com.sap.aii.adapter.file.ftp.FTPEx: 550 Access denied.'. For details, contact your FTP server vendor.
    Regards,
    Daniela
    Edited by: Daniela Machado on Aug 11, 2010 10:18 PM

    Hi Daneial,
    This is an issue due to any firewall or proxy between your Xi system and the FTP.In this case the direct logon
    works with same user but when XI tries to create file at runtime you get this error due to network issues.
    To resolve this contact your Basis/Network guys  and
    1. Set the permissions to FTP User you are using as 777 rights(full access to read , write and delete)
    2.If you have access to PI server, try to telnet /connect to ftp using command prompt (open ftp .....) the FTP server form there, you should see the same error there , inform this to your network guys.
    3.Clear all the files places already in the ftp (take backup) and test afresh after permissions are set by basis team.
    Regards,
    $rinivas

  • Receiver File Adapter - Content Conversion

    Hi,
    I don't quite get this:
    I have a structure
    <?xml version="1.0" encoding="UTF-8"?>
    <AnElement1>
       <AnElement2>
          Bla bla bla
       </AnElement2>
    </AnElement1>
    I want to convert this to a flat file with a line containing
    Bla bla bla
    In te receiver file adapter I define the following:
    In the 'Content Conversion Parameters'
      Recordset Structure : AnElement2
      Name                         Value
    AnElement2.addHeaderLine         0
    AnElement2.fieldSeparator        'nl'
    AnElement2.endSeparator          'nl'
    This results in an Empty file each time indicating some error somewhere.
    What am I missing?
    Thanks
    Andre

    Hi Andre,
    Just check the link <a href="http://help.sap.com/saphelp_nw04/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/frameset.htm">File content conversion</a>
    Also check out this web log <a href="/people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2 to TXT</a>
    Is there any error log shown in File adapter ?
    Regards,
    Keith
    Message was edited by: keith thompson

  • Problem: The same filename from a sender to a receiver file adapter - SP14

    Blog : /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    My Problem:
    The thing works for me and i am able to get my input files name as my output file name. But one thing i noticed is that in my target message, the field where i have mapped the code it always returns the value "null" but finally when the file is created i get the required result.
    My input file name is input.txt and i get the same name in my output file too.
    In sxmb_moni if i check DynamicConfiguration link i see the following
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!-- Response
    -->
    - <sap:DynamicConfiguration xmlns:sap="http://sap.com/xi/XI/Message/30">
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFTPHost">10.25.116.98:21</sap:Record>
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="Directory">/input/test</sap:Record>
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileTimestamp">20060228T112200Z</sap:Record>
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileType">bin</sap:Record>
    <b><sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">input.txt</sap:Record></b>
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileSize">770</sap:Record>
    </sap:DynamicConfiguration>
    But when i check my mapped field i see
    <field3>BodyC</field3>
    <keyfield>02</keyfield>
    <field5>BodyE</field5>
    <field6>BodyF</field6>
    </Body>
    - <Trailer>
    <keyfield>03</keyfield>
    <b><field2>null</field2> -> Null value instead of input.txt</b>
    </Trailer>
    </ns0:MT_Putfile>
    The code i have used to map the field2 of the trailer is the following ....
    <i>DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileType");
    String valueOld = conf.get(key);
    return  valueOld;  </i>
    Any clues ?

    Gosh this is spooky
    Anyway i tried with that line of code but it throws me an error during activation ...
    Activation of the change list canceled Check result for Message Mapping mm_IS | http://t-systems.com/Shabarish:  Starting compilation  Source code has syntax error:  /usr/sap/TXT/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map387c7300a9ac11da9d280011256afae8/source/com/sap/xi/tf/_mm_IS_.java:104: cannot resolve symbol symbol : method getTransformationParameters () location: interface com.sap.aii.mappingtool.tf3.rt.GlobalContainer DynamicConfiguration conf = (DynamicConfiguration) container.getGlobalContainer().getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); ^ 1 error
    The code is :
    DynamicConfiguration conf = (DynamicConfiguration) container.getGlobalContainer().getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    //DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    //String valueOld = conf.get(key);
    String valueOld = conf.toString();
    return  valueOld; 
    Thanx Renjith so far .. but i hope this gets resolved (else i will loose my sleep thinkin abt the situation)

Maybe you are looking for