Same filename from a sender to receiver :: DO we really need UDF ?

Hi
This is in refrence of Weblog " <i>same filename from a sender to a receiver file adapter "</i> by <i>Michal Krawczyk</i>.
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Actually I worked on another weblog by " <i>Shabarish Vijayakumar</i> "-->
/people/shabarish.vijayakumar/blog/2006/04/03/xi-in-the-role-of-a-ftp
And I am getting file created on the receiver side with the same file name as on the sender side without using the user-defined function mentioned in Michal's weblog.
Now my question do we really need UDF for same file name when on the sender we are polling for one file only by its name.
I am not exaclty getting the benefit of this feature. Can you tell me why do we need this feature as in whatever scenarios I worked I mentioned the file names in both Sender & Receiver File Adapters.
So I am not getting what is the use of using this UDF, when we mention the name of file needs to be created on Receiver side.
- Lalit Chaudhary -

Hi
I put this code for UDF -->
<i>String valueNew;
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String valueOld = conf.get(key);
if (valueOld != null)
    valueNew = valueOld.replaceAll("input123",name);
    conf.put(key, valueNew);
return valueNew;</i>
Signature of UDF is this :: <u>public String GetFileName(String name,Container container)</u>
But when I am testing this UDF, I am getting following RunTime exception -->
<i>Runtime exception during processing target field mapping /ns0:FileFTP_InOut_MT/File_nm. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._FileFTP_MsgMapping_UDF_ method GetFileName$[lalit, com.sap.aii.mappingtool.tf3.rt.Context@735df3b0] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns0:FileFTP_InOut_MT/File_nm. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._FileFTP_MsgMapping_UDF_ method GetFileName$[lalit, com.sap.aii.mappingtool.tf3.rt.Context@735df3b0]</i>
I am not much of Java Guy, can you pls. suggest what am I doing wrong, I copied this code from <a href="http://help.sap.com/saphelp_nw04/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm">SAP Help</a>
- Lalit -

