Dynamic columns for dataTable

Hi,
I want to add column to dataTable in Studio Creator. How can I do that ? Any idea ?
Thanks
Wilson

In your bean code add code something like below
private UIColumn mycolumn = new UIColumn();
    public UIColumn getMyColumn() {
        return mycolumn ;
    public void setMyColumn(UIColumn uic) {
        this.mycolumn = uic;
    }and in your jsf page you can do something like below
<h:column binding="#{YourBean.mycolumn }" id="column1">
                            <h:outputText value="My Value"/>
                            <f:facet name="header">
                                <h:outputText  value="My Header"/>
                            </f:facet>
                        </h:column>regards
Sudhakar

Similar Messages

  • Define Dynamic column for integrated inbox

    hi ,
    can any one explain me what is the puprose of this setting.
    SPRO>SRM>Cross application basic settings>sap business workflow>define Dynamic columns for integarted inbox.
    what we maintain here and how it is helpful
    regards
    subhash

    Hi Subhash,
    Please check if the following link helps you:
    How to add an extra dynamic columns in workflow inbox?
    Regards,
    Saumya

  • Dynamic columns in datatable...

    Hi guys,
    i've a question about datatable.
    I have to use datatable for inserting data into db.
    My question is:
    I'm developed a datatable with 5 columns and various rows,i've create an actionlistener and when i click it each row is successfully inserted.
    Now i want adding some columns to datatable depending by a number inserted by user.
    That is:
    the user inserts 3(for example) and the user sees in another page
    the datatable with the 5 fixed columns and others 3 columns...
    Clicking the actionListener i want the 5 columns values were inserted in a table(and it's easy) and the others variable column's number were inserted as different row in another table...
    excuse me for my english....i try an example....
    This can be one row
    giuseppe napoli milano italia europa ---variable(age address sex)----i want giuseppe napoli milano italia europa is inserted as a row in user table and age,address,sex are inserted as different rows into details table....
    i want knowing how ciclying among dynamic different columns values and inserting each value as a different row....
    thanks very much,please help me with code or ideas...

    thanks...
    but my problem is this:
    i've create a populate method that has to add dynamic column,i've supposed a fixed value,3, to my existing datatable.
    public HtmlDataTable populateMyDataTable() throws Exception{
              getBiosampleDataTable();
              for (int i=0;i<2;i++){
                   //UIOutput header = new UIOutput();
                //header.setValue(headers);
    // Set output.
    UIInput output = new UIInput();
    ValueBinding biosampleItem =
    FacesContext
    .getCurrentInstance()
    .getApplication()
    .createValueBinding("#{biosampleItem[" + i + "]}");
    output.setValueBinding("value", biosampleItem);
    // Set column.
    UIColumn column = new UIColumn();
    //column.setHeader(header);
    column.getChildren().add(output);
    // Add column.
    biosampleDataTable.getChildren().add(column);
    setBiosampleDataTable(biosampleDataTable);
              return biosampleDataTable;
    i've
    public HtmlDataTable getBiosampleDataTable() throws Exception {
              loadBiosamples();
              return populateMyDataTable();
         }and
    public void loadBiosamples() throws Exception {
              if (load==0){
              for (int i = 0; i < nrows; i++) {
                   Biosample biosample = new Biosample();
                   biosamples.add(biosample);
                   setBiosamples(biosamples);
                   load=1;
              else
                   setBiosamples(biosamples);
         where is my error?
    I'vejavax.faces.el.EvaluationException: javax.faces.el.EvaluationException: Exception getting value of property biosampleDataTable of base of type : giu.BiosamplesTableand i'm not sure about my code...can you help me?

  • Generating dynamic columns for a report

    Hi all,
          Can anybody pls. tell me how to output dynamic columns in a report. my req. is that i've to generate so many columns as there are no. of unique(a particular field value) rows in my internal table. for e.g say suppose i've 5 rows in my internal table which has 2 fields, one short text & it's corresponding value. so now my report output shud have 5 columns with the short text as the column heading & the their corresponding values below each column heading. i heard it can be done thru field-symbols. can anyone pls. guide me.

    Hi Sushma,
    This piece of code might be useful.
    The following sections will help you to understand the steps required to define a Dynamic ALV.
    Following symbol signifies:
    Þ                    Important
    Main Steps Required
    The following are the main steps that are to be performed for defining a dynamic Alv
    1.       Defining a field catalog
    2.       Defining the dynamic table
    3.       Filling data into the table
    4.       Displaying ALV list
    Defining a field catalog
    The purpose of defining a field catalog first in case of Dynamic ALV is somewhat different than in case of normal ALV. In case of Dynamic ALV the field catalog is used to define the final internal table that will hold the data, and would be used to display the final output.
    Þ It is very important to remember that the field catalog table be refreshed first, else it might give an error.
    For example:
    DATA: T_FIELDCAT TYPE LVC_T_FCAT,
    L_FIELDCAT TYPE LVC_S_FCAT.
       Refresh T_FIELDCAT.
      CLEAR L_FIELDCAT.
      L_FIELDCAT-FIELDNAME = 'LIFNR'.
      L_FIELDCAT-INTTYPE = ''.
      L_FIELDCAT-OUTPUTLEN  = 10.
      L_FIELDCAT-COLTEXT  = TEXT-002.
      APPEND L_FIELDCAT TO T_FIELDCAT.
    Defining the dynamic table.
    This table will hold the final data that needs to be displayed. To declare the table the following things need to be done.
    Declare a field symbol
    Displaying Alv List
    This is done in the same way as we do for normal Alv. Call function “REUSE_ALV_GRID_DISPLAY” and pass the field catalog table in the export parameters and the dynamic table in Tables.
    Reward Points if it is helpful.
    Reagrds,
    Kiran I

  • Dynamic columns for ALV/classical

    Hi friends,
    I came across an issue where I need to create an output list based on the selection screen.
    Example: In selection screen if user enters plant 1000 2000 3000 4000 .
    I want the output table having columns 1000 2000 3000 4000 .
    Please help me out how to accomplish this task.  Is  this functionality is possible with ALV..?
    A sample code for this will really help me a lot .. or send me your valuable suggestions..
    Thanks
    Prasead K

    Search sdn for [cl_alv_table_create=>create_dynamic_table|https://www.sdn.sap.com/irj/scn/advancedsearch?query=cl_alv_table_create%3d%3ecreate_dynamic_table&cat=sdn_all], there are already many threads and samples. Basically, you dynamically fill an ALV fieldcatalog, then use the method to create a dynamic internal table from this catalog, fill the internal table and display it.
    Regards

  • Special characters in SBWP dynamic columns are not showing for some users

    Hi experts,
    We have set up a dynamic columns for business workplace. One of the field displays the comments entered by the user. Some users are able to see the values entered perfectly. But for some users, if we enter special characters like @gopal, it is not displaying the value in dynamic column.
    Are there any workflow/user settings need to be changed.
    Thanks
    Gopal

    I had the same issue, you should check the link between AD and CRM, so you could make a new user in AD and connect your CRM account with it, then you should return the old AD account back. It worked for me, try it :)

  • Dynamic columns in ALV report

    halo fellow SAPiens,
    i need to show dynamic columns for a particular material........the scenario is as follows....
    1) there r 7 fixed columns describing the material...
    2)when the material returns back to the plant for some reason , i need to insert a column which shows the date and reason(char) of return.
    3)again after dispatching the material for some reason it comes back again a new column shld be displayed showin the date and reason(char).
    4)if the material doesnt come back...the report shows only 7 columns.
    any solution?

    try <a href="http://www.alvrobot.com.ar/home.php">here</a>  ......its a useful tool for dealing with ALV
    <b>reward points if useful</b>

  • Problem with dynamic column in SBWP

    Hi Friends,
    In SWL1 I have created two attributes with header as "CANCELLED" and " DESCRIPTION" for a particular task.But my SBWP is still showing columns as "Dynamic column" for the workitems of that task.
    Please help me on this.
    Thanks.
    Dilip

    Hi Dilip,
    The column headings will only appear in the task-specific view. In other words, by default the headers will be generic because you can have mixed tasks in the worklist, and column 1 can be a date for one task and a company name for another.
    The user needs to expand the tree on the left hand side and navigate to the "Approve Purchase Order" (or whatever) node to show only items of that task, then column headers should show up.
    Regards,
    Mike

  • Dynamic columns with grouping.... in crystal report...using java /c# api ??

    I need to create a report with dynamic columns
    for e.g/
                                           Pre   Scen 1   Scen 2   Scen 3   Scen 4   Scen 5   Scen 6      .....
    *Total                          4.5118   4.5118    4.5118   4.5118   4.5118        4.5118   4.5118     *
    *Canada                    1.7180    1.7180    1.7180   1.7180  1.4103     8.4103      8.4103     *
       BG                           1.6224    0.9641    1.0473   1.0473  6.4635     6.4635  1.6224     
       BI                              0.044     0.0827     0.3578   0.3578 0.0560     0.0560   0.0744     
      DIN                    0.0056     -0.0655     -0.0215     -0.0215     -0.0210     -0.0210     0.0056     
    *Czech Republic     1.7180     1.7180     1.7180     1.7180     18.4103     18.4103     18.4103     *
      CEE               0.0275     1.0000     0.7359     100.0000     0.0858     0.0858     0.0275     
    *Israel               1.7180     1.7180     1.7180     1.7180     18.4103     18.4103     18.4103     *
      F                    0.0077     1.0000     0.7359     100.0000     -0.0035     -0.0035     0.0077     
    *United States          1.7180     1.7180     1.7180     1.7180     18.4103     18.4103     18.4103     *
      A                    0.0144     0.1871     91.0473     0.0679     0.0544     0.0544     0.0144     
      AA                    0.0428     0.0626     0.3578     0.0675     0.1175     0.1175     0.0428     
      AB                    0.0431     0.1553     -0.0215     0.1685     0.1199     0.1199     0.0431     
    in this report....grouping will be parameterized ....and total also required at every stage...
    so how can i add the columns dynamically ?
    number of columns are not fixed...they may be 20...30....etc

    Requirement is...
    I have a table scn ... where i can make entries any time....assume they are some rules...
    I have another table called t1 ... where i need to calculate values of t1 again some specific rules are table scn.
    So for each t1 there will be one row with columns as scn entries which I select on interface.
             Original Value  --  Sc1 ......  Sc2  ...... Sc3  ......  Sc4 ......  Sc5 . . . . . .. .
    t1...................xx...... xx..........xx..........xx........ xx........ xx
    t3...... .............xx...... xx..........xx..........xx........ xx........ xx
    t4....................xx...... xx..........xx..........xx........ xx........ xx
    selection of these scn columns will be dynamic....so i cant create n number of columns in the report template and hide them as per requirement....it will not work.
    Wat is a feasible solution to create such kind of report ?
    Can we create template in C# or .net ?
    IF yes...do we have to save every time in order to render report ?
    e.g.   one report may contain 4 columns and other 10 ... so do i have to create new rpt file each in order to render the report ?
    Please if any1 have approach to create this kind of report then it will very helpful....
    Edited by: pchawan on Jul 19, 2011 11:28 PM

  • Handling ALV Layout & Dynamic Columns

    I have a custom report for Purchasing / Finance.
    1) I create 5 dynamic columns for the purchase rder invoices based on the report run date.
    Example:
    Previous Quarter   [Q4 2009]  [Q1 2010]   [Q2 2010]  [Q3 2010]
    My query is that this report has layouts defined. I want to add the dynamic columns to the report output.
    Example:  In the below scenario i have dynamic columns in the  fieldcat[] but the report shows only the columns defined in the layout selected. 
    disvariant-VARIANT has the layout selected from the seelction screen of the report.
    Also fieldcat-tabname = '<fs_table> '.
    CALL METHOD alv_grid->set_table_for_first_display
       EXPORTING
          is_variant                    = disvariant
          i_save                         = 'A'
          is_layout                     = layout
          is_print                        = print
       CHANGING
          it_outtab                     = <fs_table>
          it_fieldcatalog             = fieldcat[]
          it_sort                         = sort[]
       EXCEPTIONS
         invalid_parameter_combination = 1
         program_error                 = 2
         too_many_lines                = 3
         OTHERS                        = 4
    Appreciate if anyone knows the solution.

    I don't believe you can display the dynamic columns and still use the variant from the selection screen.
    Have you considered using multiple table rows for the multiple time periods?
    If you will always have 5 dynamic columns, maybe you can make them not dynamic and just make the column header text dynamic?

  • How to add an extra dynamic columns in workflow inbox?

    Hi Every Expert,
    Transaction SWL1 only provides Six columns as dynamic columns for workflow inbox. But we need to use 7 to 8 dynamic columns. How to add these two extra columns into workflow inbox?
    Thanks,
    Shirley

    Thank you very much for all you responses.
    Due to SAP only provides 6 columns, I can't add anohter extra dynamic column. I may consider to change task to show the contents in preview pane.
    Thanks again to everyone.
    Shirley,

  • Dynamic Columns in UWL  from the NWBC 3.0?

    Hi  People
    Is there anyone that know how to change the UWL so it uses Dynamic Columns for Worklist . I know that it is possible to do this in the portal by changing the XML's to the UWL. But at the moment i am trying to get this to work from the NWBC 3.0.
    When i setup the uwl in NWBC i use the dynpro application SWF_WORKPLACE.
    thanks in advance.

    Hi,
    I have the same problem. Does anyone how to do it?
    Thanks in advance,
    Cecilia.
    Edited by: Cecy_Vivar on Jun 22, 2011 12:15 AM

  • Dynamic add column to datatable

    Hi ,
    How can I add columns to datatable dynamically ? I don't know how many columns will be selected.
    Actually I don't know how to do it in the jsp file. There is columns tag in it. Is there any tag like 'for' ?
    Thanks in advance.
    Wilson

    thanks for that but still cannot figure out what is wrong with my code (I'm really getting crazy !). I can see the titles of the columns but I cannot see any data. Any ideas ?
                   <h:dataTable styleClass="dataTable" id="tablecsv"
                        binding="#{mainPage.dataTable}" rendered="#{mainPage.completed}"
                        value="#{mainPage.resultsModel}" var="varresultsModel" />
        public UIData getDataTable()
            FacesContext context = FacesContext.getCurrentInstance();
            String[] cols = getTheTable();
            List children = dataTable.getChildren();
            children.clear();
            dataTable.setVar("vartableRow");
            for (int i = 0; i < cols.length; i++)
                UIColumn col = new UIColumn();
                col.setId("column" + i); //?
                UIOutput out  = new UIOutput(); //?
                out.setId(cols[i] + i); //?
    /*           children.add(col);
                HtmlOutputText header = new HtmlOutputText();
                String label = "" + cols;
    header.setValue(label);
    col.setHeader(header);
    HtmlOutputText data = new HtmlOutputText();
    col.getChildren().add(data);
    data.setValueBinding("value", context.getApplication().createValueBinding("#{" + (i +1) + "}"));
    HtmlOutputText header = new HtmlOutputText();
    String label = "" + cols[i];
    header.setValue(label);
    col.setHeader(header);
    ValueBinding vb = FacesContext.getCurrentInstance().getApplication().createValueBinding("#{result." + cols[i] + "}");
    out.setValueBinding("value", vb);
    col.getChildren().add(out);
    dataTable.getChildren().add(col);
    this.completed = true;
    return this.dataTable;
    public ArrayList getResultsModel()
                   this.resultsModel = new ArrayList();
                   for (int n = 0; n < getTheTable().size() - 1; n++)
                   this.resultsModel.add(new Integer(n));
    return this.resultsModel;

  • Dynamic binding for table column

    Hi,
    I am using standard application and in a table (not ALV) i want to chnage the name of a column. Already a OTR is placed in it so am planning to do a dynamic bind for the text in the header. Kindly suggest ways.
    Thanks,
    Koushik

    DATA:
            l_caption          TYPE string,
            l_title            TYPE string.
      data lr_caption type ref to cl_wd_caption.
    *---Get OTR Text for Value Description
      CALL METHOD cl_wd_utilities=>get_otr_text_by_alias
        EXPORTING
          alias      = 'ZPERF_MGMT_DEV/RATING'
      language   =
        RECEIVING
          alias_text = l_title.
    lr_caption ?= view->get_element( 'TBL_VAL_HELP_DESCRIPTION_HEADER' ).
    lr_caption->set_text( value = l_title ).

  • Cannot use alias for dynamic column name in SELECT statement

    Hi,
    I want to retrieve values from several tables by using dynamic column & table name as below:
    DATA: tbl_name(30) TYPE c VALUE '/bic/tbi_srcsys',  " staticly initialized for this example
               col_name(30) TYPE c VALUE '/bic/bi_srcsys'.  " staticly initialized for this example
    SELECT (col_name) INTO CORRESPONDING FIELDS OF TABLE it_values FROM (tbl_name).
    The internal table "it_values" does not contain a field named "/bic/bi_srcsys", instead it has another generic field "value" so that the above code can be applied to other tables. I tried to use alias (AS) as below:
    SELECT (col_name) AS value INTO CORRESPONDING FIELDS OF TABLE it_values FROM (tbl_name).
    But this cannot work. I know that there are other ways to solve this problem, such as by using a single field in SELECT .. ENDSELECT and subsequently appending it to the work area and internal table as below:
    SELECT (col_name)  INTO (lv_value) FROM (tbl_name).
      wa_value-value = lv_value.
      APPEND wa_value TO it_values.
    ENDSELECT.
    Just wonder if there is any other more elegant workaround, because I might have several other fields instead of only one?
    Thanks.
    Regards,
    Joon Meng

    Hi Suhas,
    thanks for the quick reply.
    Sorry that I have not well described the structure of the internal table "it_values". This internal table contains several other fields (key, type, value, etc.).
    I guess that the following code
    SELECT (col_name) INTO TABLE it_values FROM (tbl_name).
    works if the internal table only has one field (value) or the field "value" is in the first position, right?
    In this case, I need to fill the "value" field of internal table it_values (ignore the other fields like type, key) with values retrieved from (col_name) of the DDIC table.
    Looking forward to your reply.
    BR,
    Joon Meng

Maybe you are looking for