Dynamic creation of node in ABAP WD

Hi All,
Can anyone please suggest me why in ABAP webdynpro the second code is more prefareable then the first one.
It's mentioned in SAP material that the 2nd code is more prefarable.
1) lr_parent_node = wd_context->get_child_node(
   name = '<parent_node>' )
  lr_parent_node_info = lr_parent_node->get_node_info( )
2) lr_root_node_info = wd_context->get_node_info( )
   lr_parent_node_info = lr_root_node_info->get_child_node(
   name = '<parent_node>' )

Hi Suman,
I would suggest that you ask questions about ABAP WD in the forum for ABAP WD.
Kind regards,
Ulrich

Similar Messages

  • Dynamic creation of Views

    Hi All,
    I am new to web dynpro abap, I had a requirement that based on the user input I need to create views dynamically that is : if the user enters 3 I had to create three new views dynamically and like the same, also the UI elements of the view should be picked up based on the content of ztables dynamically as the entries in the ztables keep on changing.
    Is that possible. If so any one please help me out with some procedures.
    Thanks In avdvance,
    Regards,
    Sriratna.

    hi ,
      Dynamic UI developement it possible .
    This is link for dynamic programming blog.
    <a href="/people/thomas.szcs/blog/2005/12/28/dynamic-programming-in-web-dynpro-abap--introduction-and-part-i-understanding-ui-elements programming</a>
    <a href="http://Link 2">/people/thomas.szcs/blog/2006/01/03/dynamic-programming-in-web-dynpro-abap--part-ii-handling-viewelements
    but in my view I will not suggest to go for dynamic programming if you want create large no. of UI elements over view and large no. of views .
    Another thing is it is bit advanced concept in WD ABAP so as you are new to web Dynpro ABAP it self dont directly jump to it .
    I had similar complex requirement where UI over other view was based on inputs given in initial view .It was possible to address it with dynamic programming but I have not went for that .
    I made normal programming but gave feel like things are dynmic which was finally serving ultimate purpose .
    Weather one should go / should not go for dynamic programming is decided based on Volume of UI elememts , Supply function and nodes  needed .
    I can suggest you alternatives but Please give details of it else mail me .

  • Dynamic creation of business graphics.

    Hi,
    i have a piece of code which dynamically create a business graphics. If i use the same node data and create BG in statically.. i am able to view the graph. In case of dynamic creation , i am getting graphical rendering error. Have i missed something here..
    The piece of code i had used is..
         IWDBusinessGraphics bg = (IWDBusinessGraphics)view.createElement(IWDBusinessGraphics.class,null);
              IWDCategory c = (IWDCategory)view.createElement(IWDCategory.class,null);
         //     c.setDescription("tableutility");      
              c.bindDescription(wdContext.getNodeInfo().getAttribute(IPrivateSDNUtilityView.IContextElement.TEST));                                                                               
    bg.setCategory(c);
              bg.setDimension(WDBusinessGraphicsDimension.PSEUDO_THREE);
              IWDSimpleSeries ss = (IWDSimpleSeries)view.createElement(IWDSimpleSeries.class,null);
              ss.bindValue(wdContext.nodeDepartments().getNodeInfo().getAttribute(IPrivateSDNUtilityView.IDepartmentsElement.NO_OF_PEOPLE));
              ss.setLabel("Simple Series");
              ss.setLabel("No of People");
              bg.addSeries(ss);
              bg.setChartType(WDBusinessGraphicsType.COLUMNS);
              bg.bindSeriesSource(wdContext.nodeDepartments().getNodeInfo());
              bg.setIgsUrl("http://<hostname>:40080");
    Please help.
    Regards
    Bharathwaj

    Please got through following link
    <a href="/people/sap.user72/blog/2006/05/04/enhancing-tables-in-webdynpro-java-150-custom-built-table-utilities:///people/sap.user72/blog/2006/05/04/enhancing-tables-in-webdynpro-java-150-custom-built-table-utilities

  • 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 ComponentUsage

    Hi people,
    I want to reuse a view (ViewA) in different views (ViewB, ViewC, ViewD).ViewA has a quite complex logic, so it is necessary to outsource this view.  Not only the logic, but also the count of UIElements and contextelements is quite large, for this I don't want to implement this part redundant in the views A, C and D.
    I have to use ViewA in a table in  the TablePopin UIElement. Every line of the table should have its own instance of ViewA. Is that possible?
    My idea is it, to put the view in an own component. For every tableline I need an instance of the componentUsage. My problem is now, that I'm not able to create at runtime a ComponentUsage and at designtime I don't know how many instances I need. Is it possible in webdynpro to create dynamic instances of ComponentUsage?
    If you know an other way, that prevents me from implementing the view and its logic more times, please tell me!
    Thanks in  advance,
    Thomas Morandell

    Hi Thomas,
    just for clarification. Principally it is possible in Web Dynpro to dynamically create new component usages of the same type like an existing, statically declared one. This means after having defined a component usage of type ISomeComp (component interface definition) you can dynamically create new component usages which all point to the same component interface definition ISomeComp:
    wdThis.wdGetISomeCompUsage().createComponentUsageOfSameType();
    But this dynamic creation approach implies, that you must also embed the component interface view of this component usage to the view composition dynamically; and this is (unfortunately) quite cumbersome and complicated based on the existing Web Dynpro Java API (it is not yet optimized for a simple dynamic view composition modification.
    Additionally, like Valery pointed out, the dynamic creation of new component usages is not compatible with table popins.
    Regards, Bertram

  • 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

  • Dynamic creation of date in selection variant

    Hi All,
    I have a Z program for updating a field in BOM item. One of the input field in the report is "Valid From Date". Actually the current date is automatically fetched through a function module and it is defaulted in that field. 
    Our client is using selection variant for ease of use. The problem here is old date in the selection variant  is replacing the current date. I want current date to be created automatically during insertion of variant also. How can i solve this problem. Is there any selection variable inside the variant for dynamic creation of Date?
    Thanks
    Sankar

    As I know there is no setting for this. For any std or Z report variant function with L should act same way...anyway you discuss with your ADABer.
    See the help for variables
    Selection Variables                                                                               
    The following three types of selection variables are currently          
        supported:                                                                               
    o   Table variables from TVARV                                          
            You should use these variables if you want to store static          
            information. TVARV variables are proposed by default.                                                                               
    o   Dynamic date calculations:                                          
            To use these variables, the corresponding selection field must have 
            type 'D' (date). If the system has to convert from type T to type D 
            when you select the selection variables, the VARIABLE NAME field is 
            no longer ready for input. Instead, you can only set values using   
            the input help.                                                     
            The system currently supports the following dynamic date            
            calculations:                                                       
            Today's date                                                        
           From beginning of the month to today                               
           Today's date +/- x days                                            
           First quarter ????                                                 
           Second quarter ????                                                
           Third quarter ????                                                 
           Fourth quarter ????                                                
           Today's date - xxx, today's date + yyy                             
           Previous month                                                                               
    o   User-specific variables                                            
           Prerequisite: The selection field must have been defined in the    
           program using the MEMORY ID pid addition. User-specific values,    
           which can be created either from the selection screen or from the  
           user maintenance transaction, are placed in the corresponding      
           selection fields when the user runs the program.                                                                               
    The SELECTION OPTIONS button is only supported for date variables that 
       fill select-options fields with single values.                         
    i.e means we can do that with D also.

  • Regarding creation of node element

    Hi
    i hav a doubt regarding creation of node element. u can create new node element using method create(cn)Element available either directly from wdContext or from wdContext.node(cn) where cn is any context node.
    can any one plz explain me what's the difference between two.
    does it has any thing to with node being singelton or non-singelton?
    also can anyone explain me the difference between add and bind method.
    thanks.

    hi
    good
    Data Binding Methods
    If a property can, or must be bound to the context, the respective bind and bound methods are available.
    &#9679;     The bind methods bind the value of a property to the context element specified by the path.
    The name of the method is created according to the following pattern:
    BIND_<runtime name of the property>.
    Example: table, property: design, method: BIND_DESIGN.
    &#9679;     The bound methods return the path of the context element to which a property is bound and return NULL if no binding exists.
    The name of the method is created according to the following pattern:
    BOUND_<runtime name of the property>.
    Example: table, property: design, method: BOUND_DESIGN.
    ADD METHOD->
    Two add methods that add an element.
    &#9675;     If only the element is transferred as parameter, then the element is added at the and of a list
    &#9675;     If an index is transferred as well, then this element is transferred at the specified index position.
    http://help.sap.com/saphelp_erp2005/helpdata/en/66/18b44145143831e10000000a155106/content.htm
    thanks
    mrutyun^

  • Sales order creation using webdynpro in ABAP

    Plz give the process how to create sales order creation using webdynpro in ABAP. if not possible plz let me know how to create in JAVA.
    It is very urgent. I hope i will get it very soon.
    Thanks all
    Sai

    In your WDA application,  all you need to do is call the BAPI BAPI_SALESORDER_CREATEFROMDAT2 when the user clicks some button.  Most likely, you can put the code for this BAPI call in the onAction method for your button. 
    Regards,
    Rich Heilman

  • Dynamic reverse context node mapping at runtime

    Hi!
    I have an application which uses another embedded component containing a ALV table which shows the data of a transparent table.
    Everything works fine if i'm working with a static table with static attributes and map the context node of the application to the node in the embedded component. The context node in the embedded component is reversed mapped and gets its data from the application's context node.
    Now i want to do it dynamically. Inside the application the user should choose the name of a table and I'm using RTTI functions to get it's technical informations. At runtime i'm adding dynamically attributes (i.e. fieldname, type, length) to a static context node called 'DATA'.
    The ALV component of the embedded component is mapped to an interface context node named 'DATA' which uses reverse mapping to receive data from the applications context node 'DATA'.
    What I need to know is how to create the mapping between application context node and interface context node of the embedded component at runtime after i have created the attributes of the node dynamically. Is that basically possible?
    I've already tried to map the both nodes statically to see if the dynamically created attributes are mapped automatically then. The mapping seems to be fine at node level, but doesn't work for the later dynamically added attributes.
    Could someone point me to informations if dynamic mapping context nodes is basically possible and how to do it?
    Regards
    Ralf-J.

    Hi Lars!
    Thanks for the link! The problem isn't to fill the context node dynamically. That's already working using RTTI etc.
    It seems to me that the interface context node of the ALV in the embedded component doesn't recognize the dynamically added attributes. As i wrote the binding on node level (DATA->DATA), which i'm doing at design time, is working as expected, but the added attributes are only shown in the context node of the using component but not in the embedded.
    I'm still thinking there must be a way to do a binding at runtime. On the other hand the comment of Glenn in the thread you've pointed me to, seems to suggest that the ALV itself might have problems with dynamically appended attributes.
    Regards
    Ralf-J.

  • Build Hierarchy  with nodes with ABAP for custom Infoobject

    Hi,
    Need to build hierarchy with nodes with abap for custom infoobject.
    Thanks

    Hi,
    Using information from:
    http://help.sap.com/saphelp_nw04/helpdata/en/fa/e92637c2cbf357e10000009b38f936/content.htm
    you can bulid flat file with hierarchy data and then load in into BW...
    Krzys

  • Is it possible to dynamically create xml nodes?

    Hi,
    Is it possible to dynamically create child nodes of an xml
    file with flash??
    Im what i want to do is save a users name etc in an xml file
    without having to manually add nodes in.
    So when a user clicks a button to save their details a new
    node is created.
    Thnx

    Yes.
    Look
    at XML.appendChild as a starting point.

  • Create CRM customer/account hierarchy node thru abap code

    Hi,
    Any one can help me on how to Create CRM customer/account hierarchy node thru abap code?
    Is there any Class/methods, FMs that I can use to create node in customer/account hierarchy?
    Sample codes will greatly help me.
    I hope someone can help me on this since this is my urgent requirements on my project.
    Thanks,
    james

    James,
    You can find the FM, Class Lib and APIs under the package BUPA_HIERARCHY.

  • 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

  • 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

Maybe you are looking for

  • LOOK HERE: using an ipod shuffle with windows xp/gets unknown device error

    http://www.genesoc.com/node/405 If this is similar to what's happening with your shuffle 2g ipod, I may have a weird solution. I spent a few nights troubleshooting this issue and searching many many sites and forums for solutions, all without success

  • Setting classpath not working in java control panelr of jre1.5

    -Dawt.toolkit=ttt.util.ProxyToolkit -cp ; ;C:\TTTHTML\TestingTool\tttruntime_v1.2.jar; when I place above path in java control pannel as runtime parameters browser is crashing in java 1.5 but in java 1.4 its working fine. Another observation i have m

  • How to maintain the sequence in the custom table

    Hi, We have custom table where we will store the standard text name based on different flags and it will be fetched the value according to the condition. Example code SELECT SINGLE field1                   field2              INTO  ( vaiable1 variabl

  • Pivot table data source keeps referring to old file name

    Hi, I am using Excel 2013 on Windows 8 I create a table, and insert a pivot table that use this table as data source I close the excel and rename the file from "myfile.xlsx" to "newfile.xlsx, and then open it again When trying to refresh my Pivot Tab

  • Passing values to include program

    HI, Need help on following. in my program A : DATA: BEGIN OF it_qlqua OCCURS 0.         INCLUDE STRUCTURE lqua. DATA:   altbatch TYPE ausp-atwrt,         v_verme TYPE kwmeng. DATA: END OF it_qlqua. INCLUDE zprogramB. perform check_lqua tables it_lqua