FileName in Sender File Adapter Module

Hi Folks,
In my sender file adapter have written a module to read the picked file name. The protocol used is NFS.
Notice that the file name read in the module has the absolute path, including the directory path. E.g The file name xyz has to be picked from source directory
XIServer\Outbound. In the module when I retrieve the file name, it comes up as
XIServer\Outbound\xyz. Is this expected behaviour?
I was expecting just the file name<xyz> to be retrieved.
Thanks,
Anand

HI,
Create an UDF and write this code.
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 Adapter u will have Adapter specific parameters check the file name check box.
Using this UDF u will get the file name at target side.
Regards,
Phani.

Similar Messages

  • Dynamic configuration required in sender file - Adapter Module

    Hi Everybody,
    I am developing an Adapter Module in the file adapter (sender) using Adapter Specific Message Attributes.
    I am using Dynamic configuration inside the Module Process method in the adapter module.
    We are getting an error saying Dynamic Configuration cannot be resolved.
    Can anybody tell me the package to be used.
    Thanks,
    Zabiulla

    You can access the dynamic configuration in adapter module like this:
    Message msg = (Message) inputModuleData.getPrincipalData();
    String fileName = msg.getMessageProperty("http://sap.com/xi/XI/System/File", "FileName");
    You do not need any addition library besides the adapter module API.
    Hope that helps
    Stefan

  • Errro when referring a Bean in Sender file adapter

    Hi
    I have created a sample code and deployed in  the server and when i refer that in the sender file adapter module processor using the naming format
    localejbs/sap.com/com.vas.mod/GetFileNameBean
    where
    com.vas.mod  is the EAR Project name
    GetFileNameBean is the  Bean name
    I am getting the erro in the XI Adaptor monitor as follows
    <b>- 2006-07-31 13:06:51 UTC: Error: NameNotFoundException: Path to object does not exist at com.vas.mod, the whole lookup name is localejbs/sap.com/com.vas.mod/GetFileName.</b>
    I checked theJNDI name in the server it is exactly the same.
    can some one help me on this please?
    vasagam R K

    Hi Vasagam,
    Please check these threads..
    They deal with ur question...
    NameNotFoundException during JNDI lookup for Deployable WebService Proxy
    Strange Lookup Error (SAP Resource Adapter)
    cheers,
    Prashanth
    P.S Please mark helpful answers

  • How to get the filename in mapping when using sender File adapter?

    hi Experts,
       I have scenario where XI reads the input file using Sender file adapter.
       The file name is configured in the communication channel.
       In my message mapping it is possible to read this file name?
    Thanks
    gopal

    Hi Gpoal,
    Use Dynamic Configuration - /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Regards,
    Geetha

  • Sender File Adapter - Dynamic Filename?

    Dear All,
    I have a simple requirement to retrieve a file named "XXX_ddmmyy" from an FTP site. The FTP site administrator will place a new file everyday. The date is part of the filename.
    I can find a lot of information on how to set the Filename for a "Receiver File Adapter", but none about dynamically setting of the filename for a "Sender File Adapter".
    Can you help please?
    Kind Regards
    Farshad

    Hi,
    You have mentioned over here that the requirement is to get the file "XXX_ddmmyy" from an FTP site.
    Is that site strictly for keeping files related to your requirement only or lot of other files are also being placed???
    If its strictly related to your requirement then you can use the filename "*.extension" and set the processing mode as "delete" so that once the File Adapter picks the file it will be automatically deleted.
    But here disadvantage is that the file wont be no longer present in FTP site once it is picked by File adapter.
    Thanks,
    Lekshmi.

  • Module processing inside Sender File Adapter

    Hello,
    I am trying to analyze whether I can create a specialized module inside Sender File Adapter. As of right now, the Sender File Adapter and Receiver as well, assume endSeparator character in the end of each record. For files that do not have this field, it is just on continuous string, I assumed I can create an
         adapter module
         call it BEFORE data in the file is being converted to XML format
         Insert 'nl' character (since the record length is fixed)
         Call regular adapter processing (converting to/from XML)
        However, creating any module inside Sender File Adapter, the payload of the main document is already in XML format. Is there anyway to avoid it?
       Thanks for your help,
             Dmitriy Mindich

    It is not possible with the standard functionality.
    So maintain the sender file adapter with no conversion, but in the module tab enter following modules:
    1. Your module
    2. The conversion module (*)
    3. The standard module.
    (*) for details look here:
    Look here:
    http://service.sap.com/nw-howtoguides
    -> Exchange Infrastructure
    -> How To Use the Content Conversion Module in JMS Adapter
    Regards
    Stefan

  • Sender File Adapter Bespoke Module Development

    I have been following the How To ... Create Modules for the J2EE Adapter Engine to create a bespoke module for the Sender File Adapter.
    Initially all the module does is write a message to the Augit Log. The module has been deployed to XI successfully. When I add the module to the sender file adapter the adapter is green in the adapter monitor but I get the following message in the message monitor ....
    "Attempt to process file failed with Path to object does not exist at com.kk.FileAdapter, the whole lookup name is localejbs/sap.com/com.kk.FileAdapter/WriteToLog."
    com.kk.FileAdapter is the package. All of the required files have been built as per the How To pdf.
    Does anyone have any ideas??

    Hi Satish,
    Thanks for the quick response.
    Using the fully qualified name I get the following error in the adapter monitor.
    "Last message processing started 18:32:11 2005-09-19, Error: Module Exception 'com.sap.aii.af.mp.processor.ModuleProcessorException' found, cause: com.sap.engine.services.jndi.persistent.exceptions.NameNotFoundException: Path to object does not exist at BANKSenderFileAdapterEAP, the whole lookup name is localejbs/sap.com/BANKSenderFileAdapterEAP/WriteToLog."
    If is use the JNDI name I do not get an error in the Adapter Monitor but get the following error in the Message Monitor.
    "Attempt to process file failed with Path to object does not exist at BANKSenderFileAdapterEAP, the whole lookup name is localejbs/sap.com/BANKSenderFileAdapterEAP/WriteToLog."
    The rest of the message seems to be successful, only the run of the module.
    Any ideas??
    Many thanks
    Gary

  • Sender file adapter - filename containing  *  does not work

    Hi All,
    I am doing simple file-file scenario wherein my filename is something like
    MATMAS05_XI20070911-150159-088.xml 
    there are many files having similar kind of  name which are supposed to be picked
    so simply I can go on writing <b>MATMAS05_XI*.xml</b> in filename
    it is not working.. communication monitoring gives error <i>Error occurred while connecting to the FTP server "10.25.117.237:21": java.lang.NullPointerException</i>
    But  when I use character '?' then it works fine - '?'  placeholder for each extra character
    I am on SP 20.My adapter is configured properly. FTP server working fine with '?' or simple filename. So bit confused why it is not working with *
    Are there some BASIS settings which have to be in place to work it out with * ?
    All your inputs are welcome !!
    Thank You,
    Mugdha kulkarni

    Hi
    this error is not related to multimple files or sending with the * char.. you can use it
    see the below link
    /people/mickael.huchet/blog/2006/09/18/xipi-how-to-exclude-files-in-a-sender-file-adapter
    The error related to the server connection.. also check the ip address is correct or not you configured correctly or not..
    also clarfity the correct error description ..
    Chilla

  • .xls ,.xlsx, .xlsm in sender file adapter

    hi guys,
    I have written an adapter module to read an excel file in sender file adapter...
    if the input file comes as .xlsx or .xlsm wll it be able t read the same?
    or do i have to change anything in the module code?
    filename in sender cc is filename.*
    Regards,
    Teja

    Hi Gurus,
    How can we download data from SAP internal table to Excel file in .XLSM format?
    file is having macros and header, i need to append the values from internal table to the excel file from 6th row(5 rows contains header).
    when i try to use " gui_download " FM , status message in sap shows as no.of bytes transfered! but , while oppening the file it is showing currupted.
    When i try to use OLE Method it is creating the file in xlsx format in stead of xlsm.
    can any one please guide me how to proceed!!
    Regards,
    Balaji

  • Sender File Adapter : File Name Determination

    Hi All,
    My Scenario :
    1) Im my scenario i need only the "FileName" of the File when picked up by the Sender File Adapter.
    2) Rest Content of the File need not be in the XML file format.
    Now what i did was developed "File Adapter Module " to get the "FileName" when picked up by the Sender File Adapter.
    Outcome : When i put the developed module at first and put the file in specified folder allowint the Sender file Adapter to pick up. Now Everything is fine working when one kind of File is placed as per my Content Coversion paramaters.
    Actual : My Client would place file of any kind (.jpeg -> Mostly , gif ) i need to get only the file name in the Outbound interface , which i would split it further to my Target Interface.
    How could i achieve this , when i took away this content conversion , in sxmb_moni it shows error.I need only the filename in the Outbound not the Content , moreover the hit is i donot know what could be content of my file as it could be different and varing , so i could not set particular content conversion paramters:
    Second Question:
    Now my outbound XML interface looks as below when i test with a file , with proper content conversion paramerters:
      <?xml version="1.0" encoding="UTF-8" ?>
    - <MT_DMS_FINAL>
    - <Record>
    - <Row>
      <FirstName>2323_eer_rtr</FirstName>
      </Row>
      </Record>
      <FileName>d:\mdmtest\srinivaS\padusrini.txt</FileName>
      </MT_DMS_FINAL>
    Well i have designed in my MI only FirstName , how to capture this element "FileName" which i can use it in mapping , if i have to write any UDF to capture it ,please guide me.
    thx in advance for u r help
    with regards
    Srini

    Hi Guys ,
    Can i use File Content Conversion for .pdf document , my pdf doc content is not known, means it"s a complete info doc.I may get .jpeg any picture or drawing.
    I thought i can use below file content conversion paramters:
    Document Name : MT_DMS_FINAL
    RecordSet Name : Record
    RecordSet Structure : Row,*
    Row.fieldNames - FirstName
    Row.fieldSeparator - ;
    Row.processFieldNames - fromConfiguration
    Row.additionalLastFields - ignore
    Row.missingLastfields  -  ignore
    Now i put a pdf doc of unknown content , and my assumption was some set of charater would be dumped in  XML and rest would be ingonered which is least bothered part in my scenario , unless i get the filename from runtime ot Adapter module developed
    But in RWB CC monitoring i see below error :Error: org.xml.sax.SAXParseException: Illegal XML character:  &#xb;.
    Any views on this , can any one help me out with the above requirment. Hope u guys got wat am trying to put out here
    thx in advance for u r help
    with regards
    Srini

  • Dynamic file Directory : Sender File Adapter

    Hi all
    In one of our interface development ,at  we require a dynamic Directory path at the sender file adapter ..
    ex :
    path = Root/A/B/C
    filename = test.txt
    now in Root Directory, Folder & subfolder  " A ( B ( C )))  are dynamic.
    Subfolder "C"  wil contain the source file..
    Will it possible...with Z module development..??
    Regards,
    Ashutosh

    hi,
    if you want your directory name dynamically from Payload, you can use the option variable substitustion;
    For example follow below procedure:
    1)in the Target directory name --> /%dir%
    2)go to advanced tab and check for the variable substitution option(enable),
    3)variable name:dir
       Reference:Payload:mt_filetest,1,name,1
    according to the given details in the communication channel your  payload should be like this
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:mt_filetest xmlns:ns0="urn://filetest">
       <name>madhav</name>
    </ns0:mt_filetest>
    now  directory is created with the name of madhav (Dynamically according to the payload directory name is created).
    Note: points if it is useful
    Thanks
    Madhav

  • File Adapter-Module configuration

    Hi All,
    I have the following requiremnt.
    "Duplicate files should not process"
    Following are the File Access Parameters.
    Source Directory: ABC (ex: contains aa1,aa2,aa3,aa4 files)
    Filename: *
    File name mask: aa*
    My doubt is if they place aa1 file again in ftp , i should not process.
    For this I'm thinking to write module configuration.
    Can any one suggests , whether this is the correct approach? If it is could u explain how to write this module and where to write this module and how to import in xI, do i need to pass any parameter name in module configuration.
    Regards,
    venu.

    Hi Venu,
    You can go with Module in the Sender File Adapter.
    First you need to check the file name and you need to store this file name in the Database.( you can use Java Database).
    If there is an entry in the database for that file, then reject the whole file as per the business requirement. So that you can avoid , overhead of Mapping. Because if there is an error set the flag in the message and check this flag in your Receiver Determination, if it is an error send into error directory.
    Another way is outside the XI, i.e using shell scripts.
    Regards,
    Moorthy

  • Configure Sender File adapter dynamically

    Hi,
    I need to configure the sender file adapter dynamically. Ex: I will be providing the src dir , file name etc dynamically. I think this is not possible using module because module gets executed after file is picked (in my case file dir and file names need to be determined dynamically). I even don't won't to use directory API for craeting my file sender comm channel. Is there any other way to achive this.
    Regards,
    Rakesh

    Hi Rakesh,
         what is the Operating system of the PI server? Could you please kindly explain what conditions determine filename and source directory? I do not think there is anyway you can determine src file and dir names dynamically in PI.
    Here is what you can try.
    PI server is on windows system u need batch file. If its on unix or Linux you need scripts. Now what you have to do is place all files in a directory. Here the script/batch file will run continuously in background. Once it gets files it will rename files based on file content or file name then move them in different directories as per your conditions. your interface must have multiple communication channels and sender agreement (with diffrent parties) which will pick up those files from these directories.
    The name of directories will be fixed in each channel.
    regards
    Anupam

  • German umlauts :Sender File Adapter

    Hi,
    I am trying to configure Sender File adapter,but it is not working properly for German umlauts.
    I have tried encoding UTF-8, UTF-16, ISO-8859-1,ISO-8859-2, ISO-8859-5 but none of them are working.
    Can anyone please help me out in this.
    Thanks a lot.
    Regards,
    Shweta

    Hi Stefan,
    I have already added this module exactly in the same way.
    But can you please confirm the sequence
    Module :
    localejbs/AF_Modules/PayloadSwapBean                     Local Enterprise Bean     swap
    localejbs/AF_Modules/MessageTransformBean     Local Enterprise Bean     Transform
    localejbs/AF_Modules/MessageTransformBean     Local Enterprise Bean     Transform
    Transform.ContentType                     text/plain;charset="UTF-8"
    Transform.ContentDisposition            attachment;filename="ABC.csv"
    Also,I noticed one thing
    The content is corrupted in SXI_MONITOR but it is correct in payload of File as well as Mail adapter in Message Monitor(RWB)
    Thanks.
    Regards,
    Shweta

  • Multiple Exclusion Criteria[Exclusion Mask] in Sender File Adapter

    Hello All,
    I have a requirement to specify multiple exclusion criteria in the 'Exclusion Mask' property of a Sender File Adapter, i.e. I need to pick up files that correspond to 111*.txt from a specified source directory, but I would also want to exclude specific individual files that go by the following names:-111ACC.txt, 111INV.txt & 111PUR.txt.
    I have tried the following - Specified 111*.txt in the 'File Name' field and in the 'Exclusion Mask' field specified ACC, INV & PUR - the exclusion criteria separated by commas. But this does not seem to work. All the 111* files are getting picked up.
    Have gone through a couple of weblogs that deal with exclusion masks, but they do not talk about multiple exclusion criteria.
    Is there any other way I could accomplish this?
    Thanks,
    Anand

    Hi,
    Try this config.
    Give  *.txt in filename. and Directory as <YourDir>
    In exclusion mask give 111ACC.txt
    Below this there will be a table. Add two Entries
    Dont add anything to FilenameMask.
    Directory ->FileNameMask--->ExclusionMask
    <yourDir>->--->111INV.txt  
    <YourDir>->--->111PUR.txt
    Try this and get back.
    Regards,
    Sudharshan
    Message was edited by:
            Sudharshan Aravamudan

