Error in mappingwith dynamic configuration using udf

Hi All,
Good Morning,
i am working with ABAP proxy to file scenarion but here according my client requirement i am using udf for file dynamic configuration.
In mapping, i mapped the field from "Filename" to message type tag(receiver file header)  "/ns0:MTxxxxxxDataFile". between there two fields i am using the following udf for dynamic configuration. but i got error after testing with test data in mapping that is also mentioned below.
plz help me to solve the error. i will be wait for ur immediate response this sis very urgent.
very thankfull to immediate response.
UDF:
i am not puting any packages here.
public String putFileNameInHeader1(String a,Container container){
//write your code here
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName");
conf.put(key, a);
return "";
ERROR:
12:21:30 Start of test
Compilation of MMSAPLegacySalesDataToCOGNOS successful Runtime exception during processing target field mapping /ns0:MTCOGNOSLegacySalesDataFile. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MMSAPLegacySalesDataToCOGNOS_ method putFileNameInHeader1$[cd00000038, com.sap.aii.mappingtool.tf3.rt.Context@f300f30] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ns0:MTCOGNOSLegacySalesDataFile. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MMSAPLegacySalesDataToCOGNOS_ method putFileNameInHeader1$[cd00000038, com.sap.aii.mappingtool.tf3.rt.Context@f300f30] at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:350) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:401) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:142) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:105) 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_0.execute(MapServiceRemoteObjectImpl0_0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0p4_Skel.dispatch(MapServiceRemoteObjectImpl0_0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:313) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:199) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136) 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._MMSAPLegacySalesDataToCOGNOS_ method putFileNameInHeader1$[cd00000038, com.sap.aii.mappingtool.tf3.rt.Context@f300f30] at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.calculateCurrentValue(FunctionWrapper.java:83) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.cacheValue(FunctionWrapper.java:59) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.gotoNextContext(FunctionWrapper.java:37) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:252) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:401) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:142) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:105) 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_0.execute(MapServiceRemoteObjectImpl0_0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0p4_Skel.dispatch(MapServiceRemoteObjectImpl0_0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:313) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:199) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136) 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.calculateCurrentValue(FunctionWrapper.java:75) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.cacheValue(FunctionWrapper.java:59) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.gotoNextContext(FunctionWrapper.java:37) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:252) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:401) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:142) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:105) 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_0.execute(MapServiceRemoteObjectImpl0_0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0_0p4_Skel.dispatch(MapServiceRemoteObjectImpl0_0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:313) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:199) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:136) 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._MMSAPLegacySalesDataToCOGNOS_.putFileNameInHeader1$(_MMSAPLegacySalesDataToCOGNOS_.java:853) ... 26 more RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ns0:MTCOGNOSLegacySalesDataFile. The message is: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MMSAPLegacySalesDataToCOGNOS_ method putFileNameInHeader1$[cd00000038, com.sap.aii.mappingtool.tf3.rt.Context@f300f30]
12:21:35 End of test

Hi Sai,
First of all, this UDF is pretty well knaown so there is no error in this UDF or your configuration for this UDF. I can suggest you something that at the time of configuration in IR, give a context object for that particular field of that file and then use the contect object name everywhere to refer that field. and also check the message type config for correction for my sake.
There is also a possibility that of the input data. i guess you are sending the input file from Cognos and you making the file and putting some where in XI directory and want these to process something and generate with some new desired filename. Check the input because i guess its finding NOTHINg as an Input. check once again.
Hope this will help you.
Regards
Aashish Sinha
PS : Reward points if helpful.

