ABAP: dynamic creation of nested elements

Hello,
I need to create a dropDown and put it into transparent container dynamically. Here is some things that I have:
Trasparent container:
  transparent_container = cl_wd_transparent_container=>new_transparent_container( ).
  cl_wd_grid_layout=>new_grid_layout( container = transparent_container ).
  cl_wd_grid_data=>new_grid_data( element = transparent_container ).
  ui_container->add_child( transparent_container ).
and a dropDown:
drop_down_figure = cl_wd_dropdown_by_key=>new_dropdown_by_key( bind_selected_key = 'REPOSITORY.FIGURES' on_select = 'GET_OPERATOR' ).
  cl_wd_grid_data=>new_grid_data( element = drop_down_figure ).
  ui_container->add_child( drop_down_figure ).
I need to put this dropDown inside trasparent container that was just created.
I can get reference to the container this way:
tr_cont = ui_container->get_child( index = 1 ).
return type of the above code is cl_wd_uielement.
I do not see any methods of this type that allow me to put dropDown inside this element.
Do I need to cast it to cl_wd_uielement_container type first? If so how is casting done?
Thank you.

Hi Georrgy,
Casting is done using "?=".
For ex:
DATA: THE_TABLE_CELL_EDITOR type ref to CL_WD_DROPDOWN_BY_KEY,
THE_TABLE_CELL_EDITOR ?= wd_table_column->GET_TABLE_CELL_EDITOR( ).
Here I am getting a table cell editor which can be of any type say dropdown, Link to Action etc and since I need dropdown I am casting it using "?=".
Regards,
Srini.

