Defining component use at runtime?

Hi Developers,
Is it possible to define the component usage at runtime with WD4A ?
I would need to programmatically define or change the COMPONENT ("class" and not interface to use) at runtime.
Then I would create an instance of this component (which I know how to perform).
I would then need to be able to map some controllerinterface context of the newly defined component to my current controllerinterface context.
Does it sounds possible?
Sincerely,
Olivier MATT
Message was edited by:
        Olivier Matt

Hi Oliver,
That's possible. Just let your component usage point to an interface. While creating an instance of a component for this component usage, dynamically specify the actual component to be used. Of course, the component needs to implement the component interface.
Best regards,
Thomas
P.S: There's also the possibility to use ComponentUsageGroups, but this is a highly dynamic thing for which you will lose all workbench support. Hence, it's only advised to use it in very special cases.

Similar Messages

  • How to create multiple component instances at runtime using java

    Hi,
    I need to create component instances at runtime using java.I found ComponentSet.add method.But I am not finding a way to get handle of ComponentSet.
    I see methods with params of IRuntimeNode.But how to get ComponentSet from IRuntimeNode.
    If anybody knows or have sampel code then please share with me.
    thanks,
    ashok

    Ashok --
    This is a common challenge for those using Configurator Extensions with multiple instantiation for the first time. The problem is that the CIO's representation of the structure for multiply-instantiable Components differs slightly from what both Configurator Developer users and Configurator Runtime users see in those respective applications. Multiply-instantiable Components are not direct children of the Model in which they're defined. Internally, there is an entity that sits between the parent Model and the instantiable Components; that intermediate entity is the ComponentSet object you've found in the CIO documentation.
    If the name of your multiply-instantiable Component is "My Component", then its ComponentSet may be accessed simply by calling getChildByName("My Component") on its parent Model; a List of the instantiated Components may be accessed with the ComponentSet's getChildComponentNodes() method, and instances may be added and deleted using its add() and delete() methods.
    Hope this helps.
    Eogan

  • Define table type on runtime...Getting Error..

    My requirement is to
    I am trying to define table type on runtime. i.e. ortf_in_table_tbl{noformat}({noformat}i).field_position_rec.ortf_segment_field_name in below code.
    But when I am executing below code and getting below error:
    DECLARE
       CURSOR field_position_cur (p_table_name VARCHAR2)
       IS
          SELECT xosf.field_name, xosf.starting_position, xosf.field_length
            FROM record_types xort, record_segments xors, segment_fields xosf
           WHERE xort.record_type_id = xors.record_type_id
             AND xors.record_segment_id = xosf.record_segment_id
             AND xosf.table_name = p_table_name;
       CURSOR raw_data_cur
       IS
          SELECT *
            FROM raw_data;
       TYPE raw_data_typ IS TABLE OF raw_data_cur%ROWTYPE
          INDEX BY BINARY_INTEGER;
       TYPE table_typ IS TABLE OF emp%ROWTYPE
          INDEX BY BINARY_INTEGER;
       table_tbl      table_typ;
       raw_data_tbl   raw_data_typ;
    BEGIN
       OPEN raw_data_cur;
       LOOP
          FETCH raw_data_cur
          BULK COLLECT INTO raw_data_tbl;
          EXIT WHEN raw_data_tbl.COUNT = 0;
          FOR i IN raw_data_tbl.FIRST .. raw_data_tbl.LAST
          LOOP
             FOR field_position_rec IN field_position_cur ('EMP')
             LOOP
                table_tbl (i).field_position_rec.field_name :=
                   SUBSTR (raw_data_tbl (i).raw_line_text,
                           field_position_rec.starting_position,
                           field_position_rec.field_length
                DBMS_OUTPUT.put_line
                        (   'table_tbl (i).field_position_rec.field_name '
                         || table_tbl (i).field_position_rec.field_name
             END LOOP;
          END LOOP;
       END LOOP;
       CLOSE raw_data_cur;
    FORALL i IN table_tbl.FIRST .. table_tbl.LAST
          INSERT INTO emp
               VALUES (table_tbl (i)
       COMMIT;
    EXCEPTION
       WHEN OTHERS
       THEN
          DBMS_OUTPUT.put_line ('OTHERS ' || SQLERRM);
    END;
    **ORA-06550: line 61, column 52:**
    **PLS-00302: component 'FIELD_POSITION_REC' must be declared**
    **ORA-06550: line 54, column 13:**
    **PL/SQL: Statement ignored**Here field_position_cur is giving me column name for the EMP table (i.e. field_position_rec.field_name) and field_position_cur is giving start and length to derive value of the that column
    i.e.
    SUBSTR (raw_data_tbl (i).raw_line_text,
                           field_position_rec.starting_position,
                           field_position_rec.field_length
                          )But it is giving me error. We are on 10g database.
    Please suggest the solution to it.
    Edited by: BluShadow on 12-Jan-2012 08:21
    added {noformat}{noformat} and other tags to make it readable.  Please read {message:id=9360002} and learn to do this yourself.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    piyushgupta wrote:
    My requirement is to
    I am trying to define table type on runtime. Please explain - it is not clear from the code what you are attempting.
    Also note that PL/SQL is strong typed language. This mean that you cannot define a variable using a weak type and at runtime change that into a formal data type.
    In Oracle, the abstract AnyData data type can be used for unknown data types - and methods exist that allows different data types to be stored and retrieved as AnyData types. Of course, there are overheads involved in using an abstract data type (implemented as an object class) like this.
    Another method is to use DBMS_SQL to create dynamic code (SQL or PL/SQL) - and perform dynamic binding (the bind determines the data type of the bind variable in the code). If the dynamic code is a SQL select, the describe interface enables you to determine the content (columns and data types) of the SQL projection.
    The final method that comes to mind is using a RTTI (Run Time Type Information) interface - something that is also supported by Oracle (and basically the backend implementation of answering a describe interface call). This is however a bit more complex and quite specialised and needs a very unique problem to justify it being used.

  • Creating a user defined control using java Beans

    Hi,
    I want to create a user defined control which is used to draw a line ...
    same as we using in VB as Line control.In java we will create the component using using Beans . I created a code
    which will draw a line in the run time .For tat i extend the class with JPanel,but i cant use the same program in beans....b'coz it simply draws the jpanel when we drag and drop that control in the form....
    so can u give me some ideas to create a control which is used to draw a line .....i am attaching the same which i did .....
    thank u in advance...
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import javax.swing.*;
    import javax.swing.event.*;
    public class Line extends JPanel
    BufferedImage image;
    Color color;
    Stroke stroke;
    Point start = new Point();
    Point end = new Point();
    public Line()
    color = Color.blue;
    stroke = new BasicStroke(1f, BasicStroke.CAP_BUTT,
    BasicStroke.JOIN_MITER);
    protected void paintComponent(Graphics g)
    super.paintComponent(g);
    if(image == null)
    initImage();
    g.drawImage(image, 0, 0, this);
    // Draw temp line over image.
    Graphics2D g2 = (Graphics2D)g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
    RenderingHints.VALUE_ANTIALIAS_ON);
    g2.setPaint(Color.red);
    g2.drawLine(start.x, start.y, end.x, end.y);
    public void setTempPoints(Point p1, Point p2) {
    start = p1;
    end = p2;
    repaint();
    public void draw(Point p1, Point p2)
    Graphics2D g2 = image.createGraphics();
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
    RenderingHints.VALUE_ANTIALIAS_ON);
    g2.setPaint(color);
    g2.setStroke(stroke);
    g2.drawLine(p1.x, p1.y, p2.x, p2.y);
    g2.dispose();
    start = end;
    repaint();
    private void clearImage()
    Graphics g = image.getGraphics();
    g.setColor(getBackground());
    g.fillRect(0, 0, image.getWidth(), image.getHeight());
    g.dispose();
    repaint();
    private void initImage()
    int w = getWidth();
    int h = getHeight();
    image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
    Graphics2D g2 = image.createGraphics();
    g2.setPaint(getBackground());
    g2.fillRect(0,0,w,h);
    g2.dispose();
    public static void main(String[] args)
    Line wbclient = new Line();
    DrawingListener listener = new DrawingListener(wbclient);
    wbclient.addMouseListener(listener);
    wbclient.addMouseMotionListener(listener);
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().add(wbclient);
    f.setSize(400,400);
    f.setLocation(200,200);
    f.setVisible(true);
    class DrawingListener extends MouseInputAdapter
    Line wbclient;
    Point start;
    Point end;
    final int MIN_DIST = 5;
    public DrawingListener(Line fh)
    this.wbclient = fh;
    public void mousePressed(MouseEvent e)
    start = e.getPoint();
    public void mouseReleased(MouseEvent e)
    end=e.getPoint();
    if(start.distance(end) > MIN_DIST)
    wbclient.draw(start, end);
    public void mouseDragged(MouseEvent e)
    wbclient.setTempPoints(start, e.getPoint());
    }

    Hi Ravi,
    How about something like this:
    IUserMaint user = UMFactory.getUserFactory().newUser("myNewUser");
    user.setFirstName("1st Name");
    user.setLastName("2nd Name");
    user.setEmail("[email protected]");
    user.save();
    user.commit();
    IUserAccount uacc = UMFactory.getUserAccountFactory().newUserAccount("myNewUser", user.getUniqueID());
    uacc.setPassword("initial");
    uacc.setPasswordChangeRequired(false);
    uacc.save();
    uacc.commit();
    Hope this helps.
    Daniel

  • Define a function at runtime...

    is it possible to define a function at runtime and call it...?
    i.e i have a program thats makes a call to some function xxx() in a class Abc
    but there is no definition for xxx() yet..hence during runtime the user types in the code and compiles it and then can he call the function xxx() from my program....? if so how..
    Thank you

    georgemc wrote:
    corlettk wrote:
    Both languages can be used from within a Java application.But you can't call-back Groovy methods from your java-app, can you?Sure you can! It compiles down to bytecode. Even code-weaving tools like AspectJ work with Groovy. If the OP really does need what he's asking for, Groovy or BeanShell are pretty much exactly what he's looking for. If it's what he really wants
    Have a butcher's hook at [this wackiness|http://groovy.codehaus.org/ExpandoMetaClass+-+Dynamic+Method+Names]
    My goodness me, what will they think of next.
    I do like Groovy, and Jython, and BeanScript already... but I've barely scratched the surface of any of them. Maybe I should... Hmmm...
    Thank you George.
    Slange. Keith.

  • Define the class at runtime?

    Hi,
    is it possible to do something like the following:
        public function readGenericClassEntity(myClass:Class,ac:ArrayCollection):void{
            var entity:myClass=myClass(ac.getItemAt(dataGrid.selectedIndex));
    The part "entity:myClass" gives a compiler error:
         Type was not found or was not a compile-time constant: myClass.
    So is it possible to define the class at runtime?
    Thanks for any pointers!
    Martin Zach

    Hi Jason,
    thank you for your answer, one possible solution.
    I used the solution from:
    http://thillerson.wordpress.com/2007/03/01/runtime-class-instantiation-in-actionscript-30/ #comment-951
    Thank worked fine for me!
    Cheers!
    Martin Zach

  • Navigating from Custom Component to Standard Compoent(IUICCON). Getting Exception "Define Component Usage 'Random Component Usage of Standard component'"

    Hi Everyone,
    We have a requirement to
    Navigate from Custom Component to the Standard Component(IUICCON – Contract
    management) on the basis of some conditions.
    We tried navigating with Manual
    as well Dynamic Navigation. The Navigation is happening properly and the Navigation is completed and we are on the Contract
    Management Screen(Standard component View).
    On the Contract Management
    screen (standard Component view), when we click on New Contract Button; it throws dump stating “Define
    Component Usage IUICOBJ”. After debugging we identified that the issue was with the Parent class/ component is getting changed, because of which the usage was not found.
    Appreciate your help.
    Thanks in Advance.
    Regards,
    Bhavikjp.

    Hi Bhavik,
    Check which is the active enhancement set at the runtime in the component_loading BADI.
    If it is anything other than your enhancement set,Set it to your enhancement set .
    Check if the parameter WCF_IGNORE_ENHANCEMT in Tcode SU01 is set to 'A' for the User.
    Regards JP.

  • AIR runtime and AIR applications built using Captive Runtime still need Admin Privilege to Install

    I am working on a small project to install AIR application(native .exe & .dmg) with AIR runtime without needing the Administrator privilege so I used Captive runtime but the installation is still asking for admin privilege
    I bundled AIR application with AIR runtime using Captive runtime from flash builder 4.6, then I packaged this into a .MSI using Advanced Installer. Now when I install it for a user without admin privilege it prompts me for Admin credentials.
    Can you please tell me if
    1. I need AIR distribution license to install AIR runtime without Admin privilege
    2. Do I need a different installer
    3. Am I missing any step here
    Thank you

    If you're installing to a location where Windows requires elevated privileges, like Program Files, you'll need to have admin privileges to continue.  Are you using an AIR based native installer or have you taken the application with the captive runtime and rolled this up in your own installer?
    Here's a section from the Installation and deployment options in Adobe AIR 3 article that might help:
    Installation privileges
    When designing an installer, one has the option to choose from approaches that may or may not require administrative privilege. For example, a drag-and-drop install on Mac OS X requires no special privilege; users can always copy the application into their own application folders, for which they have the necessary permissions. On the other hand, if registry keys must be written to the machine-specific portion of the registry on Windows, installation of that application will require administrative privilege to do so.
    The two installer formats directly supported by AIR, AIR files and native installers, have always required administrative privilege. This was a design decision made in part to simplify the implementation of the AIR installers: If administrative privilege is assumed to be available, implementation is possible if the registry can be written to, and so on. It was also selected because, in many enterprises, this is the desired behavior: administrators can use the privilege requirement to gate software installation.
    All the same, there are scenarios where supporting installation without requiring administrative privileges is desirable, or even necessary. This can now be achieved using custom installers; you simply need to author an installer that operates correctly with only standard user privilege. In practice this can be easy to achieve; a simple install-by-copy to a writable location (that is, in the user's own folder) will suffice. Should you author a more complex installer, you should keep in mind that the addition of certain operations during the install process will in turn reintroduce the requirement for administrative privileges.

  • Error -5002 when adding linked user defined field using DI API

    Hello,
    When I try to add a linked user defined field using DI API I get the error number -5002 with description:
    "The field 'Related Table' should consist of 8 alphanumeric characters with no valid or default values"
    I Get the error when I use the Add method.
    What is the solution for this problem? I use SBO 2005 A SP1 Patch 18
    The code I use is (.NET C# 2.0):
    SAPbobsCOM.IUserFieldsMD uf = (SAPbobsCOM.IUserFieldsMD)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields);
    uf.Name = "S_BUCO";
    uf.TableName = "OPOR";
    uf.Type = SAPbobsCOM.BoFieldTypes.db_Memo;
    uf.SubType = SAPbobsCOM.BoFldSubTypes.st_Link;
    uf.LinkedTable = "S_BU";
    uf.Description = "Description";
    uf.Add()
    Regards,
    Jeffrey

    Hi Jeffrey,
    Your code above does not match the settings you are using in the UI. In particular, the type and subtype you are setting in code are not correct.
    To create the UDF via code, set the field types as follows:
    SAPbobsCOM.IUserFieldsMD uf = (SAPbobsCOM.IUserFieldsMD)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserFields);
    uf.Name = "S_BUCO";
    uf.TableName = "OPOR";
    uf.Type = SAPbobsCOM.BoFieldTypes.db_Alpha;
    uf.EditSize = 8;
    uf.LinkedTable = "S_BU";
    uf.Description = "Description";
    uf.Add()
    There's no need to set the SubType property as you require a regular alphanumeric field.
    Kind Regards,
    Owen

  • How to call class os functions defined in share/vm/runtime/os.hpp?

    HI. I haven't coded in C for some time, and no experience with JNI
    I dabbled a bit in JNI and creating native functions.
    I would like to know, how can I call Java VM os functions from my own libraries without much hassle? e.g. os::javaTimeMillis(), or os::active_processor_count() ?
    #include "HelloWorld.h"
    JNIEXPORT void JNICALL Java_HelloWorld_sayHi
      (JNIEnv *env, jclass clazz) {
      printf("Hello\n");
    long x = os::javaTimeMillis(); // HOW TO DO THAT?
    Including src/share/vm/runtime/os.hpp seems overkill with lot of dependencies?
    http://hg.openjdk.java.net/jdk8/jdk8/hotspot/file/87ee5ee27509/src/share/vm/runtime/os.hpp
    Could I create a custom header file copy-pasting parts from os.hpp to make some functions known?
    And I don't want to java-call the native java methods that mapped to these os functions, but call C functions directly.

    Two parts
    1. How do you write C code.
    2. How do you use JNI to interface between java and C code.
    1 is independent from 2 but 2 requires 1 because you can't do it if you don't know how to write C code.
    If you want to do JNI then you start by writing C code and debugging the C code.  No JNI at all in that process.
    After you complete that then you write wrappers around the C code which are JNI.
    JNI code tends to make Java unstable because bugs in JNI code will cause the VM to crash.  So it is often better to find an executable that does what one wants and then use Java Runtime.exec to manage that executable.  That is going to be true even if one is writing the executable (like in C.)
    To learn C you should start with a C site.

  • V-41 tcode error :Table 304 is not defined for use with condition type PR00

    Hi All,
    I am trying to create a BDC using the transaction V-41. 
    The first screen has fields:
    ConditionType and Table, where I have to fill values ZPM1 and 800 respectively.
    But as soon as I enter the tcode v-41 and say enter, the above mentioned fields are already having the  values 'PR00' and ' 304'. Normally if you take an example fo t-code VA02, all fields are blank.
    Then an error message  is displayed:
    Table 304 is not defined for use with condition type PR00
    This behaviour is not allowing me to use the BDC feature.
    Please advise me on why this is happening. What are the possible solutions I can use to clear these values programmatically?
    Can anything be done via customizing?
    Regards,
    Namita.

    Dear ILHAN ,
    Well the problem you are facing is having the following solution:
    Table 304 is not defined for use with condition type PR00
    Message no. VK024
    Diagnosis
    The selected condition type does not fit in the condition table, that is the basis for the condition record. Alternatively the selected condition type is not included in the condition types that were selected on the selection screen or that are defined in the variant of the standard selection report.
    Procedure
    Úse F4 help to choose a valid condition type.
    If this does not give you the required condition type, check in Customizing for condition types and the related access sequences.
    In the condition maintenance also check Customizing for the selection report (pricing report), that you have selected in the navigation tree, using the standard condition table as a reference.
    I hope this helps.
    It has worked for me.
    I gave it a try and what I am getting using the transaction V-41 is create Price condition (PR00) : Fast Entry.
    Please award points if you find it useful.
    Regards,
    Rakesh

  • What's the component used in this example?

    Hi,
    I'd like to know what's the component used to make those nice 'drawable' panels (like curtains) just like the lateral menu in this substance's example:
    https://substance.dev.java.net/webstart/test.jnlp
    Thanks.

    those nice 'drawable' panels (like curtainsAre you talking about JTaskPane?
    ICE

  • SAP BPC 10 NW - component used by admin module

    Hello Gurus,
    We are on BPC 10NW - SP04
    We were trying all the features using some test data.  Now, we have received actual data from the business.  We are trying to delete the previously created master data and create the new one give by the business.
    It gives an error while processing the dimension (ENTITY Dimension)
    To get processed we had done following activities too -
    1.  Deleted the transaction data from Consolidation, Ownership and Rate cubes
    2.  Deleted the BPFs
    3.  Deleted the inout forms and/or changed the references wherever we had used the hardcoded values.
    4.  Deleted the data from the referencial dimension (INPUTCURRENCY)
    5.  Tried to delete the ENTITY data from the backend (From BW)
    Still it gives the error while processing the ENTITY dimension as "Error in admin module, Component used by admin moduile"
    Only remaining part I can think of is of JOURNALS.  We had created few data using journals.  However, I am not sure how to delete the journal data. (if that is the root cause of the issue)
    Can anyone suggest the remedy for this issue.
    Let us know if you need more information.
    Regards,
    Rashmi

    Hi Rashmi,
    Please check if there is journal data. The journal data would be in a generated table. Please check for the journal generated table using the program UJ0_GET_GEN_TABNAME. You can check the entries in the table. The tables start with /1CPMB.....
    - If you simply want to clear, then  in BPC 7.5 there would be seprate task profile 'Admin Journal' which would enable the option of clearing the journals in admin console.
    Thanks,
    Sreeni

  • CANT execute query with parameter on user defined tables using query genera

    Dear All,
    I have problem when executing query with parameter on user defined tables using query generator.
    It seems SBO cannot accept parameter to query user defined tables.
    I've tried these:
    SELECT T0.U_Status FROM [@ST_PR_H] T0 WHERE T0.U_Status = [%0] --- this FAIL
    I try to pass the value directly without using parameter and It works
    SELECT T0.U_Status FROM [@ST_PR_H] T0 WHERE T0.U_Status = 2 --- this SUCCESS
    This one works
    SELECT * FROM RDOC T0 WHERE T0.width =[%0]  --- this SUCCESS
    and this one works too
    SELECT * FROM RDOC T0 WHERE T0.width = 595  --- this SUCCESS
    Is there anyone can help me ....???
    Thanks,
    Alfa

    I  generated this code using query wizard ....
    SELECT T0.[U_Status] AS 'Document Status' FROM  [dbo].[@ST_PR_H] T0  WHERE T0.[U_Status] = (N'2' )
    and replaced the (N'2' ) with [%0]
    SELECT T0.[U_Status] AS 'Document Status' FROM  [dbo].[@ST_PR_H] T0  WHERE T0.[U_Status] = [%0]
    and It worked ......
    Thanks 4 all .....

  • No destination URL is defined. Use the followind redirect URL in Transactio

    Hi,
    I am new BSP, I have to display logon screen in my BSP application, i was copied SYSTEM bsp application and tried to run it, but it is throwing error "No destination URL is defined. Use the followind redirect URL in Transaction SICF:  /sap(====)/public/bsp/sap/login/default.htm?sap-url= " . Please let us know what has to be done for the same
    Message was edited by:
            Rams BSP

    Hi Rams,
    see http://help.sap.com/saphelp_47x200/helpdata/en/33/8351f1f3351c41853ea3508cbef0cf/frameset.htm
    and
    http://help.sap.com/saphelp_47x200/helpdata/en/1d/13c73cee4fb55be10000000a114084/frameset.htm
    It sounds like you have not configured the redirect correctly in the ICF.
    Cheers
    Graham

Maybe you are looking for