Maybe you are looking for

  • Report S_BCE_68001398 and Object s_tcode

    Hi Guys When running report S_BCE_68001398 with tcode suim i.e Tcode suim >>> Users>>> Users by complex selection criteria .. By transaction authorizations and Insert a tcode. I get a list of tcodes that are being used by users. When I do the same th

  • Problem in installation of Oracle 10g database on RHEL 6

    I am facing the problem when I am trying to install Oracle 10g database on Red Hat 6. When ./runinstaller is run, the message seems to be if I remember correctly is like '-----bad ELF interpreter'. But, the same source seems to be installing correctl

  • Modify CSS in region help

    Hi, I am using a region help type following the instructions in APEX Users Guide. But the code generated by APEX has 2 issues: It hasn't CSS (bgcolor hardcoded): <table bgcolor="#CCCCCC" width="100%"><tr><td><b>Region</b>:  Acciones Generals</td>...

  • How to fetch single row data into multiple columns

    Hi Have a cursor which will have SELECT Sun_hrs,Mon_hrs,Tue_hrs,Wed_hrs,Thu_hrs,Fri_hrs,Sat_hrs from OTMaster; now my cursor has one row of the above columns with this row data I want to insert into other tale as column wise ex: my row is like this:

  • Displaying subtotals for each group item in a Matrix or Group Matrix Report.

    Hi, I have generated a Report as follows: month1 month2 month3 M1 R1 P1 x y z P2 a b c R2 P3 d e f M2 R3 P4 g h i R4 P5 k l m Is it possible to display the subtotals per each category as follows: month1 month2 month3 M1 R1 P1 x y z P2 a b c ---------