Global Container

Hi all,
I am trying to understand the concept of Global Container.
i have referred to the following blog by Michal
<a href="/people/michal.krawczyk2/blog/2005/03/04/globalcontainer--in-graphical-mapping-xi:///people/michal.krawczyk2/blog/2005/03/04/globalcontainer--in-graphical-mapping-xi
I have created the Second UDF 'getContainer'.
But, while testing I am getting the following error:
RuntimeException in Message-Mapping transformation: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._MM_TEST_IN_ method getContainer$[]
Code that i am writing in getContainer is as follows:
<b>GlobalContainer globalContainer = container.getGlobalContainer();
String[] b = (String[]) globalContainer.getParameter("our_number");
for (int i=0; i<b.length; i++)
result.addValue(b<i>);
}</b>
getContainer function does not have any input parameters.
Kindly, provide me some guidance about where am I getting wrong.
Thanks & Regards,
Nilima Rodrigues

Hi Nilima,
Hi Nilima,
   //write your code here
GlobalContainer globalContainer1 = container.getGlobalContainer();
String[] b = (String[]) globalContainer1.getParameter("our_number");
String str_result = "";
if( (b != null)  ) {
  int a1 = Integer.parseInt(b[0]);
  int cnt = Integer.parseInt(counter);
  int ans = a1;
  str_result = String.valueOf(ans);
return  str_result;
Note counter is a arguement for value based...
Map Now like this
use COUNTER standard function --> UDF getContainer --> then target field..
this will work..
regards,
sridhar
Message was edited by:
        sridhar reddy kondam

Similar Messages

  • Trace not showing Global container variable at mapping test time.

    Hi Folks ,
    I have a scenario file to Proxy scenario. At mapping time I am doing a lookup inside a UDF using JCO connections.
    Lookup is taking 2 fields(ex X an dY) as input and coming up with couple of fields in output.
    Output fileds I am storing in global container and want to access in further mapping .
    I am using trace to see variable values at mapping tijme
    Surprisingly :
    1. For a particular "X" field in Input, No output fields are coming at trace . On testing it end to end I can see fields getting populated at run time at lookup table . but not getting reflected at mapping trace . what could be the possible cause ?
    2.  For few input fields like "Z" . It is showing all the output values at Trace. But when I go and place a value in lookup table for the same Input field "Z" . this new value is not coming up at trace Level while rest of teh values are coming up. Can anyone hint where I am going wrong  ?
    End to end Debugging sahows values populating and being sent across . Where I need to look at ?
    Regards ,
    Santosh

    Hi Horia ,
    By trace do you mean display queue or running the mapping completely in the ESR ?
    --->I am talking about running the mapping at IR and getting the values of trace by using messagetype.traceinfo() in UDF functionality. I am working on Pi 7.0
    Regards ,
    Santosh

  • Global Container in Java Class of Interface Mapping

    I have written a Java Class that implements the StreamTransformation interface for use in an Interface Mapping. I would like to cache information read from a file between message processing calls of this mapping.
    It appears that maybe the GlobalContainer object can be used to perform this caching. How do I access the GlobalContainer object from a class that implements StreamTransformation?
    The examples all show container.getGlobalContainer() method call to get access to this object. However container is not a variable in this interface. Any ideas on how to do this?
    Thanks,
    Jay

    Hi Jay,
    if you want to link data from different messages you must use BPM, you cannot do this with GlobalContainer because it is instantiated at the begin of the mapping and is flushed at the end of the mapping (e.g. graphical mapping).
    2 files for the same scenario will use 2 different instances of the same message mapping program and they will not share the container.
    The container is shared inside the same instance of the mapping program.
    So it is shared for example between two UDF in the same mapping
    So if you are using Java mapping you do not need to use the global container, you can use an Object to store data, but keep in mind that all this data will be lost at the end of the mapping.
    Hope it helps,
    Kind Regards,
    Sergio

  • Sequence Number Generation with Global Container

    Hi ALL,
    Can any plz send me the steps of using global container for generation seqence number's
    And also if possible send me the code.
    Thanks & Regards
    Rupash

    Hi Rupesh,
    chack this code:
    public String seqNumber(Container container)
          int i;
          GlobalContainer global=container.getGlobalContainer();
          String getnum=(String)global.getParameter("a");
          if(getnum==null){
                     global.setParameter("a","1");  i=1;
          else{
                i=Integer.parseInt(getnum); i++;
                global.setParameter("a",String.valueOf(i));
          return String.valueOf(i);
    **Reward points if helpful
    --Sankar Choudhury

  • Java doc for container ,global container.

    Hi ,
    Can somebody tell where I can get the javadoc for container and global container.
    THnks

    Hi,
    You can view the the source code also provided if you have proper Decompiler tools.
    I have used a tool to open <b>aii_mt_rt.jar</b> and found the following for <b>Global Container</b>.
    Global container:
    package com.sap.aii.mappingtool.tf3.rt;
    import java.util.Map;
    public interface GlobalContainer
        public void setParameter(String string, Object object);
        public Object getParameter(String string);
        public Map getParameters();
    For Container:
    package com.sap.aii.mappingtool.tf.rt;
    import com.sap.aii.mapping.api.AbstractTrace;
    public interface Container
        public Object getParameter(String string);
        public void setParameter(String string, Object object);
        public AbstractTrace getTrace();
        public GlobalContainer getGlobalContainer();
    Hope this helps.
    Regards,
    Ananth

  • Concept of Global Container or Global Variable

    Hi friends,
    My Scenario is from JMS to SOAP.
    I need to store some data when it comes to XI from JMS.
    When the response comes back from SOAP I need to add these fields and send back to JMS.
    Can I do this Scenario without using BPM ?
    Is there any concept like Global Container which I can use it in different Message mappings?
    Thanks and regards,
    Jose

    Hi,
    This object enables you to cache the values that you want to read again when you next call any user-defined function in the same message mapping. Note that the sequence in which user-defined functions are called is predefined. It depends on the position of the target fields that the function was assigned to
    On details of global container refer these.
    /people/sap.user72/blog/2005/10/01/xi-new-features-in-sp14
    http://help.sap.com/saphelp_nw2004s/helpdata/en/75/8e0f8f3b0c2e4ea5f8d8f9faa9461a/frameset.htm
    /people/michal.krawczyk2/blog/2005/03/04/globalcontainer--in-graphical-mapping-xi

  • Mapping and global container?

    I have to map single different field IN_F1 to three output fields..
    1) map the input field value IN_F1 to output field value OUT_F1
    2)
    a) based on the INPUT field value , conditionally map incremental numbers to OUT_F2. For example, if IN_F1 is 'X', OUT_F2 will be '01' and second time around I will increment it to '02'.
    b) Same condition as 2a, but move the incremented value from OUT_F2 to OUT_F3 in different node.
    I am planning to set global container in step 2a. And then use  that global container in step 2b to  fill OUT_F3. My question is will steps 2a and 2b always follow the order? Since my field OUT_F3 occurs in node after OUT_F2, 2a should always get executed first. Is this assumption right?
    I am actually invoking standard BAPI.. Would it be better to do all this steps in XI to fill std. BAPI structure or create a custom RFC to do this?

    Hi,
    >>>>Since my field OUT_F3 occurs in node after OUT_F2, 2a should always get executed first. Is this assumption right?
    yes
    you can also get all OUT_F2 in an advanced function
    and put then in a global array which you'll just
    use in a new andanved function to fill OUT_F3
    Regards,
    michal

  • Rebooting Global Container

    Is there a way to reboot the global container and all non-globals with one command?

    Rebooting the global zone will force all local (aka non-global) zones to reboot.
    The clean ways is to look through the zonelisting on the global zone and halt each local zone prior to rebooting the global. This gives you a clean shutdown.
    Here's a zone table from one of my machines I'm working on:
    essgzdu31z0|global$ sudo zoneadm list -cv
    ID NAME STATUS PATH BRAND IP
    0 global running / native shared
    5 essapdu31z1 running /zones/apps_zones/essapdu31z1 native shared
    12 essapdu31z4 running /zones/apps_zones/essapdu31z4 native shared
    17 essapdu31z3 running /zones/apps_zones/essapdu31z3 native shared
    - essapdu31z2 installed /zones/apps_zones/essapdu31z2 native shared
    essgzdu31z0|global$
    This command prints the running zones on the machines:
    essgzdu31z0|global$ sudo zoneadm list -cv | grep running | grep -v "global " | awk '{ print $2 }' <
    essapdu31z1
    essapdu31z4
    essapdu31z3
    essgzdu31z0|global$
    You could use this as a front end to zoneadm -z "zone name" halt
    Then it's safe to reboot the GZ.
    The rest I leave as an exercise to the reader :-)

  • Accessing Global Container

    Dear Experts,
    I have an RFC  to FILE Scenario and used BPM to meet the requirements.
    There are 2 graphical mappings - mapping1 before the BPM and mapping2 (transformation) within the BPM.
    I have saved a parameter in the global container in mapping1 but unable to extract the same in mapping2. Any idea?
    UDF in mapping1:
    GlobalContainer gc1 = container.getGlobalContainer();
    String gdata1 = va2 + "_" + var3;
    gc1.setParameter("gdata",gdata1);
    UDF in mapping2:
    GlobalContainer gc2 = container.getGlobalContainer();
    String gdata2 = (String) gc2.getParameter("gdata");
    Thanks and Regards,
    Rana Brata De

    Hi Rana
    Refer the following statement from SAP Help stating that the values only available in same message mapping.
    This object enables you to cache the values that you want to read again when you next call any user-defined function in the same message mapping.
    GlobalContainer Object - Enterprise Services Repository - SAP Library
    If you want to pass the value, you can either add additional fields in your structures or use DynamicConfiguration (has limit of 200 characters). Since you are using BPM (is it ccBPM or NW BPM?), I'm not sure if DC attributes can be passed into a BPM an accessible.
    Any particular reason to do the 2nd mapping within the BPM? You can also do it out of the BPM after all the necessary BPM processing.
    Rgds
    Eng Swee

  • Global Container Variable

    Hi
    Give me idea on Global Container variable in Graphical mapping.
    Thanx in Advance

    Hi
    Ref this
    /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    http://help.sap.com/saphelp_nw04/helpdata/en/95/bb623c6369f454e10000000a114084/content.htm
    Design and Configuration [original link is broken]
    Thanks
    Sridhar

  • Help needed with Global Container usage

    Hi All,
    In a scenario, we are using a Global container.
    we are using setParameter and getParameter methods to set and get values from the Global Container.
    The problem we are facing is that although we are setting the value for a parameter before getting it but it always returns "null".
    Please find attached the code:
    SetVar:
    GlobalContainer myGlobalContainer;
    myGlobalContainer = container.getGlobalContainer();
    myGlobalContainer.setParameter(b.toUpperCase(), a);
    return a;
    GetVar:
    GlobalContainer myGlobalContainer;
    myGlobalContainer = container.getGlobalContainer();
    if (myGlobalContainer.getParameter(a) == null) {
       return "";
    else {
       return (String)myGlobalContainer.getParameter(a.toUpperCase());
    We have also tried putting the string value excplicitly in "" but of no use.
    We also read the blog by Michael but i think the problem is a little different.
    If any body can help us with where to look for Global Container related errors, it would be of great help.
    Regards,
    Varun Joshi

    Varun,
    The Signature of setParameter() is,
    void
    setParameter
    (String parName, Object obj);
    Taking this into account,
    GlobalContainer myGlobalContainer;
    myGlobalContainer = container.getGlobalContainer();
    myGlobalContainer.setParameter(b.toUpperCase(), a);
    return a;
    In this method you are settting parameter b with value a.
    But, in the get
    GlobalContainer myGlobalContainer;
    myGlobalContainer = container.getGlobalContainer();
    if (myGlobalContainer.getParameter(a) == null) {
    return "";
    else {
    return (String)myGlobalContainer.getParameter(a.toUpperCase());
    You are trying to use get(a) when it should be get(b).
    Regards
    Bhavesh

  • Mapping in XI - cannot access Global Container parameters

    Hi all,
    we have the following problem in graphical XI mapping.
    Trying to retrieve the run-time value of a global parameter, we cannot access the value itself (e.g. test using "display queue" menu).
    We use 2 simple user-defined functions (getIdoc and corresponding setIdoc).
    The source code for our custom get/set methods is:
    public String getIdoc(Container container){
    // This is a CUSTOM global parameter set <- cannot get the value itself
    //String codMsgExport = (String) container.getGlobalContainer().getParameter("idoc");
    //return codMsgExport.toString();
    GlobalContainer globalContainer;
    java.util.Map map;
    globalContainer = container.getGlobalContainer();
    map = globalContainer.getParameters();
    // This is a STANDARD global parameter set <- cannot get the value itself, as well
    String headerField = (String) map.get(StreamTransformationConstants.INTERFACE_NAMESPACE);
    return headerField;
    public String setIdoc(String codMsgExport,Container container){
    container.setParameter("idoc", codMsgExport.toString());
    String retValue = (String) container.getGlobalContainer().getParameter("idoc");
    return retValue.toString();
    => anyway, get method returns only blank values (testing by "display queue" with some custom values...)
    It seems as if the parameter is seen, as pointing to a not existing variable - e.g. getParameter("idoczz") - XI runtime returns a NullPointerException.
    Some XI server details:
    Runtime Environment
    Java version: 1.4.2_06
    Java vendor: Sun Microsystems Inc.
    Version
    Service pack: 14
    Release: 30_REL
    Thanks all!
    Gianluca Tacchella

    Hi Sudharshan and Bhavesh,
    I forgot to put a value under the tab PARAMETERS (this is the reason for the blank value, thanks:)).
    Anyway, modifying (run-time by the set function) the standard runtime constant => leads to a get function with a single value returned (out) for "display queue", despite of test valorization: the initial value set under tab PARAMETERS.
    Instead of using the runtime (standard) constant, using my (custom) global variable => leads to NullPointerException ("display queue" for get function) EVEN IF I initialize the variable (e.g. initIdoc() function called once at top-level target message).
    under JAVA_SECTIONS_TOOLTIP button:
    Global Variables
    String idoc;
    Initialization Section
    idoc = "";
    Clean-Up Section
    idoc = "";
    public String initIdoc(Container container){
    GlobalContainer globalContainer;
    globalContainer = container.getGlobalContainer();
    // this is the only way NOT to get a NullPointerException
    if ( globalContainer.getParameter("idoc") == null )
    globalContainer.setParameter("idoc", "a");
    return globalContainer.getParameter("idoc").toString();
    initIdoc:
    out (*)
    [a]
    (*) despite of initialization under JAVA_SECTIONS_TOOLTIP button
    public void getIdoc(ResultList result,Container container){
    //String codMsgExport = (String) container.getGlobalContainer().getParameter("idoc");
    //return codMsgExport.toString();
    GlobalContainer globalContainer;
    java.util.Map map;
    globalContainer = container.getGlobalContainer();
    map = globalContainer.getParameters();
    //String headerField = (String) map.get(StreamTransformationConstants.INTERFACE_NAMESPACE);
    // this returns null (out stream)
    //String headerField = (String) map.get("idoc");
    //if ( globalContainer.getParameter("idoc") == null )
    //globalContainer.setParameter("idoc", "");
    // this returns NullPointerException
    String headerField = globalContainer.getParameter("idoc").toString();
    //result.addValue(headerField);
    // this returns NullPointerException
    //return headerField.toString();
    //return globalContainer.getParameter("idoc").toString();
    result.addValue(globalContainer.getParameter("idoc").toString());
    => leads to NullPointerException
    public String setIdoc(String codMsgExport,Container container){
    GlobalContainer globalContainer;
    globalContainer = container.getGlobalContainer();
    java.util.Map map;
    map = globalContainer.getParameters();
    //globalContainer.setParameter(StreamTransformationConstants.INTERFACE_NAMESPACE, codMsgExport.toString());
    //container.setParameter("idoc", codMsgExport.toString());
    //String retValue = (String) map.put(StreamTransformationConstants.INTERFACE_NAMESPACE, codMsgExport.toString());
    // this returns a NullpointerException
    //String retValue = (String) map.put("idoc", codMsgExport.toString());
    globalContainer.setParameter("idoc", codMsgExport.toString());
    //return "True";  // pointer for debug
    //return retValue.toString();  // pointer for debug
    return globalContainer.getParameter("idoc").toString();
    setidoc:     
    in0     out (*)
    [1]     [1]
    [2]     [2]
    (*) as if this "idoc" parameter is not the globally managed (JAVA_SECTIONS_TOOLTIP button), but one which lives inside the function and not outside for the get function..
    Regards,
    Gianluca

  • Solaris10 missing /usr/openwin directories in non-global container

    I created a global (default) and two non-global containers. The /usr/openwin directories in non-global containers are empty (while global one's are fine). Since /usr is read only in non-global containers, I can't add anything to it.
    questions:
    1. why is the /usr/openwin directories is empty in non-global containers, did I miss some steps in creating containers?
    2. How do I make /usr/openwin visible now to the non-global containers?
    appreciate your help.

    What you observed is normal. The basic Solaris 11 zone install gives you a somewhat minimal install. If you want additional packages, you can install them. If you want the zone install to have what you would install from a CD I suppose you could do a the following:
    pkg install slim_install
    pkg uninstall slim_install
    My understanding is that the slim_install package contains dependencies which loads all of the desktop software but doesn't contain any content itself - which is why you can (and should) remove it afterwards.
    That said, normally one uses a zone for a particular purpose. A better approach might be to install only the software in the zone which is needed for that purpose. That would save space, limit security exposure and reduce maintenance overhead. If your purpose is to have a full user environment, that may be to include all the slim_install packages and maybe others as well.
    I would recommend that you not install services by copying files. If you need a service find out what package contains that service and install the package in the zone. That way you won't break maintenance via pkg update.
    So - your questions:
    1. A Solaris 11 zone install is minimal, presumably to make it easy to set up simple single function zones. Additional packages can be added as needed using "pkg install" as needed to provide any necessary services.
    2. Solaris 10 zones work differently and import most packages from the global zone. With Solaris 10 sparse zones, you actually use the same files from the global zone. Solaris 11 zones are different in that they are actually a separate install. The basic install is minimal, presumably to allow for small and simple single function zones. You are not doing anything wrong with respect to the basic install, this is just how things work.

  • Dynamic Filename in global container

    Hi,
    I want to get filename dynamically and I have standard function
    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);
    I want to put this code in java functions and I had put and I am getting error as
    cannot resolve symbol symbol : variable container
    Can you please help me on this?
    B

    Hi Harleen,
    Even I had a simlar Probem I used this UDF
    public void DynamicFilename(String[] a,String[] b,ResultList result,Container container){
      //write your code here
    AbstractTrace trace = container.getTrace();
    String strDirectory=" ";
    String strFileName="";
    try
         Map map= container.getTransformationParameters();
         //This is for generating the file Direcotry Dynamically
         DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get
    (StreamTransformationConstants.DYNAMIC_CONFIGURATION);
         DynamicConfigurationKey key = DynamicConfigurationKey.create( "http://sap.com/xi/XI/System/File", "Directory");
         DynamicConfigurationKey key1 = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File",
    "FileName");
    strDirectory= "/fms/PPM/S3";
    strFileName= b[0] + b[2] + b[1]+ ".XML";
    trace.addWarning("strDirectory " +strFileName);     
    conf.put(key, strDirectory);
    conf.put(key1, strFileName);
    result.addValue(b[0]);
    catch(Exception ex)
    trace.addWarning("Catch Block " );

  • How to populate Global Container

    Hi,
         We have an output structure of the form-
        <Record>                          occurence 1-n
            <MSGFN>..</MSGFN>  occurence 1-1
            <MTART>..</MTART>    occurence 1-1
            <VOLUM>..</VOLUM>   occurence 1-1
        </Record>
    I have written a UDF(queue) to populate the Record field. In this UDF I want to populate an ArrayList (ArrayList as initial size is unknown) with the output queue of Record which I need to reference in other another UDF(queue) for populating the fields under Record.
    When I tried this by declaring an ArrayList under Global Variables and then trying to use that ArrayList in the UDFs for populating the fields, it was unable to do so.
    Can anyone help out with this?

    Hi;
    This is all abt Global Variables
    <b>Global Variables Declaration</b>
    ArrayList arrVI;
    int counter =0;
    <b>Initialization Section</b>
    arrVI= new  ArrayList();
    <b>assignment</b>
    arrVI.add(sVI[iLoopCounter]);
    counter++;
    <b>Calling Back</b>
    for (int i =0;i<counter;i++)
    result.addValue(arrVI.get(i)+"");
    Mudit
    Award points if it helps

Maybe you are looking for

  • Log on to Runtime Workbench : click display error on page

    Dear all, when i try to log on to Runtime Workbench  and click on display message , i am getting error that error on page, we have already done post implementation steps for PI(XI),, what to do, to test the senario from Runtime Workbench. Best regard

  • How to transfer apps from one device to another without losing progress?

    Is there anyway that I can move my apps/games from my ipad mini to my new iphone without having to start all over?

  • How to get Test Utility for PI 7.3 Single Stack JAVA only.

    Hi All,    We are having PI 7.31. Single Stack JAVA only. we want to test some scenario. Can anybody tell me how can i test the scenario in PI 7.3 is there any test utility by which i can send some test messages to PI 7.3. from where to download this

  • No Room on my Hard Drive to Install Book

    I have 80G on my MacBook and have all my photos on an External Drive. With that said, I have only 4.6G left. Does anyone know of a way to determine which one of my applications is eating my disk space?

  • Uninstall folder with 192 files in them?

    Can anyone tell me what the files are for in the Uninstall folder? The file path is: Library>Application Support>Adobe>Uninstall. I have 192 files in there with all the extensions either .db or .js I don't get it.....please enlighten. Thanks