Call JCO.ParameterList.setActive() only once?

In a loop construct where I am calling a JCO.Function over and over again, do I need to call setActive() on the export parameter list and the table parameter list only once to render unnecessary parameters inactive or do I have to do it on each iteration?  Please refer to the code example below:
void processFunction(JCO.Client connection, String fxName) {
JCO.Function fx = createFx(fxName);  // some helper method
JCO.ParameterList epl = fx.getExportParameterList();
JCO.ParameterList tpl = fx.getTableParameterList();
deactivateExportParameters(epl);  // Deactive here?
deactivateTableParameters(tpl);    // Deactive here?
for (int i = 0; i < count; i++) {
   deactivateExportParameters(epl);  // or here?
   deactivateTableParameters(tpl);    // or here?
   setImportParameters(fx);  // helper method
   connection.execute(fx);
   processResults(fx);  // helper method
The methods deactivateExportParameters() and deactivateTableParameters() both
call JCO.ParameterList.setActive() to inactivate export parameters or table parameters
based on whether they are referred to after the JCO.Function is executed.
Thanks in advance.
Message was edited by:
        Jim OHearn
Message was edited by:
        Jim OHearn
Message was edited by:
        Jim OHearn

Hi Jim,
the setActive method needs to be called only once. It is fired when the Function is created (either called from the Repository or created anew).
When you want to use the function, call the setActive method before the for loop. If you had been actually creating the functions inside the loop, then you need to call the setActive method also in the loop.
For e.g -
JCO.Function fx;
ParameterList tableParamList;
for(int looper = 0; looper < 10; looper++)
          fx = createFunction("BAPI_NAME");
          tableParamList = fx.getTableParamList();
          tableParamList.setActive(false, "TABLE_NAME");
Bye,
Sameer

Similar Messages

  • SAP Enterprise Connector: omitting parameters like ParameterList.setActive

    Hello,
    I use the SAP Enterprise Connector and i've got a question:
    how can i avoid that the unnecessary optional parameters are requestet during the call, as i could do it with pure JCO.ParameterList.setActive(false).
    Thanks,
    Gena

    Hello,
    I use the SAP Enterprise Connector and i've got a question:
    how can i avoid that the unnecessary optional parameters are requestet during the call, as i could do it with pure JCO.ParameterList.setActive(false).
    Thanks,
    Gena

  • Lov Webservice called multiple times instead of once

    Hi,
    I am having a LOV which is being populated by a webservice call.
    I have attached this LOV to a view object attribute.
    Binded this attribute to a UI(Combo list of values) and when I pick the value from LOV, it fires a
    webservice call and fetches data.
    When I select a particular value from the list of values, it again fires the webservice call twice.
    Can some one advice me on how I can avoid the second and third calls to the webservice being made.
    I want the call to be made only once.
    Also is there any method in the VOImpl which can help me change this behavior when overriden.
    Thanks,
    Malathy.

    One possible solution is store the LOV values in some scope while retrieving it first time from the web service.
    Next time whenever LOV is called then return the LOV values from the scope instead of calling the web service.
    psedo code:
            if (ADFContext.getCurrent() != null &&
                ADFContext.getCurrent().getSessionScope().containsKey("LOV_LIST")) {
                LOVList =
                        (List<SelectItem>)ADFContext.getCurrent().getSessionScope().get("LOV_LIST");
            } else {
                LOVList = this.populateVendorListFromWS();
                ADFContext.getCurrent().getSessionScope().put("LOV_LIST",
                                                              LOVList );
            }Hope it helps.

  • Can we restrict a Procedure to be called only once in a session or package?

    Hi,
    I am having a procedure which is called for each insert statement.
    The code is non-Editable.
    So, I want to restrict the procedure to be called only once for the entire session or package.
    Could any one please suggest me, can we do this?
    Thak you,
    Regards,
    Gowtham Sen.

    Hi,
    Actually, I am using OWB tool. I used a procedure with output parameters, to map to the target table. So, OWB creates a package. In that package its calling the procedure for each record.
    So, in order to avoid that, can I do any thing else, which would restrict it to call for each record.
    Thank you,
    Regards,
    Gowtham Sen.

  • Call fucntion on App load only once

    Hi
    I call a Windows live SDK logon function, GreetUser(); when the apps loads on start-up as below. If I navigate to another page then back again the logon calls again.
    How can I make it call the function only once?
    public sealed partial class GroupedPicturesPage : LayoutAwarePage
    public GroupedPicturesPage()
    this.InitializeComponent();
    GreetUser();

    I'm sure a real programmer would use something more sophisticated. I am a fake programmer. So, I use very simplistic solutions for this kind of thing.
    In the App.xaml.cs page, create a static bool variable.  This will be your app global variable.  Initialize it to true. 
    static public bool firsttime = true;
    Now, in the page that you posted the code from, modify it to this.
    public sealed partial class GroupedPicturesPage : LayoutAwarePage
    public GroupedPicturesPage()
    this.InitializeComponent();
    if(firsttime==true) {
    GreetUser();
    App.firsttime = false;
    And voila.  GreetUser() will only fire the first time around.  After that, it won't fire again.

  • What method is called only once in the life cycle?

    Hello,
    What method is called only once in the life cycle of an Entity Bean and Session Bean?
    Is it ejbRemove()?
    Thanks

    hi,
    ejbCreate() and setSessionContext() are called once by the container after the bean instace is created.when the bean instance goes to pool and again return to ready state to handle client requests these methods r never called .only bussiness methods r called.this is in case of stateless session bean.
    in case of stateful session bean, each bean instance is associated with client.so,when new client requests, new bean instance is created and above 2 methods are called. no pool terminology in case of stateful session bean.
    ejbRemove() is called by the container when it is abt to remove bean instance,so it its obvious tht it is called only once.

  • Custom Render service is called only once, why?

    Hi All,
    I've created a custom render service in order to prepopulate principals name on each step of my process.
    The input form of the process is a Document Form cause users attach files to the form and it is routed to next station with the attachments.
    "Call Render Service only once" checkbox in advanced settings is unchecked.
    When the process is initiated my custom render is invoked fine, but when it reaches the assign task activity the form is opened but no render service is invoked.
    Why is it happens?
    Thanks in advance, Yan.

    Hi Parth,
    I'm writing to the log file every time that my custom service is invoked.
    When I open a form for a first time in workspace I see that it was invoked but when it reaches "assign task" activity and opened again the service is not invoked.
    I have only one form variable.
    Yan.

  • Is there any solution to make getter called only once?

    In my application i can see getter is calling more than once. I know this is due to JSF life cycle, but can i avoid that?
    is there any solution to make getter called only once? what will happen if i use immediate ="true"
    thanks in advance

    debdutta wrote:
    In my application i can see getter is calling more than once. I know this is due to JSF life cycle, but can i avoid that?
    is there any solution to make getter called only once? what will happen if i use immediate ="true"
    thanks in advanceTake whatever you need out of the getter method(s) and put it in the constructor method of your bean. Then it only get called once. The getter method should only return the value and nothing else i.e. no database calls, calculations or anything else.
    Off topic, perhaps a sticky thread for this topic should be created as I see it being asked numerous times in the last four months.

  • Calling a setup only once

    CAn anybody help me in this.
    I have a configuration setup which has to be called only once for every user when tomcat is started.
    can anybody suggest me where can i put my code.
    1)in a servlet and call it in web.xml
    2)in my logonaction class
    where can i put it.
    Thanks

    If you need the code to be run once, when the user logs in, then the idea of putting it in a class that gets instantiated, and then stored in the session upon login might be your best (and frankly, easiest) option.

  • Transition executed only once in a TableRow

    h1. SCENARIO
    h3. Model
    /* Model is a Person containing a flag active */
    class Person {
       private Boolean active = false;
       /* more fields and methods */
    h3. View
    /* The View is implemented in FXML */
    class View extends TableView<Person> {  }-----
    h3. Service backend
    class Service implements Observable {
       public void run(){
          Person person = new Person();
          person.setActive( Math.random() > 0.5 ? true : false );
          setChanged();
          notifyObservers(person);
    h3. AS IS ViewController
    /* ViewController observes the service which sends back Person with a randomly changed flag [true or false] */
    class ViewController implements Observer {
    TableView table;
    public void initialize(URL url, ResourceBundle rb){
    /* some code before */
    /* Implemented with datafx library */
    table.setRowFactory(new Callback<TableView<Person>, TableRow<Person>>() {
                @Override
                public TableRow<Person> call(TableView<Person> p) {
                    final CSSTableRow rowCell = new CSSTableRow() {
                        @Override
                        public void getCssState(List s) {
                            super.getCssState(s);
                            if(getItem() == null || s == null){
                                return;
                            if ( !((Person) getItem()).isActive() ) {
                                s.add("active");
                                FadeTransition fadeTransition = FadeTransitionBuilder.create()
                                        .duration(Duration.seconds(2))
                                        .node(this)
                                        .fromValue(0.1)
                                        .toValue(1)
                                        .build();
                                fadeTransition.play();
                    rowCell.getStyleClass().add("table-row");
                    return rowCell;
    /* some code after */
    }h4. Main Problem in AS-IS:
    <font color="green" face="courier" size="3"> The animation animates for every event occurs in the table (click on a row, hover on a row and so on) </font>
    h3. WANNA BE ViewController
    <font color="blue" face="courier" size="3">
    <li>Apply the transition when the service sends the updated Person.</li>
    <li>Apply the transition to the row which this person belongs to.</li>
    </font>
    class ViewController implements Observer {
        public void update(Observable obj, Object message) {
            if (message instanceof Person) {
                Person p = (Person) message;
    /* ----> 1. Find the row of this current person sent by service */
    /* ----> 2. Apply the transition only once in the row found */
    }Edited by: valerio.massa on 29-ago-2012 2.51

    I just dont want to raise the animation via rowfactory, is that possible?
    I would like to find a "better" (stylish) way to launch the animation (for example in the update(){} method, which is better theoretically speaking)

  • How to display field value only once in REUSE_ALV_GRID_DISPLAY

    hi experts,
                   i am using REUSE_ALV_GRID_DISPLAY, for alv outpur display.but i want one of the field in output ,not to display the value which is of same, it have to be displayed only once, I mean i have a number which contains multiple line items corresponding, here i want to display the field value only once when it is repeating , for the same header number, how can i achieve it

    Hi,
    check the sample code,
    REPORT  Z_ALV.
    Database table declaration
    TABLES:
      sflight.
    Typepool declaration
    TYPE-POOLS:
      slis.
    Selection screen elements
    SELECTION-SCREEN BEGIN OF BLOCK blk_1 WITH FRAME TITLE text-000.
    SELECT-OPTIONS:
      s_carrid FOR sflight-carrid.
    SELECTION-SCREEN END OF BLOCK blk_1.
    Field string to hold sflight data
    DATA:
      BEGIN OF fs_sflight ,
        carrid   TYPE sflight-carrid,      " Carrier Id
        connid   TYPE sflight-connid,      " Connection No
        fldate   TYPE sflight-fldate,      " Flight date
        seatsmax TYPE sflight-seatsmax,    " Maximum seats
        seatsocc TYPE sflight-seatsocc,    " Occupied seats
      END OF fs_sflight.
    Internal table to hold sflight data
    DATA:
      t_sflight LIKE
       STANDARD TABLE
             OF fs_sflight .
    Work variables
    DATA:
      t_fieldcat TYPE  slis_t_fieldcat_alv,
      fs_fieldcat LIKE
             LINE OF t_fieldcat.
    *START-OF-SELECTION
    START-OF-SELECTION.
      PERFORM get_data_sflight.            " Getting data for display
      PERFORM create_field_cat.            " Create field catalog
      PERFORM alv_display.
    *&      Form  create_field_cat
          Subroutine to create field catalog
          There is no interface paramete
    FORM create_field_cat .
      PERFORM fill_fieldcat USING   'Carrier Id'    'CARRID'   '2'.
      PERFORM fill_fieldcat USING   'Connection No' 'CONNID'   '1'.
      PERFORM fill_fieldcat USING   'Flight Date'   'FLDATE'   '3'.
      PERFORM fill_fieldcat USING   'Maxm.Seats'    'SEATSMAX' '4'.
      PERFORM fill_fieldcat USING   'Seats Occ'     'SEATSOCC' '5'.
    ENDFORM.                                    "create_field_cat
    *&      Form  fill_fieldcat
          Subroutine to fill data to field column
         -->p_seltext      Column label
         -->p_fieldname    Fieldname of database table
         -->p_col_pos      Column position
    FORM fill_fieldcat  USING
                        p_seltext    LIKE fs_fieldcat-seltext_m
                        p_fieldname  LIKE fs_fieldcat-fieldname
                        p_col_pos    LIKE fs_fieldcat-col_pos.
      fs_fieldcat-seltext_m  = p_seltext.
      fs_fieldcat-fieldname  = p_fieldname.
      fs_fieldcat-col_pos    = p_col_pos.
      APPEND fs_fieldcat TO t_fieldcat.
      CLEAR fs_fieldcat.
    ENDFORM.                    " fill_fieldcat
    *&      Form  get_data_sflight
          Subroutine to fetch data from database table
          There is no interface parameter
    FORM get_data_sflight .
      SELECT carrid
             connid
             fldate
             seatsmax
             seatsocc
        FROM sflight
        INTO TABLE t_sflight
       WHERE carrid IN s_carrid.
    ENDFORM.                    " get_data_sflight
    *&      Form  alv_display
          Subroutine for ALV display
          There is no interface parameter
    FORM alv_display .
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          it_fieldcat   = t_fieldcat
        TABLES
          t_outtab      = t_sflight
        EXCEPTIONS
          program_error = 1
          OTHERS        = 2.
      IF sy-subrc NE 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " alv_display
    End of code

  • Using an NDS statement for a SQL stament run only once in a proceudure

    Hi,
    We're using Oracle 11.1.0.7.0.
    I'm going through code written by someone else. In this package they're using NDS for every SQL call whether it gets called multiple times or just once. Is that a good thing?
    I thought NDS was only reserved for SQL statements that get called over and over again in a procedure with possible varying 'WHERE clause' variables and so on...
    Is there ANY benefit to using NDS for SQL queries called only once in a procedure?
    Thanks

    There is no benefit unless you want to turn PL/SQL into SQL*Plus (parse once, run once)
    Procedures exist to make sure : parse at compile time, run many times.
    The code is shooting itself in its own foot.
    Or the developer must have got hold of Tom Kyte's unpublished one chapter book 'How to write unscalable applications'.
    Sybrand Bakker
    Senior Oracle DBA

  • I am traveling in Chile, South America. I purchased an Entel sym card and I can make and receive phone calls, but the internet only works on WiFi. Do I need to region unlock or what? I willl only be here for A month and a half so I don't want to buy a pho

    I am traveling in Chile, South America. I purchased an Entel sym card and I can make and receive phone calls, but the internet only works on WiFi. Do I need to region unlock or what? I willl only be here for A month and a half so I don't want to buy a phone. Any suggestions?

    Most of the current Apple Intel based computers are comparable in CPU speed. I don't think it is so much the model of laptop as it is the memory, and storage capacity of the machine. If you are going to use FCP on a regular basis, perhaps as a professional or semi-professional, then you should think about the maximum memory and a very large capacity internal disk drive. For instance, one hour of finished compressed video will take up about 1.5 to 2Gbytes of disk space. If you add up the raw footage and still imagery and audio, you'll use up your disk drive capacity real quick. So a hard disk on the order of 750Gbytes @ 7200rpms might be good for video editing. 5400RPMs might be slow to rendering times. Rendering a video might take up a lot of memory so more memory is better e.g. 8Gbytes.
    As a rule of thumb, once you get to about 80% of your disk drive or memory you'll see degradation of performance.
    You can check out macsales.com. THey have a menu system that will allow you to pick and choose from various alternatives. BTW, it's been said that although Macs are typically spec'd at a certain memory size, macsales.com found that Apple computers will actually support higher memory levels. That is, if 4Gbytes are spec'd, some machines support 6Gbytes. macsales.com will provide the guidance for you.
    You might also consider buying an external disk e.g. 500Gbytes to carry around with you for back-up or transport to another machine.

  • Read config file only once for beans

    I want to read onfiguration file Myconfig.cfg with many global values (server IP, port, database URL, pages, etc) I'm using a bean but every time a JSP or servlet create an instance of that bean all the data has to be read form disk...
    I know that if I put the code for reading the file in the init() method in a servlet it is called only once, but how do I read those values from another servlet or JSP, ???
    What is the best solution...

    You can put initiation parameters in your web.xml file and write a servlet that is called on startup. Once the values are read you can put them into the application scope. (i.e. application.setAttribute("jdbcUrl", jdbcUr); )
    Then in your JSP pages you can take them out by using the application.getAttribute("jdbcUrl"); method.

  • How do I make something happen only once on a true condition in a loop

    So I have a way of doing this, but it uses a dreaded local variable, and seems to me that it might be unreliable.
    What I want to happen is to have something happen only once on a condition that will remain true. What I need is to set something after a given amount of time, but I only want to set it once after that time has been reached. Problem is, if I use a range, it could be true more than once, if I use a greater than, it'll be true every time after the set time, and if I use an equal, there's no way to know that the particular millisecond value will even appear in the loop.
    Maybe I'm wrong in even using those comparison functions... Any ideas would be greatly appreciated. See the attached vi for a better look at what I'm trying to do... (v7.0)
    Thanks,
    Geoff
    Attachments:
    Question.vi ‏16 KB

    The "Idle" state that the help file refers to is the "non-running"
    state. The Top Level VI must end execution before any "First Time" VIs will
    return TRUE after being called initially.
    Therefore, if your application calls a subVI at the beginning of the
    Test portion, on the next iteration of the loop it will return FALSE
    from that subVI, since your main VI never stopped running, and received
    a TRUE from the "First Time" on the initial test loop.
    If you have code that you want to execute only on the first run of your
    entire program, "First Time" should work fine. If you have code that
    you only want to execute on the first iteration of just the Test loop,
    the "First Time" VI is not ideal.
    I think that shift registers are going to provide the best solution,
    however you mentioned that for your particular application that is not
    ideal. Could you describe a little bit more why shift registers are
    problematic?
    Thanks Geoff, let us know.
    DWeiland
    Applications Engineer
    National Instruments
    www.ni.com/support
    Dan Weiland

Maybe you are looking for

  • Changing a user name

    I've just got a used MacBook Pro and when I open Users folder it's got a user called "greg" with the little home icon. It contains the usual folders: Pictures, Documents, Library, Music etc. , It's not listed on the accounts page of system preference

  • How to make a menu for HD content (not BD)

    I am a newbie on this forum and I am not sure where to post: I am a middle-aged woman with blond (grey) hair (**** happens) BUT I have been 'playing around' with computers since 1977. I have been editing video and audio since the 90's and mainly as a

  • JIttery final product

    I guess I'm not really sure if this should go here or in the iDVD spot, since I don't know what the problem is, but here it goes. I did a project in FCE 4, exported it, the .mov files looks great, run smooth, the whole nine yards. I threw them into i

  • RMS capacity on midlet

    Whats the RMS capacity of a midlet in terms of kilo bytes ?

  • Should i update ios 6 on my iphone 4s?

    Could anyone tell me that did you update os 6 successfully? Seems like there is a lot of people got many bugs issue regarding of the update. Maybe i just wait for the next update os 6.1 from apple? Pls advise. Thank you.