Similar Messages

  • The same filename from a sender to a receiver file adapter

    Michal has provided us with a brilliant <a href="/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14.  I guess a lot of people have been waiting to do this. However, I have a slightly different scenario. In this case, XI is used as a medium to transfer a PDF file from one directory to another directory. There is not transformation or mapping involved.
    The message is send by File Sender Adapter and received by File Receiver Adapter. Message type is created as a simply type hexBinary. The file is supposed to be picked up as a PDF and received as a PDF, retaining the same file name. As such, the file name is neither stored in the source structure nor the target structure.
    Once the PDF file is transfered into target directory, it should be able to be open by using Acrobat directly without further conversion.
    We might add a file name file into the target structure but would that rendered the PDF non-readable upon being received by the File Receiver Adapter?
    Any feedback is highly appreciated.

    Hi
    >>We might add a file name file into the target structure but would that rendered the PDF non-readable upon being received by the File Receiver Adapter?
    No, adding file name would not hamper the properties. You can name *.pdf or something else.
    For that matter any file pdf, word, .msg format etc can be transferred by this approach. We have tried it.
    Earlier to SP14 you cannot give the same name to outgoing file without writing a Adapter module. But things are easy with SP14.
    Cheers,
    satish

  • The same filename from a sender to a receiver file adapter - SP14

    Hi Expers,
    I Have Gone through the link which is given bu Michal.
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    Here My Questions are.........
    1.Should we give any file name in the receiver side Adapter in this scenario.?????
    2.How wil be the Sender and Receiver Communication channel Parameters????
      What Are they???????
    Please Clarify me...
    Regards
    Khanna

    Hi Rajesh,
    Is your query related to sending the file name from the source xml document to the reciever file adapter. If so this can be achieved.
    Pls. do the following.
    1. In the mapping program that you are using populate the filename coming from the source into the target root element.
    2.Sender adapters can write adapter-specific attributes to the message header; these can then be evaluated at configuration time
    3. To change the adapter-specific attributes of the message header by using message mappings, you access the required classes of the mapping API by using a mapping runtime constant.
    <b>Note: You donot need to specify any filename in the receiver communication channel.</b>
    To access the classes DynamicConfiguration and DynamicConfigurationKey by using the mapping runtime constant DYNAMIC_CONFIGURATION, use the method getTransformationParameters() of the container object.
    Create an simple user defined function in the mapping and use the following code.
    Imports: com.sap.aii.mapping.api.*;
    Parameter: String filename
    Paramter: String filename;
    filename = fileName + ".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, filename);
    return filename;
    You donot need to hard code the value of the filename in the file adapter for your interface.
    In SXMB_MONI, when you see the pipeline services you would see that the value of the filename is populated in the message payload.
    Thanks
    Indranil

  • Problem: The same filename from a sender to a receiver file adapter - SP14

    Blog : /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    My Problem:
    The thing works for me and i am able to get my input files name as my output file name. But one thing i noticed is that in my target message, the field where i have mapped the code it always returns the value "null" but finally when the file is created i get the required result.
    My input file name is input.txt and i get the same name in my output file too.
    In sxmb_moni if i check DynamicConfiguration link i see the following
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!-- Response
    -->
    - <sap:DynamicConfiguration xmlns:sap="http://sap.com/xi/XI/Message/30">
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFTPHost">10.25.116.98:21</sap:Record>
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="Directory">/input/test</sap:Record>
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileTimestamp">20060228T112200Z</sap:Record>
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileType">bin</sap:Record>
    <b><sap:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">input.txt</sap:Record></b>
    <sap:Record namespace="http://sap.com/xi/XI/System/File" name="SourceFileSize">770</sap:Record>
    </sap:DynamicConfiguration>
    But when i check my mapped field i see
    <field3>BodyC</field3>
    <keyfield>02</keyfield>
    <field5>BodyE</field5>
    <field6>BodyF</field6>
    </Body>
    - <Trailer>
    <keyfield>03</keyfield>
    <b><field2>null</field2> -> Null value instead of input.txt</b>
    </Trailer>
    </ns0:MT_Putfile>
    The code i have used to map the field2 of the trailer is the following ....
    <i>DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileType");
    String valueOld = conf.get(key);
    return  valueOld;  </i>
    Any clues ?

    Gosh this is spooky
    Anyway i tried with that line of code but it throws me an error during activation ...
    Activation of the change list canceled Check result for Message Mapping mm_IS | http://t-systems.com/Shabarish:  Starting compilation  Source code has syntax error:  /usr/sap/TXT/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map387c7300a9ac11da9d280011256afae8/source/com/sap/xi/tf/_mm_IS_.java:104: cannot resolve symbol symbol : method getTransformationParameters () location: interface com.sap.aii.mappingtool.tf3.rt.GlobalContainer DynamicConfiguration conf = (DynamicConfiguration) container.getGlobalContainer().getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION); ^ 1 error
    The code is :
    DynamicConfiguration conf = (DynamicConfiguration) container.getGlobalContainer().getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    //DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    //String valueOld = conf.get(key);
    String valueOld = conf.toString();
    return  valueOld; 
    Thanx Renjith so far .. but i hope this gets resolved (else i will loose my sleep thinkin abt the situation)

  • How can i access filename from file (sender)

    hi All,
    can anybody tell me
    how can i access filename from file (sender)?
    thank u
    swari

    See:
    "SAP NetWeaver XI: Variable Substitution with Adapter-Specific Message Attributes via DynamicConfigurationBean"
    SAP NetWeaver XI: Variable Substitution with Adapter-Specific Message Attributes via DynamicConfigurationBean
    "Accessing Adapter-Specific Attributes through User Defined Function"
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/70c89607-e4d9-2910-7280-f6746e964516

  • I restored my mac and all my music wiped from my mac and is still on my phone. how do i get the music from my phone to my mac i really need it!

    i restored my mac and all my music wiped from my mac and is still on my phone. how do i get the music from my phone to my mac i really need it!

    Did you not have a Time Machine backup of your Macbook Pro or a clone backup on an external HD?
    To copy music from the iPhone to your Mac -- except purchases from the Apple Store -- you need third-party software.
    Check this thread: https://discussions.apple.com/thread/5811515?searchText=music%20from%20iPhone%20 to%20mac

  • Can 2 people in different locations at the same time import, access, send, and receive the same messages from the same email account

    I import messages into Thunderbird. I send and receive emails. One of the things I like about Thunderbird is that I can insert (image, link, etc) right where I want to, and I can Attach. But not just a simple attach file. No, I can also click Attach and choose Webpage. A lot of web-based emails are plain, simple, no frills - Attach file and that's it.
    So I need to have my client be able to do the same thing I do when sending out emails, Namely sending out emails with an Electronic Press Kit (EPK) attached - which is to say, a webpage (not a pdf in our case). So, I need her to download, install, and use Thunderbird.
    Here's the problem and my question. She needs to access, send, and receive from my email account. That would be easy if it was simple attach files - she could just login on the web, go to squirrel mail and bang it out.. Here it is: She needs to be able to import the messages to be able to reply to some messages - she needs access to what I have access to. She needs to use Thunderbird so she can take advantage of the features like insert image with link or attaching a webpage. My question is how will this affect my use? Can 2 people simultaneously and from different locations access and use the same email account or is it a case where her importing the emails would cut me off..Is it an either or thing? Basically, can her and I both import the emails or can they only be imported to one location at a time. Because every time someone sends me an email i get it right there on my Thunderbird application..it's imported to my Thunderbird..I want her and I to be able to do that without affecting each other. I don't want her to start importing to her desktop and then I can no longer import. If she says "point those messages to my computer what will happen to my ability to access them on my computer in the same manner I am currently?

    I think there is a contradiction in your requirements. You want two people to share an account and you don't want either to interfere with the other.
    The short and simple answer is to use IMAP to connect to the mail server. If your current email provider doesn't offer IMAP, find another that does. This is old technology already and it's disgraceful that some email providers haven't yet put it in place.
    IMAP means that your messages are stored on the server and both of you will see exactly the same set of messages. And therein lies the contradiction; you will both see changes made by the other so you are inherently interfering with one another.
    Caveats: some providers may not permit you both to access the account concurrently, and even if they do, things may become interesting if you both choose to work on the same message simultaneously.
    Note that all of this is about email servers and protocols; your choice of Thunderbird as your email client has little bearing on the situation.

  • Get filename from file sender adapter

    Hi Experts,
    I have a question regarding the file/ftp adapter (sender).
    I have a directory with xml and pdf files. for every xml file there is a pdf file with the same filename. for example:
    file1.xml
    file1.pdf
    file2.xml
    file2.pdf
    file3.xml
    file3.pdf
    Now I want to read the xml file with the file sender adapter. afterwards I want to read the related pdf file. for example: If I read the file file1.xml afterwards I want to read the pdf file file1.pdf with the file sender adapter. For this it is nessessary to get the filename from the xml file so that I can read afterwards the pdf file. How can I realise it?
    Thanks and best regards
    Christopher

    Hi srinivas,
    thanks for your quick answer.
    That the file adapter is not able to read pdf files is clear to me. In this case I only want to transport the pdf. that works fine. I tested it.
    the problem is the following:
    I have a xml file with the name "file1.xml". I read the xml file with the sender file/ftp adapter configured with filename "*.xml". Then I want to import the pdf file with the name "file1.pdf". Therefor I need the filename from the xml file.do you know what I mean? So XI has to know the filename of the xml to import the pdf with the same name ...
    regards

  • Excahgne 2013 outlook 2010 don't update folders from exchange server, from owa send and receive is ok

    I have exchange 2013 server, with database for each department last week we have power problem, servers down 
    after servers goes on line, i have database with dirty shutdown, cant mount it, then i do eseutil/p, then i mount it, then all users access there mails from outlook 2010 they can send and receive, except one user cant receive new mail to outlook but he can
    send mails from outlook (in outlook the folder last update 22april), from owa he receive anew mails and can send,
    i try to delete outlook profile and create it again i get folder has not yet been updated
    i try to repair exchange database again, but the same problem
    i try to move it to another database or another server but move fail
    if i use outlook online (remove use cached mode) its receive new mails.
    Any help?
    Thanks

    Hi,
    What’s the user impact? If the issue only occur on specific users, I suggest we firstly take the troubleshooting from the client side.
    If the issue occurs to all the users, it’s seems the Outlook sync issue with the CAS server, not like a database issue. Do you configure the NLB for the CAS server?
    Thanks,
    Simon Wu
    TechNet Community Support

  • Email from Adobe Send not received

    After returning to SendNow for larger files, and still failing, I tried to use Adobe Send again for a couple of smaller files today. Time sensitive. I saw no errors on upload. Got a message stating they had been sent. Three hours later the client is questioning whether I will be able to meet the deadline.
    Apparently three recipients (all on same send) never received any notification of files in their emails. So now we have progressed from failing to send to pretending to send. I forwarded the share to myself and it came in as junk. I forwarded my email to one of the recipients and it was successful. She was able to download the files but a problem with this method is that "I" appear to have downloaded the files.
    So no real useful tracking data and a hit/miss approach to file delivery.
    Now the client  wants to "determine at the end of this project if there is a need to look into a different delivery service other than Acrobat Send Now." Even she doesn't realize the service has changed so its all lumped into Adobe services. This is unfortunate and embarrasing.
    Adobe Send is premature and untested. I recognize that the engineers are working on a solution but this is no small bug and significantly interrupts, perhaps permanently, workflows of existing users. Is August still the cut off date to switch? I fear many will be switching but not to Adobe Send.

    You might get an answer here, but I think it's a question for the Adobe Forum. Since you are receiving your other mail, it doesn't seem like a Mail or ISP problem.

  • Can we use same Business Service for Sender and Receiver

    Can we use same Business Service for Sender and Receiver

    Hi
    In addition to the above infomation explaining about the Business Service..
    Business Service: Address an abstract business entity as the sender or receiver of messages.
    Using a business service, you can define the technical or business subunits of the companies involved and then assign them the relevant interfaces.
    The business services are used when configuring cross-company processes also..
    regards
    Kishore

  • XSLT mapping to retrieve FileName from FILE SENDER adapter

    Hi
    I have an File Sender adapter scenario where I have switched on Adapter-specific message attributes (FileName).
    In my XSLT mapping program I need to RETRIEVE the filename and map it. Can anyone help please?
    Thx in advance

    Hi Bohamo
    Refer the following link.It provides the required solution for you.
    http://help.sap.com/saphelp_nwpi71/helpdata/EN/83/2200cb50d345c793336d9a1683163e/frameset.htm
    Thanks
    Ram

  • I cannot connect to wireless from Ipad when I could 2 days ago.  Still can connect to same wireless from other PC.  What settings do I need to check?

    I recently cannot connect to my neighbors wireless with my Ipad.  I can connect with my PC.  I feel like I have shanged a setting by accident but do not know where to start to correct this.  I have the password to the account.

    Are you receiving the signal? Do you see the white "fan" WiFi indicator in the upper left corner of the iPad screen?
    Go to Settings>WiFi> and see if the network name is showing on the iPad. If the name is showing, you can try this ...
    Tap on the network name, then tap on the blue arrow next to the network name and then tap Forget this Network. Restart your iPad then go to the settings again, tap WiFi - tap on the network name - enter the password and see if you can connect again.
    Normally I would suggest unplugging the router for about 30 seconds and then plug it in again, but this is your neighbor's WiFi? Does he know you are using his WiFi access? If so, what a great guy!
    Here is how to restart the iPad. Restart the iPad by holding down on the sleep button until the red slider appears and then slide to shut off. To power up hold the sleep button until the Apple logo appears and let go of the button.

  • Can my colleagues access my itunes account and all of the apps in there from their own pcs? What we really need is a shared itunes account so that anyone in the office can add apps to the account and everyone else will be able to access it?

    I have an itunes account to update the office ipad. Now we have more of them can my colleagues access my itunes account including the apps to update their ipads with? it seems silly for everyone to have a seperate account and purchase apps that i have already bought.  We just want to share and update one account that everyone can use and access from their own pc.

    Unless I am missing the point here - or in the event that there are different terms and conditions for the use of iPad in the Enterprise with regard to iTunes purchases - once you have purchased an app - you are free to download that app again - at no charge - to as many iDevices as you desire - as long as you are using the same Apple ID and iTunes account that you used to make the original purchase.
    So the short answer to the question - IMHO - is Yes! My wife, my daughter and I share one iTunes account and we download apps onto four different iDevices - and only pay for the apps once. The purchases are tied to the Apple/iTunes account and not to the PC or the iDevice.
    The only caveat to this point is - I have no idea how Apple handles purchase for businesses meaning that I don't know if businesses are subject to the same terms and conditions as we "everyday" users.
    Maybe the company could set up one iTunes account and you could all share from there but I still don't see why this can't be done. However, that is why I suggest that this question might be better served being posted in the iPad in the Enterprise section of the ASC.

  • After upgrading from win 7 - win 8, do I really need the win 7 recovery partition?

    Hello.
    I'm a happy camper after upgrading my HP Spectre XT from win 7 to win 8 (Win 8 upgrade offer). The 128GB SSD disks just makes everything so smooth and fast.
    However I am abit annoyed with the Win 7 recovery partition that still uses 20 GB of my total 128GB space.
    I have tried searching the forums, as well as the www for any good answers, but I end up more confused.
    So I am asking the community some questions that interests me, and hopefully you can provide me with some meaningsful answers
    1. Can I now delete my win 7 recovery partition, and if so what is the most effiecient and safe way to do it?
    2. Is there a a good way to make sure that if (heaven forbid) something would happen, I still would be able to recover my notebook preferably to win 8, and not the preinstalled OEM win 7?
    3. Of course the Spectre XT has no optical drive, so if its doable I might need to make an win 8 recovery partition in the end. Is it possible? 

    You can use Windows builtin Disk Management to delete the partition, or EaseUS software. Both procedures are outlined at EaseUS site:
    http://www.partition-tool.com/resource/windows-8-partition-manager/delete-windows-8-partition.htm
    As for a Recovery option after deleting, look at System Imaging which is builtin Windows 8 also.You need an external USB hdd for this.
    http://www.eightforums.com/tutorials/8956-system-image-create-windows-8-a.html
    ******Clicking the Thumbs-Up button is a way to say -Thanks!.******
    **Click Accept as Solution on a Reply that solves your issue to help others**

Maybe you are looking for

  • Robocopy with Win 8.1 , guidance needed

    In Win8.1Pro 64 bit used  the command line: Robocopy V: F: \ backup /MIR / R:0 The copied directories now take most of the space on an external Lacie HD F: . All the files and directories seem to be hidden though, neither  command line DOS evel  nor

  • Rulers by default in Acrobat X

    Is there a way to set the Rulers to display by default when opening documents in Acrobat X Pro

  • ORACLE_HOME of 11g on Linux/Unix

    Hi, is default ORACLE_HOME of 11g on Linux/Unix as follows : /softwares/app/Administrator/product/11.1.0/db_1 Thanks and regards.

  • Mail opens off the screen & I can't reposition it...HELP!

    Has anyone had this issue and maybe can help? When I open Mail it flies off the screen to the right. It is open and all the controls on top are there, but I can't see the main screen pane. So I am not able to open Preferences or anything else than mi

  • Work item 000000399133: Object 000000399133 method SENDTASKDESCRIPTION can

    hi experts,                    sometimes frequently i get this kind of wrror after executing my workflow. Work item 000000399133: Object 000000399133 method SENDTASKDESCRIPTION cannot be executed..how to correct this??what might be the problem?