DynamicConfiguration changed in PI 7.1?!

Hi guys,
at the moment we are upgrading from PI 2004s to PI 7.11.
Therefore all our interfaces have to be tested.
During test I came along to one strange situation regarding DynamicConfiguration.
I have an Idoc to File szenario, where the message is mapped via Java.
during this mapping idoc runtime information is used (RCVPRN).
This information is accessed via DynamicConfiguration.
In PI 7.1 i got an NullPointerException trying to access the DynamicConfiguration.
In the mapping follwing Key is used for DynamicConf access
private static final DynamicConfigurationKey KEY_RCVPRN = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/IDoc", "RCVPRN");
In sxmb_moni the SOAP Header section DynamicConfiguration differs from PI 7.0 to PI 7.11
PI 7.0
<SAP:Record namespace="http://sap.com/xi/XI/System/IDoc" name="RCVPRN">M1962</SAP:Record>
PI 7.11
<SAP:Record namespace="urn:sap-com:document:sap:idoc:messages" name="RCVPRN">M1962</SAP:Record>
In the name scenario I have an second usage of the DynamicConf for setting the FileName dynamically.
In this case the entry in PI 7.0 and PI 7.11 is the same
PI 7.0 and PI 7.11
<SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">test.xml</SAP:Record>
Does the DynamicConfiguration behaviour changed with PI 7.11
How to access the dynamic header section of IDoc?
Hopefully someone could bring some light to this issue
Thanks in advance
Regards
Jochen

The dynamic configuration should not change and did not change for most
adapter like file, soap, jms.
Dynamic configuration for IDoc is not officially documented, nevertheless there
exists a  contect object for this and in PI 7.1 the context object does match the
header field.
In my opinion this is a bug, so you should open an OSS ticket for this.
Regards
Stefan

