Map source file name in target payload.

Dear All,
I have an interfacing scenario in which I want to populate a IDoc(target) field with the Source xml File Name.
How can I do this in graphical mapping?
If theres a UDF, plz guide me on the code.
Help!!
Thanks.

If theres a UDF, plz guide me on the code.
DynamicConfiguration is teh concept that you need and Rajesh has already pointed you to teh blog.
This has been discussed and re-discussed almost every other week. Please run a simple search before raising a query.
Regards
Soumen...

Similar Messages

  • How do I map the source file name to a target table?

    I am mapping a source fixed length flat file to oracle target tables. One of the tables is a parent transaction table that stores the date, record number, status, etc. and the file name of the source flat file. The file name will change daily because the date is part of the naming convention. Is there an easy way to determine the source file name and map it?
    One option a co-worker is working on is writing a pre-mapping stored procedure. It would insert the file name into a table prior to the mapping. But I was hoping for a cleaner solution.
    Thanks!

    Hi
    Use extarnel table to load the data from the file into the table.
    Create a procedure which changes the external table definition as the filename chnages.
    Use this proceudre in the mapping as a premapping process.
    Ott Karesz
    http://www.trendo-kft.hu

  • Determine Target directory from Source file names with out mapping

    Hi All,
    I have a requirement to determine the Target Directories from the Source file names.
    File Sender Adapter - XI - File Receiver Adapter
    In this scenario I am not doing any mapping. Source File directory contain 3 files. These file should go to 3 directories in the Target Server.
    Please help me how can meet this requirement
    Thanks in advance
    Kevin

    Hi Kevin,
    if you can separate the files by name. have 3 sender communication channels each picking up one of the files (you do this by making the regex in the file name mutually exclusive) and then send them all to the target system using the same comm. channel.
    regards,
    Horia

  • Need Target File  Name  Timestamp  is  same  as Source File name Timestamp

    Hi ,
           I want to genereate Target file name (Target_09062008082030.xml)   but  this time stamp is exactly Sorce FileTime stamp..(Source_09062008082030.xml)..
         so, i want to create a  target file  with the same source file time stamp.. 
    for this.. i sed Message Specific attributes... in both sender and receiver side.. but  that was creating with the complete name.of source file name.. but i want only Timestamp of the source filename... and remaing is the constant.. for this  how can i proceed  ..
    Thanks
    Jain

    See in Sender CC when you set the Adapter Specific Message Attr  for file name it will send the filename in the header of the XI Message.
    To acces this file name inside mapping you need to create a UDF . The type can be any thing as you desire.
    You dont need to pass any variable .if suppose you want the file name (constant) e.g ABC_<timestamp>.xml
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String fileName= conf.get(key);
    //see above your key is FileName which will be sent by the sender CC automatically... You are simply accessing it here using get() method.
    //now ur filename will contain name of the source file... you need to perform a substring operation to get the timestamp and create a new file name as you desire.
    fileName = "New_<timestmp>.xml"; //for e.g
    //set this file name again in header message using put()
    conf.put(key, fileName);
    //when you check on the adapter specific message attr for fileName in the receiver CC ,it will automatically take this new file name value.
    return fileName;
    // if you want to use this new fileName inside your mapping payload (for other fields) you can assign this to any target field,else just assign it to the root tag which will make no difference if this file name is not used anywhere.

  • Same file name in target as source file

    Hi,
    I am doing a file to file scenario in which there is no mapping involved, it is a bypass scenario.
    I want my target file name to be exactly same as the source file name.
    Source file name dynamically changes based on date and time.
    I have tried creating the target file using the Add timestamp characteristic. But it is not in the same format as the source file.
    How can I achieve this???
    Since there is no mapping invlolved, I can't use dynamic configuration or variable substitution.
    Please advice.
    Regards,
    Sachi

    Hi Sachi,
    -->Are you bypassing the mapping rite....?
    -->Then in your ID under Interface determanation what interface mapping did you maintained....?
    -->I think you are by passing the IR.
    -->I think this can be achived by using the ASMA but it requires the Mapping Program.
    -->Even the above blog explains about getting the same file name using the ASMA and UDF.
    Thanks

  • Getting the Source File name Info into Target Message

    Hi all,
    I want to get the Source file name Info into Target message of one of the fields.
    i followed Michal BLOG /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Requirement :
    1) I am able to get the Target file name as same as the source file name when i check the ASMA in Sender & Receiver Adapter , with out any UDF...............this thing is OK
    2) I took One field extra in the target structure Like "FileName" & I mapped it Like
                              Constant(" " )--UDF-----FileName
    I Checked the Option ASMA in Both Sender & Receiver Adapters
    Here iam getting the Target File name as same as Source file name + Source File name Info in the Target Field " FileName".
    I Dont want to get the Target File name as same as Source file name. I want like Out.xml as Target file name.
    If i de-select the Option ASMA in Adapters means it is showing " null" value in the target field "FileName".
    Please Provide the Solution for this
    Regards
    Bopanna

    Hi All,
    Iam able to do this by checking the Option ASMA in only sender adapter itself
    Regards
    Bopanna

  • To retain the same file name in target(File) that coming from source system(AS2).

    Hi All,
    I have a requirement to send the two file from the third party system(GXS) to SAP ECC via SAP PI(version - 7.4). We are using AS2 adapter at the sender side to pick the file and using File Adapter to place the file in ECC.
    Its a pass through scenarion(No ESR part is used).
    Requirement:
    We are going to get 2 files ->Example:  one from Axis and another one from ICICI -> each bank file will have a file name ->
    We have to post the file at the target system with the same name as source file name, the source file name could come dynamically(with diff time stamp).
    Please let me know, Is it possible to achieve the above requirement(we have to retain the file name in target that coming from source system) with Sender AS2 adapter, If yes then please suggest the best approach.
    Regards,
    Pradeep Bawlia

    Hi Guys,
    The above requirement is solved now.
    Solution - I used java mapping for extracting the same source file name and assignning the same to the target system.
    Code:
    public class ExtractFileName_ASMA extends AbstractTransformation{
    public void transform(TransformationInput in, TransformationOutput out) throws StreamTransformationException  
    DynamicConfiguration conf=in.getDynamicConfiguration();
    DynamicConfigurationKey key_AS2FileNmae = DynamicConfigurationKey.create("http://sap.com/xi/XI/AS2/AS2", "AS2Filename");
    DynamicConfigurationKey key_FileNmae = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File", "FileName");
    String As2FileName=conf.get(key_AS2FileNmae);
    conf.put(key_FileNmae, As2FileName);
    try{
    byte b[]=new byte[in.getInputPayload().getInputStream().available()];
    in.getInputPayload().getInputStream().read(b);
    out.getOutputPayload().getOutputStream().write(b);
    catch(Exception e)
    2. Another solution we can use the graphical mapping and need to use the dynamic config UDF at mapping level to acheive this requirement but here is one drawback - we need to do content conversion is this case.
    In case of Java mapping, no need to play with source file.
    WITHOUT USING ESR, WE CAN NOT ACHEIVE THIS REQUIREMENT.
    Regards,
    Pradeep Bawlia

  • UDF to capture the source file name or the source folder for mapping

    Hi All,
    i have 2 files -  File1 from File2 from 2 different folders- single comm channel FTP (FCC). i have to pass a constant A and B respectively to a field in target structure.
    my options are -
    either create a new field in source str populating different constants and  then map to the target str
    or a udf to get the source file name or the source folder so that i can map the constant using the value mapping/FixValue mapping.
    please suggest. thanks.
    rajib

    Hi,
    please use the UDF to determine the file name. Then based on file name either pass A or B to your target field.
    The code is as given below. Just tweak the code to pass either A or B as per your requirement.
    public String G_GetFileName(Container container) throws StreamTransformationException{
    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; 
    Regards,
    Deepak.

  • Get source file name in the structure itself or in the payload

    Hi everyone,
    I have a task regarding mapping
    In my  structure , i defined a field for Filename . What I need is, what ever source file name am sending, that should be mapped into this filed.
    If am sending inputfile.txt.
    My output file should appear like this,
    <?xml version="1.0"?>
             <message id=u201DmessageIDu201D>
                     <header>
                             <filename>D:\\inputfile.txt</filename>
                     </header>
                     <body>
                              FileContent
                     </body>
             </message>
    Any help would be appreciated. Do I need to create any UDF. If So please provide.
    Regards,
    Varun

    Hi Varun,
    are u using the same UDF that I replied. also note that the variable key should be declared only once.
    Use this without changing any thing. It works for me...
    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);
    key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    String dir =  conf.get(key);
    return dir+'/'+ourSourceFileName;
    Also let us know where do you het this error..
    Thanks
    SaNv...

  • Need to genereate Target file name same as Source File Name thru Local J2SE

    Hi Everyone,
    I want to genereate Target file name exactly same as Source File Name. I know how to handle this in Central Adapter Engine(Sender & Receiver Communication Channel).
    But I need to do this in Local J2SE adpater engine.
    Please help me in this regard.
    Thanks & Regards,
    Nagaraju

    U can use the parameter to save the filename in the message header
    file.messageAttributes=<name,directory>
    This is similar "Adapter-Specific Message Attributes" concept.
    http://help.sap.com/saphelp_nw04/helpdata/en/6f/246b3de666930fe10000000a114084/frameset.htm
    Regards,
    Prateek

  • ** How to get Source File Name thru XSLT Mapping

    Hi friends,
    We require source file name after message processing (SXMB_MONI) in the output structure.  We understad from Forums and  blog 2664, this is possible thru UDF - DynamicConfiguration class. This UDF will work if we use message mapping. But, in our case we are using XSLT mapping. So, how do we call  the same from Java Pacakage ? (Imported Archives). For writing java class separately, what are the changes to be made in the program?
    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;
    Kindly reply, friends.
    Kind Regards,
    Jeg P.

    Hi,
    This is the example in this similar manner u have to call the method in which u have to write the code for picking the source file name.
    <name>
       <xsl:if test="function-available('javamap:concat')">
        <xsl:value-of select="javamap:concat($first, $last, $inputparam)"/>
       </xsl:if>
      </name>
    for reference check the Link,
    http://help.sap.com/saphelp_nw04s/helpdata/en/73/f61eea1741453eb8f794e150067930/frameset.htm
    Regards,
    Phani

  • Condition based on source file name - PI 7.1

    Hi Friends
    I have an file2file interface without any mapping requirement , source is sending  .csv files and I need to post those source files to two target systems in which each target system have two directories where I need to post based on few conditions and here are my queries.
    1. As mapping is not required I guess File Content Conversion is also not required as I simply pick and drop the .csv files into target - please confirm.
    2. One of the condition is :  source file name will be XXXX-AABB-C-XXXX-XXX-XXX.csv , here SAP PI has to read the company code (AABB) to determine the target system. Z001 and Z007 should be sent to TARGET1 & All other files will be sent to Target2.
    3. 2nd Condition : SAP PI has to read the type of file indicator (C). The files will be sent to the following target application directories:
    Simulation files (indicator = S): /interfaces/XXX/simulation
    Production files (indicator = P): /interfaces/XXX/inbound/
    Please kindly provide your ideas/solutions .
    Regards
    Suman.

    Hi Suman,
    If the Target is two different locations, then i guess you need to have two receiver Channels. Please check the below thread for details:
    Re: Genrate file in 2 different locations
    Incase of different directories in same server, you can check out this link:
    Dyanamic Configuration at receiver file adapter determine target directory
    kanan

  • Same source file name with a different extension

    Hi All,
    I have a source file which is dynamic all the time. Can I create a target file which has the same name as the source file but with a different extension.
    Scenaio is file to file.
    test. xml is the source file name and the target file name should be as test.csv
    Regards,
    Amar

    Hi Amareshwar,
    you can write a java code (either in UDF or import in imported archive and use in imterface mapping).
    The piece of code is..
    DynamicConfiguration conf = (DynamicConfiguration) myParam.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey Filekey = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String OriginalFileName = conf.get(Filekey);
    if (OriginalFileName != null)
    NewFileName=OriginalFileName.replaceAll(".csv",".txt");
    conf.put(Filekey,NewFileName);
    And in Integration Directory>Configuration Scenario>your communication channels (both sender and receiver) just select
    Adapter specific message attributes- File name
    This would solve your problem.....
    Regards,
    Vishal Gupta
    Plz reward points if you are satisfied with the solution.

  • Source File Name - ABAP

    Hi Guys,
    I am trying to get the source file name in an ABAP mapping. I have done Dynamic Config - for the target file map.
    I have tried
    *l_dyn_record-namespace = 'http://sap.com/xi/XI/System/File'.
    l_dyn_record-name = 'FileName'.
    CALL METHOD dynamic_configuration->get_record
        EXPORTING
          record = l_dyn_record.*
    But it is giving me some error about the name space.
    Can any help on this.

    Hi Naveen,
    Refer this forum thread Get xml file name within Abap Mapping
    It should be able to resolve the problem, if not then paste here the error message which you are getting
    Regards
    Suraj

  • SFTP sender to File receiver mapping of file names

    My scenario is: sender channel = SFTP (Seeburger) transferring multiple PDF files to Receiver adapter File (NFS).
    These PDF files need to have the same name as the original files from the sender (3rd party) system.
    Because these files are being processed without an interface, I can't use UDF to help map the file names.
    I've tried using Seeburger's localejbs/Seeburger/AttribMapper to map the names, as follows:
    File (NFS) receiver channel config:
    - ASMA boxes for 'Use Adapter-Specific Message Attributes' and 'File Name' are ticked
    - Module localejbs/Seeburger/AttribMapper is on the first line in the module tab under processing sequence, with module key = AttributeMapper
    - Under Module Configuration: 
      - Module Key = AttributeMapper
      - Parameter Name = http://sap.com/xi/XI/System/File/FileName
      - Parameter Value = @http://seeburger.com/xi/SFTP/dtSubject
    (I haven't entered any attribute module config on the sender side)
    This setup fails on the receiver side with the message 'Delivering the message to the application using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.RetryControlException: Channel stopped by administrative task.' (not very helpful!).  All I can get from that is that it doesn't like my module configuration!
    Can anyone help me understand the correct way to do the file name mapping for my specific scenario?
    Regards,
    Christine

    We've got this working at last!
    The main problem was indeed the missing .sca file from Seeburger:  SeeModuleCollectionPI.sca
    Our Basis team deployed this file this morning.  After a bit of fiddling around with the attribute mapping, my test files were transferred successfully with their original names.
    The config I ended up with is just as described in another forum post for SFTP to FTP, but I'll repeat it in more detail here:
    Sender channel
    Parameters tab:
    Adapter Type = SFTP (Seeburger)
    (sender, transport & message protocol = SFTP)
    Scheduler = x in all appropriate days, with interval = 1 (minimum allowed)
    (rest here is specific to your environment, but I set filename to *.pdf to get all .pdf files from the sender)
    Module tab
    Processing Sequence
    Number  Module Name                                          Type                                          Module Key
    1            localejbs/Seeburger/AttribMapper          Local Enterprise Bean     AttribMapper
    2            localejbs/Seeburger/solution/sftp           Local Enterprise Bean     solutionid
    3            localejbs/CallSapAdapter                   Local Enterprise Bean     exit
    Module Configuration
    Module Key        Parameter Name                                               Parameter Value
    AttribMapper          http://sap.com/xi/XI/System/File/FileName         @http://seeburger.com/xi/common/dtSubject
    Receiver Channel
    Parameters tab:
    Adapter type = File
    (receiver, with transport protocol File System (NFS), etc)
    Target tab:
    Target directory (set to your required PI server directory)
    File Name Schema = * (can be anything, will be ignored)
    Processing tab:
    (your requirements-specific settings - mine were create, write directly, file type binary)
    Advanced tab:
    Under Adapter-Specific Message Attributes (ASMA):
    tick the following:
    Use Adapter-Specific Message Attributes
    Fail If Adapter-Specific Message Attributes Missing
    File Name
    Modules tab:
    Processing Sequence
    Number  Module Name                                          Type                                          Module Key
    1            CallSapAdapter                                       Local Enterprise Bean     0
    (nothing under Module Configuration)
    Thanks to those who kindly took the time to try and help me, your suggestions pointed me at the real problem.
    Christine

Maybe you are looking for

  • Strokes Not Working

    Hi everyone. I am having an issue with applying strokes to images. I have PhotoShop CS5 installed on two PCs, both from the same source download file (part of E-Learning 2 Suite). On one PC the Edit > Stroke effect works absolutely fine, as evidenced

  • Need Help in Dreamweaver CS3

    I so desperatly need help with using creating Websites. First of all I should let you know that I was placed in this position becuase the girl before me quit and they had no one else to take over. Dont get me wrong I really do like the software but I

  • Joint Stereo and dB level

    my .wav custom import settings won't change back to normal stereo, it keeps selecting joint stereo. and, one of my songs imported volume is at +4.3 dB and is distorting, the rest of the songs from the album are fine. I tried re importing it using cd

  • SAP webdispatcher and URL redirect?

    Hi, I just installed SAP web dispatcher with the purpose of using it (similar to saprouter for sapgui) as single point of entry for all http(s) requests to our SAP systems. I configured parameters icm/HTTP/redirect_x to accomplish that but to only li

  • 'PICK' and User commands in reports

    I'm a bit confused about 'PICK' in PF_STATUS. I fI define it, does that mean It can only be recognised in LINE-SELECTION , and not in AT USER-COMMAND. I've defined a small program and thats what seems to be happening?