Reg:Dynamic Configuration

Hi....
       I am having one problem while using Dynamic Configuration.
In Dynamic Configuration, i am using the below code.
DynamicConfiguration conf = (DynamicConfiguration) container
    .getTransformationParameters()
    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
    conf.put(key, a);
return "";
I am having the condition like, if the Product code="DD" and Server Name =" A", then the file should be places in "Disb" directory else it should be places in the "Power" directory.
Can you please help in this issue.
I have executed the scenario, but both the files are going to the same folder.

Hi...
  Check the below code whther it is correct or not.
public String DynamicDirectory(String code,String server,Container container)
DynamicConfiguration conf = (DynamicConfiguration) container
    .getTransformationParameters()
    .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","Directory");
if(code.equals("DD") && server.equals("DISB"))
dir = "/home/corpuser/Disbursement/DD";
else(code.equals("CC") && server.equals("DISB"))
dir = "/home/corpuser/Disbursement/CC";
config.put(key,dir);
return "";
While activating, i am getting the below error.
usr/sap/APD/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map1354a56019d011debb16002264977f6e/source/com/sap/xi/tf/_MM_MTO_Payment_DB_To_MTI_Payment_DD_CC_.java:301: not a statement else(code.equals("CC") && server.equals("DISB")) ^ /usr/sap/APD/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Map1354a56019d011debb16002264977f6e/source/com/sap/xi/tf/_MM_MTO_Payment_DB_To_MTI_Payment_DD_CC_.java:302: ';' expected dir = "/home/corpuser/Disbursement/CC"; ^ 2 errors
Can you please in this issue.
Regards,
Leela