Similar Messages

  • Changing time stamp format in the file receiver adapter file name

    Hi all,
    How can we change the standard date time stamp from
    filename_yyyymmdd-hhmmss-mil
    to
    filename_yymmdd_hhmmss
    i.e.,  I want "underscores" instead of "hyphens" and also I do not want the MilliSeconds.
    I read in the forums that I have to use the combination of variable substitution and mapping functions to do this, but not sure how exactly.
    Can the experts help me with this please?
    Many thanks.

    Hello Ramesh,
         You can make this possible using runtime filename creation using UDF.
    Please go though the below steps.
    Message mapping:  
    Create an UDF and include the piece of code that captures the Filename and Timestamp from source side via ASMA.
    Modify them according to our requirement by adding the <Timestamp> at the end of <filename> with _.
    Map the UDF to any of the top level node so that the modified filename will be available for the target communication channel
    UDF Code is:
    try {
    String filename    = "";
    String timestamp = "";
    DynamicConfiguration conf1 = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","FileName");
    DynamicConfigurationKey key2 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","SourceFileTimestamp");
    filename = conf1.get(key1);
    timestamp = conf1.get(key2);
    filename = filenametimestamp".xml";
    filename = filename.replaceAll( "-" ,"_" );
    conf1.put(key1,filename);
    return filename;
    catch(Exception e)
         String exception = e.toString();
          return exception;
    Click on Advanced tab and check the Option u201CSetAdapterSpecificMessageAttributesu201D in addition to that check the attribute that are required to be captured during run time. In our case File Name and Source File Time Stamp are required to be checked
    In the receiver communication channel Mention u2018 * u2018as File Name Scheme.
    Click on Advanced tab and check the Option u201CSetAdapterSpecificMessageAttributesu201D in addition to that check the attribute u201CFile Nameu201D which will carry the modified value in the UDF .
    i hope this will help you.
    Monica

  • Values in a DynamicConfiguration must not be null

    In File to RFC to File synchronous method without BPM , i need to populate the file name for the receiver file dynamically.
    So i have used UDF in RFC to File message mapping.
    Z_RFC                                               MT_RCV_FILE
    FILENAME                                          FILENAME
    ITAB_OUT----
    ITAB_OUT
       item        -
    item
          STR1   -
    STR
    Created a  UDF for FILENAME as below:
    FILENAME -
    > UDF -
    > FILENAME
    and coded as below:
    try{
    String FILENAME  =  " ";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FILENAME");
    FILENAME = conf.get(key);
    conf.put(key, FILENAME);
    return FILENAME;
    catch(Exception e)
         String exception = e.toString();
          return exception;
    when i test the mapping it shows an error :java.lang.NullPointerException
    and while doing a full test it shows :
    java.lang.IllegalArgumentException: Values in a DynamicConfiguration must not be null in SXMB_MONI
    can anybody guide me to solve this error.

    Hi Abhisek,
    I have changed it to FileName and when i do a end-to-end testing it shows
    Error: com.sap.engine.interfaces.messaging.api.exception.MessagingException: 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! (Value '20000000Test2222222220      Pass1')', probably configuration error in file adapter (XML parser error)'
    The strucute of receiver File:
    MT_RCV_FILE
         FILENAME          0 .....1
        ITAB_OUT           0......1
                  item            0.....unbounded
                      STR1      0......1
    In the  receiver CC i have given the following parameters:
    Target directory : /home/ftpusr/test/out
    File name scheme : *
    Content Conversion
    ITAB_OUT.fieldFixedLengths  30,255
    ITAB_OUT.endSeparator : 'nl'
    item.addHeaderLine  : 0
    item.fieldFixedLengths : 255
    item.endSeparator : 'nl'
    where could be the problem?

  • How to set JMS Header Property without using DynamicConfiguration.

    Hi,
    My Scenario is: PDF File -->XI -->JMS
    I need to send the PDF file as it is to JMS receiver, which shouldn't be a problem. The problem is I need to set the same file name in the Receiver JMS header property.
    So to do this I am using DynamicConfiguration in message mapping but when File Adapter picks the PDF file (as it is) I get the run time mapping error which is quite obvious since message mapping expects the data in xml format.
    Do you have any idea if I can avoid the message mapping and set the Dynamic Configuration somewhere else (not sure if java mapping can help here) or if there is some Module available to set file name in JMS header.
    Note: PDF File name is dynamic.
    Thanks!

    I am on XI 3.0. I am not good in java.. can someone give an example?
    Update:-
    I have done some changes to my code and now it is working for me. Since I don't have much knowledge in Java (except writing UDFs )so don't know how good this coding is but defiantly this is my first step to learn Java APIs. Thanks to everyone for their comments & suggestions!!
    If any improvement in below code can be done please let me know.
    package com.sap.xi;
    import com.sap.aii.mapping.api.*;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.HashMap;
    import java.util.Map;
    import com.sap.aii.mapping.api.StreamTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import org.xml.sax.helpers.DefaultHandler;
    public class JMSHeaderMapping extends DefaultHandler implements StreamTransformation{
       private Map param;
        public void setParameter(Map map)//to access message header data during runtime
            param = map;
            if(param == null)
            param = new HashMap();
        public void execute(InputStream in, OutputStream out)  //This method is used to run the mapping
        throws StreamTransformationException
                DynamicConfiguration dynamicconfiguration = (DynamicConfiguration)param.get("DynamicConfiguration");
                DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
                String MyFileName = dynamicconfiguration.get(key);
               DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/JMS","DCJMSMessageProperty0");
            dynamicconfiguration.put(key1, MyFileName);
            byte[] inbyte = null;
            try {
        // convert InputStream into byte stream
              int bufsize = in.available();
              inbyte = new byte[bufsize];
              in.read(inbyte);
        // convert byte stream into OutputStream         
              out.write(inbyte);
            catch (Throwable t){
             t.printStackTrace();
    Edited by: Sarvesh Singh on May 9, 2011 8:47 PM

  • Changing the file name dynamicallly in file Adapter - NullPointerException

    Hi, I want to change the file name directly from Java Mapping in the file adapter for this i have written this code:
    [code]
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http:""/""/"+"sap.com/xi/XI/System/File","FileName");
    String newFileName = CCC'_'NNN'_'NOMCIA'_'DATE;
    conf.put(key, newFileName);
    return newFileName;[/code]
    Where CCC, NNN, NOMCIA and DATE are input of the user-defined function.
    but it gives a null pointer exception:
    [code]16:44:53 Start of test
    Runtime exception during processing target field mapping /ns0:MT_HSBCAltasTrabajadores_TEST/row/separador7. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_JDBC_2_HSBCAltasTrabajadores_TEST_ method FileName$[123, James, Gates, Spectory, com.sap.aii.mappingtool.tf3.rt.Context@247d247d]
    com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns0:MT_HSBCAltasTrabajadores_TEST/row/separador7. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_JDBC_2_HSBCAltasTrabajadores_TEST_ method FileName$[123, James, Gates, Spectory, com.sap.aii.mappingtool.tf3.rt.Context@247d247d]
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:347)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398)
    at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
    at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
    at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(AccessController.java:215)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Root Cause:
    com.sap.aii.utilxi.misc.api.BaseRuntimeException: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_JDBC_2_HSBCAltasTrabajadores_TEST_ method FileName$[123, James, Gates, Spectory, com.sap.aii.mappingtool.tf3.rt.Context@247d247d]
    at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:56)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:291)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398)
    at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
    at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
    at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(AccessController.java:215)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Root Cause:
    java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60)
    at java.lang.reflect.Method.invoke(Method.java:391)
    at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:47)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:291)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398)
    at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141)
    at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431)
    at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301)
    at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146)
    at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
    at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
    at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(AccessController.java:215)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: java.lang.NullPointerException
    at com.sap.xi.tf._MM_JDBC_2_HSBCAltasTrabajadores_TEST_.FileName$(_MM_JDBC_2_HSBCAltasTrabajadores_TEST_.java:564)
    ... 26 more
    RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns0:MT_HSBCAltasTrabajadores_TEST/row/separador7. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_JDBC_2_HSBCAltasTrabajadores_TEST_ method FileName$[123, James, Gates, Spectory, com.sap.aii.mappingtool.tf3.rt.Context@247d247d]
    16:44:53 End of test[/code]
    Regards,
    Luis Diego

    Hey Luis,
    the container object only exists in message mapping runtime.
    Thus you're getting a null pointer exception there.
    For java mappings, remember that you have a .setParameter() method (which is necessary from definition of StreamTransformation interface),
    which sets the private variable param with the transformation parameters. In your .execute() method, just use it like this:
    DynamicConfiguration conf = param.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    Regards,
    Henrique.

  • Changing the file name dynamicallly in file Adapter

    Hi i want to change the file name directly from Java Mapping in the file adapter
    for this i have written this code
    DynamicConfiguration dynamicConfiguration = (DynamicConfiguration)map.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
                   DynamicConfigurationKey keyFile = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
                   DynamicConfigurationKey keyDir = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
                   dynamicConfiguration.put(keyFile,fileName);
                   dynamicConfiguration.put(keyDir,outputpath);
    but it gives a null pointer exception at dynamicConfiguration.put(keyFile,fileName);
    please suggest.
    regards
    Nilesh Taunk.

    Hi Nilesh,
    If your requirement is to create , the file name dynamically for your receiver file adapter, you can do so using your <b>FILE ADAPTER CONFIGURATION</b> itself, and need not go for any JAVA Mappping / Java Code at all.
    The dynamic filename generation concept is as follows.
    In your filename field in the receiver file adapter, just give a variable with <b>%</b> symbols. (eg: %file% ).
    Now, under the option <b>Variable Name Substitution</b>, you can give how the value has to be created.
    <b>It can be your interface name, sender service name, etc or it can be some value dynamically from your payload.</b>
    For the former, your give
    <b>message:interface_name</b> ,etc
    and for the payload part you give,
    <b>Payload: "your element root which u wanna acecss"</b>
    Just check this link out,
    http://help.sap.com/saphelp_nw04/helpdata/en/bc/bb79d6061007419a081e58cbeaaf28/content.htm
    And read the contents under variable substitution and it will help you understand the concepts better.
    Also, in your FILE Adapter under the option FILE CREATION MODE, you have options like,
    1.Add Counter,
    2. Append
    3. Create
    4. Add Time Stamp
    If you have any clarifications on this approach, do get back.
    Regards,
    Bhavesh

  • Change in time stamp format in receiver file name

    Hi,
    We have a scenario as AS2 - PI - FTP Server (AS/400). We want target file name as BMMDDHHSS where B is constant and
    MM (month e.g., 01), DD (day e.g., 12), HH (hour e.g.,11), SS (seconds e.g., 12). Is there standard way of doing this, just by changing some configuration in receiver file adpter?
    Please let me know, how could we do this using PI. If script is optional, keeping as back-up only.
    How come, naming dynamic receiver file names are so difficult in PI. I have been trying to get the answers for our another requirement like to name receiver file as C1.YYMMDD.C2 in a file pass through scenario for more than a month.
    It is just file through scenarios, so we can't use variable substitution as we are not going to read content/payload of file
    Thanks in advance,
    - Riya Patil

    Hi Shabarish 
    Thanks for your reply. I have trying to make this UDF work since almost a month with no luck. Can you please check where am I doing wrong?
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String SourceFileName = "C1." + a + ".C2";
    conf.put(key, SourceFileName);
    return " ";
    In the above code, I am passing date as "a". And mapping CurrentDate (formatted) --> UDF --> Target root node.
    I am getting the following error in SXMB_MONI:
    <SAP:Code area="MAPPING">EXCEPTION_DURING_EXECUTE</SAP:Code>
      <SAP:P1>com/sap/xi/tf/_MM_Lockbox_Filename_</SAP:P1>
      <SAP:P2>com.sap.aii.utilxi.misc.api.BaseRuntimeException</SAP:P2>
      <SAP:P3>Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:P3>
    <SAP:Stack>com.sap.aii.utilxi.misc.api.BaseRuntimeException thrown during application mapping com/sap/xi/tf/_MM_Lockbox_Filename_: Fatal Error: com.sap.engine.lib.xml.parser.Parser~</SAP:Stack>
    Your help would be much appreciated.
    Thanks,
    Riya Patil

  • File copy with change of file type

    I'm currently working on what seems like a simple file-to-file scenario. A file (without an extension) on server A has to be copied to server B. The name of the file on the target server should be the same as the file on the source system. Only change is that the file on the target system should get a .txt extension. After trying various options I'm stuck on the .txt extension.
    I enabled File Name in Adapter Specific Message Properties on both the sender and receiver communication channels. With this option the file gets copied to the target server with the same name, but I cannot add the .txt extension. I also followed the instructions in this blog: https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2664. [original link is broken] [original link is broken] [original link is broken] Unfortunately, I don't see the file name in the payload of my message, which means I cannot use it in the Variable Substitution option of my receiver communication channel.
    Does anyone know what I might be doing wrong here?
    Edited by: Cheese2 on Jul 15, 2009 12:39 PM

    use dynamic configuration. you can manipulate the file names very easily - /people/shabarish.vijayakumar/blog/2009/03/26/dynamic-configuration-vs-variable-substitution--the-ultimate-battle-for-the-file-name
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14 - in your case as per this blog all you need to change in the code will be;
    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);
    ourSourceFileName = ourSourceFileName + ".txt";
    return  ourSourceFileName;

  • Erron while using DynamicConfiguration  in UDF

    Hi All,
    I have create an UDF ,which imports com.sap.aii.mapping.api.*; package  adn performs the following:
    /* UDF */
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String AgiFileName ="MSIPl_"+ paddedAgi+".dat";
    conf.put(key, AgiFileName);
    AbstractTrace trace = container.getTrace();
    trace.addDebugMessage("FileName"+AgiFileName);
    /End of UDF/
    I am getting the following error,during run time .Plz advice
    RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns1:AddMaterial/LEGAL_REGULATIONS/Legal_Regulation. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._Select_Material_to_AddMaterial_ method Syn_FileName_Directory$[000000000000101960, com.sap.aii.mappingtool.tf3.rt.Context@492f5aa1]

    Hi Mohan,
    It seems that the error is due to directory data. Please change the UDF as below.
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
    DynamicConfigurationKey key_dir = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","Directory");
    String AgiFileName = "MSIPl_" + paddedAgi + ".dat";
    String dir = "/outgoing";
    conf.put(key, AgiFileName);
    conf.put(key_dir, dir);
    AbstractTrace trace = container.getTrace();
    trace.addDebugMessage("FileName" + AgiFileName);
    Hope it will help.
    Regards,
    Madan Agrawal
    Edited by: Madan Agrawal on Jul 3, 2009 3:14 PM
    Edited by: Madan Agrawal on Jul 3, 2009 3:25 PM

  • Change name of output file.

    Hello.
    I'm a new in PI.
    I have created communcation channel:
    adapter type: FILE.
    transport protocol: FTP
    then I defined target directory and file name scheme.
    In proccessing tab I choose Add Time Stamp. File was created in my directory, but with this name XXX20100618-153919-672.dat.
    Can I somehow change the name of file like
    XXX[ddmmyyyy][mmtt].dat
    Thanks a lot!
    Edited by: earnestik on Jun 22, 2010 6:49 AM

    > In proccessing tab I choose Add Time Stamp. File was created in my directory, but with this name XXX20100618-153919-672.dat.
    >
    When you select Add time stamp the output file name come like that only,so chnaging name to your desired format at cc level not possible.
    > Can I somehow change the name of file like
    XXX[ddmmyyyy][mmtt].dat
    Try with Dynamic Configuration UDF, in message mapping,then we can achieve this one easily.
    String filename=XXX;
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    SimpleDateFormat dateformat = new SimpleDateFormat("yyyyMMdd");
    String timestamp = dateformat.format(new Date());
    String newfilename=fileName+timestamp+".dat";
    // change to new file name
    conf.put(key, newfilename);
    return "";
    some small changes required in above code, do it your slef,
    if you dont know how to use Dynamic Configuration UDF search in SDN.
    Regards,
    Raj

  • Same file name at Target with change in file extension

    Hi,
    I am working on File to File scenario. I need to create target file name similar to the source file name. This can be achieved by using ASMA. But my requirement is to change the file extension for the target file.
    For example:
    Source File u2013 InvoiceNotification.txtu2026.Then target file should create as
    Target File - InvoiceNotification.csv
    This can be achieved by using OS Command unix script in the receiver communication channel.
    Is there any better way of doing this..say something like Dynamic Configuration or Variable substitution?
    Thank you.

    Hi Achuth,
    I think you are doing content conversion at the receiver side. Go ahead with ASMA, get the file name.
    DynamicConfigurationconf = (DynamicConfiguration)container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKeyFileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
    conf.put(FileName, a);
    return "";
    In the receiver file adapter, keep the extension as .CSV. That's enough.
    Else you can follow as said by Abhishek Salvi. Either way you can achieve the requirement.
    Thanks,

  • Changing file name schema

    In my receiver adapter the file name schema is intern_pay%var1%.dat and in variable substitution var1 is defined as message:message_id_hex.According to this i can see the file in the target directory as intern_payb0ba03a0904711dbbb9e00000e252c96.dat
    Can any one please help me out to change the format of the file in the target directory to intern_pay_yyyymmdd.dat
    Briefly, can any one please explain me how to change the file name schema in the receiver adapter.
    Many Thanks,
    Smith.

    Hi Paul,
    You can use DynamicConfiguration in a user defined function to achieve this.
    Go thro these threads, they will provide you the solution.
    Dynamic Directory and File Naming in Receiver Adapter
    In the above thread look at the post that answered the question. It will certainly help you.
    And go thro this also.
    Dynamic  File Name for Receiver File Adapter
    Regards,
    P.Venkat

  • XI3.0 File Adapter - Changing target directory at runtime

    Hi all,
    I have a XI3.0 running and I'm using the file adapter of SAP Basis 7.00. I'm trying to change the target directory at runtime, as I already did with the file name. The file name could be changed using the DynamicConfiguration, but this does not work for the directory. In help.sap I found the hint to use the variable substitution of the communication channel. I did not get it running, but it also does not solve my problem since I don't want to get the value for the target directory from the message header, but from a SAP IS-U system.
    Can anybody help me to solve this problem?

    Hi,
    while using variable substitution, did u set the indicator for create Directory:
    <i>If the adapter is to create the target directory, if it doesn't already exist then set the indicator Create Target Directory.
    If the indicator is not set and the target directory doesn't already exist the adapter returns an error.</i>
    Regards
    Vijaya

  • Message Header value is not written to DynamicConfiguration

    Hi Forum,
    I have a scenario on a PI 7.11 SP06, where a SOAP message is sent via HTTP to a SAP WAS Java.
    The response contains in header a  parameter"set-cookie" which has to be written in dynamic configuration.
    For example: Set-Cookie: JSESSIONID=DF4D3F35636D8E3549490B678SAP9403229; Path=/
    Therefore, i use SOAP adapter with axis extension, but the "set-cookie" content is not written to dynamicconfiguration.
    Here is my axis adapter configuration. Do you see something wrong here?
    **Processing Sequence**
    1    AF_Adapters/axis/AFAdapterBean                afreq
    2    AF_Adapters/axis/HandlerBean                     xireq----------------------O/B Handler
    3    AF_Adapters/axis/HandlerBean                     trp--------------------------- HTTPSender
    4    AF_Adapters/axis/HandlerBean                     dcres----------------------This is for Dynamic Configuration (read)
    5    AF_Adapters/axis/HandlerBean                     xires------------------------O/BHandler
    6    AF_Adapters/axis/AFAdapterBean                afres
    **Module Configuration**
    dcres          handler.type     java:com.sap.aii.axis.xi.XI30DynamicConfigurationHandler
    dcres          key.1          read http://sap.com/xi/XI/System/HTTP SetCookie
    dcres          location.1      header
    dcres          value.1          set-cookie
    trp             handler.type     java:com.sap.aii.adapter.axis.ra.transport.http.HTTPSender
    trp             module.pivot     true
    xireq          handler.type     java:com.sap.aii.axis.xi.XI30OutboundHandler
    xires          handler.type     java:com.sap.aii.axis.xi.XI30OutboundHandler
    I followed the [How To Guide|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b092777b-ee47-2a10-17b3-c5f59380957f] which is unfortunately for 7.0.
    Also i tried with "set-cookie" and "Set-Cookie" without success. I have written a small java test which is accessing
    this service and I can see parameter "set-cookie" in the header. So with small letters should be okay.
    I have also read this very similar [sdn thread|DynamicConfiguration to Message Header;.
    Tests with writing constants to dynamicconfiguration works without any problem.
    I'm not sure if i have the correct handler classes. Is there any documentation about the handlers?
    Any help is very appreciated.
    Thanks in forward and best regards,
    Sigi

    Hi all,
    thanks for response.
    I'm aware of these functions so I tried the test to create a dummy entry in header and read it from there.
    So first i used which wrote constant to ASMA
    dcres1     key.1    insert http://sap.com/xi/XI/System/HTTP dummy
    dcres1     value.1 12345
    Then  I used write to move that constant from ASMA to header
    dcres2     key.1   write http://sap.com/xi/XI/System/HTTP dummy
    dcres2     location.1  header
    dcres2     value.1  dummy
    Finally i used read on that dummy value, creating a new entry in ASMA based upon that dummy entry
    dcres3     key.1   read http://sap.com/xi/XI/System/HTTP SetCookie
    dcres3     location.1  header
    dcres3     value.1  dummy
    So the "read" entry is correct in my origin settings. So now I know that the "set-cookie" header parameter from Java WAS response is not passed through SOAP Axis adapter.
    Does anybody know if there are settings which have to be changed in system? Or is that a design as usual, that the set-cookie parameter is not passed to SOAP AXIS HTTP-header params?
    Thanks in forward and best regards,
    Sigi
    Edited by: Siegfried Ertl on Apr 13, 2011 3:06 PM

  • DynamicConfiguration: Null pointer?

    Hi, I'm using a UDF that creates a connection to our database tables to gather information to parse into a file, and this UDF createFileName, which used to work (we're implementing changes to make our UDF lookups more streamlined into 1 Java class)..
    however, now I'm running test data and I keep getting this error, traced to DynamicConfiguration put(..) method.
    Code:
    DynamicConfiguration conf = (DynamicConfiguration) container
    .getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
    String fileName = "Transaction_"siteName[0]"_"timeStamp[timeStamp.length-1]subSeqNumber.trim()+"00.csv";
    conf.put(key, fileName); //traced error here
    result.addValue(siteName[0]);
    Error in mapping test:
    Runtime exception during processing target field mapping /ns1:MT_Inventory_Tran/InventoryTran/Supplier_Site_ID. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_XI_Inventory_Tran_Cust_Data_to_SUN_Inventory_Tran_ method createFileName
    Thanks for any help.
    Adam

    Hi,
    Check out the data you are getting and accessing those are valid...? Because this may be because you are accessing some parameters for which you are not getting values.
    e.g the error is here I think: <i>Transaction_"siteName[0]"_"timeStamp[timeStamp.length-1]subSeqNumber.trim()+"00.csv</i>
    TO debug more, use Display Queue option in the mapping editor so that you can see how the data is mapped..
    http://help.sap.com/saphelp_nw70/helpdata/en/43/03612cdecc6e76e10000000a422035/content.htm
    Rgds,
    Moorthy

