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)

Similar Messages

  • 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

  • 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

  • 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 -

  • MQ to File: How to send a Filename from JMS Header (MQ) to a File Adapter

    Hello Experts,
    I have a flat file coming into PI via JMS adapter (MQ) and going out on a File adapter (NFS). We would like to keep the file name consistence throughout the transaction. While coming from MQ our sender is sending the filename in one of the MQ Headers (JMSCorrelationID). We are trying to figure out how to read the file name from the MQ header and send it to the file adapter. Please let us know any other suggestions.
    Thanks,
    Mayur

    Use this UDF code in MessageMapping.
    try
    DynamicConfiguration conf = (DynamicConfiguration)
    container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey KEY_JMSCorrID = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/JMS","DCJMSCorrelationID");
    DynamicConfigurationKey KEY_FILENAME = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    conf.put(KEY_FILENAME, conf.get(KEY_JMSCorrID));
    catch(Exception e){}
    return a; //a is some input field.
    Enable ASMA on receiver File channel.
    Edited by: Praveen Gujjeti on Mar 17, 2010 9:23 AM

  • File receiver adapter with the same filename than sender

    Hi guys,
    I am experiencing a problem when I use the <b>Adapter Specific Message Properties</b> to be able to receive a file with the same name as the sender.
    I've been following the example of Michal Krawczyk (XI: The same filename from a sender to a receiver file adapter - SP14) but i get a problem  related with the content converter parameters. 
    The error I receice in the File  Adapter is the next:
    <i>Could not process due to error: java.lang.Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'java.lang.Exception: Consistency error: more fields found in XML structure than specified in conversion parameters!</i>
    I have been trying to do all the combinations with the content conversion parameters but the result is allways the same, MORE FIELDS FOUND IN XML ....
    My XML structure is the next:
    <ns0:MT_MDFranceN xmlns:ns0="urn:s-n:HR:MasterDataFrance">
       <lines>
          <line>  
             <header/>    1..1
             <data/>       0...unbound
          </line>
       </lines>
    </ns0:MT_MDFranceN>
    In the header I write the name of the file with the code provided by SAP and Michal, so the name of the file is stored there.
    any help?
    Thanks!!!!!

    I have changed the XML because, as you said, there is no need to introduce the filename inside the payload. Now the  structure is the next:
    <i><?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_MDFranceN xmlns:ns0="urn:s-n:HR:MasterDataFrance">
       <lines>
          <line>
             <data/>
          </line>
       </lines>
    </ns0:MT_MDFranceN></i>
    Record Structure: lines,line
    line.addHeaderLine   0
    line.endSeparator     'nl'
    lines.fieldSeparator   'nl'
    line.fieldFixedLengths  1300
    A sample of the payload is the next:
    - <ns0:MT_MDFranceN xmlns:ns0="urn:s-n:HR:MasterDataFrance">
    - <lines>
    - <line>
      <data>EDI_DC40_U5300000</data>
      <data>E2HR_HD001 530000000000007802</data>
      <data>E2HR_KY001 530000000000101TS 20070104000010 20070129</data>
    000000601</data>
      </line>
      </lines>
      </ns0:MT_MDFranceN>
    And.....   I still have the same problem, the same message in the file adapter:
    <b> 'java.lang.Exception: Consistency error: more fields found in XML structure than specified in conversion parameters</b>
    Any idea of what can be the problem?
    thank you very much!!!

  • Setting dynamic file name in Receiver file adapter - not from payload

    Guys I just remember reading a weblog but can't find it now that I need it, on how to set the file name in message mapping dynamically but not using any payload field.
    Please let me know if you remember this.
    Thanks a lot,
    Viktor Varga

    also u can check in
    <a href="/people/jayakrishnan.nair/blog/2005/06/28/dynamic-file-namexslt-mapping-with-java-enhancement-using-xi-30-sp12-part-ii file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II</a>
    <a href="/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14: The same filename from a sender to a receiver file adapter - SP14</a>

  • Send attachment via Receiver FILE/JMS adapter without using any Mapping.

    Hi,
    R/3 program creates one (encoded) text file, which I want to send via Proxy to JMS adapter without any mapping or FCC.
    Note: I don't want to use File adapter to pick the file from R3 dir and then send it to JMS.
    Reference: I have gone through below mentioned blog which produces the attachment in the XI payload but I am not able to write the same attachment to my XI dir using Receiver File adapter (File adapter is just for testing actual adapter will be used as Receiver JMS adapter).
    /people/michal.krawczyk2/blog/2006/04/19/xi-rfc-or-abap-proxy-abap-proxies-with-attachments
    Regards,
    Sarvesh

    > note sure why you want to complicate things here
    Actually the idea was to explore the possibilities of "Proxy with attachment". And I also wanted to confirm with experts like you before going to other options. Anyway it seems it's only possible with mail adapter.
    Reason for exploring above possibility: Since ABAP team has to create one text file and encode it, so we thought to call the outbound proxy in the ABAP program to send the same file as an attachment and then simply send it to JMS. Which is quite obvious thinking when you don't want to manage a share directory between R3 & XI or don't want to manage FTP user and pwd.
    > i think the simplest thing is to go for a simple file to jms configuration unless you have any specific reasons for not doing so.
    This we already kept in our mind as a last option in case if above thing is not possible then we can easily do it by this way.
    Thanks a lot for suggestion.
    Regards,
    Sarvesh

  • Dynamic Filename on Receiver File Adapter

    Hi,
    I am running XI 3.0 SP 14.
    The scenario is
    SAP R/3 (IDOC) > XI (Receiver File Adapter)> FTP Server
    There is no mapping on the XI side, we just drop the IDOC XML on to the ftp server.
    I would like to configure a dynamic file name on the Receiver File Adapter where if the 'MSATZ' Field
    within the E1EPD04 segment of the IDOC is populated then I would like to send a separate
    Filename than the one specified on the 'File Name Scheme'.
    Has anybody done this or any suggestion how I should go about this please.
    Thank you.
    Warm  Regards,
    Ranjan

    Hi Guys,
    When I tried to create the User defined function as below, I got the Null value for the "StreamTransformationConstants.DYNAMIC_CONFIGURATION" object.
    My code looks like this,(this is part of the debuging code)
    Start
    public String Create(String a,String b,Container container){
    if (container.getTransformationParameters() == null)
    return "conf.null";
    if (container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION) == null)
    return "Dynamic.null";
    return b;
    --End
    On the output I get the value "Dynamic.null". I do not know why the object value is Null.
    Any suggestion pls.
    Thank you.
    Warm Regards,
    Ranjan

  • Problems importing the same clips from diferents cards  IMAC and CS5

    Hi, I'm having trouble importing my clips recorded in The ex1, I'm using CS5 with an imac, The problem is that when I import the same clips recorded in two cards, the second card comes exactly with what is inside the first card.  It does not have what was originally in it, it just copies what was on the first card or vice versa.  But the original folder in my drive is intact with the two cards intact. The problem is when I import it to CS5 on IMAC.  When i import the video the imac makes a long file with all the clips an puts them together except the clips from the previous card, it shows but with the same video that is in the begining of the second card or the last clip recorded in the second card .I tried to import the clip again from the first card and it comes with the same video from the second card again.

    1) Don't know why this is happening. It may have something to do with
    I downloaded from iCloud the same library I was working with
    I'm not clear what procedure you're using here. Using a cloud for storage might change some file tags. Generally users I think keep the library on the same drive as the media, keeping the library backups on the system. There is no real benefit in keeping the media in a separate location. Often users will keep the library in the same folder as the media. It makes backing up using tools like Carbon Copy Cloner very efficient.
    1a) This can be difficult to find as there sometimes is no obvious indicator. It might be a missing element in a compound clip, a missing or altered layer in a graphics file, a missing font, a missing effect. These will show up inside the item involved, but may not be apparent in the browser. A missing transition for instance will not be seen until you skim over the project or try to export it.
    2) The 43 MB is a small amount of optimized media. This never prevents relinking. The library is always looking for original media, or proxy media if you're in proxy playback. It never looks for optimized media. If it has it, it uses it, if it doesn't, it uses the original media. If you are using original/optimized playback, you must have the original files. The optimized files are not enough.

  • SAP PI ftp FIle transfer one to one with the same filename

    Hello all,
    maybe sombody ask the same in this forum, but couldn't find any topic regarding these.
    Okay:
    We have a scenario which have to pick up a txt file from a folder and to deliver to another folder
    outside. The file transfer itselfs isn't a problem and works propertly, but we need the same file-
    name for the outgoing file. Unfortunaltey we have huge different filenames..
    So, my question would be, what for possiblities we have to sure, that if we can deliver the
    file which the same filename as we have in the orginal (source) filefolder.
    e.g. file named in source called TEST.123 in the destination should be also TEST.123.
    The next file called TEST123.abc should be also in the destination TEST123.abc.
    Thanks

    Hi friends.
    I don't know about if you need still any help. But i think it will be useful for another people who have encountered that problem and looking for the solution.
    The solution is pretty simple for case if you are going to some file by scenario FTP - to - FTP without interface mapping. I was able to create simple example ant put it on my site to let you use the portable short instruction with screen shots and highlighted marks that help you understand it more clear. Indeed you don't need any udf if you wish to repeat that example in your real scenario. Link is HERE
    Shortly you have to do the next:
    1) for the sender adapter in tab "Advanced" switch on the check-box "Set Adapter Specific Attributes" and check that "File name" is switched on as well.
    2) for the receiver adapter you have to repeat step 1 as well. Plus you have to change setting on the tab "Processing". On that tab you need to change "File Construction Mode" into "Create" and than you have to switch on the check box named as "Overwrite Existing File".
    That's it.
    Thank you, i hope that is help.
    Sincerely, LukCAD.

  • How to receive emails of the same inbox from in a Weblogic Server cluster

    Hi All,
    I have an application running on WebLogic Server with 6 instances. Many requests for the application come from Email. We already set up an email account that will be used by all clients to send email to. But the problem is that the email account inbox can only be opened for reading by a single connection, unlike a typical database. Currently I can only deploy the email reading service on a single server instance, this will effectively create a single point of failure and unbalanced load. What's the best way to read from the same inbox from multiple servers? I am thinking developing something using a database table, sort of leasing, whoever locked the table own the lease and can connect to the email server, but this is pretty hard to implement correctly in all circumstances.
    I did an intensive search on the internet, but couldn't find anything.
    I appreciate your help very much.
    Thanks
    Tao

    Hi Aditya
    By default, OPA 10.4 will collect the minimum amount of information needed to answer the goal of your interview and then display the answer and the reasons for the answer.You can change what appears on these screens within OPM itself (you don't need to change those settings).
    So I would:
    - add a Summary Screen to your project (if you haven't already)
    - add <your goal attribute> to your summary screen. This will display as a link if the goal is unknown and as a sentence showing the outcome and a Why? link when it is known. 
    - add a label to the summary screen, providing information about the outcome (eg "Congratulations you are eligible") or simply show the value of the outcome (eg Your total deduction is %deduction_amount%). 
    - use visibility rules to control which items to display at the start/end of your interview (in your case, maybe hide your goal once it is known and show your label once your goal is known). See OPA help topic "Tutorial: Hiding and displaying summary screen elements".
    The Inferred Brand Discount sample supplied in the OPM install provides an example of this (see Help topic Sample Rulebases for information on how to open this).
    Hope that helps,
    Fiona

  • How can I remove multiple copies of the same song from the iTunes listing?

    How can I remove multiple copies of the same song from the iTunes listing. The program seems to be picking up the same songs from, for example, my user area and my public area in the C drive

    As above, Apple's official advice is here... HT2905 - How to find and remove duplicate items in your iTunes library, however it is a manual process and the article fails to explain some of the potential pitfalls.
    Use Shift > View > Show Exact Duplicate Items to display duplicates as this is normally a more useful selection. You need to manually select all but one of each group to remove. Sorting the list by Date Added may make it easier to select the appropriate tracks, however this works best when performed immediately after the dupes have been created.  If you have multiple entries in iTunes connected to the same file on the hard drive then don't send to the recycle bin.
    Use my DeDuper script if you're not sure, don't want to do it by hand, or want to preserve/merge ratings, play counts and playlist membership. See this thread for background and please take note of the warning to backup your library before deduping.
    (If you don't see the menu bar press ALT to show it temporarily or CTRL+B to keep it displayed)
    tt2

  • Looping the same answer from the 1st row in the table

    I have a database with 3 tables: (1) employeeTable (2) cityTable (3)stateTable.
    I reference the employee's city name and state code by each id number from the cityTable and stateTable.
    My Employee table has about 10 records, 3 has an idcity and idstate input, the rest are blank.
    (1st row) id 9 for Henderson, id 28 for NV (6th row) id 9 for Henderson, id 28 for NV, and (10th row) id 10 for Las Vegas, id 28 for NV
    I run a query:
    <cfquery datasource="dsnName" name="qEmployees">SELECT * FROM users ORDER BY lastName ASC</cfquery>
    <cfquery datasource="dsnName" name="qState">SELECT code FROM states WHERE idstate=#qEmployees.idstate#</cfquery>
    <cfquery datasource="dsnName" name="qCity">SELECT name FROM cities WHERE idcities=#qEmployees.idcity#</cfquery>
    a run the table output:
    <table>
        <cfoutput query="qEmployees">
        <tr>
            <td>#qEmployees.lastName#, #qEmployees.firstName#</td>
            <td>#qCity.name#</td>
            <td width="40">#qState.code#</td>
            <td width="60">#qEmployees.zipCode#</td>
        </tr>
         </cfoutput>
    </table>
    PROBLEM:
    All 10 records output in the table as the same answer from the 1st row (Henderson, NV).
    What's making this loop having the same answer from the 1st row and affects all the rows with blank info or different info?
    I've been trying to figure this out for weeks and I hope the community can help me out. Thanks!

    As Dan rightly says, take a look into table joins; there's no point just giving you the answer as you'll just get stuck next time and these forums are to help people rather than to do their jobs for them.
    What you're looking to do is a relatively simple join, so you shouldn't have to read up for long before you've mastered them. Plus your site will be significantly more efficient

  • I cleared a conversation in messages. I did not delete.  How can I get it all the messages back from this sender.

    I cleared a conversation in my messages. I do not delete. How do I get all the messages back from this sender?

    Clearing a conversation is the same as deleting the messages, so unfortunately they're gone. You could always restore from a previous backup, but you would lose anything that you've added/changed etc on your phone between the last time you synced your phone and now.

Maybe you are looking for