Deriving file path in communication channel depending on environment

We have received this request:
======begin request======
As you know transporting communication channels is a tedious affair
that consists of exporting and importing objects, manual steps to
modify the communication channel for the target system and then
activation. The process of manual modification of the communication
channel after it has been transported is particularly subject to human
error.
Could you please investigate using dynamic/logical names for such
things as:
Directory names
Filenames
Any thing else that can be derived dynamically, or set logically.
======end request======
An example would be a directory path in a file adapter:
in dev: <drive>/dev
in prod: <drive>/prd
We don't want to reconfigure the channel on transport. Value mapping
is not an alternative as we would have to maintain a table anyway and
use a custom function to derive. Dynamic Configuration in a map
requires a custom function and lack of flexibility. Adapter Specific
Message Attributes don't really help.
Is there some way environment variables can be accessed and configured in a communication channel?

Hey Dave,
reconfiguring Adapters after Integration Directory objects transport is a necessary step, since the addresses/ports of production environments will almost always be different.
Nevertheless, you will need to manually reinsert the path information in Prod File adapter, and there you could use "prod" instead of "dev".
A possible workaround to make it a little more "automatic" would be to refer to the Business System name in the File path, using variable substitution. In this case, for example, use the variable "dir" in the variable substitution table, refering to the property "message:receiver_service" (without quotes), and in the path field, use something like "/%dir/" (also, without quotes).
Regards,
Henrique.

