Get Source Filename

Hello,
  I have a requirement where I need to get the source filename and use that in the XI message mapping. I need to append the source file with a value from the payload and create the new file with the new values (Source file name + value from the payload) . I don't see a standard XI function that can get the source file name. I appreciate any pointers in this issue.
BTW, we are on version 7.0
Thanks

Hi Balu,
  In adition to the procedure that was mentioned in the Micheal blog .
  /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
you are going to use Payload value also as apart of file name in the UDF you take the value of filed in payload from source structure as one of the parameter input  to UDF,concatenate  that to the filename and map to any of the node on the target side message (can be top most hierarchy eg: MT_TARGET_MSG). So you need to do changes to the code as shown below
Souce field-->UDF--
> TargetNode(any top level node)
code in udf:
String a = null;
a = payloadfield;
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);
a = a+ oursourceFileName;
return  ourSourceFileName; 
Thanks,
Ram.

Similar Messages

  • Get source FileName - RuntimeException during test of Message Mapping

    Hi,
    Inside a graphical mapping, I want to get the source file name, and then use it.
    For that I use Michal's post inside a UdF: The specified item was not found.
    And that works perfectly during the treatment (File -> Mapping -> IDoc)...
    But my problem is when I try to test my Message Mapping inside the I.R (see tab "Test"), I have a RuntimeException due to the fact that DynamicConfiguration does not exist (obviously!) in the SOAP.
    So I tryed to encapsulate the line "String ourSourceFileName = conf.get(key);" by a try/catch or by using the method "containsKey", but I have always the same RuntimeException...
    is there someone who know how to catch this exception ?
    Regards
    Mickael
    Note: JavaDoc is: http://help.sap.com/javadocs/NW04S/current/pi/com/sap/aii/mapping/api/DynamicConfigurationKey.html

    Hi Progirl
    yes... but it will be not really pratical for the maintenance to think everytimes that this "error" is not an error and to think to delete the link in order to realize a test and then to not forget to add (again) this link.
    the risk is too important.
    Hi Varun,
    yes... but with the Test of Interface Mapping, I don't have the possibilty to see the Queue and all options than we have inside the Message Mapping... So it's will be not really practical for the maintenance.
    The solution is really to catch this exception directly inside the UdF which generates this Exception.
    I'm sure there is a Java solution for that, but not yet found the good syntax... I continue.
    Regards.
    Mickael

  • Sort Loaded Groups in Portal According to Source Filename Property

    Hello,
    I am using a script to load 4 files in th Data portal and later graph some selected channels. The problem is that when I choose the files through a dialog box, the order gets mixed up in the data portal. I would like the files to be sorted according to the source filename. Here is the loading script:
    Dim i, intLoop, Group,b
    Call Data.Root.Clear()
    If FileDlgShow(DataReadPath,"TDMS Files,*.tdms","DataSelection",True) = "IDOk" Then
    For i = 0 to UBound(FileDlgNameList)
    Call DataFileLoad(FileDlgNameList(i),"TDMS","Load") DataFilename,FileImportFilter,ImportAction
    Next
    End If
     Is there any way I can do that?
    Thank you!
    Solved!
    Go to Solution.

    winner wrote:
    Hi Saloutios,
    You can sort the FileDlgNameList Array for example using the BubbleSort algorithm:
    Sub BubbleSort(arr)
    Dim value, numEls
    Dim index
    Dim firstItem
    Dim indexLimit, lastSwap
    ' account for optional arguments
    numEls = UBound(arr)
    firstItem = LBound(arr)
    lastSwap = numEls
    Do
    indexLimit = lastSwap - 1
    lastSwap = 0
    For index = firstItem To indexLimit
    value = arr(index)
    If (value > arr(index + 1)) Then
    ' if the items are not in order, swap them
    arr(index) = arr(index + 1)
    arr(index + 1) = value
    lastSwap = index
    End If
    Next
    Loop While lastSwap
    End Sub
    The input array is sorted after you called that procedure.
    Hope this helps
    Winfried
    Hi Winfried,
    Thank you very much for the reply. That worked just fine for me!
    Cheers!

  • How to get open filename in Reader

    Hello,
    I am looking for a way to get the filename of the open document in Acrobat Reader window from a C# application I am working on.
    I can't find a way to do it... I am so desperate I am thinking on create a plug in or something for Acrobat Reader so I will be able to get the information from the plugin...
    Any help/ideas on how to do it are welcome.
    Thanks

    There is no approved/supported way to do so, other than the use of a custom plugin for Reader (which will require a Reader Integration License).

  • How to get source table name according to target table

    hi all
    another question:
    once a map was created and deployed,the corresponding information was stored in the repository and rtr repository.My question is how to find the source table name according to the target table,and in which table these records are recorded.
    somebody help me plz!!
    thanks a lot!

    This is a query that will get you the operators in a mapping. To get source and targets you will need some additional information but this should get you started:
    set pages 999
    col PROJECT format a20
    col MODULE format a20
    col MAPPING format a25
    col OPERATOR format a20
    col OP_TYPE format a15
    select mod.project_name PROJECT
    , map.information_system_name MODULE
    , map.map_name MAPPING
    , cmp.map_component_name OPERATOR
    , cmp.operator_type OP_TYPE
    from all_iv_xform_maps map
    , all_iv_modules mod
    , all_iv_xform_map_components cmp
    where mod.information_system_id = map.information_system_id
    and map.map_id = cmp.map_id
    and mod.project_name = '&Project'
    order by 1,2,3
    Jean-Pierre

  • How to get image filename in indesign cs3

    Hi,
        I want to get a filename of a selected rectangle frame graphic child item like tiff image or pdf file. Please help me with a code snippet.
    Thanks,
    K.Saravanan.

    app.activeWindow.activeSpread = myDocument.spreads[j];
    app.activeWindow.zoom(ZoomOptions.FIT_SPREAD);

  • SFTP to AS2(non-seeburger): How to get sender Filename to be used in AS2 Receiver Channel

    Hi Experts,
    I have this scenario,
    SFTP > Process Orchestration > AS2(non-seeburger)
    My interface is not using Message Mapping and I want to use the source Filename as my Receiver Filename.
    Sender
    orders_1234 - source filename
    Receiver
    orders_1234 - target filename
    How to do it in Process Orchestration without Seeburger.
    Thanks and Best Regards,
               Orlan

    Hi Orlan - So are you using SAP AS2 adapter?
    If you so i think you can make use of dynamic configuration bean.
    Unknown use case of DynamicConfigurationBean: Store file name to JMS header without mapping
    Enable adapter specific attributes in sender SFTP channel and in the receiver AS2 channel use the above module to swap the dynamic attributes.
    Dynamic attributes
    http://sap.com/xi/XI/System/SFTP ,FileName 
    http://sap.com/xi/XI/AS2/AS2:  AS2Filename

  • Is there a way to get the filename only on iOS using CameraRoll?

    This post is a sidetrack from this post: http://forums.adobe.com/thread/848761?tstart=0
    The method used in that post works perfect on both Android and iOS for selecting and uploading files.... BUT is there a way to get the filename of the file from the mediaPromise cross-plattform?
    If you let the user select an image it's not very nice to have the image be called "temp.jpg" after uploading - you want the user to know which image he/her have uploaded
    Any ideas? The "mediaPromise.file.relativePath()" works on Android but not on iOS. Not "mediaPromise["file"].url/relativePath/nativePath" either.
    Thank you

    Hey Joe what do you think of this solution.
    1. Let the user select the image
    2. Store the mediaPromise object in an array (event.data) for later use
    3. Load in the object using loadMediaPremise
    4. Add the loaded image into a movieclip (not visible from the scene)
    5. Resize that movieclip to let's say 100x100
    6. Use the BitmapData class to create a new bitmap from that movieclip and save it to storage
    7. Use the saved file within the app as a thumbail
    8. Use the mediaPromise object stored in the array later when the user wants to upload the images (then go through mediaPromise.open() on each image -> save to storage -> upload -> clear from storage -> loop).
    I haven't tried it yet (will do this week) but should that be a acceptable solution to the problem(?)
    I'm unsure if by just keeping the mediaPromise object within Flash will make the memory run wild though?

  • To upload the ZIP file and get the filenames available in ZIP file in ABAP

    Hi Experts,
    For my requirement, file from legacy comes as ZIP file with number of files in that.
    Please provide one code sample to upload the ZIP file from local workstation and get the filenames available in ZIP file to check few filename validation checks for the available files in report program.
    Thanks in Advance,
    Regards,
    Basani

    1. Copy the ZIP file into App server
    2. Call function
      call function 'RFC_REMOTE_PIPE'
        destination 'SERVER_EXEC'
        exporting
          command = command  " Unzip command gunzip /path & file
          read = 'X'
        tables
          pipedata = std_lines
    then you can read the files and can validate the file names

  • How to get the filename from J2SE File adapter

    In our project scenario , we are using J2EE and J2SE engine both .J2EE for mapping  and J2SE for Deliveying the message .
    In one senario, routing will be based on the filename .
    J2SE Sender File adapter --- XI Adapter --- XI pipe line
    So the File reaching to XI pipelane via J2SE File adapter--> XI adapter.
    When we are using the dynamic configurator in the XI to get the filename
    we are not able to get the file name  becasue it is coming to XI via
    XI adapter.
    How to get the filename ????Hope I am clear about the problem.

    hi,
    try this
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    //obtengo la Key del FileName
    DynamicConfigurationKey keyF = DynamicConfigurationKey.getName();
    http://help.sap.com/javadocs/NW04/current/pi/com/sap/aii/mapping/api/DynamicConfigurationKey.html
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70c89607-e4d9-2910-7280-f6746e964516
    /people/mohammed.zabiulla/blog/2008/03/26/have-you-ever-tried-to-determine-mail-cc-dynamically
    Hope it helps
    Thanks
    Rodrigo
    Edited by: Rodrigo Pertierra on Apr 11, 2008 9:31 AM

  • How can i get report filename in a fomula column

    Hi,
    We are using Oracle Reports 6i.
    i want to get the filename of current report in a formula column.
    how can we take the current report filename into a variable in a formula column..
    If it is possible please provide your valuable inputs on how to achieve this or please provide any helpful pointers
    Please get back to me if my requirement is not clear
    Thanks,
    anish

    Its not possible to get the report file name in a formula column

  • How to get the filename of the active jsp page?

    how can i get the filename of the active jsp page?

    You could register the JSP [ages in the web.xml and then use the ServletConfig.getServletName.
    You could use the JspContex.getServletName which will return the registered name or the name of the servlet class.
    You could programmatically add a page context attribute that holds the jsp page name                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to get the filename when parsing a file with d3l

    All
    After some time have experience with interconnect, IStudio I need the following info. Is it possible to get the filename when parsing a flat file using a d3l? This is needed because we need to store the filename together with the data into the database.
    Any examples or directions to some documents are welcome.
    Regards
    Olivier De Groef

    has anyone some info on this

  • Getting the filename of a placed image inside a smart object

    Hi
    I'm wondering if I can get any help with a problem I'm trying to overcome for a friend of mine.
    My friend is a photographer who does a lot of schhols work (pupil portraits) and wants to create a little document similar to this (very simplified) version:
    I'm trying to help him to create a batch process so that he can make this take up much less of his time!
    Here's where I've got to so far. I've created the layout above which is essentially a smart object (from an external file) manipulated in a couple of ways.
    The workflow as I see it at the moment (although I'm wide open to suggestions, and I'm having a bit of Friday brain) is this: I generate an action that replaces the content of the external file with the contents of (each file in his incoming list, sequentially).
    That file then comes back into the layout above and a new (flattened) copy is saved out from there.
    Rinse and rerpeat through the list of incoming files.
    I can just about make that bit happen using actions, but here's what I can't get - the filename of the incoming file (the one that's placed in the smart object). Can I can use a modified version of the AddFileName script to generate a text layer based on the filename of the placed contents in the smart object? Does any of that make sense? I'm reading this back to myself and even I'm not sure! ho ho.
    My lack of logic/coherent sentence structure here is what probably holds me back in any eforts I have made in getting into scripting.
    I'd appreciate any help that could be offered.
    Thanks.
    Fenton

    Ah - alas it sems not to be. I think I am going to have to come up with a different workflow and by extension, solution. My current thinking is that I need to have an input folder for the images to be used in the layout, and an output folder for the results to be saved into, along with the layout.psd (as above) all housed in the same folder. Then I need (help) to write a script that does the following:
    Checks that the layout document is open (that bit is easy enough)
    if(documents.length==0){
       alert("You need to have your layout template open (-layout.psd-)")
    }else{
        // Do next bit here - and what I'm trying to do is described below.
        // Hopefully by typing it out I might start to get it straight in my head
        // Any help with any part of this process is greatluy appreciated
        // I'm trying to learn!
    Then what I think the script needs to do is tocheck the contents of the input folder and find out how many files are in it then set this as a variable, to set the length of a loop, maybe? Or should it load the filenames as an array and work through them sequentially?
    Once that information is established, there is a smart object on the first layer that needs to be updated with the contents of the first file - my thinking s that this is done by the script opening each image, and then copy/pasting into the smart object, merging down (so I don't end up with an enormous multi-layered file). My reason for thinking this would be a good idea would be that I could just run a quick check to make sure that no landscape pics have sneaked in there and if they have, rotate them (which again, is pretty easy as even I could do that bit, too).
    doc = activeDocument;
                if (doc.height < doc.width) {
                  doc.rotateCanvas(90);
                } else {
                  // Carry on
    This will update all of the smart object instances throughout the layout template.
    Then the text underneath the main image needs to be updated with the filename of the file that has been pasted in the smart object, and after that a [flattened] copy saved out to an output folder.
    Rinse and repeat for the remaining images in the input folder.
    Any thoughts?
    Thanks
    Fenton

  • [JS CS4] Getting unexpected filenames - *TempScratchDocument*

    Hi,
    I have a Startup Script which launches event handlers to write to a log file when an InDesign document is opened and closed.
    The functions write the filename, username and time of the event to the log file but I am getting unexpected filenames written to the log and wondered if anyone could explain where these are coming from.
    An example from the log file is:
    Started: Untitled-4 lhusband Wed Jun 09 2010 10:55:34
    Finished: -/*TempScratchDocument*/- lhusband Wed Jun 09 2010 10:55:34
    It is the -/*TempScratchDocument*/- bit I don't understand.
    My thoughts are that doing a copy/paste or saving a snippet or putting something in a library could be creating a "new" temporary document somewhere in InDesign memory, but I cannot replicate this on my own PC.
    This script is running on 30 PCs and I only get this for 2 or 3 users.
    The event listeners are:
    var myEventListener1 = app.addEventListener("afterOpen", openJob, false);
    var myEventListener2 = app.addEventListener("afterSaveAs",openJob, false);
    var myEventListener3 = app.addEventListener("afterNew",openJob, false);
    var myEventListener4 = app.addEventListener("beforeClose", closeJob, false);
    var myEventListener5 = app.addEventListener("beforeSaveAs",closeJob, false);
    The two function called are:
    function openJob(myEvent) {
            var myDate = new Date;
            var myTime = myDate.toString();
            var myEventTime = myTime.slice(0,-9);
            var user=getUser(); // function to get username
           try  {   var myPath = myEvent.parent.fullName } catch(e) { var myPath = myEvent.parent.name } // to handle unsaved documents
        // Write to Jobs.Log
            myFile = File("//10.19.55.220/Logs/jobs.log");
            myFile2.open("a");
            myFile.write('\n' + "Started:" + '\t' + decodeURI(myPath) + '\t' + user + '\t' + myEventTime);
            myFile.close();
    } // end of function
    function closeJob(myEvent) {
            var myDate = new Date;
            var myTime = myDate.toString();
            var myEventTime = myTime.slice(0,-9);
            var user=getUser(); // function to get username
           try  {   var myPath = myEvent.parent.fullName } catch(e) { var myPath = myEvent.parent.name } // to handle unsaved documents
        // Write to Jobs.Log
            myFile = File("//10.19.55.220/Logs/jobs.log");
            myFile2.open("a");
            myFile.write('\n' + "Finished:" + '\t' + decodeURI(myPath) + '\t' + user + '\t' + myEventTime);
            myFile.close();
    } // end of function
    If anyone can shed any light on this I would be most grateful.
    Thanks
    Simon Kemp.

Maybe you are looking for

  • Date Format is not Working in Cross tab Crystal report 2008

    Hi, I have developed an application ASP.Net c# in Framework 3.5 with crystal report 2008 with service pack 5. in my crystal i used cross tab to show the grid records. one of the data having the data type as date time after launching the report, when

  • QuickTime 7.7 for windows vista 64 bit will not stream for me,anyone else having problems?

    I updated to 7.7 quicktime and itunes 10.4.0.80(latest versions) for windows vista 64 bit .It appears to be working for movies I took with my camera no problem and other various tasks but I cannot get it to stream online videos.I did the test http://

  • Logical system name vs. destination name - CUA -

    Hey experts, at the moment I´m thinking about using the CUA in our SAP environment for role distribution. In this scenario I need destinations to the child systems (of course!). In all manuals I found it say, that i HAVE to create destinations which

  • Regarding SRM MDM 3.0

    Hi Gurus!! I will soon be working on SRM MDM business scenario,so i want to be prepared beforehand. Please guide me about the integration details from SRM as well as MDM side,and also important documentation\link regarding the same. Thanks, Ravi

  • HD instead of Apple symbol on startup

    Hi - I've recently noticed that every once in a while, when I start my macbook, instead of the normal apple logo, I get a hard drive symbol with an arrow pointing to it. The system won't boot completely until I click on the arrow. It's as if the OS i