Similar Messages

  • Dynamic Creation of UI Elements

    Hi,
    Can anyone help me to create a DropDownByIndex and CheckBox dynamically in the Implementation tab of a View. Also I am not able to insert values into the dropdown.
    If someone send the code it would be very helpful
    Thanks
    Kalyan

    Hi,
    Create one static node name like 'NodeA'
    Create one Node(MultiNode) with one attribute(roles) using the following code. Inside the DoInit() method
    Step 1:
    IPrivate<ViewName>.INodeAElement ele = wdContext.createNodeAElement();
    wdContext.nodeNodeA().addElement(ele);
    IWDNodeInfo multipleinfo = wdContext.nodeNodeA().getNodeInfo();
    IWDNodeInfo multiplenode = multipleinfo.addChild("MultiNode" , null, true, false, true, true, false, true, null, null, null);
    multiplenode.addAttribute("roles", "ddic:com.sap.dictionary.string");
    Step 2:
        Assign values for Dropdown. Here i assigned 5 values.if you want assign values from database/BAPI also.
    IWDNode node1 = wdContext.nodeNodeA().getChildNode("MultiNode", IWDNode.NO_SELECTION);
    IWDNodeElement elem1;
    for(int s=0;s<5;s++){
       elem1 = node1.createElement();
       elem1.setAttributeValue("roles","Value"+s);
       node1.addElement(elem1);
    Step 3:
    Inside Domodifyview create IWDDropDownByIndex UI Element and Bind it.
    IWDDropDownByIndex dropDownList = (IWDDropDownByIndex)view.createElement(IWDDropDownByIndex.class, "drop");
    IWDAttributeInfo info = wdContext.getNodeInfo().getChild("NodeA").getChild("MultiNode").getAttribute("roles");
    dropDownList.bindTexts(info);
    Finally add this Dropdown into container. Like this you can create more Dropdown and add action to the dropdown as dynamically.
    <b>Valuable answer=points</b>
    Kind Regards,
    S.Saravanan.

  • Dynamic creation of clusters elements

    hi,
    i need to create elements in cluster dynamiccaly.is it possible.my problem is i need to read the xml file and i need to create the cluster element based on the attribute
    in this xml
    <cluster>
    <element 1/>
    <element 2/>
    <cluster/>
    In this case the cluster should have two element
    <cluster>
    <element 1/>
    <element 2/>
    <element 3/>
    <cluster/>
    In this case the cluster should have 3 element is it possible to change the cluster dynamically bt reading the xml.

    If you don't know about clusters and arrays it's a VERY bad idea to even look at scripting. That's jsut going to get you into a lot of trouble. LabVIEW scripting is not supported by NI, and so any code you create will be on your own.
    As noted before, if the element types are all the same, use an array.
    To learn more about LabVIEW it is recommended that you go through the tutorial(s) and look over the material in the NI Developer Zone's Learning Center which provides links to other materials and other tutorials. You can also take the online courses for free.

  • ABAP: Dynamic creation of transparent container

    Hello,
    I have this code and it fails (null pointer exception):
    transparent_container = cl_wd_transparent_container=>new_transparent_container( ).
      cl_wd_grid_data=>new_grid_data( element = transparent_container ).
      ui_container->add_child( transparent_container ).
    What is the problem? Do I need to create transparent container and pass some parameters?
    Thank you.

    Hello Armin,
    yes it is.
    I have some code like this:
      "create a transparent container
      transparent_container = cl_wd_transparent_container=>new_transparent_container( ).
      cl_wd_grid_data=>new_grid_data( element = transparent_container ).
      ui_container->add_child( transparent_container ).
      "create a dropDown with figures
      drop_down_figure = cl_wd_dropdown_by_key=>new_dropdown_by_key( bind_selected_key = 'REPOSITORY.FIGURES' on_select = 'GET_OPERATOR' ).
      cl_wd_grid_data=>new_grid_data( element = drop_down_figure ).
      ui_container->add_child( drop_down_figure ).
    If I comment out code where I create transparent container it works fine and creates dropDown.
    However, as soon as I add transparent container I get NullPointer exception.
    Thank you.

  • Automatic creation of cost elements

    Dear All,
    The automtic creation of cost elements functionality is not working for some GL accounts in production. When new GL accounts are created, the same are not created as cost elements. All the standard settings viz 'selection of automatic creation' in controlling area configuration, creation of number ranges in OKB2 etc are in place. We posted in OSS and they are not able to find reasons why this is happening.
    Has anyone faced a situation like this? Please post your valuable thoughts and share your inputs. We currently have a log created by user on this and pending for quite sometime.
    Thanks in advance
    Venkatesh

    Hi,
    Yes. We do face problem like this often. We wriggle out by updating through manually when we are very nearer to go-live date. Otherwise, we can create an abap program and meet the deficiency.
    Trust this helps much!
    Cheers!

  • Automatic creation of WBES element using front end application

    Hi,
    i am looking at developing a front end tool where user will provide the required data and project name/wbes lement in the request. upon approval from project manager, sytem must creation requird WBE element in the requested project automatically. there will be multiple requests supplied to create wbes lements under the existing projects.
    for Eg. assume that there is a project AB11.00001 
    i have already have one 4th level wbes element like displayed below:
    AB11.00001
    AB11.00001.01
    AB11.00001.01.01
    AB11.00001.01.01.01
    AB11.00001.01.01.02
    AB11.00001.01.01.03
    now i would like to add new 3rd level and 4th level for above project as mentioned below:
    AB11.00001
    AB11.00001.01
    AB11.00001.01.01
    AB11.00001.01.01.01
    AB11.00001.01.01.02
    AB11.00001.01.01.03
    AB11.00001.01.02
    AB11.00001.01.02.01
    AB11.00001.01.02.02
    AB11.00001.01.02.03
    AB11.00001.01.03
    AB11.00001.01.03.01
    AB11.00001.01.03.02
    AB11.00001.01.03.03
    this must be done either using bapi or any other programme, i tried with bapi, but not able to solve, pls help me with best way of executing this auto application rather creating manually one by one using CJ20N. i am very sure we have finest ABAP'rs in this forum who will build this programme..
    thanks
    naveen lewis
    Edited by: naveennl on Aug 16, 2010 11:39 AM

    Hi Rifaee,
    appplogies for misunderstanding..
    i want only the clues how i can execute this using some of the available SAP functionalities.. ofcourse finest ABAP'rs only think out of the box to solve this and rest will usually answer it as not feasible.
    Edited by: naveennl on Aug 16, 2010 11:51 AM

  • Dynamic creation of TabStrip

    Hi,
    I want to create a tabstrip dynamically.The tabstrip should have 3 tabs, and in each of the tabs i want to put some UI elements like a label, input field, dropdown, tables.........etc.
    Im able to create the tabstrip and add tabs to it dynamically.
    I've even created the UI elements which i wanted to put in the tabs.............But im not able to proceed as i dont know how to add the UI elements to the tabs.......
    Can anyone tell me how to add UI elements to a tab in a tabstrip?
    Regards,
    Padmalatha.K
    Points will be rewarded.

    Hi,
    Following code will help you to understand the dynamic creation and adding them
    //Tabstrip
           IWDTabStrip tabStrip = view.createElement(IWDTabStrip.class);
           //Tab
           IWDTab tab = view.createElement(IWDTab.class);
           //Input Field
           IWDInputField inputField = view.createElement(IWDInputField.class);
           //Adding inputfield to tab
           tab.setContent(inputField);
           //Adding tab to tabstrip
           tabStrip.addTab(tab);
    //Finally add this tabstip to either your root container or some other container.
    Regards
    Ayyapparaj

  • Dynamic Creation of UI in adobe forms??

    Hi Experts,
    I need to create a dynamic interactive form and dynamic UI elements in the interactive form.
    As per my requirement I need to display a pdf and I will be getting values from the RFC's. I need to show the form segments and the UI elements only when there's a data from the RFC else not. I am unable to understand whether this requirement needs generation of the UI elements dynamically or I can do it statically as well.
    The form thus generated will be having data from the RFC which based on the data quantity may exceed to n number of pages.
    In case it needs dynamic creation can you suggest me please how to achive it in interactive forms?
    Helpful answers will be appreciated.
    Warm Regards,
    Gaurav

    Hi,
    subForm1:-
    Flow content
    Allow page breaks
    Place: following previous-----> This means when you are repeating the subform the previous one should be followed.
    Say you have a table and have 3 columns in it.
    After 1st column is completed, the next column should come with 1st comun
    After: Continue filling parent--->Continously fill the data with the parent element
    Repeat sub form min count is 1 : Minimum of 1 line item will be printed
    Height: Expand to fit is true.: If the field height is increased it automatically expands.
    For help in Adobe Press F1 or Goto Help--> Adobe Designer Help in Adobe Designer
    After installing Adobe Designer, goto the specific folder
    C:\Program Files\Adobe\Designer 8.0\EN you can get sample documents.
    For help press F1 after opening designer.
    Sub Form1: Content--> Flowed, Flow direction --> Top to bottom
                       Binding --> Check the checkbox Repeat Subform for each data item
    Subform 2: Content --> Positioned, No pagination No binding settings changes needed.
    Hey i forgot to mention the Header Subform where you create all these subforms should be flowed.
    Try it once like this and lte us know
    Edited by: Sankar Narayana on Oct 3, 2008 5:06 PM

  • Restrict Creation of Cost Elements

    Hi All,
    I have a situation in which I have to restrict creation of Cost Elements for some of my P&L GL accounts. Is there any way I can restrict them. Any help would be appreciated.
    Thanks
    MKR

    Hi MKR,
    I would recommend not to have any validations for this.. This is the heart of the whole system and needs to be maintained in a very disciplined way
    If you put hard stops for such things, people will never understand the relevance of things and slowly the mind set evolves like "Unless the system gives a hard stop, any thing and every thing can be done"...  So, they go on creating nuisance in the system till the system stops them
    Moreover, there is no logic by which you can control this even if you try for an ABAP check... If you do still, it will propose probs in future...
    Provide the authorization for creating/changing cost elements to one single person who understands the system well and have a central control...
    Regards
    Ajay M

  • Dynamic Creation of Buttons and Actions HELP

    Hi there,
    I have got a problem (or maybe even two) with the dynamic Creation of buttons. The code below creates the buttons.
    My main problem is, that the parameter created for the button's action isn't propagated to the assigned event handler. I get a null, though the name of the parameter in the event handler and the name of the parameter added to the action are the same.
    Could it also be that I'm always using the same action? I.e. does wdThis.wdGetAddElementAction() always return the same action instance? If yes, how can I create individual actions for each button?
    Any help is appreciated!
    Cheers,
    Heiko
    "    for(int i=rootContainer.getChildren().length; i<wdContext.nodeFeature().size();i++)
                   IPrivateVCT_Feature.IFeatureElement featureElement = wdContext.nodeFeature().getFeatureElementAt(i);
                   IWDTray featureTray = (IWDTray) view.createElement(IWDTray.class, featureElement.getName());
                   IWDCaption header = (IWDCaption) view.createElement(IWDCaption.class, featureElement.getName()+"_Header");
                   header.setText(featureElement.getName());
                   featureTray.setHeader(header);
                   featureTray.setExpanded(false);
                   rootContainer.addChild(featureTray);
                   IWDButton button = (IWDButton) view.createElement(IWDButton.class, featureElement.getName()+"_Button_AddElement");
                   IWDAction actionAddElement = wdThis.wdGetAddElementAction();
                   actionAddElement.getActionParameters().addParameter("featureIndex", new Integer(i).toString());
                   button.setOnAction(actionAddElement);
                   button.setText("Add Element");
                   featureTray.addChild(button);

    Hi Heiko,
    You have done everything correctly....except for 1 line
    in the code...
    Replace the following line in your code:
    actionAddElement.getActionParameters().addParameter("featureIndex", new Integer(i).toString());
    Replace the above line with this code:
    button.mappingOfOnAction().addParameter("featureIndex",i);
    Actually in your code, you are not associating the parameter with the button...
    Note that addParameter(...) comes with two signatures: addParameter(String param, String value) and addParameter(String param, int value). You can use any of them based on yuor need.
    Hope it helps,
    Thanks and Regards,
    Vishnu Prasad Hegde

  • Loop through nested elements and insert via PL/SQL

    INSERT INTO Orders(id, OrderXML) VALUES
    (S_Orders.Nextval,
    '<?xml version="1.0" encoding="utf-8" ?>
    <Order xmlns="urn:foo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:foo foo-1.xsd">
    <OrderRef>BBB</OrderRef>
    <OrderDate>2005-03-29</OrderDate>
    <CustomerID>1051</CustomerID>
    <Items>
    <Item>
    <ProductID>7</ProductID>
    <Price>45.6</Price>
    <Quantity>2</Quantity>
    </Item>
    <Item>
    <ProductID>19</ProductID>
    <Price>73.5</Price>
    <Quantity>10</Quantity>
    </Item>
    </Items>
    </Order>'
    I some questions regarding index search of nested elements like,Items in the above example.
    I would like to know how I can LOOP through the Items like 1..2 LOOP
    and insert those elements(item) into one table. Order information should go in to another table.
    Can this be done with xpath and PL/SQL.
    Regards
    Ulf

    Hi Marco!
    Here's some more information:
    CREATE TABLE ITEM (ProductID NUMBER,
    Price NUMBER(8,2)
    Quantity 10 NUMBER);
    CREATE TABLE ORDER (OrderRef VARCHAR2(10),
    ORDER_DATE VARCHAR2(10),
    CUSTOMERID NUMBER);
    The main problem that I have is to create an solution that can be dynamic so that I can have for instance one order and four items in one XML.
    The second XML can have one order and 10 items.
    First I want to insert the order elements in the order table and then the items records in the item table.
    To complicate things futher my real XML have namespaces in the XML, but this I think I can handle.
    Summary: So for each order row(element) I want to traverse the Item elements and insert them to the Item table.
    Regards
    /Ulf

  • Dynamic Creation Form

    Hi friends,
    Is there a way to create dynamic creation forms in ADF,in jdev 10.3.3?
    By this I mean--I need to populate a table in my DB and on my page I have an add button,
    now at each click of add button,a new creation form should be displayed on the page one below the other.
    finally there would be a Save button that would save all my entries to the table.
    I searched a lot for the same...Please do help if anybody has any ideas..
    Thnks in Advance..c ya
    kavitha
    Edited by: user6403440 on May 5, 2009 2:22 AM

    Hi,
    well, the easiest would be to create an updateable table and add new rows. If you need a form then you can use af:forEach or af:iterator with the table binding to render input form elements (more like a custom table rendering). However, its quite a bit of development that is required for this.
    Frank

  • Creation of PL Element without it being a cost element

    Hi
    I have to asign two PL elements in T code 0KEK for transfer of material between two profit centers. The two elements should not be <b>cost elements</b> but they should be PL Elements to be used only in PCA.
    We have to create PL elements through FS00. But the system automatically creates a new cost element when i create a GL as a PL nature. Pls let me know how to create a PL element without it being a cost element.
    Regards
    Sanil Bhandari

    Hi Sanil
    IN OB13 
    Controlling integration tab
    select : Manual creation of cost element and create GL accts.
    Hope this works
    Best Regards
    Ashish Jain

  • Issue in BAPI_PS_PRECOMMIT in mass creation of WBS Elements

    Hi,
    I am facing a issue with BAPI_PS_PRECOMMIT.
    we have the following WBS Hierarchy:
    S - Proj, (level1)
    S-XXX WBS Element (level2)
    S-XXX-001 WBS Element (level3)
    I have created a program for mass creation of WBS elements creation
    which uses the following BAPI's
    BAPI_PS_INITIALIZATION
    BAPI_BUS2054_CREATE_MULTI
    BAPI_PS_PRECOMMIT
    BAPI_TRANSACTION_COMMIT
    The proj: 'S' and the level2 WBS element: 'S-XXX' already exist in the system.
    When I run the program for delta load, so as to create the following level3 WBS elements:
    S-XXX-001
    S-XXX-002
    S-XXX-003
    The system is throwing the following errors at the BAPI_PS_PRECOMMIT:
    1. Final Check of the project definition and WBS elements: Error
    2. Validation unsuccessful
    Pls help me on this.
    Thanks,
    Deepak

    Check the WBS elements doesn't exist already in your system.
    Here is what I coded some days back for deletion of Network Activities, most of the things are same.
    You are doing for WBS element.
    * Call to initialization BAPI Before Delete
          CALL FUNCTION 'BAPI_PS_INITIALIZATION'.
    * Call to Network Activity Deletion BAPI
          CALL FUNCTION 'BAPI_BUS2002_ACT_DELETE_MULTI'
            EXPORTING
              i_number           = t_bapi_activity-network
            TABLES
              it_delete_activity = l_t_del_vornr
              et_return = l_t_bapiret2.
          DELETE l_t_bapiret2 WHERE type <> 'E'.
          READ TABLE l_t_bapiret2 INDEX 1.
          IF sy-subrc EQ 0.                                      "If error in Deletion
            MOVE: f_idoc_contrl-docnum TO t_idoc_status-docnum,
                  l_t_bapiret2-type TO t_idoc_status-msgty,
                  'CNIF_PI' TO t_idoc_status-msgid,
                  l_t_bapiret2-number TO t_idoc_status-msgno,
                  l_t_bapiret2-message TO t_idoc_status-msgv1.
                  MOVE c_idoc_status_error TO t_idoc_status-status.
                  APPEND t_idoc_status.
                  ROLLBACK WORK.
                  EXIT.
          ELSE.                                                  "If Delete is successful COMMIT
    * Call to PreCOMMIT BAPI
            CALL FUNCTION 'BAPI_PS_PRECOMMIT'
             TABLES
               ET_RETURN       = l_t_bapiret3.
    * Call COMMIT BAPI
    *        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
          ENDIF.
    The other solution is use BAPI_PROJECT_MAINTAIN.

  • Manual/Autometic creation of cost elements in chart of accounts field

    Dear Friends,
    While creation of Chart of accounts (OB13) under  Controlling Integratiion tab
    thers is two options are there.
    1 manual creation of cost elements
    2 autometic creation of cost elements.
    While creation of cost elements if we select
    (MANUAL CREATION OF COST ELEMENTS) what will happen???
    (AUTOMETIC CREATION OF COST ELEMENTS) what will happen?
    What is the main difference between about two fields?
    Thanks in advance,
       Mallika

    Hi,
    MANUAL CREATION OF COST ELEMENTS -  Cost elements maintained manually. A push button is available for
    this purpose, with which you can go directly to the related cost
    element.
    AUTOMETIC CREATION OF COST ELEMENTS - Cost elements maintained automatically. When you save a new G/L
    account, the related cost element is automatically created. A prerequisite is that a default value for the cost element category
    has been set up for this cost element. If no default value is found, the system will not create a cost element.
    You can make default settings via :
    Cost Element accounting --> master data --> cost element --> automatic creation of primary and secondaru cost element --> make default settings
    Dhara.

Maybe you are looking for

  • Advice on DVD Writer for PowerBook - Matshita DVD-R UJ-815

    Hi there, I have been attempting to burn DVDs on my PowerBook using Toast Titanium Version 6 - TO NO AVAIL. During my first few attempts to burn DVDs, the SuperDrive accepted the disc but was unable to complete the Encoding process. Burning data file

  • PDF Reports from Portal

    My goal: PDF report for print-out, launched from Portal, that displays text and image (.jpeg, .gif, .bmp, etc.) data pulled from the database. Currently, users retrieve this data right from the portal via JSP portlets. This works great. We'd like to

  • Can't find a specific photoshop tutorial

    It was on Adobe.tv several months ago.. It was about masking and using a gradient to feather a mask to blend layers together. The sample photos were a closeup of a man on the right side of the screen and the other photo was a open field. The tutorial

  • Apple logo is on the screen and does not repond

    help plz

  • 2 inspections

    Hi, in in-process we have two inspections,i.e one is by our own in-process insp by qa team and second is that the customer will come and check at each stage /operation? How to map the same.