Similar Messages

  • Error Message through Dynamic Configuration length problem

    HI All,
    We are trying to raise an error message with the help of Dynamic configuration in the Message mapping.
    The need is to populate the message with certain variables.
    However we are facing the problem that the message is getting truncated beyond a certain length.(Around 60 characters)
    Similar custom messages in other interfaces are working fine for messages up to 100 characters.
    Question:
    1. What could be the maximum length for an error message in case of mapping failure?
    2. What could be limiting the length of the message in our case?
    Thank you for looking into this.
    Regards,
    Ankesh

    hi Ankesh,
    yes, there is limit length, see this oss [Note 974481 - XI Adapter Framework DynamicConfiguration Module|https://service.sap.com/sap/support/notes/974481]
    regards.
    Mickale

  • Is there any way to read to dynamic configuration using abap mappings?

    Hi,
      Is there any way to read dynamic configuration suppouse filename using abap mappings, I mean using abap code?
    Appreciate for your response.
    Regards,
    Daniel.LA

    Daniel,
    Yes it's possible. Please refer Henrique Pinto's reply in this thread -Re: Abap mapping and variable substitution in File adapter
    raj.

  • Error on Send Port configured using HTTP adapter

    Hi All,
    For Load balancing purpose we have created new host and host instance and changed send handler for send port configured using 
    plain HTTP adapter.
    We are getting below error after change:
    A password is mandatory if UserName is specified
    Parameter name: Password
    Please advice.
    Thanks
    Pooja Jagtap Software Engineer KPIT Cummins

    Have you updated the password for your Host instance . Try restarting your host instance once .
    Thanks
    Abhishek

  • Error on a Dynamic Select using Pro*C

    I am a new user on Pro*C and I am facing an error for which I could not find a solution in the Pro*C/C++ Programmer’s Guide. The problem occurs when I do a dynamic SELECT to retrieve sequence of numbers (from 0 to 10) from a very simple table in a database.
    The program is retrieving the following sequence: {705, 961, 1217, 1473, 1729, 1985, 2241, 2497, 2753, 3009} rather than the sequence {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}.
    It’s very interesting to notice that the retrieved sequence, in hexadecimal, is equal to {2C1, 3C1, 4C1, 5C1, 6C1, 7C1, 8C1, 9C1, AC1, BC1}.
    I am quite sure that I'm missing a small detailed here and I would appreciate
    any help. Please find below the code that I am using.
    Thanks a lot!
    #include <string>
    #include <iostream>
    using namespace std;
    #include <sqlca.h>
    #include <sqlcpr.h>
    EXEC SQL BEGIN DECLARE SECTION;
    VARCHAR username[30];
    VARCHAR password[30];
    VARCHAR db_name [30];
    VARCHAR dns_name[30];
    EXEC SQL END DECLARE SECTION;
    void SQL_Error ( void )
    char msg[200];
    size_t buf_len = sizeof ( msg );
    size_t msg_len;
    sqlglm( msg, &buf_len, &msg_len );
    if ( msg_len > buf_len )
    msg_len = buf_len;
    cout << msg << endl;
    bool OpenDBConnection( char uname, char pword, char dns, char dbname )
    // Assign the database identifications to the ORACLE variables
    username.len = (unsigned short) strlen ( strcpy( (char *) username.arr, uname ) );
    password.len = (unsigned short) strlen ( strcpy( (char *) password.arr, pword ) );
    dns_name.len = (unsigned short) strlen ( strcpy( (char *) dns_name.arr, dns ) );
    db_name.len = (unsigned short) strlen ( strcpy( (char *) db_name.arr , dbname ) );
    /* Register sql_error() as the error handler */
    EXEC SQL WHENEVER SQLERROR goto err;
    /* Connect to the non default database */
    EXEC SQL CONNECT :username IDENTIFIED BY :password AT :db_name USING :dns_name;
    return ( true );
    err:
    SQL_Error();
    return ( false );
    ** Select the database using a dynamic method
    long SelectIDRecord ( void )
    EXEC SQL BEGIN DECLARE SECTION;
    // Define the dynamic statement
    char dyn_statement[4000];
    // Define the bind variables
    long db_id = 0;
    long db_id_type = 2; /* NUMBER */
    long db_id_len = 10;
    EXEC SQL END DECLARE SECTION;
    // Initialize the dynamic statement
    memset ( dyn_statement, 0, sizeof( dyn_statement ) );
    strcpy ( dyn_statement, "SELECT ID FROM TEST_DB ORDER BY ID" );
    EXEC SQL AT :db_name PREPARE s1 FROM :dyn_statement;
    // Declare and initialize the output descriptor
    EXEC SQL ALLOCATE DESCRIPTOR 'out';
    EXEC SQL AT :db_name DESCRIBE OUTPUT s1 USING DESCRIPTOR 'out';
    EXEC SQL SET DESCRIPTOR 'out' value 1 TYPE = :db_id_type,
    LENGTH = :db_id_len, DATA = :db_id;
    // Declare and open the cursor
    EXEC SQL AT :db_name DECLARE test_db_cursor CURSOR FOR s1;
    EXEC SQL AT :db_name OPEN test_db_cursor;
    EXEC SQL WHENEVER NOT FOUND DO BREAK;
    long nRec = 0;
    while ( true )
    EXEC SQL AT :db_name FETCH test_db_cursor INTO DESCRIPTOR 'out';
    EXEC SQL GET DESCRIPTOR 'out' VALUE 1 :db_id = DATA;
    nRec++;
    cout << "ID = " << (long) db_id << endl;
    // Close the cursor
    EXEC SQL AT :db_name CLOSE test_db_cursor;
    EXEC SQL DEALLOCATE DESCRIPTOR 'out';
    return ( nRec );
    err:
    SQL_Error();
    return ( 0 );
    int main ()
    char *uname  = "test";
    char *pword  = "test";
    char *dns    = "test_db";
    char *dbname = "test";
    OpenDBConnection ( uname, pword, dns, dbname );
    long nRec = SelectIDRecord ();
    }

    No need to specify the length if the data type is number and pointing to Long.
    You can directly map the values using INTO clause.

  • Get IDoc-number from flat IDoc using dynamic configuration

    Dear experts
    In an IDoc2File scenario I have added the IDoc-number to dynamic configuration using the folling code in an UDF:
    DynamicConfiguration conf = (DynamicConfiguration)
    container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey FileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","DOCNUM");
    conf.put(FileName, a);
    The information is stored in the SOAP message
    <SAP:DynamicConfiguration SOAP:mustUnderstand="1">
      <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="DOCNUM">0000000000012345</SAP:Record>
    </SAP:DynamicConfiguration>
    Can anybody tell me how I can access this information in the "variable substitution" section of the CC? Perhaps something like "message:docnum"?
    Additional information:
    Taking the IDoc-number from the payload using e.g. "payload:ORDERS05,1,IDOC,1,EDI_DC40,1,DOCNUM,1" does not work, since the XML-IDoc has been converted to an flat-IDoc.
    Thanks in advance for any good ideas
    Markus

    Dear Rodrigo and Sarvesh
    Thanks for your help so far! I applied your hints and now it is working fine.
    But now I have the following additional questions
    1.) My message mapping only maps the input IDoc to an output IDoc of the same type and structure. The MM is only required to process the UDF. Is there another, better solution to achieve my requirement that the IDoc-number shall be part of the filename?
    2.) In the CC you have the possibility to use temporary files (section "Processing", Option "Put File" = "Use Temporary File". I think this will not work with the given solution, will it?
    To possibly help somebody else or clarify the mechanism once again, I wrote down how my solution now looks like.
    My UDF in the message-mapping looks like this
    - Input = DOCNUM of IDoc, e.g. ORDERS05/IDOC/EDIDC/DOCNUM
    - Outpt = DOCNUM of IDoc, e.g. ORDERS05/IDOC/EDIDC/DOCNUM
    - UDF:
    public String putDynamicConfiguration(String docnum, Container container) throws StreamTransformationException{
    try
         DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
         DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
         String filename = "Prefix_" + docnum + ".txt";
         conf.put(key, filename);
         return docnum;
    catch (Exception e)
         return docnum;
    In the CC the settings are now as follows
    File Name Scheme = . -> only a dot or something else, because this field is obligatory, even if it is not used in this case.
    Variable substitution (...)
        Enable -> unchecked
    Adapter-Specific Message Attributes
        Use Adapter-Specific Message Attributes -> checked
        Fail If Adapter-Specific Message Attributes Missing -> checked
        File Name -> checked
        Directory, File Type, Temporary Name Scheme for Target File Name -> unchecked
    When I send an IDoc to PI and view the Adapte-Engine Version of the message (the SOAP-document, not the payload) I can find the Filename:
    <SAP:DynamicConfiguration SOAP:mustUnderstand="1">
    <SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">Prefix_0000000000012345.txt</SAP:Record>
    </SAP:DynamicConfiguration>

  • SM19 Dynamic Configuration.

    Hi Friends,
    Is it possible to set Security Audit Log as "Dynamic Configuration" using SM19?
    Is there any conditions, and if we set Static configuration, what is the difference?
    Thanks in advance
    Jayakar Reddy

    Hi Jayakar
    Have a look at SAP note 539404. It contains 51 questions/answer regarding the Security Audit Log which can be of help for you.
    Regards,
    Désiré

  • UDF Using Dynamic Configuration for Counter Reset

    Hi All,
    In an Idoc to file scenario we want to have counter option at the end of the file.we are using NFS so that we wil not face any problem of counter reset on a j2ee restart
    But when the counter turns 999999 it has to be reset to 0000001
    So we are trying to dynamically create a file name using the counter and check whether it has reached 999999 then resetting back . I had written a code for the same but it is throwing an error while mapping and activating.
    UDF CODE is below
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION) ;
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File", "FileName") ;
    String FileName = conf.get(key) ;
    int inc = 1 ;
    String temp = FileName.substring(10,6);
    String temp1 = FileName.substring(0,10);
    Integer seqNo = Integer.parseInt(temp) ;
    if(seqNo == 0 || seqNo == 999999) {
    seqNo = new Integer(inc) ;
    else {
    int num = seqNo.intValue() + inc ;
    seqNo = new Integer(num) ;
    container.setParameter("seqNo", seqNo);
    String File_Name = temp1 + Integer.toString(seqNo);
    conf.put(key, File_Name);
    return File_Name;
    ERROR it is throwing
    'class' or 'interface' expected public String Decimal$(String Sample,Container container){ ^ /usr/sap/PJD/DVEBMGS58/j2ee/cluster/server0/./temp/classpath_resolver/Map76d12330b43811df8c1500e000a6fabc/source/com/sap/xi/tf/_MM_Sample_to_TRGT_.java:127: 'class' or 'interface' expected }
    So can anyone please advice.

    Hi Stefan,
    I removed the last }
    But stil it is throwing the below error:
    Activation of the change list canceled Check result for Message Mapping MM_Sample_to_Trgt | :  Starting compilation  Source code has syntax error:  /usr/sap/PJD/DVEBMGS58/j2ee/cluster/server0/./temp/classpath_resolver/Map8e67b780b44111dfbc4100e000a6fabc/source/com/sap/xi/tf/_MM_Sample_to_Trgt .java:98: FileName is already defined in File$(java.lang.String,com.sap.aii.mappingtool.tf3.rt.Container) String FileName = conf.get(key) ; ^ /usr/sap/PJD/DVEBMGS58/j2ee/cluster/server0/./temp/classpathresolver/Map8e67b780b44111dfbc4100e000a6fabc/source/com/sap/xi/tf/_MM_Sample_to_Trgt .java:102: incompatible types found : int required: java.lang.Integer Integer seqNo = Integer.parseInt(temp) ; ^ /usr/sap/PJD/DVEBMGS58/j2ee/cluster/server0/./temp/classpathresolver/Map8e67b780b44111dfbc4100e000a6fabc/source/com/sap/xi/tf/_MM_Sample_to_Trgt .java:103: operator == cannot be applied to java.lang.Integer,int if(seqNo == 0 || seqNo == 999999) { ^ /usr/sap/PJD/DVEBMGS58/j2ee/cluster/server0/./temp/classpathresolver/Map8e67b780b44111dfbc4100e000a6fabc/source/com/sap/xi/tf/_MM_Sample_to_Trgt .java:103: operator == cannot be applied to java.lang.Integer,int if(seqNo == 0 || seqNo == 999999) { ^ /usr/sap/PJD/DVEBMGS58/j2ee/cluster/server0/./temp/classpathresolver/Map8e67b780b44111dfbc4100e000a6fabc/source/com/sap/xi/tf/_MM_Sample_to_Trgt .java:111: cannot resolve symbol symbol : method toString (java.lang.Integer) location: class java.lang.Integer String FileName = temp1 + Integer.toString(seqNo);
    Edited by: mallavarapu soundarya on Aug 30, 2010 4:44 PM

  • Getting an error in Dynamic Configuration

    Hi Guys,
    I need to dynamically post the file into different directories based on the file in the source payload.
    In Receiver File Communication Channel
    Target Directory : *
    Filename : *
    Checked the ASMA Attributes for filename and directory
    Iam refering this weblog
    /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
    In the mapping
    <filename> ---> UDF --> topnode of target message.
    My UDF is as below
    public String Directory(String a,Container container){
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key  = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "Directory");
    String FileName = conf.get(key);
    FileName = a;
    conf.put(key, FileName);
    String Directory = conf.get(key1);
    Directory = "/SAPInterface/XI/PPD/DHX/out";
    conf.put(key1, Directory);
    return " ";
    But in runtime(moni) iam getting  error as
    com.sap.aii.af.ra.ms.api.MessagingException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header
    Please suggest me how to correct this.
    Thanks
    Srinivas

    Hi Srinivas,
    You said you are having dynamic directories to post the file. But I see you hardcorded or put constant for directory which is /SAPInterface/XI/PPD/DHX/out. I think you need to put //SAPInterface/XI/PPD/DHX/out.
    Try this in udf:
    public String Directory(String a,Container container){
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key  = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "FileName");
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "Directory");
    String FileName = conf.get(key);
    FileName = a;
    conf.put(key, FileName);
    Directory = "//SAPInterface/XI/PPD/DHX/out";
    conf.put(key1, Directory);
    return " ";
    Put FileName and Directory in file name and directory paramters in receiver communication cahnnel and cehck.
    Regards,
    --Satish

  • File name cant be fetched from Dynamic configuration...mutli-mapping used

    In a scenario, i have a BPM which has a transformation step which contains a mutimapping ...means 2 messages mapped to 1 messgaes, here in the mapping i m using an UDF and written code to extract the file name from dynamic configuration.....
    the problem is ...the same BPM contains another transformation step which contains a message mapping (which is not multi mapping), and here the code (UDF) works to fetch the file name...
    the code is all correct....and it looks like
    DynamicConfiguration conf = (DynamicConfiguration)
    container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    String sourceFileName = conf.get(key);
    if (sourceFileName == null ){
    sourceFileName = "ErrorFile.xml";}
    return sourceFileName;

    Hi,
    Yes u r correct it will show error in operation mapping.. bcoz u cannot check the DynamicConfiguration in Operation mapping...
    It will throw Exception..
    The parameter to UDF depends on ur requirement.... Let us know ur requirements exactly...
    If u r doing for file to file means no UDF required,, just check ASMA on both sides....
    Babu

  • Problem:obtaing file name using Dynamic configuration of file adapter

    hi all
    I am using Dynamic configuration for getting file name.
    I am getting Dynamic configuration in SXMB_MONI containg file name, but payload is empty unlike file i am sending.

    Hi All,
    Basically my requirement to get Filename in idoc segments in order to validate the posting at month end.
    Its an File to idoc scenario- GL Posting.
    Please check attached UDF and it gives error. Kindly help. Thanks

  • Need Dynamic attributes for XI adapter to use in Dynamic Configuration ..!!

    Hi Friends,
    We are planning send message to different receivers through XI adapter by using Dynamic Configuration.
    Can anyone please tell me what are the dynamic attributes used for XI adapter.
    In my scenario, I want to pass the Service Number and Path prefix of XI adpater dynamically by using sender ID from Idoc payload.
    I know how to use the dynamic configuration UDF in message mapping. But I don't know the dynamic attributes which we can pass to Service Number and Path prefix of XI adpater.
    Kindly suggest ..
    Thanks
    Deepthi.

    Hi Sourabh,
    >> You need to set these attributes explicitly in the adapter configuration..
    Can you please elaborate on this like how to implement this? Do we need to use any module configuration in the adapter?
    We will use XI adapter only while sending the data directly from IE without using any feautures of AE (like adapters, modules etc). It is like directly sending data from ABAP stack without using J2EE stack. That is the reason we can't use any Modules in XI adpater and it is in disabled by default.
    When I checked in SXMB_MONI.. as you said details are found in
    - <SAP:Attribute>
      <SAP:Name>host</SAP:Name>
      <SAP:Value>10.190.25.16</SAP:Value>
      </SAP:Attribute>
    - <SAP:Attribute>
      <SAP:Name>httpDestination</SAP:Name>
      <SAP:Value />
      </SAP:Attribute>
    - <SAP:Attribute>
      <SAP:Name>path</SAP:Name>
      <SAP:Value>/rcvA/receiver</SAP:Value>
      </SAP:Attribute>
    - <SAP:Attribute>
      <SAP:Name>port</SAP:Name>
      <SAP:Value>8210</SAP:Value>
      </SAP:Attribute>
    XI adapter uses mainly three parameters Host, Port and Path.
    I want to pass any two of these values dynamically to achieve my solution. Can you please suggest your solution how we can implement it.
    -Deepthi.

  • Dynamic Configuration Error:  Exception:[java.lang.IllegalArgumentException

    Hi All,
    I am using dynamic configuration to put a string to the message header. i have created a tilde delimited string with the length more than 200(length=928). During mapping i am using dynamic configuration to put this in SOAP header. But everytime i execute scenario i get an error:
    "com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-field mapping; root message: Exception:[java.lang.IllegalArgumentException: Value is too long (928/200): "
    Is there a limit to the length of the string that can be placed in the dynamic configuration ?
    Please help.
    Regards,
    Meenakshi Pradhan

    meenakshipradhan wrote:>
    > "com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-field mapping; root message: Exception:[java.lang.IllegalArgumentException: Value is too long (928/200): "
    >
    I think the above error does say about that..!! Try putting data like 201 chars and the 200 chars, then see what happens.
    VJ

  • Proxy to file using dynamic configuration

    Hi Frnds,
    I  have a scenario ABAP_Proxy-XI-File, here in the proxy I am getting a pdf file with xml as attachment now I need to save the pdf file to the target folder with the name availble in one of the fields of attached xml file.
    I have used Adapter specific attributes option for filename substitution but getting the follwoing error:
    Attempt to process file failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message header
    Please anyone can help me in overcoming this issue.
    Regards
    shiva

    U have a limitation here. At XI u can read only 1 file (pdf or xml). Bcoz receiver file adapter will not support attachment. pdf is required bcoz u need to transfer it to receiver. Xml is also required bcoz the directory name is inside that xml
    The workaround could be creating an adpater module that passes the directory name as well. U should send pdf file with xml as attachment.
    If u have the dir name, then the dynamic configuration code should be like this
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    conf.put(key,MappedDirectoryName);
    This MappedDirectoryName should be the name passed through payload. The receiver file communiation channel must have dummy dir name
    Regards,
    Prateek

  • Using Dynamic Configuration api for SOAP adapter

    I want to use Dynamic Configuration api to send a SOAP request to a webservice.
    tha value in my adapter is
    my Target URL  is
    http://xidr3.bcs.de:50000/XISOAPAdapter/MessageServlet? channel=:Routing2_Service:SS_SOAP_Sender_Working_June12&nosoap=true
    which is the corresponding field i have to set in Dynamic Configuration?
    I have written the following code is this right?
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    String temp = "http:/"+"/sap.com/xi/XI/System/SOAP";
    DynamicConfigurationKey key = DynamicConfigurationKey.create(temp, "TServerLocation");
    String varURL =
    "http:/"+"/xidr3.bcs.de:50000/XISOAPAdapter/MessageServlet?channel=:Routing2_Service:SS_SOAP_Sender_Working_June12&nosoap=true";
    conf.put(key,varURL);
    return "";

    Hi,
    Yes, your code looks fine. Can you let me know what is the error you are getting. Have you checked the Flag in your communication channel.
    Use Adapter-Specific Message Attributes
    Variable Transport Binding 
    Once you test your scenario you can see the Dynamic URL in your message Header by going to tcode sxmb_moni. See if you are able to find something called DynamicConfiguration in your message haeader. If yes what is the value set there.
    PS: From the target URL you posted It looks like your webservice is hosted on the XI box itself. Is it the same XI box or different box? Just curious to know.
    Reward point if answer is helpful
    Thanks
    Amit

Maybe you are looking for