Dynamically determining a binding

Hi All,
Much progress has been made with scripting since my last post as we have successfully used formcalc to determine the visibility of subforms, the colour of borders and so on!
Although now we are once again stuck!
We have a table on a purchase order and the description and item lines must be bound to one structure if the purchase order is of type 'NB' else it should be bound to a different structure.
The PO type is determined by the CHAR2 value in 'HEADER-BSART'.
when you create a floating field to bind a structure to, it appears in the hierachy as a 'textfield' symbol. when this item is selected you are able to add a script to it, but we are unsure as to what to put in the script, or even, which part of the processing sequence to attach it to, ie, intialize, calculate, form:ready etc.
My guess would be something like:
if ($record.HEADER.BSART == "NB")
then ITEM.??????? = <data structure1>
else ITEM.??????? = <data structure2>
ENDIF
//where ITEM is the name of the textfield thats bound structure is dependent on the value of BSART.
Any ideas?
Thanks!

Hi,
Try ITEM.rawValue = <Value to be assigned>
Ashutosh

Similar Messages

  • Is there a way to dynamically determine the number of out parameters for a server side procedure?

    Hi,
    Below is a helper method used for calling a server-side function which loops through the inbound bindVars parameter to populate the function's IN parameters. Is there a way to dynamically determine the IN/OUT parameters based on the procedure name in the stmt parameter? No members of the CallableStatement class seemed promising, but the getParameterMetaData() method in the PreparedStatement class seemed like it could be helpful lead. However, I have not found any detailed descriptions (yet) of how to use it.
    protected Object callStoredFunction(int sqlReturnType, String stmt,
      Object[] bindVars) {
      CallableStatement st = null;
      try {
      // 1. Create a JDBC CallabledStatement 
      st = getDBTransaction().createCallableStatement(
      "begin ? := "+stmt+";end;",0);
      // 2. Register the first bind variable for the return value
      st.registerOutParameter(1, sqlReturnType);
      if (bindVars != null) {
      // 3. Loop over values for the bind variables passed in, if any
      for (int z = 0; z < bindVars.length; z++) {
      // 4. Set the value of user-supplied bind vars in the stmt
      st.setObject(z + 2, bindVars[z]);
      // 5. Set the value of user-supplied bind vars in the stmt
      st.executeUpdate();
      // 6. Return the value of the first bind variable
      return st.getObject(1);
      catch (SQLException e) {
      throw new JboException(e);
      finally {
      if (st != null) {
      try {
      // 7. Close the statement
      st.close();
      catch (SQLException e) {}
    James

    The PreparedStatement.getParameterMetaData() object is exactly what you need for this task.
    Once you have the ParameterMetaData you can ask it how many parameters are present and which mode they are. The parameters are numbered from 1 to n and you can use ParameterMetaData.getParameterMode(1); to get the mode of the 1st parameter. The modes are defined as static values in the ParameterMetaData object. Check out the doc at http://docs.oracle.com/javase/7/docs/api/java/sql/ParameterMetaData.html
    Timo

  • Dynamically changing form binding

    Hi,
    I would like to dynamically change the binding variable (bind.ref) of a subform during runtime based on a "change event" triggered by a single/multiple selection in a list box, contained in a different subform.
    List box A is part of subform A, during completion of the form, the user selects one or more entries from list box A and triggers a "change event". Based on this event a table, part of subform B, is filled with entries that depend on the users selection in the list box. The rows in this table are determined by the "bind.ref" value of subform B. That means, dependent on the list box selection "bind.ref" will be assigned with a different array, that is also constructed at runtime.
    Before asking for hints to a possible solution, I would like to know whether it is possible in general to change the binding of a subform dynamically (so not in the "initialize event" as in Daniel's case), based on a "change event" triggered by a list box selection?
    Regards,
    Franz

    Hi radzmar,
    Thanks for the reply, much appreciated.
    I also found out more on that topic under another adobe forum post:
    http://forums.adobe.com/message/3607404#3607404
    So, yes it seems the binding of for instance a list box can't be modified once it's set.
    I finally solved my issue by making subforms 'hidden' or 'visible' dependent on the items selected in a list box. This worked reasonably well.
    Cheers,
    Franz

  • How to dynamically determine Receivers within BPM

    I’m trying to design a way to determine my receivers within my BPM process during runtime.   My Scenario is as follows:
    SAP IDOC
        V
      XI
                 XI uses JAVA Mapping MT1 to determine vendors and if customer receives PIDX
                             JAVA Mapping MT2 to creates the PIDX output file if required
      V
    SENDs to required Vendor (PIDX if required otherwise email)
    My problem is how to dynamically determine the appropriate receiving vendor for my PIDX.
    I can not use the condition editor on the standard Receiver Determination because the output message (PIDX) doesn't have specific enough information to determine the vendor.
    Other than the customer number there are no other values and we don't want to use customer number because each vendor can have multiple customer numbers (hundreds).
    I've tried various attempts but none seem to work.  This could also be because I have limited knowledge of BPMs and this is my first complex development.  Below are the different attempts I've made at dynamically determining the receiver.  Any input would be appreciated.
    Receiver Scenario 1 
      I developed an interface mapping with MT1 as input and the SAP Receiver Determination as output.  The problem is for me to use this, the interface mapping had to reference the PIDX output (MT2 instead of MT1) which has no data that I can use to determine the receiver.
    Receiver Scenario 2
    I added a receiver step right before my send step and used the receiver list.  This appears to send the PIDX to everyone in the list and there is no way to evaluate or eliminate a name from the list. 
    Receiver Scenario 3
    I created a context object in the Integration Builder and assigned it to a field in MT1.  I then added a switch step with a branch for each vendor.  Within each specific branch there is a Send step that has the context object name I created in the "Send Context" field.  However, on the configuration side I’m unable to access the context object which I created on the design side.  Whenever I open the condition editor and select the radiobutton for "Context Object" the list  does not include the context object I created in the Integration Builder.

    Hi,
    Try using the enhaced receiver determination concept.
    Maybe based on certain field values you can write a UDF which calculates the receiver.
    Try this Blog out
    Link : [
    http://help.sap.com/saphelp_nw70/helpdata/en/43/a5f2066340332de10000000a11466f/frameset.htm]
    Regards,
    Abhishek
    Award if helpful.

  • Dynamically change the Binding of a view object

    I want to reuse a panel several times in my application. The VO has one bind parameter (:1). The same panel should be reused several times with different bind variables.
    I found a technical note concerning this issue called: How to Dynamically Change the binding of a View Object to a JClient Panel. This works for JDeveloper 9i but not for JDeveloper 19g. Does anybody know how to dynamically change the binding in JDeveloper 10g

    You may use bindRowSetIterator() and pass in a custom fetched ViewObject or a RowSetIterator to the iterator binding that is displayed in your panel.

  • Dynamic determination of IDOC

    Hi,
    I have a scenario wherein based on a particular KeyField, I need to dynamically determine the IDOC.  I haven't used BPM before and I don't know whether this scenario is feasible using BPM.
    My approach is creating a data type for the source which will have common fields of both the IDOCs.  This data type will hold the data sent by the sender system.  Thereafter, I would create 2 message interfaces for each IDOC.  Subsequent Message Mapping and Interface Mapping will also be done.  In BPM based on the KeyField, I will determine the Message Interface dynamically and post it to the target system.
    Kindly advice whether the above approach is right.  Is this scenario possible without using BPM.  If so, kindly suggest how to proceed.
    Thanks in advance.
    Bala

    Hi Kumar,
    Is there any possibilites of coming both the idoc data ? If so, you can do as following.
    As you are going to execute 1:N mapping, it is required to have BPM here. (and one more reason is Idoc adapter is not a part of J2EE engine.)
    <i>Is this scenario possible without using BPM</i>
    >>>If it is not of above case, then you can make use of conditional Interface determination , you can try without BPM
    Hope this helps,
    Regards,
    Moorthy

  • Dynamic Determination of Logical System- Transaction Launcher

    Hi Friends,
    Need your suggestions and inputs on how to dynamically determine the logical system for the transaction launcher.
    Our system landscape is like this.
    We have one CRM connected to mulitple back end ECC Boxes. Currently, we have created separate TL's fo VA01 ( One each for each back end application ) and provided the same in logical link and controlled the same via business role.
    For eg: BROLE1 - LLINK1  having (TL VA01) pointing to ECC System1
    BROLE2 - LLINK2  having (TL VA01) pointing to ECC System2
    BROLE3 - LLINK3  having (TL VA01) pointing to ECC System3
    The above procedure is working fine. But what we are trying to do is, when the end user clicks on the TL link in WEB UI, Based on the assigned business role, it should dynamically determine the back end system and open the VA01 Screen in that system.
    I have activated indicator multiple systems in the customizing of mapped logical systems.
    In debugging mode, i have tried changing the LOGSYS value @ run time in the handler class.
    Any pointers on this would be of great help.
    Thanks,
    Madhu

    Hi,
    Try this..
    To maintain RFC destination in each business role, there is one functional profile  "ERP_SALES_ORDER" where in you can maintain respective rfc destination.
    Create z-functional profile's for "ERP_SALES_ORDER" and maintain corresponding rfc destination, later assign these erp sales order function profiles in respective business roles trxn (CRMC_UI_PROFILE).
    you can use the below statement to fetch rfc destination whcih assigned to business role via functional profile.
      If gv_rfc is INITIAL.
        gv_rfc = CL_CRM_IC_ERP_SERVICE=>GS_ERPPROF-RFCDEST.
      ENDIF.
    Hope this helps.
    Cheers,
    Sumit Mittal

  • Dynamically determine location for a file relatively to current CLASSPATH

    Hi All,
    I am quite new to Java and I have a problem.
    I am trying to write a program that can dynamically determine the location of a file (the class that handles this will only have the relative path/file name).
    Eg.
    File f = new File(config/MyMainCfg.file);
    The class will then need to be "smart" enough to locate the file "config/MyMainCfg.file" in relative to the current CLASSPATH.
    Hence, if the current CLASSPATH is /usr/local/myclasspath, then the file should be able to be located at "/usr/local/myclasspath/config/MyMainCfg.file".
    My main question is:
    (1) If the CLASSPATH contains multiple values (i.e. CLASSPATH=path_1:path_2:path_3), how do I correctly determine the current CLASSPATH that the currently executing program is using?

    I have a method that does something like that. A few lines of it below:
       // Get location class loaded from
       public final static String getHomeLoc(Object obj, String className) {
            URL ourLoc = obj.getClass().getResource(className);
           ... code gets ourLoc.toString()  and parses it.
    // Called by:
         String loc = getHomeLoc(this, "MyClassname.class");

  • XI - Dynamically Determine System Details in User Functions

    Hello.
    Does anybody know how to dynamically determine the logon information for the statement JCO.Client mConnection = JCO.createClient() from a user defined function in XI? 
    Within a mapping I have written a user defined function to call a function module on ECC but as the system details are 'hard-coded' the incorrect system is called once the interface is promoted from the DEV system. I am not able to modify the user function code for each system as we transport the interfaces between systems which are locked and as such code the builder objects cannot be modified .  I desperately need a method of determining which logon details should be used and I would prefer the solution to be within the user defined function.
    User defined function code:
    JCO.Repository mRepository;
    // Change the logon information to your own system/user
        JCO.Client mConnection = JCO.createClient(
                "300",         // SAP client   
                "pi_jco_rfc",        // userid
                "ecd4adrt",       // password
                "EN",          // language
                "adrp560dev1",        // host name
                "10" );        // system number                     
    // connect to SAP
    mConnection.connect();
    // create repository
    mRepository = new JCO.Repository( "SAPLookup", mConnection );
    // Create function
    JCO.Function function = null;
    IFunctionTemplate ft = mRepository.getFunctionTemplate("ZPI_DETERMINE_STORE_FROM_SITE");
    function = ft.getFunction();
    // Obtain parameter list for function
    JCO.ParameterList input = function.getImportParameterList();
    // Pass function parameters
    input.setValue( site[0] , "IM_WERKS" );
    mConnection.execute( function );
    String ret = function.getExportParameterList().getString( "EX_VLFKZ" );      
    mConnection.disconnect();
    result.addValue(ret);
    Any ideas gratefully accepted.

    Darren,
    Why are you using JCOs directly? It is not advisable to do so. You can/have to use the RFC Lookup API to achieve this.
    Have a look at Michal's article about this.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
    Regards,
    Jai Shankar

  • Dynamically change the binding of a field

    Hi,
    I've been looking all over the internet for 2 days to find the answer to my question, but I couldn't get any information on my problem. Here's what i'm trying to do :
    Based on a checkbox in my form, I want to export or I don't want to export a field to a XML document.
    My checkbox is working properly and I got the Send button with the XML working too. I only need to find a way to dynamically change the binding property of my field. I've read some informations with the ".bind.match", but I can't seem to make it work.
    I'm using Windows XP, LiveCycle Designer ES2 v.9.0 and I have to run the form in Reader 8.0.
    Thanks alot for your help, it's greatly appreciated.
    Jonathan

    Hi,
    the binding cannot be changed at runtime.
    You can use the checkbox to delete the value of the field so the exported xml contains an empty tag.
    Or you try to delete the data node of the desired field in the data DOM (xfa.datasets).

  • Dynamically determining the port number of a deployed application

              Hi
              How do I dynamically determine the port number of a deployed web application ?
              I know HttpRequest.RequestURL() returns us the entire URL but I wanted to just
              know the port number .
              Is there any API do that ??
              Thanks
              Kar
              

    kar piyush wrote:
              > Hi
              >
              > How do I dynamically determine the port number of a deployed web application ?
              > I know HttpRequest.RequestURL() returns us the entire URL but I wanted to just
              > know the port number .
              >
              > Is there any API do that ??
              >
              kar,
              Here's what I do under WL 7 SP2:
              import javax.management.AttributeNotFoundException;
              import javax.management.DynamicMBean;
              import javax.management.MBeanException;
              import javax.management.ReflectionException;
              import javax.naming.Context;
              import javax.naming.NamingException;
              import weblogic.jndi.Environment;
              import weblogic.management.MBeanHome;
              String domainName,
              serverName,
              serverPort,
              serverUrl;
              // Getting the initial context
              Environment env = new Environment();
              try
              Context ctx = env.getInitialContext();
              if (ctx == null)
              // unable to retrieve a JNDI context
              return;
              // Retrieving the server-specific MBeanHome interface
              MBeanHome home =
              (MBeanHome) ctx.lookup(MBeanHome.LOCAL_JNDI_NAME);
              if (home == null)
              // unable to retrieve the local server MBean
              return;
              // Get the domain & server name
              domainName = home.getDomainName();
              serverName = home.getMBeanServer().getServerName();
              // The server port and address are a little trickier to extract...
              Object mbeanArray[] =
              home.getMBeansByType("ServerConfig").toArray();
              DynamicMBean mbean = (DynamicMBean) mbeanArray[0];
              try
              serverPort =
              Integer.parseInt(
              mbean.getAttribute("ListenPort").toString());
              serverUrl =
              mbean.getAttribute("ListenAddress").toString();
              catch (AttributeNotFoundException thrown)
              // caught a AttributeNotFoundException
              catch (MBeanException thrown)
              // caught a MBeanException
              catch (NullPointerException thrown)
              // caught a NullPointerException
              catch (ReflectionException thrown)
              // caught a ReflectionException
              catch (NamingException thrown)
              log.debug("caught a NamingException", thrown);
              

  • Dynamically determining the number of cols in Select stmt

    Hi,
    I was wondering if it is possible to dynamically determine the number of cols in Select stmt.
    For example:
    If it had:
    Select empno, lname from emp where empno = 32
    then I'd like it to return 2.
    Thanks in advance.
    Sincerely,
    Nikhil Kulkarni

    Hi,
    I was wondering if it is possible to dynamically determine the number of cols in Select stmt.
    For example:
    If it had:
    Select empno, lname from emp where empno = 32
    then I'd like it to return 2.
    Thanks in advance.
    Sincerely,
    Nikhil Kulkarni

  • Dynamic sql and bind variables

    Hi,
    I have a stored procedure which filters a table on 5 five columns. The filters come from the input parameters,
    and these 5 parameters can come in any combination, I mean some of them may be null and some of them may not be null.
    So I constructed the where filter of the query with IF blocks like the following:
    dynamic_query := 'select * from TESTTABLE where 1= 1';
    IF (P1 is not null) THEN
    dynamic_query := dynamic_query || ' AND column1 = :1';
    END IF;
    IF (P2 is not null) THEN
    dynamic_query := dynamic_query || ' AND column2 = :2';
    END IF;
    IF (P3 is not null) THEN
    dynamic_query := dynamic_query || ' AND column3 = :3';
    END IF;
    IF (P4 is not null) THEN
    dynamic_query := dynamic_query || ' AND column4 = :4';
    END IF;
    IF (P5 is not null) THEN
    dynamic_query := dynamic_query || ' AND column5 = :5';
    END IF;
    OPEN CUR_OUT FOR dynamic_query USING P1, P2, P3, P4, P5;
    The problem is how can I construct the USING and bind parameters, I cannot use "USING P1, P2, P3, P4, P5" because some of bind variables
    may not be in dynamic query if the input parameters are null. Is there a way to overcome this problem without writing all the 2 ^ 5 combinations?
    Any help is greatly appreciated.

    here it is in the Tomer Cohen way:
    IF (P1 is not null) THEN
    dynamic_query := dynamic_query || ' AND column1 = :1';
    ELSE
    dynamic_query := dynamic_query || ' AND  :1 IS NULL';
    END IF;
    IF (P2 is not null) THEN
    dynamic_query := dynamic_query || ' AND column2 = :2';
    ELSE
    dynamic_query := dynamic_query || ' AND  :2 IS NULL';
    END IF;
    IF (P3 is not null) THEN
    dynamic_query := dynamic_query || ' AND column3 = :3';
    ELSE
    dynamic_query := dynamic_query || ' AND  :3 IS NULL';
    END IF;
    IF (P4 is not null) THEN
    dynamic_query := dynamic_query || ' AND column4 = :4';
    ELSE
    dynamic_query := dynamic_query || ' AND  :4 IS NULL';
    END IF;
    IF (P5 is not null) THEN
    dynamic_query := dynamic_query || ' AND column5 = :5';
    ELSE
    dynamic_query := dynamic_query || ' AND -1 = :5';
    END IF;
    OPEN CUR_OUT FOR dynamic_query USING P1, P2, P3, P4, P5;Amiel Davis

  • Report with dynamic order by (binding of parameter)

    hy,
    my problem is the following:
    i want to let the user customize the ordering of a portal report.
    but the binding does not really work, the bind variable seems to
    have no effect in the order by clause.
    code sample:
    select * from SCOTT.EMP order by :p_order
    then, portal gets the right value for the parameter:
    :p_order binding with HIREDATE
    but: this results in an emp table sorted by the empno.....
    and not by the hiredate
    do you have any ideas how to get this working ???
    thanx, martin allhoff

    Hi, the way to do this is to pass in a different set of
    parameters. Try not using the :bind parameter in the report
    query, but instead, call your report like this:
    http:// ... /pls/portal30/Schema.report.show?
    p_arg_names=_ORD_BY_COL&P_arg_values=HIREDATE
    then try calling
    http:// ... /pls/portal30/Schema.report.show?
    p_arg_names=_ORD_BY_COL&P_arg_values=EMPNO
    to see if indeed it is dynamically selecting the order by clause
    based on the info passed in. Also, check my syntax, I cant
    remember if ORDBY_COL is correct or not. But any possible
    options should be listed for you in the "Display Call Interface"
    screen for the report.

  • Dynamic determination of VALUES of an Attribute in a Mail-form

    Hi All,
    We have created a Mail Form with ceratin attributes. We have assigned a target group to a campaign.
    now, the requirement is to determine the VALUES of the attributes dynamically for the BPs in the target groups.
    please help me what should be done to meet this rquirement.

    Hi there,
    I believe the following link demostrates the whole process including your requirements:
    [http://wiki.sdn.sap.com/wiki/display/CRM/NavigationtotheCRMUIComponentfromMailFormorSmartFormsHyperLink|http://wiki.sdn.sap.com/wiki/display/CRM/NavigationtotheCRMUIComponentfromMailFormorSmartFormsHyperLink]
    Please reply if this helps.
    Regards,
    Vinamra.

Maybe you are looking for

  • How to get one character at a specified index and put it in a mutablestring

    I am new in cocoa programing and i am stock. I am trying to get a character in a NSString and i want to put it in a NSMutableString with the command appendString. For now it's not working. I try with different approach but i didn't find the right way

  • How do I add album art like I did with previous version of itunes?

    I could easily drag and drop my album art into the window in the lower left album art viewer in the previous version of Itunes. Please bring this back!!!!

  • Integrating Portal and BI Systems

    Hi All, I am having an error on integrating Portal and BI systems. In Portal, when i navigate to the respective iview, i am being asked for my user name and password in a popup box (for the Web As server of the portal). After entering my password thr

  • Get Info Panel Information

    Hi All, How can we get info panel characters count using indesign javascript. We can get characters count using below code: app.selection[0].characters.length But if the document is xml document then it includes each xml tag as one character. I want

  • Can not transfer pictures from iPhoto on my MacBook Air to any of my devices via airdrop.

    Can not transfer pictures from iPhoto on my MacBook Air to any of my devices via airdrop. I have a new iPad Air 2 and a iPhone 5 all running the newest updates and IOS,OS X. I can airdrop from my iPhone to iPad and vice versa.  But iPhoto on my macbo