Dynamic to generate the data tables

Hi, I would like to dynamically generate data tables or faces components based on some parameter ? Might I have some suggestion or examples ?
Thanks

Here is the codes in my jsp page and opHandler class.Is anything wrong ?
In jsp page :
     <h:dataTable border="0" binding="#{opHandler.test1}">                                        
     </h:dataTable>
====================================================
In opHandler class:
     * @return Returns the test1.
     public HtmlDataTable getTest1() {
          System.out.println("TEST");
          test1 = createDataTable();
          return test1;
     private HtmlDataTable createDataTable()
     String el ;
     ValueBinding val;
     HtmlDataTable dataTable = new HtmlDataTable();
System.out.println("getTable");
// Faces Application
FacesContext context = FacesContext.getCurrentInstance();
Application application = context.getApplication();
// DataTable
el = "#{" + "opHandler.shpModel" + "}";
val = application.createValueBinding(el);
dataTable.setValueBinding("value", val);
dataTable.setVar("shpList1");
dataTable.setStyleClass("dataTable");
dataTable.setWidth("98%");
dataTable.setColumnClasses("columnClass1");
dataTable.setRowClasses("oddRow,evenRow");
// Column1
UIColumn fltColumn = new UIColumn();
// Column 1 : Header information
HtmlOutputText fltHeader = new HtmlOutputText();
fltHeader.setValue("Flight");
fltColumn.setHeader(fltHeader);
// Column 1 : Output content information
HtmlOutputText fltOutput = new HtmlOutputText();
el = "#{" + "shpList1.dest" + "}";
val = application.createValueBinding(el);
fltOutput.setValueBinding("value",val);
fltOutput.setId("flt");
fltOutput.setStyleClass("outputText");
fltColumn.getChildren().add(fltOutput);
dataTable.getChildren().add(fltColumn);
return dataTable;
}

