Dynamic configuration of Adpater in SAP PI

Hi,
I have a requirement where in I have to dynamically configure connection adpater in SAP PI 7.1 EHP 1,  the configuration data will be pulled form database on the bases of the message content.
Thanks in advance.
Gautam

Not sure if you are lookingg for dynamic configuration as mention in the below blog..
<a href="/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping Configuration of Some Communication Channel Parameters using Message Mapping</a>
<a href="/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14: The same filename from a sender to a receiver file adapter - SP14</a>
<a href="/people/daniel.graversen/blog/2006/10/05/dynamic-configuration-in-adapter-modules Configuration In Adapter Modules</a> <a href="/people/michal.krawczyk2/blog/2006/10/09/xi-dynamic-configuration-in-adapter-modules--one-step-further Configuration In Adapter Modules</a>
~SaNv...

Similar Messages

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

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

  • 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

  • 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

  • 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

  • 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

  • Dynamic Configuration-File to File in scenario

    Hi Experts,
    As per the requirement needs to supress the numeric extensions of the files and transfer to the receiver.
    Example: file name is XXX123.txt , but after picking up by sender communication channel in XI that file needs to converts XXX.txt and transfer to the receiver. Finally in the receiver end the file name should be Mahesh.txt only.
    Please share the inputs how to do dynamic configuration in XI in File to File scenario.

    Hi,
    First you need to have a UDF as shown below. No need to put any arguments in the UDF.
    public String getFileName(Container container){
    DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
    //get file name in string s
    String s = conf.get(key);
    //remove all numeric values
    int i,l;
    l=s.length();
    String a="";
    for(i=0;i<l;++i)
    if(s.charAt(i)>='0' && s.charAt(i)<='9')
    continue;
    a=a+s.charAt(i);
    s=a;
    conf.put(key, s);
    return s;
    Now you need to map this UDF to any root element or dummy element of the target XML structure.
    Ensure that
    1. Sender Comm Channel has ASMA and file name ticked
    2. Receiver Comm Channel  has ASMA and file name and "fail if ASMA missing" ticked
    3. in receiver communication channel -> File access parameters-> File name scheme -
    > put any value say "*". This step is not compulsory.
    Hope this solves your problem.
    regards
    Anupam

  • Dynamic Configuration is not called in End to end processing

    Hi,
    I am working on scenario Proxy to File. From the source side, they are sending the target file name in the proxy. So for that we are implementing the dynamic configuration.When the proxy is triggered from ECC, the dynamic conf is not called. I am not able to see the Dynamic configuration in SXMB_MONI. But when i send the same payload through RWB, i m able to see the Dynamic conf in SXMB_MIONI and the target file is getting generated.
    Please suggest the solution for this.
    Thanks,
    Soumya.

    Hi,
    I feel the dynamic configuration should be accessed at the runtime and not generated.  We have had similar scenarios where we built the file name at runtime accessing the payload.
    Try using the below UDF for a dummy field on target side and the field carrying file name on source side..
    public String setDynamicFileName(String Key, String Value, Container container)throws StreamTransformationException{
    DynamicConfiguration conf = (DynamicConfiguration) container
        .getTransformationParameters()
        .get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create(
        u201Chttp://sap.com/xi/XI/System/Fileu201D,
        u201CFileNameu201D);
    conf.put(key,value);
    return("");
    This should work as long as you are passing a value in source field.
    Thanks
    Amit

Maybe you are looking for

  • Special characters in EL

    I am creating a simple querying mechanism for a remote database. I have composed an HTML page with two controls, a text box (txtTitle) and a text area (txtQuery) that take as input the title of a report and the SQL query to generate it, respectively.

  • Cannot Update Final Cut Pro X

    FCPX 10.0 was purchased and installed on my system. I'm unable to update it. The application is listed as a purchsed application on my AppStore/Purchased page. However the button to the right reads "Install" instead of "Installed." If I press Install

  • JSF Rendering in IE 7 and Firefox 2.0

    Hello everyone, I have developed a JSF page and have been testing it mostly with Firefox 2.0. I liked how it worked: when virtual forms where submitted only the related components where re-rendered. However, when using IE 7 or firefox 1.0 (haven't te

  • Steps to do switchover / switchback in RAC environment

    Hi folks, I m having setup with 2 node RAC primary and 2 node RAC Dataguard on 10.2.0.4.0. Dataguard setup is working fine. Dataguard is setup with Standby Redo log group with managed recovery. There is no problem with transferring archives & applyin

  • Embedded Database - data does not load

    Hello. I am currently using NetBeans 6.5 and am experimenting with the CarsApp tutorial. Whenever I create an application using the server database, the data loads automatically when the application starts. However, when I create the application usin