Similar Messages

  • Dynamic Configuration in SAP PI 7.3

    Hello,
    I am doing one file to file scenario in PI 7.3 (Java Stack only).
    There is one requirement i.e. The output file name will change according to Development, Quality and Production. Prefix will be added to the outputput file name according to Development, Quality & production.
    I am new in SAP PI . Please suggest me what to do for the above requirement.
    Thanks & Regards,
    Moumita

    Hi Moumita,
    Please find the details
    1) read the source directory and based on source directory name set the file name in dynamic configuration
    In sender communication channel select the ASMA parameter Directory and read the dynamic configuration as below
    String devFileName = "DEV_out.txt";
    String qaFileName = "QA_out.txt";
    String regFileName = "Reg_out.txt";
    String directory= "";
    DynamicConfiguration conf1 = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key1 = DynamicConfigurationKey.create( "http:/"+"/sap.com/xi/XI/System/File","Directory");
    directory= conf1.get(key1);
    If (directory.equals("DEV"))
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey FileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
    conf.put(FileName, devFileName);
    return "";
    else
    If (directory.equals("QA"))
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey FileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
    conf.put(FileName, qaFileName);
    return "";
    else
    If (directory.equals("Reg"))
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey FileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
    conf.put(FileName, regFileName);
    return "";
    2) read the system id and based on that set the file name in dynamic configuration.
    String System = System.getProperty("SAPSYSTEMNAME");
    String devFileName = "DEV_out.txt";
    String qaFileName = "QA_out.txt";
    String regFileName = "Reg_out.txt";
    If (System.equals("DEV"))
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey FileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
    conf.put(FileName, devFileName);
    return "";
    else
    If (System.equals("QA"))
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey FileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
    conf.put(FileName, qaFileName);
    return "";
    else
    If (System.equals("Reg"))
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransf
    ormationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey FileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
    conf.put(FileName, regFileName);
    return "";
    regards,
    Harish

  • 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

  • Two FileName in Dynamic Configuration

    Hi All,
    I have a very rare problem. In an interface which uses BPM, where file is the sender and Proxy is the target,
    there is an ABAP Class in the mapping which uses Dyanmic Configuration to retrieve the FileName and create a Proxy structure and posts it to the ECC. In this scenario, Multiple files are picked from different folder using advanced Selection and sent to BPM which uses the ABAP Class.
    When i run the interface with 5 different files placed at source, In SXMB_MONI, I can see that after 3 files are processed successfully with a single filename in the Dynamic Configuration, the 4th or the 5th one wil have 2 filenames in the dynamic configuration out of which the first filename will be the copy of the earlier processed filename and the second one wil be the actual required filename. The above behaviour keeps on chainging.
    How can this be possible as the Context Object 'FileName' can have only single filename through out the interface instance, as there is no setting of the filename done in dynamic configuration.
    Please reply if anyone has a solution to the above problem.
    Thanks.

    Hi Jaideep..
    Thanks for the reply.
    Yes.. its a serial processing. Let me explain a bit more.
    as i said above, after the 3rd BPM instance (Just as an example.. keeps on chainging), the 4th instance has a unique filename compared to before 3. but after processing, the Dynamic Configuration in SXMB_MONI will have 2 fileNames. which will have a copy of any one of the earlier filenames along with actual filename.

  • Acces dynamic configuration variable (e.g. filename) in ABAP mapping class

    Hi experts
    I am searching for a possibility to acces a dynamic configuration variable (DCV) in an ABAP mapping class. Since I could not find a solution in SDN and other sources, I hope somebody in this forum can help me.
    What I already found is the following code which can be used to set a DCV, but what I would be interested in is how to read a DCV.
    Any help is appreciated.
    Markus
    METHOD if_mapping~execute.
    DATA l_record type mpp_dynamic.
    * copy payload
    result = source.
    * add an adapter specific attribute
    l_record-namespace = 'http://sap.com/xi/XI/System/File'.
    l_record-name = 'FileName'.
    l_record-value = 'test.xml'.
    dynamic_configuration->add_record( l_record ).
    ENDMETHOD.

    Hi Markus,
    you can find everything in my blogs
    /people/michal.krawczyk2/blog/2007/04/26/xipi-throwing-generic-exceptions-from-any-type-of-mapping
    Regards,
    michal

  • Dynamic configuration required in sender file - Adapter Module

    Hi Everybody,
    I am developing an Adapter Module in the file adapter (sender) using Adapter Specific Message Attributes.
    I am using Dynamic configuration inside the Module Process method in the adapter module.
    We are getting an error saying Dynamic Configuration cannot be resolved.
    Can anybody tell me the package to be used.
    Thanks,
    Zabiulla

    You can access the dynamic configuration in adapter module like this:
    Message msg = (Message) inputModuleData.getPrincipalData();
    String fileName = msg.getMessageProperty("http://sap.com/xi/XI/System/File", "FileName");
    You do not need any addition library besides the adapter module API.
    Hope that helps
    Stefan

  • Dynamic Configuration File Names

    Hi,
    I have a RFC->XI->File scenario.
    I have to put the target files names based on the calculation of values in 2 fields in the input.
    I tried using Dynamic Configuration in my message mapping for this.
    This is the code:
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(u201Chttp://sap.com/xi/XI/System/Fileu201D,u201CFileNameu201D);
    String MyFileName = a + "_" + b +".xml";
    conf.put(key, myFileName);
    I checked ASMA in both the sender RFC adapter as well as the receiver file adapter.
    But it never works.
    I saw the dynamic configuration tab in SXMB_MONI but i can see only the RFC destination parameter.
    Cant see the file filename parameter.
    What is the problem here?

    No need enable ASMA on RFC sender adapter.
    See if the file channel is activated after selecting ASMA with FileName.
    The UDF might not be use in the mapping. Check this.
    Edited by: Praveen Gujjeti on Feb 23, 2010 1:05 AM

  • 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 in Dynamic Configuration bean

    Hi
    I am trying to dynamically change the filename using Dynamic Configuration bean with some constant value but target file is having same name as source.  In communication channel logs I can see the successul pro

    Hi,
    M not sure what will be the error with this when u r using dynamic configuration bean.But same functionality can be better achieved by using this dyanamic configuartion UDF :
    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 value;
    Regards,
    Anoop

  • Doubt om Dynamic Configuration of receiver file

    Hello ,
      for Acheiving the Dynamic configuration of receiver file name ,adapter specific message attribute is used...But how to suppress the name of file in the content of the Received file...
    Is my question correct..do we get the file name in content of the receiver file,while using the Adapter specifc message attribute.
    And another question ,in the Variable substitution ...do we get the above problem,then how to tackle the situation to suprress the file name in the payload of receiver file.

    HI,
    You can handle the dynamic file name via Dynamic configuration or with the help of Variable Substitution.
    Please refer
    have a look
    Dynamic File Name using XI 3.0 SP12 Part - I --> Dynamic File Name using XI 3.0 SP12 Part u2013 I
    Dynamic file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II --> Dynamic file name(XSLT Mapping with Java Enhancement) using XI 3.0 SP12 Part -II
    With Variable Substituion, you may need to supress the filename
    Dynamic File Name - Suppress the Substitue varible
    Let me know if you need anymore info.
    Thanks
    Swarup

  • Problem facing in Dynamic configuration in SAP PI 7.3

    Hello,
    I am doing dynamic configuration in sap pi 7.3. I am using the following UDF.
    String devFileName="'a.vc'";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey FileName = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File","FileName");
    conf.put(FileName, devFilename);
    I am using this UDF in message mapping and mapped this UDF in the message header.
    I have selected the adapter specific message attribute in receiver communication channel also.
    Still I am getting the folowing error.
    MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but was not supplied in the XI Message header
    Exception caught by adapter framework: The Adapter Message Property 'FileName' was configured as mandatory element, but was not supplied in the XI Message header
    'Transmitting the message to endpoint using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.adapter.file.configuration.DynamicConfigurationException:  The Adapter Message Property 'FileName' was configured as mandatory element, but was not supplied in the XI Message header.
    Please help me what to do.
    Thanks & Regards,
    Moumita

    Hi, try this code:
    String devFileName="a.vc";
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    conf.put(FileName, devFilename);
    ASMA checkbox and respective parameter should be enabled in the required Adapter.
    Best Regards

  • Dynamic configuration in integration process using abap mapping

    Hi everybody,
    i have the following scenario:
    file adapter -> integration process -> file adapter
    The integration process uses an ABAP mapping and sets the filename in dynamic configuration as follows:
    *-- Set Parameter
        clear ls_dyn_record.
        ls_dyn_record-name      = gc_dyn_config_name.
        ls_dyn_record-namespace = gc_dyn_config_ns.
        ls_dyn_record-value     = <new_file_name>
    *-- Write configuration
        ir_dyn_config->add_record( ls_dyn_record ).
    But now the new filename is not reflected in the file adapter (receiver). In the integration monitor (SXMB_MONI) i still find the old filename.
    Whats wrong?
    Elko

    The ABAP mapping is more complex, setting filename in Dyn. Conf. is just one step in mapping.
    If I check the Workflow protocol of the Integration Process, I find the following in the Trace of the ABAP-Mapping:
    The filename has been set to 3233340.SWNF00HW.P10I. The Suffix P10I has been added in the ABAP mapping.
    When I check the subsequent message in SXMB_MONI I find:
    The added suffix is missing in the filename !!
    Elko

  • Dynamic configuration- Is file name stored in any abap table in PI

    Hi.
    Is there any ABAP table in XI containing the dynamic configuration's xml of a message.
    For any file scenario Can I get the file name from any of the abap table in PI
    Regards,
    Deepak

    Interesting ABAP tables in XI
    Interesting ABAP tables in XI – Part I
    Regards,
    Phani

  • Dynamic configuration for PI 7.1 in mapping for file adapter

    Hi Experts,
    I have used the code below to use dynamic configuration in PI 7.1, but it isnt working..
    http://help.sap.com/saphelp_nwpi71/helpdata/en/43/03612cdecc6e76e10000000a422035/frameset.htm.
    it shows the file name in the dynamic configuration in the sxmb_moni...
    but hen i chekc it  in operations mapping..it shows dynamicconfiguration has to be in queue ..
    has ne one used it before??
    I used a simple UDF to create it without any input parameter and I mapped it to a field n the target side...
    has ne one faced a similar situation????
    Regrads,
    Tauseef

    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

  • Dynamic Configuration of HTTP Destinations in SOAPReceiver

    Dear PI Developers
    I'll define a dynamic Configuration for my HTTP Destination in SOAPReceiver with XI3.0 Protocol.
    The solution for that is to use an Adapter Module to set the dynamic Configuration Value.
    Process: ... > SOAP Receiver > MyAdapterModule, set HTTP Destination > SOAP Receiver, send Message to HTTP Destination
    URL-Adressing work's fine
    This works fine for URL-Adressing, here's my Java Code from my Adapter Module:
    Message message = (Message) inputModuleData.getPrincipalData();
    message.setMessageProperty(new MessagePropertyKey("TServerLocation", "http://sap.com/xi/XI/System/SOAP"), "http://domain.com/foobar");
    HTTP Destination, how it works?
    If I'll use HTTP Destination as Adressing Type but the HTTP Destination will not set.
    I think the "TServerLocation" Property don't work for the HTTP Destination, but I don't find a Property in:
    Configuring the Receiver SOAP Adapter - Advanced Adapter Engine - SAP Library
    My Questions
    Did someone know the coresponding property name for HTTP Destinations instead of "TServerLocation"?
    Are there other Solutions to set the HTTP Destination dynamicaly, for Example with variables %my_http_dest% ?
    How can I set my own variables %my_http_dest% in my Adapter Module?
    Background
    We have a lot of Destinations and a lot of Szenarios and won't create a SOAPReceiver and Routing for each Destination in each Szenario.
    The Destination depends on a HTTP Header Parameter from Sender, I'll map this Parameters to the coresponding HTTP Destination in the Adapter Module, that's the same Mapping for all Scenarios. To keep the performance, I cache this Routing Table in the Adapter Module.

    Here's a way to misapplay "mesage:{var}" variables:
    SAP NetWeaver XI: Variable Substitution with Adapter-Specific Message Attributes via DynamicConfigurationBean
    But it is a dangerous solution, I think we use URL-Adressing in place of HTTP Destination

Maybe you are looking for

  • Report Alignment Issue

    We have converted report from Oracle 6i to Oracle 10g. We have a field which is equal aligned. We could see that the alignment is different in 6i and 10g. In 6i the last row is left as is, but in 10g it is made to fit the entire field width. If anyon

  • N96 Firmware update

    I am aware that a new firmware has been released by Nokia for the N96. However i am not able to get hold of it yet. I have a UK Vodafone phone & contract. 1.Can you advise how i can install this new firmware? 2. Will it address the various problems s

  • Mavericks Drag

    Howzit okes! I did a clean install of OS X Mavericks. When I start my mac, I can click a file and drag it to another folder. However, after like an hour or after dragging dropping a few files the cursor fails to grav files. I have to restart for it t

  • Customer Fields values in FAGLL03 not displayed in background job

    Hi Experts My client has implemented customer fields in transaction FAGLL03 through enhancement. When I run the report in background, these fields are appearing but the values are missing, e.g., the columns are displayed in blank. Can you help me wit

  • Emca unable to create dbconsole

    When i run the command C:\Windows\system32> emca -config dbcontrol db -repos create it ask for database Sid, after giving oracleSID it give this type of message Enter the following information: Database SID: orcltrng Exception in thread "main" oracle