How to create a Tray dynamically

Hi All
I have tried to develop a method where I can create a tray dynamically.  I have embedded this code in the method WDDOINIT of my View called 'MAIN_VIEW'.   My longer term plan is to create x number of trays where x is dictated by the number of entires in an Internal Table.
The code I have written compiles, but nothing appears where I thought it would.  Can anyone spot what I have so fundementally missed?
Assistance is sincerely appreciated.
Regards
Tony
create object wd_this->all_in_one_util.
data: node_input  type REF TO if_wd_context_node,
      elem_input  TYPE REF TO if_wd_context_element,
      stru_input type if_main_view=>element_input.
data: lr_view                type ref to cl_wdr_view,
      lr_tray   type REF TO CL_WD_TRAY,
      tray_id  type string,
      lr_caption             type ref to cl_wd_caption,
      caption_id             type string,
      lr_grid_data           type ref to cl_wd_grid_data,
      lr_grid_layout         type ref to cl_wd_grid_layout.
*Navigate from <CONTEXT> to <INPUT> via lead selection
node_input = wd_context->get_child_node( name = if_main_view=>wdctx_input ).
lr_tray = cl_wd_tray=>new_tray(
    EXPANDED                 = ABAP_TRUE
    ID                       = tray_id
    VIEW                     = lr_view  "'MAIN_VIEW'
    WIDTH                    = '100%'
        set the caption of the tray
          concatenate lr_tray->id '_HEADER' into caption_id.
          lr_caption = cl_wd_caption=>new_caption(
                         id   = caption_id
                         text = 'text goes here'
                         view = lr_view ).
          lr_tray->set_header( lr_caption ).
        create the grid layout data for tray
          lr_grid_data = cl_wd_grid_data=>new_grid_data( lr_tray ).
        assign the layout data to the tray
          lr_tray->set_layout_data( lr_grid_data ).
        create a new grid layout for the content of the tray
          lr_grid_layout = cl_wd_grid_layout=>new_grid_layout( lr_tray ).
        assign the grid layout to the tray
          lr_tray->set_layout( lr_grid_layout ).

Hi Tony,
If we have to do any dynamic programming in webdynpro( creating UIelements dynamically ), WDDOMODIFYVIEW is the method where we need to code the logic for creating the tray.
But you have done the coding of creating tray in WDDOINIT thats why it is not working fine. Just the have the same code in WDDODMODIFYVIEW and you need to have below code to add this tray to view's ROOTUICONTAINER.
data:  lr_container TYPE REF TO cl_wd_uielement_container.
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
  " View is import parameter of wddomodifyview method.
lr_container->add_child( '' pass the tray that is created ' ).
This is the way to create dynamic UIelements in webdynpro using wddodmodifyview
For more information on dynamic programming have at following information
<a href="http://help.sap.com/saphelp_crm50/helpdata/en/44/2d9a41ed79a009e10000000a155106/frameset.htm">http://help.sap.com/saphelp_crm50/helpdata/en/44/2d9a41ed79a009e10000000a155106/frameset.htm</a>
Thanks,
Prashanth Kumar B

Similar Messages

  • How to create  some columns dynamically in the report designer depending upon the input selection

    Post Author: ekta
    CA Forum: Crystal Reports
    how  to create  some columns dynamically in the report designer depending upon the input selection 
    how  export  this dynamic  report in (pdf , xls,doc and rtf format)
    report format is as below:
    Element Codes
    1
    16
    14
    11
    19
    10
    2
    3
    Employee nos.
    Employee Name
    Normal
    RDO
    WC
    Breveavement
    LWOP
    Sick
    Carers leave
    AL
    O/T 1.5
    O/T 2.0
    Total Hours
    000004
    PHAN , Hanh Huynh
    68.40
    7.60
    76.00
    000010
    I , Jungue
    68.40
    7.60
    2.00
    5.00
    76.00
    000022
    GARFINKEL , Hersch
    66.30
    7.60
    2.10
    76.00
    In the above report first column and the last columns are fixed and the other columns are dynamic depending upon the input selection:
    if input selection is Normal and RDO then only 2 columns w'd be created and the other 2 fixed columns.
    Can anybody help me how do I design such report....
    Thanks

    Hi Developer life,
    According to your description that you want to dynamically increase and decrease the numbers of the columns in the table, right?
    As Jason A Long mentioned that we can use the matrix to do this and put the year field in the column group, amount fields(Numric  values) in the details,  add  an filter to filter the data base on this column group, but if
    the data in the DB not suitable to add to the matrix directly, you can use the unpivot function to turn the column name of year to a single row and then you can add it in the column group.
    If there are too many columns in the column group, it will fit the page size automatically and display the extra columns in the next page.
    Similar threads with details steps for your reference:
    https://social.technet.microsoft.com/Forums/en-US/339965a1-8cca-41d8-83ef-c2548050799a/ssrs-dataset-column-metadata-dynamic-update?forum=sqlreportings 
    If your still have any problem, please try to provide us more details information, such as the data structure in the DB and the table structure you are currently designing.
    Any question, please feel free to let me know.
    Best Regards
    Vicky Liu

  • How to create a folder dynamically in KM repository

    Hi All,
    Could you please let me know how to create the folder dynamically in KM...
    Thanks in Advance,

    >
    Romano Bodini wrote:
    > Hi,
    >
    > Search the forum. And the SDN. Then ask.
    >
    > [Creating folders in KM dynamically|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/1761]
    >
    > Romano
    Actually, "look at the API documentation" should be in that list.

  • How to create alv table dynamically by performing action on the button.

    Hi all,
    my requirement is to create alv table dynamically.
    that is i will create two buttons
    1) show alv table
    2) close alv table
    if user selects show alv table then the alv table should be displayed.
    and if user selects clsoe alv table then the alv table should be closed.
    to create alv table dynamically  i have followed this procedure.
    under view properties i have added salv_wd_table component. then under the action of showalvbutton i went to code wizard and i have selected instantiate used component component use salv_wd_table. the following code will be generated
    with this code i am unable to display alv table dynamically correct me where i went wrong kindly send me the necessary steps how to create alv table dynamically
    data lo_cmp_usage type ref to if_wd_component_usage.
    lo_cmp_usage =   wd_this->wd_cpuse_salv_wd_table( ).
    if lo_cmp_usage->has_active_component( ) is initial.
      lo_cmp_usage->create_component( ).
      endif.
    to close table i have used the following code. with this code i am able to achieve the functionality to delete the alv table
    data lo_cmp_usage type ref to if_wd_component_usage.
    lo_cmp_usage =   wd_this->wd_cpuse_salv_wd_table( ).
    if lo_cmp_usage->has_active_component( ) is initial.
      else.
      lo_cmp_usage->Delete_component( ).
    endif.
    Thanks & Regards,
    Naveen
    Edited by: naveen.webhelp on Feb 10, 2011 5:52 AM

    Hi
    ALV table will be shown in the viewcontainerUI element.
    it is shown there empty if you dont fill the node bound to the data node of the interface controller of the comp usage
    SALV_WD_TABLE.
    and if you are not getting the table filled in the first place.
    then check have you mapped the DATA node to some node in the comp controller
    wht basically is your requirment is that you want to show ALV gird on click of one button and delete it on click of other button.
    there are many ways to do so.
    best way is control the visiblity of the viewcontainer UI element which containes the TABLE view of SALV_WD_table comp.
    create an attribute of type WDUI_VISIBILITY name say VIS.
    now go to the layout and bound hte visible property of the viewcontainer to this attribute VIS.
    then in the showalv grid button's eventhandler write
    wd_context->set_attribute(
    name = 'VIS'
    value = '02'
    and in the wddoinit and delete alv grid button's event handler write
    wd_context->set_attribute(
    name = 'VIS'
    value = '01'
    thanks
    sarbjeet singh

  • How to create a viewobject dynamically without using wizard

    Hi,
    I am Using jDEV 11G, i need to create a viewobject dynamically without using wizard, without binding from any entity.
    Actually my intention is to make a grid like in .Net, when a user want to create a new row in RichTable without using DB.
    just like shopping cart.
    i have done thsi code:
    ViewObjectImpl view=new ViewObjectImpl();
    view.addDynamicAttributeWithType("Att1","String",null);
    view.addDynamicAttributeWithType("Att2","String",null);
    view.addDynamicAttributeWithType("Att2","String",null);
    Row rw=view.createRow();
    rw.setAttribute("Att1","First1");
    rw.setAttribute("Att2","First2");
    rw.setAttribute("Att2","First3");
    view.insertRow(rw);
    I have a RichTable , i need bind this viewobject into that.
    Edited by: vipin k raghav on Mar 10, 2009 11:39 PM

    Hi Vipin,
    You can create the view object with rows populated at run time.
    [http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/bcquerying.htm#CEGCGFCA]
    For reference of how to create an empty rwo at run time on button click
    [http://kohlivikram.blogspot.com/2008/10/add-new-row-in-adf-table-on-button.html]
    ~Vikram

  • How to create a view dynamicly in plsql?

    I need to write a pl/sql package to create a view dynamic
    ,but i can't use 'create or replace view xxxx as select *
    from db where ...',I know the dbms_sql package can parse the
    'select' sentence,but i don't know how to create a view,only can
    drop a view,who can help me?
    thanks!
    null

    Try 'EXECUTE IMMEDIATE 'CREATE AS SELECT....' in your PL/SQL
    xhpxorcl (guest) wrote:
    : I need to write a pl/sql package to create a view dynamic
    : ,but i can't use 'create or replace view xxxx as select *
    : from db where ...',I know the dbms_sql package can parse the
    : 'select' sentence,but i don't know how to create a view,only
    can
    : drop a view,who can help me?
    : thanks!
    null

  • How to create a textfile dynamically(with in the loop) with given data?

    Hi all,
    Can anyone Please guide me how to create a text file in the given path dynamically? (with in the loop) with given data.
    For example:
    <%
    String data1="name";
    String data2="address";
    for(int i=0;i<10;i++)
    create the textfile at c:/test/sample.txt//name of the each file created being "sample.txt"
    //contents of text file will be
    data1+i; //to get name1,name2.....
    data2+i// to get add1,add2........
    delete(sample.txt) //to enable to create another file in the loop with same name
    %>

    The code which Ashokan mentioned is not is not creating a file.
    i used code given below to create and write into it.
    But, not is writing into it. I don't konw, where i am going worng !
    Code
    String sample2="C:/Ash/sample2.txt";     
                                                                                    FileWriter fw = new FileWriter(sample2,true);
                                            BufferedWriter bw=new BufferedWriter(fw);
                                            bw.write("EMP ID");     
                                            bw.newLine();
    Please help
    Regards
    aSh

  • How to create internal table dynamically based on a table entry

    hi Experts,
      I have table yprod_cat. It has product categories.
      In my ABAP program I need to create internal table dynamically based on the number of entries in the table.
      For example:
      If the table has 3 entries for product category
      1. Board
      2. Micro
      3. Syst
    Then create three (3) internal tables.
    i_board
    i_micro
    i_syst
    How can we do this? Any sample code will be very usefull
    Thanks & Regards
    Gopal
    Moderator Message: No sample codes can be given. Please search for them or work it!
    Edited by: kishan P on Jan 19, 2011 4:22 PM

    Our APEX version is 4.2We are using below SQL query to display radio groups dynamically..
    SELECT APEX_ITEM.RADIOGROUP (1,deptno,'20',dname) dt
    FROM dept
    ORDER BY 1;
    Created a form using SQL type and given abouve SQL query as source.. But when we run the page, there were no radio groups displayed in the page..
    Below is the output of the query..
    <input type="radio" name="f01" value="10" />ACCOUNTING
    <input type="radio" name="f01" value="20" checked="checked" />RESEARCH
    <input type="radio" name="f01" value="30" />SALES
    <input type="radio" name="f01" value="40" />OPERATIONS
    >
    If Tabular Form:
    Edit Region > Report Attributes > Edit Column > Change the Column type to "Standard Report Column"
    If normal Page Item:
    Edit Page Item > Security > Escape special characters=No.
    Pl read the help on that page item to understand the security risk associated with =NO.
    Cheers,
    Edited by: Prabodh on Dec 3, 2012 5:59 PM

  • How to create and use dynamic queue in JMS

    Plz tell me how to create and use a dynamic queue in jms and can reciever file lookup it as it lookup any server configurred queue(written in the server).

    Hi,
    We can use Azure File services to do this, for more information, please have a look at this article:
    http://blogs.msdn.com/b/windowsazurestorage/archive/2014/05/12/introducing-microsoft-azure-file-service.aspx. The Azure File service exposes file shares using the standard SMB 2.1 protocol. Applications running in Azure can now easily share files between
    VMs using standard and familiar file system APIs like ReadFile and WriteFile.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to create a table dynamically in webdynpro

    hai everybody
    in webdynpro we know how to create at design time
    but i want to create it at runtime that is dynmamically i want to set the rows and coloums of the table at run time
    Thanks & Regards
    sravan

    I guess this should work,
    Suppose you want to dynamically create a Table (say Category) having a column called Category Code, then in the wdDoModifyView() hook method, just add the following code snippet,
    if (firstTime) {
    //Create the Table UI Element
    IWDTable table = (IWDTable) view.createElement(IWDTable.class, null);
    //Set the Table Header
    IWDCaption tableCaption = (IWDCaption) view.createElement(IWDCaption.class, null);
    tableCaption.setText("Category Table Contents");
    table.setHeader(tableCaption);
    //Create and add a Column UI element for the above table     
    IWDTableColumn column = (IWDTableColumn) view.createElement(IWDTableColumn.class, null);
    table.addColumn(column);
    //Set the required column header using the caption (Category Code here)                         
    IWDCaption caption = (IWDCaption) view.createElement(IWDCaption.class, null);
    caption.setText("Category Code");
    column.setHeader(caption);
    //Create a TableCellEditor and bind it to an attribute of the Category Node in the context     
    IWDTextView editor = (IWDTextView) view.createElement(IWDTextView.class, null);
    editor.bindText("tb_Category.cat_code");
    column.setTableCellEditor(editor);
    //Finally add the Table UI element to the view          
    IWDUIElementContainer root = (IWDUIElementContainer) view.getRootElement();
    root.addChild(table);
    You need to follow the same procedure for adding multiple columns to the table.
    Hope this answers your question!
    Regards
    Kishan

  • How to create report with dynamic columns with static row labels

    Hi All,
    I am creating one report as per attached format. I have labels on the right side of the report
    and data in 3 columns. The data is taken dynamically from the command query.
    It gets data from 3 different result sets/command queries.
    I tried creating the report horizontally instead of vertically, but the logo image I am not able to rotate in 270degrees.
    Can anybody tell me how to create the report...??

    Hi Abhilash,
    Thanks for the quick reply.
    Actually the problem is with the image, as I am not able to rotate 270 degree. Crystal report cannot support the rotation of image.
    i have another problem, I have to create a report in which
    Lables are fixed on the left side of report and 3 columns per portrait page. Those columns are
    dynamically created and shown in the report.
    The format is like the above. Can you please help me in doing this report, as I tried it doing
    with CrossTab. I am really stuck to this report.

  • How to create a database dynamically

    I am trying to create mysql database dynamically through java. Also please help me how to execute *.sql file in java.

    dheerajsea123 wrote:
    I am trying to create mysql database dynamically through java. Also please help me how to execute *.sql file in java.If possible it depends on the database and driver.
    If possible the exact methodology varies by database (driver shouldn't matter.)
    Normally it is not considered a good practice for traditional server applications.

  • How to create a constructor dynamically

    Hi ,
    I want to create a constructor dynamically.
    I have a bean class with 30 fields.
    In my application I want to use this bean objects to hold the data returned from a ResultSet.
    But the problem is I have dynamic columns returned by the ResultSet. some times it gives 10 & some times it will be 20.
    I want to create a constructor on the fly with these dynamic columns.
    Is it possible with the reflection API ? if possible, please give me sample code or link.
    thanks
    bhuvan

    One way I have implemented a solution for this issue is creating a 'TransferEntity' that contains the generic values (in an array usually). Then you can wrapper this class with a "friendlier" one that has Get/Set methods. This allows you to always get the values you need (because the TransferEntity is inside) if they are variable. If not variable, you can simply use the Get/Set (which would reach inside the TransferEntity). Depending on how you're using the bean, you can simply put all the Get/Set methods inside and either return null, throw a NoSuchFieldException, etc.
    Hope this helps...
    Edited by: dfortae on Apr 29, 2010 2:44 AM

  • How to create table columns dynamically ?

    Hi All,
    I am working on an SSRS report that will show sales in the past 5 years. If the user selected to view sales of past 3 years he will only see 3 columns. so How can I create table columns dynamically at run time and how can I make sure that their dimensions
    will adjust to fit the report page size.

    Hi Developer life,
    According to your description that you want to dynamically increase and decrease the numbers of the columns in the table, right?
    As Jason A Long mentioned that we can use the matrix to do this and put the year field in the column group, amount fields(Numric  values) in the details,  add  an filter to filter the data base on this column group, but if
    the data in the DB not suitable to add to the matrix directly, you can use the unpivot function to turn the column name of year to a single row and then you can add it in the column group.
    If there are too many columns in the column group, it will fit the page size automatically and display the extra columns in the next page.
    Similar threads with details steps for your reference:
    https://social.technet.microsoft.com/Forums/en-US/339965a1-8cca-41d8-83ef-c2548050799a/ssrs-dataset-column-metadata-dynamic-update?forum=sqlreportings 
    If your still have any problem, please try to provide us more details information, such as the data structure in the DB and the table structure you are currently designing.
    Any question, please feel free to let me know.
    Best Regards
    Vicky Liu

  • How to create Invisible Element Dynamically?

    Dear All,
    I am trying to create a Form dynamically and for aligment prupose i need to create one InvisbleElement also dynamically.But i dont know why that is not reflecting in the Screen .The code is deploying properly without error but the Invisible Element is not getting created .The code i used is
    IWDInvisibleElement Invis1=(IWDInvisibleElement)view.createElement(IWDInvisibleElement.class,null);
    Invis1.setEnabled(true);
    Invis1.setVisible(WDVisibility.VISIBLE);
    thetransparent.addChild(Invis1);
    Can anyone please tell me if i need to set any property or if the method i am creating is wrong .Please guide me in the correct way.
    Thanks and Regards,
    Nishita Salver

    Hi,
    check "Dynamic Programming" part in below library file
    http://help.sap.com/saphelp_nw70/helpdata/EN/0f/f08841e3af1609e10000000a155106/frameset.htm
    or else,
    still you are getting Problem, create any other ui element and set its visibility to false. (dont know how far it will help you)
    regards,
    Pradeep
    Edited by: pradeep bondla on Jun 25, 2008 3:20 PM

Maybe you are looking for

  • Error in Form Printing ADS: SOAP Runtime Exception

    Hi Gurus, while printing the PF forms or form 16 for that matter i am getting an error ADS: SOAP Runtime Exception: CSoapExceptionTransport :(100101) Any idea as to why the same is coming..and how to go about solving the issue.......... Regards Ankus

  • Without using order by and connect by clause

    hi all, can i write a tree query without using start with clause and connect by clause and can i order the employee names in a select query without using order by clause can those things are possible in select statement...

  • Scshutdown fails - "Rolling Upgrade in progress"

    Anybody seen this before? bash$ sudo scshutdown -g 0 -y scshutdown: Cannot shutdown the cluster. Rolling Upgrade in progress. bash$ No one has (with intention) started an upgrade on this cluster.. Its SC3.1 U2 on Solaris 8.

  • Why do we have to flashback the failed primary DB to make it the new standby ?

    RDBMS Version: 11.2.0.3 Platform : RHEL 5.8 Standby Type : Physical Standby Primary DB name        : berlin Standby DB Unique name : lisbon Lets say berlin DB goes down due to a hardware failure so lisbon is made the Primary DB. Now lisbon is running

  • Multiple Workflows Created because of BOR event

    Hello, I have created a workflow which is triggered based on an event.  I've created a subtype to BUS2054 called ZBUS2054.  It is called WBS_EXTRA.WBS_Changed.  I've attached this, using transaction BSVW, to listen for when WBS elements are changed t