Define a sort of static variable in a FlatFile Resource

This is the problem, i have a FlatFile Resource that calls a Process Rule (a Workflow). Every user that FlatFile Resource find with the Workflow it retrieves a list, so every time it wastes time because the list is always the same, i have to retrieve this list only the first time the FlatFile start. I wonder if there is a way to define a variable that is setted only the first time FlatFile start and every user can access to it. Who comes from the world of Java like me, i mean to define a sort of a static variable.
Edited by: thestig on Mar 18, 2009 2:11 AM

>
Hi Sandipan, sorry for the late, I tried to manage this task but without success.
The user exit I'm working on in EXIT_SAPLBBPK_001.
FUNCTION EXIT_SAPLBBPK_001.
*"*"Lokale Schnittstelle:
*"  IMPORTING
*"     VALUE(IM_BBPDECDATA) LIKE  BBPDECDATA STRUCTURE  BBPDECDATA
*"     VALUE(IV_MANU_PROF) TYPE  MANPRC OPTIONAL
*"  CHANGING
*"     VALUE(CH_PROFILE) LIKE  T160EX-EPROFILE
  INCLUDE ZXBBPU04.
ENDFUNCTION.
It includes ZXBBPU04, in which I have to understand if I'm working on a Purch. requisition in MODIFY mode or in CREATE mode.