Similar Messages

  • Issue on file sender adapter communication channel

    Hi All,
    I have an issue on some of the file sender adapter communication channels .The channels are failing with the error :
    (u201CAttempt to process file failed with com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.xi.swift.ParserException: com.sap.xi.swift.ParserException: Message does not start with character '0x1f'u201D).
    Please let me know the procedure to get this message processed.
    Thanks & Rgards
    Vishnu

    Hi Vishu,
    Find out in what encoding the file is in. for that download Notepad++ and open the file with in.
    In Encoding tab you will see the encoding format.
    1. If its not UTF-8 or ANSI then you should set the correct encoding in Sender File channel.
    2. Check for BOM characters which will not be visible directoly.
    3. Use Notepad++ to convert the content to HEX and check for hidden values. i bet there will be some Encoding BOM in the file which is creating problem while picking the file.
    Since you are using SWIFT module: try to validate the XML file using Altova XML and check weather is correct.
    also ref to this thread:http://scn.sap.com/thread/2134946
    Regards,
    Senthilprakash

  • File Structure - Sender Communication Channel

    Hi All,
    My Sender flat file structure is below like this
    Filed1|Field2|Field3|Field4|Field5|Field6
    Filed1|Field2|Field3|Field4|Field5|Field6
    Filed1|Field2|Field3|Field4|Field5|Field6
    Filed1|Field2|Field3|Field4|Field5|Field6
    Filed1|Field2|Field3|Field4|Field5|Field6
    Filed1|Field2|Field3|Field4|Field5|Field6
    I did the Sender Communication Channel configuration  - Content Conversion
    Document Name : XXX
    Document NameSpace: XXXX
    Recordset Structure: MT_Test,*
    Recordset Sequence: Ascending
    Key field Type: String Case-Sensitvie
    MT_Test.fieldNames: Filed1,Field2,Field3,Field4,Field5,Field6
    MT_Test.fieldSeparator: '|'
    MT_Test.additionalLastFileds: ignore
    MT_Test.endSeparator : 'nl'
    ignoreRecordsetName: true.
    But its pick the file, In SXMB_Moni show Currect...
    But in Runtime workbench, in Communication Channel moni, it show below like this,
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MT_Test xmlns:ns0="http://XXXXX">
    <JOBS />
    </ns0:MT_Test>
    What is the Issue, where i missed some thing, In message mapping, its correct..
    Thanks.
    SR

    SR,
    I am still little confused with your below statement.
    But its pick the file, In SXMB_Moni show Currect...
    But in Runtime workbench, in Communication Channel moni, it show below like this,
    >
    > <?xml version="1.0" encoding="UTF-8" ?>
    > - <ns0:MT_Test xmlns:ns0="http://XXXXX">
    > <JOBS />
    > </ns0:MT_Test>
    You mean to say that in MONI, the mapping output is fine, but when you check the output at RWB -> CC Monitoring for the Sender Channel, then you get the above mentioned XML?
    This means that there is nothing wrong with your source CC settings. If the entry in RWB -> Sender CC is wrong, your MONI entry will never be right. So, this is really weird.
    What is the source structure that you have defined in DT?
    Regards,
    Neetesh
    Edited by: Neetesh Raj on Sep 29, 2009 2:31 PM

  • Dynamic file name in communication channel

    hello
    is it possible to give in the communication channel, under the 'File Access Parameters', a dynamic file name?
    to get it out of a table or something?
    Thanks
    Kfir

    Hi,
    Yes its bit possible to use the dynamic file name at File access paramters
    The dynamic filename generation concept is as follows.
    In your filename field. just give a variable with % symbols. (eg: %file% ).
    Now, under the option Variable Name Substitution, you can give how the value has to be created.
    It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.
    For the former, your give
    message:interface_name ,etc
    and for the payload part you give,
    Payload: "your element root which u wanna acecss"
    Just check this link out,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    And read the contents under variable substitution and it will help you understand the concepts better.
    If you have any clarifications, do get back,
    Refer below links for more in depth details about it
    Re: Dynamic file name in Receiver File Adapter
    http://help.sap.com/saphelp_nw2004s/helpdata/en/21/6faf35c2d74295a3cb97f6f3ccf43c/frameset.htm
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    /people/sap.user72/blog/2005/10/01/xi-new-features-in-sp14
    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
    /people/michal.krawczyk2/blog/2006/02/23/xi-dynamic-name-in-the-mail-attachment--pseudo-variable-substitution
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    Check out this URL
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    Check these weblogs as well...
    /people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12
    /people/sameer.shadab/blog/2005/09/23/an-interesting-usage-of-variable-substitution-in-xi
    Thanks
    Swarup

  • Advance selection for source file-Error in communication channel monitoring

    Hi all,
    Referring to the link below:
    <b>/people/mickael.huchet/blog/2006/09/18/xipi-how-to-exclude-files-in-a-sender-file-adapter
    I have developed my scenario in the same way.But due to the values <b><NOTHING></b>
    in Mandatory fields Source Directory and Filename,i am facing problem in Communication Channel Monitoring as it shows an error;even though the end-to-end scenario works successfully.
    Plase note that  our scenario is not to exclude the particular file but to pick the files serially after a certain delay.
    Kindly provide some idea about how can we remove the error from Communication Channel Monitoring.
    Thanks & Regards,
    Sudhir Tiwari

    Sudhir,
    In the sender file adapter, you have an option called <b>"Processing Sequence"</b>.
    By selecting ByName or ByDate you can make files get selected sequentially either ByName ( alphabetically ) or by the creation time stamp of the file.
    In the sender file adapter also make the QOS as EOIO and give the QueueName as any value and the files will be processed sequentially.
    Regards
    Bhavesh

  • O/P file in receiver communication channel.

    Consider a file to file scenario..
    and in the receiver Communication Channel,We have to specify the name of the output file right.but i want my output in a different way.....
    my output file names are different.....what shall io do now....
    Any ideas...

    Hi Reddy,
    your requirement is not clear...
    Try these
    Dynamic File Name Part 1
    /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i
    Dynamic File Name Part 2
    /people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii
    XI: The same filename from a sender to a receiver file adapter - SP14
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Sachin

  • Time stamp is not getting updated for File Adapter in communication channel

    Hi All,
    Since yesterday, I am observing that the time stamp of communication channel for File adapter is not gettingupdated some times.
    I had to stop and start the communication channel to update the time stamp.Please let me know if anyone has come across such issue or any useful notes on this.I could not find any related notes on Market place.
    Regards,
    Dinakar

    Hi,
    This is happening only with one communication channel which is sender in derection.Any reason why it is happening like this?since the restart of the communication channel it is getting update now.I really do not know how to delete/create the communication channels as this was done our PI consultants.Pls guide me.
    Regards,
    Dinakar

  • 2 files in 1 communication channel

    Hello,
    I transfer file from FTP to info cubes.
    The process work correctly and with out problem.
    Now I try to add 2 files with same structure from same folder to same info cubes.
    I try to use with same communication  channel to transfer this 2 files.
    I looking for advise to this problem.
    Regards
    Elad

    Hi Elad,
    Here's the solution than you want:
    In your sender CC, make parameters like that:
    1. Filename = <A_text_will_be_NOT_used>
    2. Choose option "Advanced Selection for SourceFile", a table appears
    3. Create two lines, fill them like that:
        Line 1: Directory = your_directory
                File Name Mask = aa*.text
        Line 2: Directory = your_directory
                File Name Mask = bb*.text
    If you have a "xx*.text" file, then it will be NOT processed.
    Note: If your are patient, I will create Weblog this evening with some pictures...
    Mickael
    <i>>> Because of SDN, pictures will be available in only one week (time needed to become a Webloger!)</i>
    Message was edited by: Mickael Huchet

  • Problem with Sender File Content Conversion Communication Channel

    Hi All,
    I am using XI 3.0--SP 16.
    I have configured a Sender communication channel with File Content Converison which takes up a Fixed length text file and converts to XML.
    My scenario is that I have some 'n' files, out of which one file has error in content conversion.
    In a normal scenario I would expect other files to get processed, but they are not.
    I can correct the error or even discard the error file. But I am unable to understand why XI is not processing the rest of the good files.
    Thanks in advance.
    Regards.,
    Sudharshan

    Hi,
    @Renjith
    The QOS is EO, thats why I am wondering why it is not picking the rest of the good ones
    Regards,
    Sudharshan

  • XI-Multiple instance scenario -File & SQL sender communication channels

    Hi
       i have a basic question regarding how file sender communication channel ( where we poll for a particular file pattern either using file/ftp types in a particular subfolder ) or a sql sender communication channel - ( selecting records from a sql source ) would work in a scenario with two active XI instances and j2EE file and sql adapter services running on both of the J2EE servers ?
    1. How would the file polling from both J2EE servers - avoid a conflict looking for the same file pattern ? Is there any inbuilt mechanism from SAP to make multiple instances work with the file polling - without a confict ?
    2. Simlar question for SQL sender type communication channel ?
    If SAP does have a mechanism to handle multiple instance scenarios for file and sql sender adapter based communication channels, is there a link/document on this ?

    Hi Karthik,
    Please see my comments.
    I am just wondering aloud - what will happen if we use a select for update clause in the sql sender adapter communication channel -
    Gouri: Yes you can use select + update. In fact that is the right way.
    will this ensure that polling from one J2EE instance will lock the selected records so that the second instance does not select the same set of records from the sql server ? Or should we not use a select for update and use a simple select statement ?
    Gouri: Yes. SQL DB will ensure that same data will not be picked by another node. As I mentioned earlier use serilizable option from advanced mode.
    -Gouri

  • Take Source file path in sender adapter from an environment variable .

    Hi,
    Is it possible to take source file path(half file path) dynamically in sender file adapter.
    Please suggest any alternative to this.

    Hi,
    One option, use Dynamic Configuration and set the values in the Mapping.
    By the ways, the File Directory and the Filename are taken runtime in the file adapters after transportation.
    Only if you are using FTP will you need to key in the FTP addess user id password etc.
    Refer -- same way try for File adapter
    Dynamic Configuration of Some Communication Channel Parameters using Message Mapping
    Ps Note : I have personally never tried it to use the Dynamic Configuration for file path. But you can try.
    Thanks
    Swarup

  • Problem in reading the excel file path in WINDOWs machine from UNIX environ

    Hello friends,
    My requirement is to read each row of the excel sheet and sent that row to the database. I have implemented it by using jxl and apache poi framework. locally in my WINDOWS machine it is working fine..
    But when i deploy the code in UNIX machine. My application runs on a Unix server , trying to read the excel file in WINDOWS environment. I am not able to retrieve the file path. for ex : C:\Documents and Settings\sabbanik\My Documents\KARUNAKAR\excel.xls
    I am getting error in this line
    workbook = Workbook.getWorkbook(filepath)
    Error message : input file not found.
    Thanks in advance..

    You said: I am getting error in this line workbook = Workbook.getWorkbook(filepath) >
    Based on this, I will assume you are trying to use OLE to access information about the Excel file. As mentioned by Andreas, your code will be executing on the server (Unix) and since Excel isn't on the server (and cannot be) an error will result. OLE can only be used in Windows environments (client or server). To access client side OLE calls and content, you need a java bean and Excel installed on the client machine. Oracle provides WebUtil as an option to writing your own Java Bean. To use this, you will need to be running Forms 10.1.2 or newer. Details can be found here along with a demo:
    http://www.oracle.com/technetwork/developer-tools/forms/webutil-090641.htm

  • File to 2 Communication Channels on same Business Service / PI 7.0

    Hi all,
    I got a new question.
    I want to place a file in two different directories on the same Business Service. Think I have to use 2 CC for that.
    Background: We receive a file and want to forward that to a directory (e.g. "/in"). So far so good. But in addition this file should also placed in an archive directory (e.g. /in/archive). Unfortunately there's no archive function in the receiver file channel, therefor I have to find another solution.
    Any ideas? In Receiver Determination I only can assign one CC to the BS...

    Hello,
    U can either use AM,  or u can write a script and last ut not least u can add one more file receiver channel (which u are already aware of).
    In case u want to use same design for multiple interfaces then u can certainly look towards implementing AM, but in case this is one such req. where u want to archive files then u can avoid using AM and add one more channel.
    Thanks
    Amit Srivastava
    Message was edited by: Amit Srivastava

  • Issue while archiving the processed file in sender communication channel using SFTP adapter

    Hi All,
    In one of my scenario (File to IDOC), we are using SFTP sender communicationchannel.
    we are facing an issue while archiving the processed file. Some times PI processed the file successfully but unable to archive it and in the next poll PI process & archives the same file successfully which will creates duplicate orders in ECC.
    Please let us know how to resolve this issue.

    Hi Anil,
    Refer Archiving concepts in below links.
    http://help.sap.com/saphelp_nw73/helpdata/en/44/682bcd7f2a6d12e10000000a1553f6/content.htm?frameset=/en/44/6830e67f2a6d12e10000000a1553f6/frameset.htm
    http://scn.sap.com/docs/DOC-35572
    Warm Regards,
    DNK Siddhardha.

  • Variable file name through Receiver mail Communication channel

    I need to send a file through receiver communication channel   with the following name ( YYMMDD schema)  . The YYMMDD is current date .  I know how to create these file names throug FCC ( file communication channel) , I tried in the same manner to create this file through Receiver Mail CC , but it did not work  .  If you have any ideas , can you please share with me ?
    ABC_MMYYDD.TXT
    Thanks.
    Ritvik

    Hi Ritvik,
    Also, Please look at this link and see if it helps you. It is generating variable file name through a UDF
    Re: Problem in dynamically file name generation procedure
    Best Regards

Maybe you are looking for