Similar Messages

  • Generating dynamic command links in data table

    Hi,
    I have a requirement to generate dynamic number of columns in a datatable. Also these columns should contain a command link.
    I have written following piece of code to do so...
    public UIData getDataTableBinding()
         UICommand comm = null;
         UIColumn col;
         UIOutput out = null;
         Application app = app = FacesContext.getCurrentInstance().getApplication();
    // Suppose I want to generate 7 columns
         for(int j = 0; j < 7; ++j) {
         out = new UIOutput();
         col = new UIColumn();
         comm = new UICommand();
         ValueBinding vb = app.createValueBinding("#{" + j + "}");
         out.setValueBinding("value", vb);
         out.setRendererType("javax.faces.Text");
         comm.setRendererType("javax.faces.Link");
    comm.getChildren().add(out);
         MethodBinding mbButton = app.createMethodBinding("#{pc_File1.doLink1Action}",
    null);
         comm.setAction(mbButton);
         col.getChildren().add(comm);
         dataTableTemp.getChildren().add(col);
         return dataTableTemp;
    I have bound the "binding" attribute of the data table to getDataTableBinding()
    method.
    If I remove all the references to UICommand i.e comm variable, table is displayed properly, but if
    I try to include a command link component as mentioned above I get "Assertion failed error"
    SRVE0068E: Could not invoke the service() method on servlet Faces Servlet. Exception thrown :
    javax.servlet.ServletException: javax.faces.el.EvaluationException: Error getting property
    'dataTableBinding' from bean of type pagecode.File1: javax.faces.FacesException: Assertion Failed
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:638)
         at com.ibm._jsp._File1._jspService(_File1.java:92)
         at com.ibm.ws.jsp.runtime.HttpJspBase.service(HttpJspBase.java:88)
    Any kind of help on this issue would be appreciated,
    Thanks in advance,
    Raina

    Hi,
    I solved my problem just by replacing UIOutput component with HtmlOutputText component and then making it as a child component of UICommand component.
    Now I am facing a new problem. Whenever I try to refresh the page I get following exception
    "SRVE0026E: [Servlet Error]-[Faces Servlet]: java.lang.IllegalStateException: Duplicate component ID 'form1:table1:cmd0' found in view."
    I am explicitly setting the component id of the UICommand component using the setViewId() method.
    This problem is observed only when I refresh the page. In case I navigate to another page and then again come back to this current page, then I don't get this exception.
    Your help would be appreciated,
    Raina

  • Creation of internal table dynamically based on the Date Range entered

    Hi SAPgurus,
    I have been facing one issue i.e creation of internal table dynamically based on the date range entered in the selection screen. For example the date range I am giving as 06/2006 to 08/2006, it should display the Fieldcatelog dynamically, this part i have completed but the only issue I am facing is to populate the sales data into that fields.
    Right now my program is displaying the ALV like this.
    Ex:
    <b>CSR    District   06/2006  07/2006  08/2006  totals</b>      
    Shiva      New York                             10.00
    Shiva      new york                             30.00
    Shiva      new york                             40.00
    but it should display like this
    <b>CSR    District 06/2006 07/2006 08/2006 totals</b>
    Shiva  New York  10.00   30.00 40.00
    80.00                 
    Please help me in this scenario, how to acheive like this..
    Thanks & Regards,
    Sivaram Kandula

    Hi Sivaram,
                 I also got the same requirement . i saw rich and your code whatever you have uploaded.i have created dynamic internal table but i am facing the issue to populating the data to my dynamic internal table.
    Sivaram, can you please explain your code after this.
    *<dyn_table>
    *tab_item.
      LOOP AT tab_item.
        ASSIGN COMPONENT 1 OF STRUCTURE <dyn_wa> TO <dyn_table>.
        ASSIGN COMPONENT 2 OF STRUCTURE <dyn_wa> TO <dyn_table>.
    *    <dyn_wa> = tab_item-bztxt.
    *    <dyn_wa> = tab_item-total.
    *    APPEND <dyn_wa> TO <dyn_table>.
    **    <dyn_wa> = tab_item-total.
    **    ASSIGN tab_item-bezei  TO <dyn_wa>.
    *  APPEND <dyn_table>.
      ENDLOOP.
    how you are puting the loop at tab_item. but tab_item is already commented.
    can you send me the code after that.
    i am sending some part of my code.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
       EXPORTING
         it_fieldcatalog = gt_fCAT1
       IMPORTING
         ep_table        = new_table.
    ASSIGN new_table->* TO <dyn_table>.
       create data new_line like line of <dyn_table>.
       assign new_line->* to <dyn_wa>.
    select vbeln
            fkart
            vkorg
            vtweg
            fkdat
            spart
            fksto
            from vbrk
            client specified
            into table gt_vbrk
            where mandt = sy-mandt
            and fkart in ('ZF5','ZFR')
            and vkorg = '1100'
            and vtweg = '20'
            and fkdat in s_fkdat
            and spart = '06'
            and fksto = ' '.
       if gt_vbrk[] is not initial.
      select  vbeln
              fkimg
              prsdt
              netwr
              matnr
              arktx
              werks
              mwsbp
              from vbrp
              client specified
              into table gt_vbrp
              for all entries in gt_vbrk
              where vbeln = gt_vbrk-vbeln
              and werks in s_werks
              and matnr in s_matnr.
      endif.
    select mnr ltx spras from t247
    into table it_t247
    where spras = 'E'.
    data: lv_month1 type vbrp-prsdt,
           name1(3) type c,
           s_month type string,
            s_month1 type string,
             s_month2 type string.
    *      lv_netwr1 type vbrp-netwr,
    *          lv_mwsbp1 type vbrp-mwsbp.
          loop at gt_vbrp into gs_vbrp.
            gs_final2-matnr = gs_vbrp-matnr.
            gs_final2-arktx = gs_vbrp-arktx.
            gs_final2-fkimg = gs_vbrp-fkimg.
           lv_month1 = gs_vbrp-prsdt.
            read table it_t247 into wa_t247 with key mnr = lv_month1+4(2).
            if sy-subrc eq 0.
            name1 =  wa_t247-ltx.
            endif.
             concatenate  name1
                       lv_month1(4) into s_month SEPARATED BY '_' .
             CONCATENATE S_MONTH 'QTY' INTO S_MONTH1 SEPARATED BY ''.
              CONCATENATE S_MONTH 'VALUE' INTO S_MONTH2 SEPARATED BY ''.
             gs_final2-month = s_month.
              lv_netwr1 = gs_vbrp-netwr.
            lv_mwsbp1 = gs_vbrp-mwsbp.
            gs_final2-MONTH_QTY = S_MONTH1.
            GS_FINAL2-MONTH_VAL = S_MONTH2.
            gs_final2-value = lv_netwr1 + lv_mwsbp1.
           append gs_final2 to gt_final2.
           clear: gs_final2. "lv_name2.
           endloop.
           if gt_final2[] is not initial.
             sort gt_final2 by matnr month ascending .
             loop at gt_final2 into gs_final2.
            gs_final2_01 = gs_final2.
         collect gs_final2_01 into gt_final2_01.
        endloop.
           endif.
       ENDIF..
    Regards
    Ankur

  • How to CREATE SUBQUERY in ADF or generate the ADF table consisting of colum

    hi,
    I have to generate the ADF table consisting of columns from different database tables depending on some criteria.. kindly help me in generating the subquery or retrive the columns from different database tables......

    hi, i m using adf bc, toplink . i have got 3 row of data in a table now i wnt to pass these values one by one in the query to fetch the coloumn from the different database table and place the result obtained in the third new coloumn... can u give me the detailed answer

  • When I upload a cvs file not all the column display in the Data / Table Mapping screen

    1. I have created application using Apex Data Loading wizard. There when I am trying to load data from .csv file, but not all the columns display in the "Data / Table Mapping" screen. But if I go through AQL --> Utility --> Data Workshop, there all column display in "Data / Table Mapping" page. I want to get same thing in application I created. How will get all columns display in the screen?
    2. Is there any way to select target table dynamically during runtime. So that in appication we can select different target tables with different source file to load data.

    Your user info says iPad. This is the OS X Numbers forum. Assuming you are using OS X… Be sure the file is named with a .csv suffix.
    (I don't have an iPad, so I don't know the iOS answer.)

  • Giving Error while generating the Data mart to Infocube.

    Hi Gurus,
    I need to  extract the APO infocube data in to the BW infocube. For that iam trying to generate the data mart to APO infocube .
    So, that i can use that data mart as a data source to extract that APO Infocube data in to  BW infocube.
    In that process iam trying to generate the datamart for APO Infocube . But while generating it is giving errors like below:
    Creation of InfoSource 8ZEXTFCST for target system BW 1.2 failed
    The InfoCube cannot be used as a data mart for a BW 1.2 target system.
    Failed to create InfoSource &v1& for target system BW 1.2.
    PLease suggest me what to do for this Error problem.
    Thanks alot in Advance.

    Hi,
    Point No : 1
    What is Planning Area :
    http://help.sap.com/saphelp_scm41/helpdata/en/70/1b7539d6d1c93be10000000a114084/content.htm
    Point No : 2
    Creation Steps for Planning Area :
    http://www.sap-img.com/apo/creation-of-planning-area-in-apo.htm
    Note : We will not create Planning Area.This will be done by APO team.
    Point No 3  : Afetr opening the T-Code : /n/SAPAPO/MSDP_ADMIN in APO you will be able to see all the planning areas.
    Point No 4 : Select your planning area and Goto Extras menu and Click on Generate DS
    Point No 5. System automaticall generate the DS in APO (Naming Convention start with 9) and Replicate the DS in BI Map to your cube and load the data.
    Regards
    Ram.

  • How to find the data table sin CRM 4.0

    Dear Guru's
    I want to know where can i get all the data tables in crm 4.0 for example if i want to know the data table for the Reason in activity Management.with the help of data table only the ABAP people can work.....na
    Points willbe given
    With Best Regadrs
    Sreeram Raghu

    Hi Raghu,
    There are many techniques in which you could find the database tables, few of them are given below:
    - Place your cursor in the field for ex: reason in activity and press F1
    - In F1 screen(performance assistant), Click on Technical Information (fourth button from left), you can find here the database table name.
    Another Option:
    - Go to transaction SE11
    - In Database Table Field type few letters, for example to find all the activity table type * act * and then press F4, all the tables related to activity will be displayed
    Wish this was useful to you
    regards
    Srikantan

  • How  to Generate the Dates of Billing Plan Contract

    Dear experts,
    Need your advice on this.
    I have a requirement to create a program to update the Billing Plan of contract. It will run in background and update the end date (billing plan), then generate the dates ( Settlement Date for Deadline, Billing date for billing index and printout, etc ..).
    I have managed to change to end date using 'BILLING_SCHEDULE_READ' and 'BILLING_SCHEDULE_SAVE', but I couldn't generate the dates. I've searched sdn and still, no luck. I've tried 'SD_SALES_BILLINGPLAN_CHANGE' with no result. I've also found 'RV_SALES_DOCUMENT_UPDATE', but I dunno how to fill-in all the parameters.
    Please help .. I have run out of ideas ...
    Thx..
    TRI

    Found the answer .. using BDC :).
    Thx for attention ..
    TRI..

  • Get called back as the data table is being rendered

    Hello:
    I have a datatable, like this:
    <t:column>
    <f:facet name="header">
    <t:outputText value="Process" style="font-weight: bold" />
    </f:facet>
    <t:commandButton id="ProcessButton" styleClass="sbttnHeader"
    actionListener="#{ProcessQueueBBean.processAction}"
    value="#{ProcessQueueBBean.processButtonNames[dbRow.status]}" >
    </t:commandButton>
    </t:column>I need to get called when the data table rows are being rendered. The reason I need to get called is that some columns have conditional data depending on the other values in the same row
    Any ideas?
    Thanks for your help

    I don't know i've never tried this in the way you need it but let me know if it works.. in the <column tag render=> I know you can check infor
    so have render = "#{row.num+row.othernumber >0}"
    that probably will work .. like i said I never tried it in a table column.. Let me know if it works

  • Dynamic name for the physical table

    Hi Guys,
    How to setup dynamic names for the physical table? Where it is useful?*
    Pls help me out on this.
    thanks

    Check this similar post which might be of help dynamic physical table source schema
    Cheers,
    KK

  • Error 7 occurred when generating the data transfer program

    Hello All ,
    In Master Data Load Process Chain ,  we get error like
    1. System Response
        Caller 09 contains an error message.
    Diagnosis
    Error 7 occurred when generating the data transfer program for the requested InfoSource.
    System Response
    The data transfer is terminated.
    Procedure
    Check the SAP Support Portal for the appropriate Notes and create a customer message if necessary.
    Note : We faced this issue for two days now . Just repeating the load make it success .
    If any one faced and fixed this issue . Please let me know .
    Thanks in advance .

    Hi,
    . Initially goto transaction SE38, Run the program RSDS_DATASOURCE_ACTIVATE_ALL. Give your Datasource name, and source system and check the check box for "Only Inactive objects".
    This will actiavate the given datasource.
    2. Replicate the datasource in RSA1.
    3. Try to schedule the infopackage for the datasource which you have activated now.
    4. IF infopackage runs through, Repeat the process for all datasources ie uncheck the check box, which means it will activate all datasources for the source system.
    Also make sure that there will be enough Back Ground Processor available....
    Reduce the parallel process
    Thanks
    BVR

  • How to find the dates table in T.CODE:CRMD_ORDER

    Hi ,
    Where to find the dates at sales order header level (General tab)as well item level in Transaction code: CRMD_ORDER.
    I did not see any internal table for this Dates in the FM CRM_ORDER_READ and i have tried with F1 help but is a ALV grid.
    Could any one help me to find the dates table.

    Hi,
    The dates are populated in the table IT_APPOINTMENT of FM CRM_ORDER_READ.
    if you want to populate the dates in any business order in crmd_order, then u can put a debugger in FM 'CRM_ORDER_MAINTAIN', open any business order, populate the date at header and item level and press enter.
    check the table IT_APPOINMENT table and the corresponding values that need to be populated.
    Hope this helps!!!
    Prerna

  • Error in generating the condition table.. pls help urgent

    Hi all,
    I have some condition tables to be generated in CRM from ECC.
    i am getting the following error for 2 tables : " Generation for application CRM, Usage PR and table CUS601 failed".
    But other tables data has been corectly downloaded from ECC to CRM.
    I m checking the status in SLG1. and i use tcode : CND_MAS_GEN_OBJECTS.
    Kindly help me this,
    its very very urgent.
    points will be rewarded.
    Robin

    thanks rajesh for ur reply.
    Basically the issue is like this now.
    Im trying to download the confition tables data from R3 to CRM. so in CRM...
    when i manually try to start initial download the object for a table by R3AS, tcode..
    the bdocs are been in intermeditate state in CRM. with yellow.
    when i try to reprocess it is throughing a short dump( reason telling : already a record is been availble in table : CNLCRMPRSCALEDIM, trying to insert again.
    So m not understanding what the issue would be..
    Could you please help me with this. im really in dead situation.
    it is working for other tables
    Robin

  • Smartform Dynamic colour in the item table

    Hi Experts,
    I have a requirement wherein we need different colours for each item in the table according to a particular condition.
    If the value in the  column two is 1 ,first item should have a colour blue in the last column
    If the col2 is 2, second item should have red colour in the last column.
    and accordingly.
                          Col 1       Col2       Col3      Col4
    Row1                                1                   Blue colour
    Row2                                2                   Red colour
    Row3                                3                   Green colour
    Is this possible in smartforms.
    Already tried giving condition in the condition tab and choosing the colour for different text elements,which is not possible.
    Tried writing the below code in initialisation which is also not helping.
    * Color
    *DATA: l_tabdef  TYPE ssftabdef,     " Work Area for the Table
    *     t_ltypes  TYPE tsfltype,      " Table - Line types
    *     l_ltypes  TYPE ssfltype,      " Work Area for the table
    *     t_colinfo TYPE tsfcolinfo,    " Table - Columns
    *     l_colinfo TYPE ssfcolinfo,    " Work area for the table
    *     t_border  TYPE tsfctaba,      " Tables - Borders
    *     l_border  TYPE ssfctaba.      " Work Area for the borde
    * FIELD-SYMBOLS : <f_tab> type tsftabdef.
    *ASSIGN ('(SAPLSTXBC)TABDEFS') TO <f_tab>.
    *bREAK-POINT .
    *LOOP AT <f_tab> INTO l_tabdef  where name = 'ITEM_VALUES'.  "  only for one template
    ** Table line Types
    **  Line type TYPE1 from the table MAIN_TABLE
    *  LOOP AT l_tabdef-tltype INTO l_ltypes where linetype = 'L2'.  " only for one line type is required
    ** Coloum information
    **   Column1 (cell) of the TYPE1
    *    LOOP AT l_ltypes-tcolinfo INTO l_colinfo." where widthv = '1.31'. .
    ** Borders
    **   Background color and borders for that cell
    *      LOOP AT l_colinfo-borders INTO l_border.
    ** Clearing the color parameters for the cell
    *        CLEAR: l_border-intensity,              " Intensity
    *        l_border-fillcolor-red,          " Red
    *        l_border-fillcolor-used,         " Color Used
    *        l_border-cfillcolor-color,       " Red color in Hexa
    *        l_border-cfillcolor-xred.        " Color used in Hexa
    *        l_border-fillcolor-red = '255'.
    *        l_border-fillcolor-green = '000'.
    *        l_border-fillcolor-blue = '000'.
    *        l_border-fillcolor-used = 'X'.
    *        l_border-cfillcolor-color  = 'X'.
    *        l_border-cfillcolor-xred = 'FF'.
    *        l_border-cfillcolor-xgreen = '00'.
    *        l_border-cfillcolor-xblue = '00'.
    *        MODIFY l_colinfo-borders FROM l_border.
    *      ENDLOOP.
    *      MODIFY l_ltypes-tcolinfo FROM l_colinfo.
    *    ENDLOOP.
    *    MODIFY l_tabdef-tltype FROM l_ltypes.
    *  ENDLOOP.
    *  MODIFY <f_tab> FROM l_tabdef.
    *ENDLOOP.
    Please suggest and help on how to proceed.
    Thanks in advance.
    Jojy

    Can you try creating 3 identical line types in Smartform with just 3 different colors. Add a field to the internal table to specify the color. Add a condition to the line types to output based on the color field.
    Thanks,
    Juwin

  • Problem in generating the error table

    Hi,
    I'm using ODI with SQL Server 2000.
    After putting the required constraints on a data store (Static Control), when I execute the Control --> Check, it doesn't create the Error table in the work repository.
    When I go to the Operator, under the Session Task, it shows the following error message -
    170 : S0001 : com.microsoft.sqlserver.jdbc.SQLServerException: Line 1: Incorrect syntax near 'getObjectNameDefaultPSchema'.
    com.microsoft.sqlserver.jdbc.SQLServerException: Line 1: Incorrect syntax near 'getObjectNameDefaultPSchema'.
         at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDatabaseError(SQLServerException.java:196)
         at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1454)
         at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:388)
         at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:338)
         at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4026)
         at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1416)
         at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:185)
         at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:160)
         at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeUpdate(SQLServerPreparedStatement.java:306)
         at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source)
    Under the 'Description' tab, it shows the following script,
    create table     Exception getObjectNameDefaultPSchema("L", "SNP_CHECK_TAB", "W") :
         CATALOG_NAME     VARCHAR(100) NULL ,
         SCHEMA_NAME     VARCHAR(100) NULL ,
         RESOURCE_NAME     VARCHAR(100) NULL,
         FULL_RES_NAME     VARCHAR(100) NULL,
         ERR_TYPE          VARCHAR(1) NULL,
         ERR_MESS          VARCHAR(250) NULL ,
         CHECK_DATE     DATETIME NULL,
         ORIGIN          VARCHAR(100) NULL,
         CONS_NAME     VARCHAR(35) NULL,
         CONS_TYPE          VARCHAR(2) NULL,
         ERR_COUNT          NUMERIC(10) NULL
    In the further steps of creating error tables, it shows the Execution status as 'Waiting'.
    It would be of great help if anyone can help me to resolve this issue.
    Thanks

    The error in this case seems to be that there is no default schema for your data server.
    ODI creates the table in the default schema. In your case it encounters a problem when it's unable to resolve the default schema. Take a look in Topology and mark one of your physical schema as the default for the data server. This should solve the problem.
    Thanks,
    Sutirtha

Maybe you are looking for