How to create a table,columns,rows dynamically

Hi All,
I would like to build an application which takes from date and to date as inputs and click on button it should create a table dynamically in the following format( rows - project Act1,Service Act2 etc....columns dates and total should be display rowwise and columnwise)
From 06.22.2009            To 06.23.2009    Go(button)
                      06.22.2009 06.23.2009    Total
Project act1    2                  2                  4
Project Act2
Service Act1    3               3                    6
Total               5                5
How do i build this application
I should have ALV capability so that I can download.
Thanks
Bala Duvvuri
Edited by: Bala Duvvuri on Jun 23, 2009 5:21 AM
Edited by: Bala Duvvuri on Jun 23, 2009 5:22 AM
Edited by: Bala Duvvuri on Jun 23, 2009 5:25 AM

DATA lo_table_settings TYPE REF TO if_salv_wd_table_settings.
  DATA lo_standard_functions TYPE REF TO if_salv_wd_std_functions.
  DATA lo_column_settings TYPE REF TO if_salv_wd_column_settings.
  DATA lo_column TYPE REF TO cl_salv_wd_column.
  DATA lo_column_hdr TYPE REF TO cl_salv_wd_column_header.
  lo_table_settings ?= lo_table.
  lo_table_settings->set_selection_mode( cl_wd_table=>e_selection_mode-auto ).
  lo_table_settings->set_cell_action_event_enabled( value = abap_true ).
  lo_table_settings->set_width( value = '100%' ).
set default ALV Functions off
  lo_standard_functions ?= lo_table.
lo_standard_functions->set_sort_headerclick_allowed( abap_false ).
  lo_standard_functions->set_filter_filterline_allowed( abap_false ).
  lo_standard_functions->set_filter_complex_allowed( abap_true ).
  lo_standard_functions->set_sort_complex_allowed( abap_true ).
  lo_standard_functions->set_column_selection_allowed( abap_true ).
  lo_standard_functions->set_view_list_allowed( abap_true ).
  lo_standard_functions->set_pdf_allowed( abap_true ).
  lo_standard_functions->set_export_allowed( abap_true ).
  lo_standard_functions->set_dialog_settings_as_popup( abap_true ).
lo_standard_functions->set_display_as_allowed( abap_true ).
lo_standard_functions->set_graphic_allowed( abap_true ).
  lo_column_settings ?= lo_table.
*To create a row with heading Matter No.
  lo_column = lo_column_settings->get_column( 'MTRID' ).
  lo_column_hdr = lo_column->create_header( ).
  lo_column_hdr->set_text( 'MATTER NO.' ).
same way for other required field.

