Dyanamic Configuration at receiver file adapter determine target directory

Hi Experts,
I have a requirement to determine the target directory during runtime.
From the source side one particular field determine the Target directory where you need to place file
ECC - PI - File adapter - this is the scenario
In target side 3 directories in the same server . but the directory should determine from source fields - werks
As I am new to PI Please describe the procedure in detail.
Thanks in advance.
Kevin

Hi Kevin,
Use the below UDF and map to the rootnode in the message mapping.
public String GetFileName(Container container){
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String ourSourceFileName = conf.get(key);
return  ourSourceFileName; 
In the Advanced tab of the File adapter, check the option Adapter Specific Message Attributes. Under that, check the Filename option.
This would get the fieldname in the target filename.
Check the below link:
/people/madanmohan.agrawal/blog/2009/05/20/combining-three-different-aspects-of-pi-asma-af-module-and-variable-substitution-in-one-shot
http://help.sap.com/saphelp_nw04/helpdata/en/43/0a7d1be4e622f3e10000000a1553f7/frameset.htm
/people/shabarish.vijayakumar/blog/2007/07/26/troubleshooting-the-file-adapter-last-updated-on-02-july10
Thanks,

Similar Messages

  • Need how to configuration on Receiver File adapter

    Hi,
    I am working on File to File scenario. I need to create a file in output directory with time stamp.
    I am also need to create File output directory.
    I used create target directory. But the file is not creating in the directory.
    Please help me on this issue.
    Thanks,
    Swathi

    Hi Swathi,
    1. To have the file with the Timestamp, use the option "Add Timestamp" in File construction mode.
    2. Check the receiver communication channel and in MONI. If the file is not created and is successful in MONI, then the message might stuck in Queue. Check the queues.
    Ensure the provide target directory path is correct.
    Check this:  /people/shabarish.vijayakumar/blog/2007/07/26/troubleshooting-the-file-adapter-last-updated-on-02-july10
    Thanks,

  • Need fcc configuration on receiver file adapter

    Hi,
    I am working on file to file scenario using fcc. My source file is picking propely in sxmb_moni its showing properly. but output file is not placing in target directory.
    My output record structure iss
    Target..1.1(nodE)
       detail     0..unbounded
          field1   length 15
          field2    length 10
          field3     length 14
      trailer    1...1
            field1   length 5
          field2    length 2
    for this how would i configure reciver fcc at the same time please mention me the properties.
    Thanks,
    enivass

    Hi,
    Do you need to convert from XML to Plain Text file? Or simply output the XML?
    If you need to convert your XML back to plain you should go with something like that:
    XML2Plain      Transform.Class           com.sap.aii.messaging.adapter.Conversion
    XML2Plain     Transform.ContentType     text/plain;charset=utf-8
    XML2Plain     xml.conversionType          StructXML2Plain
    XML2Plain     xml.addHeaderLine          0
    XML2Plain     xml.recordsetStructure     DT_Header,1,DT_Detail,*,DT_Trailer,1
    XML2Plain     xml.DT_Detail.fieldFixedLengths     15,10,14
    XML2Plain     xml.DT_Detail.fixedLengthTooShortHandling     Cut
    XML2Plain     xml.DT_Trailer.fieldFixedLengths     5,2
    Reference:
    http://help.sap.com/saphelp_nw04/Helpdata/EN/24/4cad3baabd4737bab64d0201bc0c6c/content.htm

  • File Adapter : Dynamic Target Directory

    Hi EveryBody,
    I have an IDOC to File Scenario in which based on some field value X in IDOC i need to send the file to Different locations under the same FTP Server.
    For Example : if X = 01 then Target folder T1
                            X = 02 then Target folder T2.
    Can somebody help me out on the same.Possibly this can be done by Dynamic Configuration.Can somebody send me some links.
    Regards,
    Zabiulla

    Hi,
    First of all I would suggest to avoid the mail communications for the query.
    Its against the SDN rules.
    please read [Rules of Engagement|/thread/117188 [original link is broken];.
    About Solution, you need not have to go for Dynamic Target Directory
    You can use the Variable substitution concept here.
    In the Target directory pass the %Var1%
    and use Var1 ---> payload:<fieldName>
    Refer to the last part of this link to understand this better,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    For dynamic configuration you can also refer below link
    Dynamic configuration of Receiver FTP File channel
    Thanks
    Swarup

  • XI3.0 File Adapter - Changing target directory at runtime

    Hi all,
    I have a XI3.0 running and I'm using the file adapter of SAP Basis 7.00. I'm trying to change the target directory at runtime, as I already did with the file name. The file name could be changed using the DynamicConfiguration, but this does not work for the directory. In help.sap I found the hint to use the variable substitution of the communication channel. I did not get it running, but it also does not solve my problem since I don't want to get the value for the target directory from the message header, but from a SAP IS-U system.
    Can anybody help me to solve this problem?

    Hi,
    while using variable substitution, did u set the indicator for create Directory:
    <i>If the adapter is to create the target directory, if it doesn't already exist then set the indicator Create Target Directory.
    If the indicator is not set and the target directory doesn't already exist the adapter returns an error.</i>
    Regards
    Vijaya

  • Receiver file adapter NFS - Access directory of other server

    HI,
    I need access from an file adapter type NFS to a shared folder on the SAP ECC server. This is possible?. Users who are connecting to assign permissions on the folder. The 2 servers are on the network and the server is not enabled SAP ECC FTP. All run on Windows 2003 server environments and the SAP PI Server is 7.1 EHP 1.
    Regards,
    Johnny

    To access a Unix NFS from Windows you can install "Microsoft Services for Unix". Those are free of charge provided by Microsoft.
    See
    http://technet.microsoft.com/en-us/library/bb496506.aspx
    Markus

  • Configuring the Receiver File/FTP Adapter !!

    Hi
    I am trying to configure the Receiver file adapter using the J2SE adapter engine(Please note , NOT the J2EE adapter engine).I see a prerequisite for configuring as below
    "The address (HTTP port and URL) where the adapter can be contacted from the Integration Engine".
    What values are to be specified and how can they be validated ?
    I could see an example given in the Docs saying below,
    If i specify , say for example,
    "XI.httpPort=1234 and
    XI.httpService=/file/Receiver, the end point address of the file/FTP adapter in the Integration Engine must be specified as follows:
    http://<fileadapterhost>:1234/file/Receiver"
    Can anyone explain what exactly is this endpoint address and where should it be specified/referred to ?
    Thanks
    Saravana

    Hi,
    "http://<fileadapterhost>:1234/file/Receiver"
    this adress refers to an end point with the end point type "xi-connectivity" in the integration directory (ID)which refers to the settings in the file adapter (httpPort=1234 and XI.httpService=/file/Receiver)
    1. you specify these adress in the file adapter (outbound)
    2. you refer to these adress in the ID (Receiver System End points)
    every file adapter should have an own port, because you can not specify two identical ports in two fileadapters.
    hope I could help you,
    michele
    Message was edited by: Michele Mangieri
    Message was edited by: Michele Mangieri

  • Specifying current directory in Receiver File Adapter

    Hi Experts,
    I have been configuring a receiver file adapter to place a file onto an FTP server. As per the information provided, as soon as I login to the FTP server, I have to place the file in current logged in directory. In this case, how can I mention this in file adapter as to use the current directory path to place the file? What should I enter in 'Target Directory' in File Access Parameters?
    Thanks,
    Dhawal

    Hi Praveen,
    Since file directory parameter is mandatory, my question is what should I enter in this parameter so that the file adapter will know that the file should be placed in the root directory itself?
    Regards,
    Dhawal

  • 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 J2SE Adapter Engine

    Hi,
    We have configured a receiver file adapter on a J2SE adapter engine through the administrator page of the J2SE adapter.
    XI.httpPort=8222
    XI.httpService=/file/Receive
    and the rest of the adapter parameters.
    I have configured a channel in ID as XI receiver adapter.
    host: "hostname"
    Service: 8222
    Path Prefix: /file/Receive
    The messages in sxmb_moni fail to be delivered with "HTTP error 404 Resource not found."
    Through a browser I am also not able to make a connection to this url:
    "host":8222/file/Receive
    Getting Http error "501".
    Please can someone shed some light on this problem.
    Regards
    Willie Hugo

    >Through a browser I am also not able to make a connection to this url:
    >"host":8222/file/Receive
    >Getting Http error "501".
    This is ok. Since get method not implemeted for this service.
    Since from XI you are getting this error "HTTP error 404 Resource not found", can you logon to XI server at OS level and do a telnet test to check if the port is working.
    cmd> telnet
    telnet> open <J2SEAdpaterEngineHostName (or) IPAddress> 8222

  • 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 - 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

  • Target Directory & File Name parameters in Receiver File Adapter with ASMA

    Hi Experts..
    I have the following question....
    What am I suppose to inform in the Target Directory & File Name obligatory parameters in Receiver File Adapter if I am using ASMA to fill it? Is it any dummy value?
    Also, if you have any step by step guide/blog to forward on how to use ASMA in file adapter I will be greatful.
    Thanks in advance,
    Daniela

    You can give any dummy value in dir and file name... Just go through these blogs
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    /people/madanmohan.agrawal/blog/2009/05/20/combining-three-different-aspects-of-pi-asma-af-module-and-variable-substitution-in-one-shot

  • Can we go with ALE configuration instead of receiver idoc adapter at target

    Hi Experts,
    Could you please provide me some idea when why don't we go with ALE configuration to exchange IDOC from PI  to Target system instead of configuring receiver IDOC adapter at target side.

    Hi Raj
    Point 1:
    When we send IDoc from SAP system to PI ,it used ALE connections nothing but using RFC destination and Port it establishes the connection IDoc will reach PI ABAP Stack.
    Point 2:
    When we send IDoc to ECC using PI IDoc adapter it uses the same mechanism(RFC destination/Port),but the only purpose of IDoc comm8unication channel is to call RFCDEstination and Port created in PI.
    i.e: There is no difference in communication(Point 1 and Point 2) both uses TRFC calls.
    Regards,
    Raj

  • Configuring Receiver File Adapter for J2SE

    Hi All,
    I have a scenario in which i need to convert the IDOC data into a fixed length file.
    I did mapping according to the output structure of the file.
    My Output file format is as follows...
    Document1          document2      document3      etc
    Each document contains different fields with different lengths
    In XI-FIle adapter we give Recordset structure : Document1,Document2,Document3.
    But while configuring Receiver File adapter in J2SE.
    There is no option mentioned in J2SE Adapter.
    <b>http://saphelp.border-states.com/EN/95/bb623c6369f454e10000000a114084/content.htm</b>
    Please throw some light on the same.
    Thank You
    Regards,
    Reehan

    as far as i read the document, what i understood is that the J2SE adapter has a limitation.
    your XML structure should be as mention in the link;
    <i>To convert a table in XML format to pure text format, the document format must be the same as that which is generated by the sender file/FTP adapter in mode FILE2XMBWITHROWCONVERSION <i>(with the default value <row> for the structure)</i> and the sender JDBC adapter. This means that the document structure looks like this:
    <resultset>
    <row>
    <column-name1>column-value</column-name1>
    <column-name2>column-value</column-name2>
    <column-name3>column-value</column-name3>
    </row>
    <row>
    <column-name1>column-value</column-name1>
    <column-name2>column-value</column-name2>
    <column-name3>column-value</column-name3>
    </row>
    </resultset>
    This is an example for 3 columns and 2 lines. The number of lines and columns is, of course, unlimited. <b>The XML elements in italics can be defined by the user and the elements of a line must be grouped within an element of type <row> … </row></b>.</i>
    So cannot take the <b>recordset structure</b> as we have for the normal File adapter.

Maybe you are looking for