Maybe you are looking for

  • Time zone support help: how do I enter an event and have it keep that time regardless of time zone?

    I consistently enter events in one time zone, because that is just easier. I would prefer it KEEP them as entered, not revise them as I travel. IE, I live overseas and constantly travel. It is very difficult to keep track of my schedule if I must alw

  • How to get the number of rows returned by a report?

    Hi, I'm developing my first application in APEX and so far everything seems fine, except I can't figure out this very simple thing: I have a report based on a PL/SQL block returning an SQL string. I'd like to have a message (something like "X rows re

  • I would like to copy an "Event" from MBA to MBP Retina.  How?

    I took a MB Air on vacation.   Uploaded pictures from several cameras and phones from family & friends.   Edited them in iphoto and created an event.  Now I'm home and would like to view and edit the photos on my MBP Retina, and save them there.   Ho

  • IPEP cant register to ISE 1.2

    I am trying to register an ipep to my primary ise running ise 1.2. Have installed certificates on the IPEP. The devices can ping each others dns names.  i keep getting the following error whenever i try to register the IPEP.

  • LR 1.1 Speed - Looks like new database may be the answer

    I run LR on a PC - XPPro SP2, 3ghz dual core CPU, 4GB fast Ram, Matrox PCIe video card, 4 fast hard disks. Everything optimized as per Adobe and everything I can find here and elsewhere on LR related sites. LR 1.0 ran way too slow for me with only 11