Similar Messages

  • How to create a table with a dynamic amount of columns

    Hi, all!
    Thare is a tutorial at javaFX documentation page. This example describes how to make tableView, if you have some certain java class, which can tell you which columns you are going to have. (That is a Person class in this example).
    But what if i do not have any specific class, and number of columns can vary from time to time? In my case i have such data structure:
    class TableData{
        List<Row> rows; //A list with all my rows i need to have in my table
    class Row{
        List<Column> columns; //Cells\Columns for every row.
    class Column{
        Attribute attr; //Each column - is somethig like a wrapper for the real data i need to show in a cell;
    class Attribute{ //My precues data
        String name;
        SupportingInfo info;
    class SupportingInfo{//Some supporting fields...
        String name;
        String value;
        //...etc....
    }So, my case is very similar to [this one|http://blog.ngopal.com.np/2011/10/19/dyanmic-tableview-data-from-database/] . The only differents is that data from the case above is not binded with its representation in javaFX table (so, even if some one will make extra controls to edit this data in a tableView, the actual object with that data will never know about it.), because it(data) goes to the table like some strings, not like some objects;
    So, what do i need - is to push data to the table (like that: table.setItems(tableData)), set some set Factories, to give user ability to edit data, and to have this edited data in my tableData object;
    Here are some code i've tried to make for this purpose:
    //prepare my table
    private void createTableHeader(TableView table, List<Attribute> ias) {
        int i = 0;
        for (final Attribute ia : ias) {
            final int j = i;
            i++;
            TableColumn tc = new TableColumn(ia.getName());
            tc.setSortable(true);
            tc.setCellValueFactory(new Callback<CellDataFeatures<List<Attribute>, String>, ObservableValue<String>>() {
                @Override
                public ObservableValue<String> call(CellDataFeatures<List<Attribute>, String> arg0) {
                    if(arg0.getValue().get(j).getSupportingInfo() == null){
                        arg0.getValue().get(j).setSupportingInfo(new SupportingInfo());
                    return new SimpleObjectProperty(arg0.getValue().get(j),"value");
            table.getColumns().add(tc);
    //loading some data to my tableView
    private void createTableBody(TableView curTable, List<Row> rows) { 
        ObservableList<List<Attribute>> data = FXCollections.observableArrayList();
        for (Row row : rows) {
            data.add(row.getColumns());
        curTable.setItems(data);
    //this one is to define some extra controls for editing data in a table by users
    private void makeCellFactory(TableColumn curTableCol, final Attribute templateIa, final Document doc) {
        curTableCol.setCellFactory(new Callback<TableColumn, TableCell>() {
            public TableCell call(TableColumn p) {
                final EditingCell cell = new EditingCell(templateIa, doc);
                return cell;
    }But, as a result, i have just empty rows in my table, with an ability to click some cell and recieve table editing controls. But there is not defult values in by table; What am i doing wrong in my code?
    Edited by: 929064 on 21.09.2012 2:24
    Edited by: 929064 on 24.09.2012 8:26
    Edited by: 929064 on 24.09.2012 8:27

    I put an example up on this thread No DataGrid component? with a TableView displaying values from a non-JavaFX aware data model. It might help get you started. This example is not editable, to make your table editable you would need to update the data model directly when editing is complete.
    Note that if you're building the data model from scratch, there's no need for the listener-notification to be built by hand, as I did in the example. Your data model can directly use the same JavaFX collections instances the table is using.

  • How to create a table with rows within a row?

    Hi,
    I am trying to create a table that looks like this: https://acrobat.com/#d=XyI3rlSWMWYXQixzpRSrXA but I can't figure it out.
    Please can someone tell how I should go about this?
    thanks for the help.

    Hi,
        We you see nested tables, you have to create a table inside a table. For this first you have to merge the rows and insert a table with the number of rows requested. You can find the sample created for you below and let me know in case of any issues
    https://sendnow.acrobat.com/m/g.ashx?i=rO1m-dIDzRs2FibTHDSiww&x=yrC*o4IZIVfpKgqOTbX8OQ
    Thanks

  • How to create a table with varied number of columns?

    I am trying to create a balance table. The colunms should include years between the start year and end year the user will input at run time. The rows will be the customers with outstanding balance in those years.
    If the user input years 2000 and 2002, the table should have columns 2000, 2001, 2002. But if the user input 2000 and 2001, the table will only have columns 2000 and 2001.
    Can I do it? How? Thanka a lot.

    Why did you create a new thread for this?
    How to create a table with varied number of columns?

  • How to create a table with editable column values.

    Hi everyone,
    I think this is very simple but i'm not able to find how to do this. This is my requirement. I need to create a table with n columns and 1 row initially. user should be able to enter data into this table and click of a button should insert data into the data base table. Also there should be a button at the bottom of the table to add 1 row to the table.
    I know how to do the insert to database, but can anyone please let me know how to create a table that allows user to enter data and how to create a add 1 row button?
    Thanks in Advance!

    Raghu,
    Go through the ToolBox tutorial Create Page & Advanced table section of OAF Guide.
    Step 1 - You require to create EO & a VO based on this EO. This EO will be of DataBase table where you want to insert the data.
    Step 2 - Create a Advanced table region. (Refer this Adavanced table section for more on this)
    Step 3 - Attach this VO in the BC4J component of Adavanced Table region.
    Regards,
    Gyan

  • How to Create a Table Component Dynamically based on the Need

    Hello all,
    I have a problem i need to create dynamically tables based on the no of records in the database. How can i create the table object using java code.
    Please help.

    Winston's blog will probably be helpful:
    How to create a table component dynamically:
    http://blogs.sun.com/roller/page/winston?entry=creating_dynamic_table
    Adding components to a dynamically created table
    http://blogs.sun.com/roller/page/winston?entry=dynamic_button_table
    Lark
    Creator Team

  • How to create XML from multiple rows in a table?

    Hi All,
    I have a table where it has multiple rows as below which I need to send as a XML.. can any one let me know how to create?
    Table:
    PRDID,NAME,DESCRIPTION,SUPPLIER,PRICE
    2012,AAA,ADESC,SUPPLIER1,1.8
    2012,AAA,ADESC,SUPPLIER2,2.5
    XML should be :
    <ROOT>
    <PRDID>2012</PRDID>
    <NAME>AAA</NAME>
    <DESCRIPTION>ADESC</DESCRIPTION>
    <PRICE>
    <REGION>SUPPLIER1</REGION>
    <PRICE>1.8</PRICE>
    <REGION>SUPPLIER2</REGION>
    <PRICE>2.5</PRICE>
    </PRICE>
    </ROOT>
    Thanks
    Rajeev

    Hi
    This white paper shows how to do it - http://www.sdn.sap.com/irj/boc/index?rid=/library/uuid/101c974c-11f9-2b10-4da5-cd350b7eeda0
    Michael

  • How to create editable table with one empty row ?

    I'm looking for solution how to create editable table with one empty row using ADF BC. I have seen this solution in application that was created in JHeadstart and it's very well idea to use it insead of creation form.

    hammm, i do it this:
    drop the VO on the page, select Table->ADF Table....
    so, drop the botton create, from de VO->operations->create (the firts), and right botton (mouse) Edit binding....
    in Data collection select the VO, in Select an action select CreateInsert
    luck

  • How to create a table component dynamically in netbeans 6.0 (JSF 1.2)?

    How to create a table component dynamically in netbeans 6.0 (JSF 1.2)?
    This example http://developers.sun.com/jscreator/reference/techart/2/createTableDynamically.html works only with JSF 1.1.

    Please help my write correct code.
    How to replace this strings for run example?
    rowGroup.setValueBinding("sourceData", getApplication().createValueBinding("#{Page1.tripDataProvider}"));
    staticText1.setValueBinding("text", getApplication().createValueBinding("#{currentRow.value['TRIP.TRIPID']}"));

  • 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 table with events in smartforms?

    How to create a table with events view in smartforms?
    It doesn't like general table with header, main area and footer.
    for example:
    in smartforms: LE_SHP_DELNOTE
    table name is TABLEITEM(Delivery items table)

    Vel wrote:
    I am creating XML file using DBMS_XMLGEN package. This XML file will contain data from two different database tables. So I am creating temporary table in the PL/SQL procedure to have the data from these different tables in a single temporary table.
    Please find the below Dynamic SQL statements that i'm using for create the temp table and inserting the data into it.
    Before insert the V_NAME filed, i will be appending a VARCHAR field to the original data.
    EXECUTE IMMEDIATE 'CREATE TABLE TEMP_TABLE (UNIQUE_KEY NUMBER , FILE_NAME VARCHAR2(1000), LAST_DATE DATE)';
    EXECUTE IMMEDIATE 'INSERT INTO TEMP_TABLE values (SEQUENCE.nextval,:1,:2)' USING V_NAME,vLastDate;What exactly i need is to eliminate the INSERT portion of it,Since i have to insert more 90,000 rows into it. Is there way to have the temp table created with data in it along with the sequence value as well.
    I'm using Oracle 10.2.0.4 version.
    Edited by: 903948 on Dec 22, 2011 10:58 PMWhat you need to do to eliminate the INSERT statement is to -- as already suggested by others - eliminate the temporary table. You don't need it. It is just necessary overhead. Please explain why you (apparently) believe that the suggestion of a view will not meet your requirements.

  • How can create a table in sap script?

    Hi,
    How to create a table in the sap script.i Have to use table in the main window with 11  rows and 3 columns. can any one send sample code. Any ideas?¿
    THKS 4all.

    Try and check on the below logic....
    1. write -
    2. write headings with '|' at start and end as well as the field separator.
    3. write -
    4. similar to step two write the data with pipe separators.
    5. write -
    regards
    Anurag

  • How to create hashed table in runtime

    hi experts
    how to create hashed table in runtime, please give me the coading style.
    please help me.
    regards
    subhasis

    Hi,
    Have alook at the code, and pls reward points.
    Use Hashed Tables to Improve Performance :
    report zuseofhashedtables.
    Program: ZUseOfHashedTables                                        **
    Author: XXXXXXXXXXXXXXXXXX                                 **
    Versions: 4.6b - 4.6c                                              **
    Notes:                                                             **
        this program shows how we can use hashed tables to improve     **
        the responce time.                                             **
        It shows,                                                      **
           1. how to declare hashed tables                             **
           2. a cache-like technique to improve access to master data  **
           3. how to collect data using hashed tables                  **
           4. how to avoid deletions of unwanted data                  **
    Results: the test we run read about 31000 rows from mkpf, 150000   **
             rows from mseg, 500 rows from makt and 400 from lfa1.     **
             it filled ht_lst with 24500 rows and displayed them in    **
             alv grid format.                                          **
             It needed about 65 seconds to perform this task (with     **
             all the db buffers empty)                                 **
             The same program with standard tables needed 140 seconds  **
             to run with the same recordset and with buffers filled in **
    Objetive: show a list that consists of  all the material movements **
             '101' - '901' for a certain range of dates in mkpf-budat. **
    the columns to be displayed are:                                   **
             mkpf-budat,                                               **
             mkpf-mblnr,                                               **
             mseg-lifnr,                                               **
             lfa1-name1,                                               **
             mkpf-xblnr,                                               **
             mseg-zeile                                                **
             mseg-charg,                                               **
             mseg-matnr,                                               **
             makt-maktx,                                               **
             mseg-erfmg,                                               **
             mseg-erfme.                                               **
    or show a sumary list by matnr - menge                             **
    You'll have to create a pf-status called vista -                   **
    See form set_pf_status for details                                 **
    tables used -
    tables: mkpf,
            mseg,
            lfa1,
            makt.
    global hashed tables used
    data: begin of wa_mkpf, "header
          mblnr like mkpf-mblnr,
          mjahr like mkpf-mjahr,
          budat like mkpf-budat,
          xblnr like mkpf-xblnr,
          end of wa_mkpf.
    data: ht_mkpf like hashed table of wa_mkpf
          with unique key mblnr mjahr
          with header line.
    data: begin of wa_mseg, " line items
          mblnr like mseg-mblnr,
          mjahr like mseg-mjahr,
          zeile like mseg-zeile,
          bwart like mseg-bwart,
          charg like mseg-charg,
          matnr like mseg-matnr,
          lifnr like mseg-lifnr,
          erfmg like mseg-erfmg,
          erfme like mseg-erfme,
          end of wa_mseg.
    data ht_mseg like hashed table of wa_mseg
          with unique key mblnr mjahr zeile
          with header line.
    cache structure for lfa1 records
    data: begin of wa_lfa1,
          lifnr like lfa1-lifnr,
          name1 like lfa1-name1,
          end of wa_lfa1.
    data ht_lfa1 like hashed table of wa_lfa1
          with unique key lifnr
          with header line.
    cache structure for material related data
    data: begin of wa_material,
          matnr like makt-matnr,
          maktx like makt-maktx,
          end of wa_material.
    data: ht_material like hashed table of wa_material
            with unique key matnr
            with header line.
    result table
    data: begin of wa_lst, "
          budat like mkpf-budat,
          mblnr like mseg-mblnr,
          lifnr like mseg-lifnr,
          name1 like lfa1-name1,   
          xblnr like mkpf-xblnr,
          zeile like mseg-zeile,
          charg like mseg-charg,
          matnr like mseg-matnr,
          maktx like makt-maktx,
          erfmg like mseg-erfmg,
          erfme like mseg-erfme,
          mjahr like mseg-mjahr,
          end of wa_lst.
    data: ht_lst like hashed table of wa_lst
            with unique key mblnr mjahr zeile
            with header line.
    data: begin of wa_lst1, " sumary by material
          matnr like mseg-matnr,
          maktx like makt-maktx,
          erfmg like mseg-erfmg,
          erfme like mseg-erfme,
          end of wa_lst1.
    data: ht_lst1 like hashed table of wa_lst1
            with unique key matnr
            with header line.
    structures for alv grid display.
    itabs
    type-pools: slis.
    data: it_lst            like standard table of wa_lst with header line,
          it_fieldcat_lst   type slis_t_fieldcat_alv with header line,
          it_sort_lst       type slis_t_sortinfo_alv,
          it_lst1           like standard table of wa_lst1 with header line,
          it_fieldcat_lst1  type slis_t_fieldcat_alv with header line,
          it_sort_lst1      type slis_t_sortinfo_alv.
    structures
    data: wa_sort         type slis_sortinfo_alv,
          ls_layout       type slis_layout_alv.
    global varialbes
    data: g_lines type i.
    data: g_repid like sy-repid,
          ok_code       like sy-ucomm.
    selection-screen
    "text: Dates:
    select-options: so_budat for mkpf-budat default sy-datum.
    "text: Material numbers.
    select-options: so_matnr for mseg-matnr.
    selection-screen uline.
    selection-screen skip 1.
    "Text: show summary by material.
    parameters: gp_bymat as checkbox default ''.
    start-of-selection.
      perform get_data.
      perform show_data.
    end-of-selection.
          FORM get_data                                                 *
    form get_data.
            select mblnr mjahr budat xblnr
                into table ht_mkpf
               from mkpf
              where budat in so_budat. " make use of std index.
    have we retrieved data from mkpf?
      describe table ht_mkpf lines g_lines.
      if g_lines > 0.
    if true then retrieve all related records from mseg.
    Doing this way we make sure that the access is by primary key
    of mseg.
    The reason is that is faster to filter them in memory
    than to allow the db server to do it.
        select mblnr mjahr zeile bwart charg
                 matnr lifnr erfmg erfme
          into table ht_mseg
          from mseg
            for all entries in ht_mkpf
         where mblnr = ht_mkpf-mblnr
           and mjahr = ht_mkpf-mjahr.
      endif.
    fill t_lst or t_lst1 according to user's choice.
      if gp_bymat = ' '.
        perform fill_ht_lst.
      else.
        perform fill_ht_lst1.
      endif.
    endform.
    form fill_ht_lst.
      refresh ht_lst.
    Example: how to discard unwanted data in an efficient way.
      loop at ht_mseg.
      filter unwanted data
        check ht_mseg-bwart = '101' or ht_mseg-bwart = '901'.
        check ht_mseg-matnr in so_matnr.
      read header line.
        read table ht_mkpf with table key mblnr = ht_mseg-mblnr
        mjahr = ht_mseg-mjahr.
        clear ht_lst.
    * note : this may be faster if you specify field by field.
        move-corresponding ht_mkpf to ht_lst.
        move-corresponding ht_mseg to ht_lst.
        perform read_lfa1 using ht_mseg-lifnr changing ht_lst-name1.
        perform read_material using ht_mseg-matnr changing ht_lst-maktx.
        insert table ht_lst.
      endloop.
    endform.
    form fill_ht_lst1.
      refresh ht_lst1.
    Example: how to discard unwanted data in an efficient way.
             hot to simulate a collect in a faster way
      loop at ht_mseg.
      filter unwanted data
        check ht_mseg-bwart = '101' or ht_mseg-bwart = '901'.
        check ht_mseg-matnr in so_matnr.
    * note : this may be faster if you specify field by field.
        read table ht_lst1 with table key matnr = ht_mseg-matnr
        transporting erfmg.
        if sy-subrc <> 0. " if matnr doesn't exist in sumary table
        " insert a new record
          ht_lst1-matnr = ht_mseg-matnr.
          perform read_material using ht_mseg-matnr changing ht_lst1-maktx.
          ht_lst1-erfmg = ht_mseg-erfmg.
          ht_lst1-erfme = ht_mseg-erfme.
          insert table ht_lst1.
        else." a record was found.
        " collect erfmg.  To do so, fill in the unique key and add
        " the numeric fields.
          ht_lst1-matnr = ht_mseg-matnr.
          add ht_mseg-erfmg to ht_lst1-erfmg.
          modify table ht_lst1 transporting erfmg.
        endif.
      endloop.
    endform.
    implementation of cache for lfa1.
    form read_lfa1 using p_lifnr changing p_name1.
            read table ht_lfa1 with table key lifnr = p_lifnr
            transporting name1.
      if sy-subrc <> 0.
        clear ht_lfa1.
        ht_lfa1-lifnr = p_lifnr.
        select single name1
           into ht_lfa1-name1
          from lfa1
        where lifnr = p_lifnr.
        if sy-subrc <> 0. ht_lfa1-name1 = 'n/a in lfa1'. endif.
        insert table ht_lfa1.
      endif.
      p_name1 = ht_lfa1-name1.
    endform.
    implementation of cache for material data
    form read_material using p_matnr changing p_maktx.
      read table ht_material with table key matnr = p_matnr
      transporting maktx.
      if sy-subrc <> 0.
        ht_material-matnr = p_matnr.
        select single maktx into  ht_material-maktx
          from makt
         where spras = sy-langu
           and matnr = p_matnr.
        if sy-subrc <> 0. ht_material-maktx = 'n/a in makt'. endif.
        insert table ht_material.
      endif.
      p_maktx = ht_material-maktx.
    endform.
    form show_data.
      if gp_bymat = ' '.
        perform show_ht_lst.
      else.
        perform show_ht_lst1.
      endif.
    endform.
    form show_ht_lst.
      "needed because the FM can't use a hashed table.
      it_lst[] = ht_lst[].
      perform fill_layout using 'full display'
                           changing ls_layout.
      perform fill_columns_lst.
    perform sort_lst.
      g_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program       = g_repid
                i_callback_pf_status_set = 'SET_PF_STATUS'
                is_layout                = ls_layout
                it_fieldcat              = it_fieldcat_lst[]
               it_sort                  = it_sort_lst
           tables
                t_outtab                 = it_lst
           exceptions
                program_error            = 1
                others                   = 2.
    endform.
    form show_ht_lst1.
      "needed because the FM can't use a hashed table.
      it_lst1[] = ht_lst1[].
      perform fill_layout using 'Sumary by matnr'
                           changing ls_layout.
      perform fill_columns_lst1.
    perform sort_lst.
      g_repid = sy-repid.
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program       = g_repid
                i_callback_pf_status_set = 'SET_PF_STATUS'
                is_layout                = ls_layout
                it_fieldcat              = it_fieldcat_lst1[]
               it_sort                  = it_sort_lst
           tables
                t_outtab                 = it_lst1
           exceptions
                program_error            = 1
                others                   = 2.
    endform.
    form fill_layout using p_window_titlebar
                   changing cs_layo type slis_layout_alv.
      clear cs_layo.
      cs_layo-window_titlebar        = p_window_titlebar.
      cs_layo-edit                   = 'X'.
      cs_layo-edit_mode              = space.
    endform.                    " armar_layout_stock
    form set_pf_status using rt_extab type slis_t_extab.
    create a new status
    and then select extras -> adjust template -> listviewer
      set pf-status 'VISTA'.
    endform.        "set_pf_status
    define add_lst.
      clear it_fieldcat_lst.
      it_fieldcat_lst-fieldname     = &1.
      it_fieldcat_lst-outputlen     = &2.
      it_fieldcat_lst-ddictxt       = 'L'.
      it_fieldcat_lst-seltext_l       = &1.
      it_fieldcat_lst-seltext_m       = &1.
      it_fieldcat_lst-seltext_m       = &1.
      if &1 = 'MATNR'.
        it_fieldcat_lst-emphasize = 'C111'.
      endif.
      append it_fieldcat_lst.
    end-of-definition.
    define add_lst1.
      clear it_fieldcat_lst.
      it_fieldcat_lst1-fieldname     = &1.
      it_fieldcat_lst1-outputlen     = &2.
      it_fieldcat_lst1-ddictxt       = 'L'.
      it_fieldcat_lst1-seltext_l       = &1.
      it_fieldcat_lst1-seltext_m       = &1.
      it_fieldcat_lst1-seltext_m       = &1.
      append it_fieldcat_lst1.
    end-of-definition.
    form fill_columns_lst.
    set columns for output.
      refresh it_fieldcat_lst.
      add_lst 'BUDAT' 10.
      add_lst   'MBLNR' 10.
      add_lst  'LIFNR' 10.
      add_lst  'NAME1' 35.
      add_lst  'XBLNR' 15.
      add_lst    'ZEILE' 5.
      add_lst    'CHARG' 10.
      add_lst   'MATNR' 18.
      add_lst   'MAKTX' 30.
      add_lst   'ERFMG' 17.
      add_lst   'ERFME' 5.
      add_lst   'MJAHR' 4.
    endform.
    form fill_columns_lst1.
    set columns for output.
      refresh it_fieldcat_lst1.
      add_lst1 'MATNR' 18.
      add_lst1 'MAKTX' 30.
      add_lst1 'ERFMG' 17.
      add_lst1 'ERFME' 5..
    endform.
    Regards,
    Ameet

  • How to create a table in smart form.

    Hi Folks,
    I need to create a table in  smart form with the following fields:-
    vbrp-arktx,vbrp-fkimg,komv-kbetr,komv-kwert.
    Please let me know how to create a table and how to name the columns,size,and the select query for the same.
    All answers will be duly rewarded.
    K.Kiran.

    Hi,
    Following Links gives Details of Smartforms and how to create tables -
    smartforms - very useful link
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/uuid/ccab6730-0501-0010-ee84-de050a6cc287
    http://www.sapbrain.com/ARTICLES/TECHNICAL/SMARTFORMS/smartforms.html
    FAQ
    http://www.sap-img.com/smartforms/smart-006.htm
    http://www.sap-img.com/smartforms/smartforms-faq-part-two.htm
    http://www.sap-basis-abap.com/sapsf001.htm
    http://www.sap-press.com/downloads/h955_preview.pdf
    http://www.ossincorp.com/Black_Box/Black_Box_2.htm
    http://www.sap-img.com/smartforms/sap-smart-forms.htm
    Siddhi

  • How to create a table in the file using java code.?

    HI,
    I should export the data from the view objects to a word document. I have done that but I should
    display the data in the form of a table.
    Kindly come up with the necessary information on how to create a table in the file using java.
    Thanks,
    Phani

    Hi, Thank you for responding to my query.
    The below are the details of my code.
    DCBindingContainer dcBindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding StudentDetailsContent =
    (DCIteratorBinding)dcBindings.get("StudentView1Iterator");
    OutputStreamWriter w = new OutputStreamWriter(outputStream, "UTF-8");
    Row currentRow =
    StudentDetailsContent.getRowSetIterator().first();
    Object a[]= currentRow.getAttributeValues();
    int i;
    for(i=0 ;i<=a.length;i++){
    w.write(a.toString());
    w.write(" ");
    w.flush();
    I am usning this coding to achieve the task of exporting data to file.
    I need to display this information in the table that is where I need help from you people.
    Thanks,

Maybe you are looking for

  • Correct display resolution no longer showing after 10.5.7 update

    Hi, The native resolution for my display (HP w2207h) no longer shows up in the displays preference pane. It should be 1680x1050 but the nearest resolutions showing are 1600x900 or 1920x1080 which both look pants, It's connected via DVI-HDMI cable and

  • Videos No Longer Working

    Hi all, I have an iPod Touch (64gig) with 3 movies, 60 music videos and some podcasts. Over the past week or so when you push the video button on my touch I get a white screen for about a minute and then it goes back to the main menu. The odd thing i

  • How to downgrade iTunes 12 to 11.4?

    I recently upgraded iTunes to 12.0.1 and want to downgrade back to 11.4. I run the 11.4 installer and it says "A newer version of iTunes is already installed." So I use the terminal to delete it (sudo rm -rf /Applications/iTunes.app/) and also trash

  • Why do my clips indicate rendering needed when exporting?

    So I have noticed this before but until now, it's never been a problem. I have rendered "all" for my entire project but when I go to export, some of my clips have red bars, indicating they need rendering. Obviously, I can't render them again because

  • Merge Two WAV File then play the result

    Hi All, I'm new In MM, I path for two wav file I want to merge them then play the result, anyone can help me asap? Thanks in Advance,