Similar Messages

  • How to read static variable defined java class from flex?

    This is a beginner question. If I use remoteClass to map a java class and a flex class, how can I access a static variable defined in java class from the flex code?
    Thanks!

    Static propeties are by default ignored in the blazeds for serialization. You can try using another global property in the java bean which maps to the value stored in the static property( Hopefully it should work)
    eg,
    public String instanceValue = ClassName.staticValue;
    Ref: http://livedocs.adobe.com/blazeds/1/blazeds_devguide/help.html?content=serialize_data_3.ht ml

  • Can we define 'Static Variables' in BPEL process ?

    Is the idea of 'STATIC VARIABLES' supported in Oracle BPEL?
    What I mean by that is, I need all my in-flight BPEL process INSTANCES to read a common variable and then decide the next course of action.
    Is this possible?
    Thanks in advance,
    Mahendra

    Hi Hans,
    In Cocoa and Objective-C a static variable needs to be declared in the implementation file and not the header as you would normally do. Standard C variables can be set at the same time as the declaration but Cocoa objects need an extra step.
    For example:
    #import "TestObject.h"
    // declare your static variable here
    static NSArray *count;
    @implementation TestObject
    - (id) init {
    self = [super init];
    if (self != nil) {
    // set the variable here
    // the 'if' statement ensures it is only set once
    if (!count) {
    count = [[NSArray arrayWithObjects:@"One",@"Two",@"Three",Nil] retain];
    return self;
    @end
    Hope this helps,
    Martin.
    PowerMac G5 1.6Ghz   Mac OS X (10.4.9)   4 gig RAM & NVidia 6800 Ultra

  • Non static variable error

    There may be more errors in here besides the static variable error. I made the methods static for the method call in my constructor Product(name, price). The purpose of this Class is to the the name and price of a product from user input, subtract 5.00 from the price, and return the new price. Please help!!!
    public class Product
    public Product(String name, double price)
    String product;
    price = Product.getPrice(price);
    Double.toString(price);
    //this.product = product;
    product = Product.getName(name) + Product.getPrice(price);
    public static String getName(String name)
    System.out.println("What is their name?: ");
    name = in.nextLine(); // I GET A NONSTATIC VARIABLE ERROR FOR variable "in" HERE.
    return name;
    public static double getPrice(double price)
    this.price = price;
    System.out.println("What is the price?: ");
    price = in.nextDouble();
    return price;
    public double reducePrice()
    price = price - 5.00;
    return price;
    public String getProduct()
    product = new Product(name, price);
    return product;
    Scanner in = new Scanner(System.in);
    public static String name;
    //public double price;
    }

    you not define the class member properly.
    the class member is define before the constructor as
    public class Product {
         static Scanner in = new Scanner(System.in);
         String product;
         double price;
         public static String name;
         public Product(String name, double price) {
              price = Product.getPrice(price);
              Double.toString(price);
              // this.product = product;
              product = Product.getName(name) + Product.getPrice(price);
    }

  • Non Static Variable addressed to Static Variable

    Hi,
    I am new to java, I am getting (Non Static Variable sb,serverAddress addressed to Static Variable)
    Here is the code. Thanks for reading, any help or explanation would be appreciated-
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    package webcheck;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.net.HttpURLConnection;
    import java.net.MalformedURLException;
    import java.net.ProtocolException;
    import java.net.URL;
    * @author
    public class checkhttp {
          private URL serverAddress = null;
          private StringBuilder sb = null;
          public checkhttp(java.net.URL serverAddress,java.lang.StringBuilder StringBuilder)
              this.serverAddress=serverAddress;
              this.sb=sb;
      public static void main(String[] args) {
          HttpURLConnection connection = null;
          OutputStreamWriter wr = null;
          BufferedReader rd  = null;
          String line = null;
          int x;
          //checkhttp check= new checkhttp();
          try {
              serverAddress = new URL("http://www.yahoo.com");
              //set up out communications stuff
              connection = null;
              //Set up the initial connection
              connection = (HttpURLConnection)serverAddress.openConnection();
              connection.setRequestMethod("GET");
              connection.setDoOutput(true);
              connection.setReadTimeout(10000);
              connection.connect();
              //get the output stream writer and write the output to the server
              //wr = new OutputStreamWriter(connection.getOutputStream());
              //wr.write("");
              //wr.flush();
              //read the result from the server
              rd  = new BufferedReader(new InputStreamReader(connection.getInputStream()));
              sb = new StringBuilder();
              while ((line = rd.readLine()) != null)
                  sb.append(line + '\n');
              System.out.println(sb.toString());
              System.out.println("Server is up");
          } catch (MalformedURLException e) {
              e.printStackTrace();
          } catch (ProtocolException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          finally
              //close the connection, set all objects to null
              connection.disconnect();
              //rd = null;
              //sb = null;
              //wr = null;
              connection = null;
    }

    Someone please correct me if I'm wrong, but since main is static, any fields it access must also be static.
    The static keyword declares that something is accessable no matter the class state, thus you can call main() and run your program without having something make an instance of the object that your progam defines. For example:
    class Foo {
          static public String strText = "Hello World";
    //Later in some method, this is valid.
    String MyString = Foo.strText;
    //However, if strText was not static you need to
    Foo fooExample = new Foo();
    String myString = fooExample.strText;Static should not override private, so static private fields/members are not accessable. To be accessable you still need to be public.
    Edited by: porpoisepower on Jan 21, 2010 2:18 PM

  • Best practices for setting environment based static variables?

    I have a set of static string variables that hold the url location of modules in a project. These locations change depending on whether I'm building for development, staging or production.
    What's the best way to set static variables in this way?

    I don't know if this is best practice, but here's the solution I've come up with.
    The root domain is accessible within the swf via a node on a loaded xml file. So I created a simple method that sets a url variable based on that domain node.
    The domain-based url variable is then used within the static string variables that define the location of the modules.
    Simplified like so:
    var domain:String = xml.node.value;
    static var bucketLocation:String = getLocation()
    static var moduleLocation:String = bucketLocation + "modulename.swf";
    function getLocation():String
         var loc:String
         switch (domain) {
              case stagingUrl:
                  loc = "pathToAmazonStagingBucket";
                   break;
              case productionUrl:
                   loc = "pathToAmazonProductionBucket";
                   break;

  • Static variable could not seem as attribute in JMX

    Hi,
    I defined a Global class and I have a static variable. I could not see them as attribute in jConsole. BTW, the methods could seem in jconsole. And, I used the class includes static variables as a Global class.
    How can i see the static variable in jconsole?

    Global class is a final Class it is not be instantiated.
    Static variables should be accessible because I want to monitor something ( for example file processing time or file sending time .. ). I set the variable as average time of file processing and I would like to monitor in jmx.
    In application-context xml in spring environment I represent the bean as mbean as below :
         <bean id="exporter3" class="org.springframework.jmx.export.MBeanExporter" lazy-init="false">
         <property name="beans">
              <map><entry key="bean:name=Global" value-ref="Global"/></map>
         </property>
         </bean>

  • Displaying Static Variable in Title view.

    Hi,
    I have defined a static variable bank with the value of 'Bank of India' in 10g and have to mention it in the title. How to define the variable in the title. valueof("bank"), @{biserver.variables["bank"]}, @{"bank"} don't work, then how to achieve it?
    Thanks,
    Anitha.B

    check with this one - @{biServer.variables['Variable Name']}
    variable name should be in single quote.
    Pls mark if it helps....

  • Why Inner class cannot access static variables

    Why is it that inner class can use only static final variables of the outerclass, and not ordinary static variables of the outer class. "Yes the JLS sepcifies that only final static variables can be used inside an inner class, esp a non blank final variable". But why this restriction.
    Thanks.

    so what are final static variables treated as if they
    are not variables. So if the final static value is
    not loaded when the class is loaded how will the
    class know about the value.??The actual value wil be substituted for the name of a static final value at compile time. That's why you can use them in switch statements where you can't use any variable variable.
    This is something to watch out for, by the way, because if you use a public static final value from one class in another the actual value will be compiled into the using class, so if you change the value where it's defined the class using it will have the old value until it's recompiled.

  • Static variable for debugging mode?

    Hello I want to have a debugging mode for my application...
    Its jsp, servlets..
    If I have one static variable String called debug and set it to true then it should print all System.out. stuff in application... otherwise it shlould not...
    Do I have ot have this static variable defined in every jsp and servlet?

    try something like this
    public Class AppControl{
    public static boolean debugMode;
    public static void setDebugMode(boolean flag){
    this.debugMode = flag;
    public static boolean ifDebug(){
    return this.debugMode;
    In your JSP just do
    if (AppControl.isDebug()) {
    //print debug
    }

  • Java inherited static operations on static variables

    How does one force a static method in a base class to operate (read/modify) on static variables in the base class and all of its subclasses ?
    From what I've seen, static methods aren't truly inherited; just invoked from the sub-classes within the super's context !! Am I mistaken ?

    It seems I've incorrectly (more like, incompletely) phrased the 1st part of the question to cause a concern in your response. I hate fundamentally flawed approaches as well :-) My title still holds good, though.
    Rephrasing:
    How does one allow a static method defined in a base class, that can already operate (read/modify) on its own static variables, be inheritable in the subclasses, so that they too can use this method to operate on their over-ridden static variables, without the subclasses having to redefine them ?
    Partial Problem Definition:
    Way before any instances of some of the above-discussed classes are created, the classes should be able to fill in a common static variable with data that is unique to the particular class in question. Especially when these so-called static variables are declared final. Therefore, a superclass (in this case the root) can define this method once, and all subclasses would inherit this class method during their class-object initialization and accordingly fill in their 2 cents worth of value in a given static variable - which in this case will have the same name in all the classes involved. This static variable can represent anything - time-of-class-creation, class-level random number etc.,
    An apparently silly example:
    Class A {
    protected static final String canonicalClassName = getMyClassName();
    protected static String getMyClassName() {
    // Implementation
    Class B {
    protected static final String canonicalClassName = getMyClassName();
    What would the commented implementation in getMyClassName() be, so that all subclasses can take advantage of (WITHOUT re-defining) the super's method ?
    Edited by: Matt0000 on Apr 17, 2008 2:21 PM

  • Local static variable not unique between dylib, Xcode 4.4.1 bug?

    I am wondering if this is a Xcode bug or it is the way the c++ standart is.
    I would expect to  see 1 in the console but i see 0.
    Anybody know why? Here is the code
    In one dylib I have
    // Header file
    class Foo {
       int i_ = 0;
       Foo(const Foo&) = delete;
       Foo& operator= (Foo) = delete;
       Foo()
    public:
       void inc()
          ++i_;
       int geti()
          return i_;
       static Foo& get()
          static Foo instance_;
          return instance_;
       Foo( Foo&&) = default;
       Foo& operator= (Foo&&) = default;
    int initialize()
       Foo::get().inc();
       return 10;
    class Bar
       static int b_;
    // cpp file
    #include "ClassLocalStatic.h"
    int Bar::b_ = initialize();
    and in my application project i have
    // main.cpp
    #include <iostream>
    #include "ClassLocalstatic.h"
    int main(int argc, const char * argv[])
       std::cout << Foo::get().geti();
       return 0;
    Thanks

    thanks for your answer, You are right there is 2 foo singleton at different memory addresses.
    I didn't think about when the dylib was loaded. I can't even tell when it is loaded. But I know if i but breaks point I break in the initialize function before breaking in main, but that might be because of this actual setup. So when does a dylib will be loaded? At the first call a program sees that need the dylib?
    Here I'explain why it is done this way. My Singleton is a UnitTestRegistry, the Bar class is a UnitTest class and the static variable b_ is a class containing metadata info on the unit test.
    I have a macro to define the unit test it is called Make_UnitTest()
    So in a cpp I do
    Make_UnitTest(MyTest)
         // Test Stuff
    The macro will get expanded to
    class MyTest_UnitTest: public UnitTestBase
         static UniTestMetaData b_;
         virtual void executeTest();
    int MyTest_UnitTest::b_ = initializeAndRegisterUnitTest("MyTest_UnitTest", factoryFunction);
    MyTest_UnitTest::executeTest()
    // Test Stuff
    And in the function initializeAndRegisterUnitTest I call the getInstance of the unit test  registry. This way my unit test are registred at loading time of the program/dll. If you know a better way to automatically register (i know it cuold be manual but i find it too cumbersome), but it wont fix the problem which is that I have two intance of my singleton because the function is inline in a header.
    Well this behavior is surprising to me, I didn't know it would do this. But hey it is good to learn right!
    Just to make it clear there is no real global!! The singleton is like a global but it is not completly one and the b_ is certainly not global it is a class static memeber...

  • Interfaces: static variables but instance methods, why?

    Why do variables need to be static in interfaces but the methods in them are not allowed to be static? Or, asked differently: Why methods must not be static while variables have to be static in interfaces?
    I don't understand the reason for that difference.

    An interface defines functionality but can not be instantiated as an object. So for the static variables, it can define variables that can be accessed by all implementing classes, but there can only be one definition of them, hence static. Non-static variables fall in the realm of implementation, which is not what interfaces are for.
    Static methods are used to define an implementation that is common among all instances of an object, and must be implemented when defined. Since interfaces can not provide any implementation, static methods are invalid. Remember that static methods are commonly used without instantiating an object (like java.lang.Math methods) so the implementation must be provided when defined.

  • Clarification about static variables declaration

    I'm getting "Illegal Start of Expression" error, When i try to declare a static variable within a static metho or nonstatic method.
    Could you please clarify me,
    Is it possible to declare a static varible within a static method or non static method ?
    Thanks

    Hi Vikas,
    First, note that this forum is devoted to Sun Java Studio Creator IDE. General Java questions can be asked on forums here: http://forum.java.sun.com/
    Second, note that static variable can be defined only as member of class. It cannot be defined inside of method.
    Thanks, Misha
    (Creator team)

  • Where to put init code for static variables? (for UIImages)

    I know that static variables are sorta a global, is that how UIImage is usually stored? What is the convention to declare UIImage variables that exists throughout the lifetime of the app? Where is a good place to init it if I choose to use static variables?

    OK, in that case do something like this:
    MyClass.m
    #import "MyClass.h"
    static UIImage *classImage;
    @implementation MyClass {
    + (void)initialize {
    classImage = <whatever to load image>;
    Code like the above makes the 'classImage' variable work like a typical class variable. It is available to all instances of MyClass but is not visible to other classes. Like a 'private static' class variable in Java. Nothing goes in the header for this variable.
    The 'initialize' method is called once the first time anything ever references MyClass. Kind of like a static initializer in Java. Notice the use of '+' instead of '-' for the method. The '+' makes it a class method instead of an instance method.
    Does that help?
    Message was edited by: RickMaddy

Maybe you are looking for

  • Monitor no longer sleeping after 10.8.2 & Mac Mini EFI update

    Hopefully someone can help out here, my new 2012 Mac Mini was running fine without any problems, then when I installed the 10.8.2 update (not the original update that got pulled from the Apple site but the newer version) with the EFI Mac Mini firmwar

  • NON Creative Cloud CS6 indesign will not open Spinning wheel of death

    We have 8 of 16 Mac Yosemite computers all imaged the same way and all other adobe CS6 NON Cloud they work fine.  However when we open InDesign only we get the spinning wheel of death and I have to Force close the program.  Adobe offers NO chat or Ph

  • Purchase Order Script

    Hi, I have an output type which is configured for both create and change of Purchase order. When ever we do changes to Purchase order items after creation, if previous output has been released, then a new output will be determined to capture the chan

  • IPod not updating! HELP!

    I need help desparately! Whenever I plug in my iPod to update new songs that I have downloaded, iTunes shows that it is updating, but once iTunes shows that it has been updated and I disconnect my iPod, the new songs are not on the iPod! The songs ar

  • Itunes can't add and deletes all my files

    i'm trying to add some video clips to my itunes library to later use with apple tv well it crashes everytime and deletes the file or group of files i was attempting to add.