Create dynamic table CALL METHOD cl_alv_table_create= create_dynamic_table

Hi gurus i have a problem i have created a dinamic internal table but the lenght of the internal table fields is 10 i need longer fields
here is my code thanks
data: begin of it_campos OCCURS 0,
            campo1(12) type c,
        END OF it_campos.
do n times.
       clear nocamptmp.
       add 1 to incont.
       CONDENSE incont NO-GAPS.
       cont = incont.
       CONCATENATE nocamp cont  into nocamptmp.
       wa_campos-campo1 = nocamptmp.
       append wa_campos to it_campos.
    enddo  .
    loop at  it_campos into wa_campos.
      t_fieldcat_wa-col_pos = SY-TABIX.
      t_fieldcat_wa-fieldname = wa_campos-campo1.
      APPEND t_fieldcat_wa TO t_fieldcat.
    endloop  .
CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING
        it_fieldcatalog           = t_fieldcat
    IMPORTING
        ep_table                  = tabla
    EXCEPTIONS
        GENERATE_SUBPOOL_DIR_FULL = 1
    others                         = 2.
ASSIGN tabla->* TO <l_table>.
    CREATE DATA ep_line LIKE LINE OF <l_table>.
all is fine but the fields of  <l_table>  are char(10) and my data is longer than 10 how can i increase the lenght of the table fields
any idea thanks

Modify the fieldcatalog accordingly for e.g.,
LOOP AT it_campos INTO wa_campos.
  t_fieldcat_wa-col_pos = sy-tabix.
  t_fieldcat_wa-fieldname = wa_campos-campo1.
  t_fieldcat_wa-inttype = 'C'. " Character Type
  t_fieldcat_wa-intlen = '50'. "50 character length
  APPEND t_fieldcat_wa TO t_fieldcat.
ENDLOOP .
BR,
Suhas

Similar Messages

  • Call method "cl_alv_table_create= create_dynamic_table"

    Hi SDN Community,
    Is it possible to create dynamic tables. I tried it by call method "cl_alv_table_create=>create_dynamic_table", but the "new_table" of output parameters is empty after the call is executed.
    Please suggest.
    Thank You.
    Pankaj.

    Hi Pankaj,
    Try the code written below and let me know whether it works?
    report  z_dynamic_itab_test .
    include z_table_fs_top.
    include z_table_fs_forms.
    initialization.
      perform clear_fields.
    start-of-selection.
      perform fetch_data.
    end-of-selection.
    *&  Include           Z_TABLE_FS_TOP
    Type Pools                                                           *
    type-pools: slis,
                rsds.
    Tables                                                               *
    tables :sscrfields,                "Fields on selection screens
            dd03l.                     "Table Fields
    Types                                                                *
    types: begin of t_dd03l,
            tabname like dd03l-tabname,              "Table Name
            fieldname like dd03l-fieldname,          "Field Name
            keyflag   like dd03l-keyflag,            "Key Flag
            rollname  like dd03l-rollname,           "Roll Name
            position like dd03l-position,            "Position
            ddtext(30),                              "Description
           end of t_dd03l.
    types : begin of t_fname,                        "To hold the field names
              fld like dd03l-fieldname,
            end of t_fname.
    Internal Tables                                                      *
    data : it_dd03l   type table of t_dd03l,       "To hold the field names of dd03l.
           it_flds    type table of rsdsfields,    "To hold the field names
           it_fields  type table of dd03l,         "To hold the field names
           it_cat     type table of lvc_s_fcat,    "To hold Field Catalog
           it_fname   type table of t_fname.
    Work areas                                                           *
    data: wa_dd03l  like line of it_dd03l,     "Workarea for IT_DD03L
          wa_flds   like line of it_flds,      "Workarea for IT_FLDS
          wa_fields like line of it_fields,    "Workarea for IT_FIELDS
          wa_cat    like line of it_cat ,      "Workarea for IT_CAT
          wa_fname  like line of it_fname.     "Workarea for IT_FNAME
    *SELECTION SCREEN WITH BLOCK DEFINITION.
    selection-screen begin of block b2 with frame title text-004.
    parameters: p_tbname type dd03l-tabname.
    select-options: s_field for dd03l-fieldname no intervals.
    selection-screen end of block b2.
    Variables                                                            *
    data : lv_where type string,
           lv_cnt   type i value '1',
           v_records type i.
    data : gv_where_cl(100) type c.              "Variable to hold Where clause
    data: wa_flname(5) type c.
    data: wa_fldcat type lvc_s_fcat.
    data: it_fldcat type lvc_t_fcat.
    data: it type ref to data.
    DECLARATION OF FIELD SYMBOLS :
    field-symbols: <fs_table> type table.
    field-symbols: <fs_temp> type any,
                   <fs_final> type any.
    *&  Include           Z_TABLE_FS_FORMS
    *&      Form  clear_fields
         To clear all work areas and refresh all internal tables.
    form clear_fields .
      clear wa_dd03l.
      clear wa_flds.
      clear wa_fields.
      clear wa_cat.
      clear wa_fname.
      refresh it_dd03l.
      refresh it_flds.
      refresh it_fields.
      refresh it_cat.
      refresh it_fname.
    endform.                    " clear_fields
    *&      Form  FETCH_DATA
          Fetch data from different tables
    form fetch_data .
      describe table s_field lines v_records.
    Populate it_flds from s_field, to hold the fields to be Selected.
      if s_field is not initial.
        loop at s_field.
          wa_flname = s_field-low.
          write: s_field-low.
        BUILD FIELD CATALOG FOR ALL FIELDS.
          wa_flds-fieldname = wa_flname.
          append wa_flds to it_flds.
        endloop.
      endif.
    Populate the Where clause as a string.
    if s_where[] is not initial.
       loop at s_where.
         concatenate lv_where s_where-low into lv_where separated by space.
       endloop.
    endif.
    Populate it_dd03l, to hold the field names from DD03L.
      select tabname
             fieldname
             keyflag
             rollname
             position
             from dd03l
             into table it_dd03l
             where tabname eq p_tbname
                   and fieldname ne 'MANDT'.
      if sy-subrc = 0.
        sort it_dd03l by position.
        delete it_dd03l where fieldname cp '.INCLU*'.          ""CP = Covers Pattern
      endif.
    Populate it_fname, with fields which have to be selected (entered in selection).
      loop at it_dd03l into wa_dd03l.
      Read table it_flds.
        read table it_flds into wa_flds with key fieldname = wa_dd03l-fieldname.
        if sy-subrc = 0.
        Move data from it_dd03l to it_fname
          wa_fname-fld = wa_dd03l-fieldname.
          append wa_fname to it_fname.
          clear wa_fname.
        endif.
      endloop.
    *TO CHECK IF TABLE EXISTS.
      call function 'SCPR_DB_TABLE_EXIST'
        exporting
          tabname        = p_tbname
        exceptions
          tab_dont_exist = 1
          others         = 2.
      if sy-subrc <> 0.
        if sy-subrc = 1.
        GIVE A POP UP.
          call function 'POPUP_TO_DECIDE_INFO'
            exporting
              textline1    = 'Table Does Not Exist !'
              titel        = 'Invalid Table Name'
              start_column = 25
              start_row    = 6.
        endif.
      endif.
    SELECT ALL RECORDS FROM DD03L.
      select *
      into table it_fields
      from dd03l
      where tabname = p_tbname.
      if sy-subrc = 0.
        sort it_fields by position.
        delete it_fields where fieldname cp '.INCLU*'.         "CP = Covers Pattern.
      endif.
    Populate IT_CAT with fields which are REQUIRED.
    Display upto 150 fields only.
      loop at it_fields into wa_fields to 150.
      Read table it_fname
        read table it_fname into wa_fname with key fld = wa_fields-fieldname.
        if sy-subrc = 0.
        Move data from it_fields
          wa_cat-tabname = p_tbname.
          wa_cat-fieldname = wa_fields-fieldname.
          wa_cat-col_pos = lv_cnt.
          wa_cat-inttype    = wa_fields-inttype.
          wa_cat-datatype = wa_fields-datatype.
          wa_cat-intlen = wa_fields-intlen.
          wa_cat-seltext = wa_fields-fieldname.
          wa_cat-decimals = wa_fields-decimals.
          wa_cat-ref_field = wa_fields-fieldname.
          wa_cat-ref_table = p_tbname.
          append wa_cat to it_cat.
          clear wa_cat.
          lv_cnt = lv_cnt + 1.
        endif.
      endloop.
    CREATE A DYNAMIC INTERNAL TABLE.
      call method cl_alv_table_create=>create_dynamic_table
        exporting
          it_fieldcatalog = it_cat
        importing
          ep_table        = it.
    ASSIGN IT TO <FS>.
      assign it->* to <fs_table>.
    *Select the data from the table given as input and populate
    it into the dynamic internal table created based on the where
    condition.
      select (it_fname)
             from (p_tbname)
             into table <fs_table>
             where (lv_where).
      if sy-subrc <> 0.
        message 'No data found' type 'I'.
      endif.
    *Displaying dynamic internal table .
      loop at <fs_table> assigning <fs_temp>.
       write:/ <fs_temp> quickinfo 'CONTENTS'.
      endloop.
    endform.                    " FETCH_DATA
    Best Regards,
    Deepa Kulkarni

  • Decimals on CALL METHOD cl_alv_table_create= create_dynamic_table

    Hello experts:
    I have a little problem, I want to create an ALV field with 4 decimales, it's a dinamic table, but when the alv report shows the fields it shows only 2 decimals, here the main code for explaining me better:
    Here the code for create the field with decimals:
    * Netpr
      lv_cols = lv_cols + 1.
      MOVE lv_cols TO wa_it_fldcat-col_pos.
      MOVE 'NETPR'      TO wa_it_fldcat-fieldname.
      MOVE 'Net Price'  TO wa_it_fldcat-scrtext_l.
      MOVE 'Net Price'  TO wa_it_fldcat-scrtext_m.
      MOVE 'Net Pr'     TO wa_it_fldcat-scrtext_s.
      MOVE 'CURR'       TO wa_it_fldcat-datatype.
      MOVE 'P'          TO wa_it_fldcat-inttype.
      MOVE 11           TO wa_it_fldcat-intlen.
      MOVE 4            TO wa_it_fldcat-decimals.
      MOVE ''           TO wa_it_fldcat-ref_field.
      MOVE ''           TO wa_it_fldcat-ref_table.
      APPEND wa_it_fldcat TO t_fldcat.
    After create more fields, here the code for create the dinamic ALV table:
    * Create dynamic internal table and assign to FS
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = t_fldcat
        IMPORTING
          ep_table        = t_newtable.
      ASSIGN t_newtable->* TO <t_dyntable>.
    * Create dynamic work area and assign to FS
      CREATE DATA t_newline  LIKE LINE OF <t_dyntable>.
      ASSIGN t_newline->* TO <fs_dyntable>.
    After this method, the structure of the work area having the data type of the fields and all the atributes, the decimals of the NETPR fields just have 2 decimals =(
    I hope my explanation it's clear.
    Any help with this issue it's very welcome, thank you very much for your time.
    Miriam

    Hi
    Xiaonan Hu is right: u need to delete the row where u transfer CURR as type:
    * Netpr
      lv_cols = lv_cols + 1.
      MOVE lv_cols TO wa_it_fldcat-col_pos.
      MOVE 'NETPR'      TO wa_it_fldcat-fieldname.
      MOVE 'Net Price'  TO wa_it_fldcat-scrtext_l.
      MOVE 'Net Price'  TO wa_it_fldcat-scrtext_m.
      MOVE 'Net Pr'     TO wa_it_fldcat-scrtext_s.
      *MOVE 'CURR'       TO wa_it_fldcat-datatype.
      MOVE 'P'          TO wa_it_fldcat-inttype.
      MOVE 11           TO wa_it_fldcat-intlen.
      MOVE 4            TO wa_it_fldcat-decimals.
      MOVE ''           TO wa_it_fldcat-ref_field.
      MOVE ''           TO wa_it_fldcat-ref_table.
      APPEND wa_it_fldcat TO t_fldcat.
    If you transfer CURR, the method will defined a type p with 2 decimals by default, so it's useless to indicate the decimals in this case.
    Infact the method calls the fm ALV_TABLE_CREATE, and here the abap code is:
    - for CURR type:
    elseif ls_fieldcat-datatype = 'CURR'.
            concatenate 'DATA:'
                        ls_fieldcat-fieldname
                        'TYPE'
                        ls_fieldcat-inttype
                        'DECIMALS 2.'
                        into lt_source-line separated by space.
    - for P type
    if ls_fieldcat-inttype = 'P' and not ls_fieldcat-decimals is
               initial.
              replace '.' with 'DECIMALS' into lt_source-line.
              concatenate lt_source-line ls_fieldcat-decimals '.' into
                          lt_source-line separated by space.
            endif.
    Max

  • CREATE DYNAMIC TABLE ERROR (CACHE PROBLEM ?)

    Hi,
    i have to create dynamic table. The Report is running. But i get Problem by next Programstart. It's showing the Message : This Table is ready exist! Can anyone help me?
    Thanks!
    CLEAR gt_fieldcatalog.
    CLEAR gz_tab.
      lv_index = 1.
      gs_fieldcatalog-tabname = 'test'.
      gs_fieldcatalog-fieldname = 'field_0'.
      gs_fieldcatalog-reptext = 'field_0'.
      gs_fieldcatalog-col_pos = lv_index.
      gs_fieldcatalog-outputlen = 10.
      APPEND gs_fieldcatalog TO gt_fieldcatalog.
      lv_index = 2.
      gs_fieldcatalog-tabname = 'test'.
      gs_fieldcatalog-fieldname = 'TEXT'.
      gs_fieldcatalog-reptext = 'TEXT'.
      gs_fieldcatalog-col_pos = lv_index.
      gs_fieldcatalog-outputlen = 50.
      APPEND gs_fieldcatalog TO gt_fieldcatalog.
      Do 10 times.
        lv_index = lv_index + 1.
         CONCATENATE field '_' lv_index INTO lv_fieldname.
        gs_fieldcatalog-tabname = 'TEST'.
        gs_fieldcatalog-fieldname = lv_fieldname.
        gs_fieldcatalog-reptext = lv_fieldname.
        gs_fieldcatalog-col_pos = lv_index.
        gs_fieldcatalog-outputlen = 10.
        APPEND gs_fieldcatalog TO gt_fieldcatalog.
        CLEAR lv_fieldname.
      ENDDO.
    "Converting the Fieldcatalog for  ALV Grid showing
    LOOP AT gt_fieldcatalog INTO gs_fieldcatalog.
        ls_fcat-col_pos = gs_fieldcatalog-col_pos.
        ls_fcat-fieldname = gs_fieldcatalog-fieldname.
        ls_fcat-seltext_l = gs_fieldcatalog-reptext.
        ls_fcat-tabname = gs_fieldcatalog-tabname.
        ls_fcat-datatype = gs_fieldcatalog-datatype.
        ls_fcat-outputlen = gs_fieldcatalog-outputlen.
        APPEND ls_fcat TO lt_fcat.
      ENDLOOP.
      " Creating internal Table
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = gt_fieldcatalog
        IMPORTING
          ep_table                  = gz_tab
        EXCEPTIONS
          generate_subpool_dir_full = 1
          OTHERS                    = 2.
      ASSIGN gz_tab->* TO <ft_tab>.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = ls_variant-report
          it_fieldcat        = lt_fcat
          i_grid_title       = 'Test'
          is_layout          = alv_layout
          i_save             = 'A'
          is_variant         = gx_variant
        TABLES
          t_outtab           = <ft_tab>
        EXCEPTIONS
          program_error      = 1
          OTHERS             = 2.
    CLEAR <ft_tab>.
    UNASSIGN <ft_tab>.
    CLEAR lt_fcat.
    Edited by: Hoang Lam Vu on Aug 25, 2008 11:18 AM

    Hi Maroz,
    I know this is not best practise to post my question in some others,  but i have posted it separately earlier
    Dynamic ITAB from Excel
    I have created a dynamic ITAB from 1 Row of Excel Sheet
    LOOP AT ist_excel INTO w_excel WHERE row = 2. " Contains the Values provided in 2nd row of Excel
        APPEND w_excel TO row1.
      ENDLOOP.
      LOOP AT ist_excel INTO w_excel WHERE row = 3. " Contains the Values provided in 3rd row of Excel
        APPEND w_excel TO row2.
      ENDLOOP.
      LOOP AT ist_excel INTO w_excel WHERE row = 4." Contains the Values provided in 4th row of Excel Etc
        APPEND w_excel TO row3.
      ENDLOOP.
      LOOP AT row1 INTO w_excel.
        CLEAR wa_it_fldcat.
        wa_it_fldcat-fieldname = w_excel-value .
        wa_it_fldcat-datatype = 'C'.
        wa_it_fldcat-inttype = wa_details-type_kind.
        wa_it_fldcat-intlen = 40.
    *  wa_it_fldcat-decimals = wa_details-decimals.
        APPEND wa_it_fldcat TO it_fldcat .
      ENDLOOP.
    * Create dynamic internal table and assign to FS
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fldcat
        IMPORTING
          ep_table        = new_table.
      ASSIGN new_table->* TO <dyn_table>.
    * Create dynamic work area and assign to FS
      CREATE DATA new_line LIKE LINE OF <dyn_table>.
      ASSIGN new_line->* TO <dyn_wa>.
    I followed the Link provided by to create a Dynamic ITAB
    Please guide me how to pass these Value from excel to Dynamic Internal Table
    Warm Regards
    Ramchander

  • Creating Dynamic table

    Hi,
    I am uploading one file into my program with structure_name,field_name,field_value and records. Now I want to create a dynamic internal table with the above fields and want to fill the records too.Can anyone tell how to do it?

    Hi,
    Have a look at this sample program to create dynamic internal and passing data to that internal table.
    <pre>
    REPORT  ztest_notepad.
    *& Declarations
    *Type-pools
    TYPE-POOLS:
          slis.
    *Types
    TYPES:
          ty_fcat      TYPE lvc_s_fcat,
          ty_fcatalog  TYPE slis_fieldcat_alv.
    *Work areas
    DATA:
          wa_fcat      TYPE ty_fcat,
          wa_fcatalog  TYPE ty_fcatalog.
    *Internal tables
    DATA:
          it_fcat      TYPE STANDARD TABLE OF ty_fcat,
          it_fcatalog  TYPE STANDARD TABLE OF ty_fcatalog.
    *Type reference
    DATA:
          it_dyn_tab   TYPE REF TO data,
          wa_newline   TYPE REF TO data.
    *Filed symbols
    FIELD-SYMBOLS:
          <gt_table>   TYPE STANDARD TABLE,
          <fs_dyntable>,
          <fs_fldval>  TYPE ANY,
          <l_field>    TYPE ANY.
    *Variables
    DATA:
          l_fieldname  TYPE lvc_s_fcat-fieldname,
          l_tabname    TYPE lvc_s_fcat-tabname,
          l_fieldtext  TYPE lvc_s_fcat-seltext,
          l_index      TYPE char2.
    "Selection-screen
    PARAMETERS:
             p_colms   TYPE i.
    *& start-of-selection.
    START-OF-SELECTION.
      PERFORM build_fieldcat.
      PERFORM create_dynamic_table.
      DO 20 TIMES.
        DO p_colms TIMES.
          l_index = sy-index.
          CONCATENATE 'FIELD' l_index INTO l_fieldname.
          ASSIGN COMPONENT l_fieldname OF STRUCTURE <fs_dyntable> TO <l_field>.
          <l_field> = sy-index.
        ENDDO.
        INSERT <fs_dyntable> INTO TABLE <gt_table>.
      ENDDO.
      LOOP AT it_fcat INTO wa_fcat.
        PERFORM fieldcatalog1 USING: wa_fcat-fieldname
                                      wa_fcat-tabname
                                      wa_fcat-seltext.
      ENDLOOP.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program = 'ZTEST_NOTEPAD'
          it_fieldcat        = it_fcatalog
        TABLES
          t_outtab           = <gt_table>.
    *&      Form  BUILD_FIELDCAT
    FORM build_fieldcat .
      CLEAR: l_fieldname,
             l_tabname,
             l_fieldtext,
             l_index.
      DO  p_colms TIMES.
        CLEAR l_index.
        l_index = sy-index.
        CONCATENATE 'FIELD' l_index INTO l_fieldname.
        CONCATENATE 'Field' l_index INTO l_fieldtext.
        l_tabname = '<GT_TABLE>'.
        PERFORM fieldcatalog USING: l_fieldname
                                    l_tabname
                                    l_fieldtext.
      ENDDO.
    ENDFORM.                    " BUILD_FIELDCAT
    *&      Form  CREATE_DYNAMIC_TABLE
    FORM create_dynamic_table .
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fcat
        IMPORTING
          ep_table        = it_dyn_tab.
      ASSIGN it_dyn_tab->* TO <gt_table>.
    Create dynamic work area and assign to FS
      CREATE DATA wa_newline LIKE LINE OF <gt_table>.
      ASSIGN wa_newline->* TO <fs_dyntable>.
    ENDFORM.                    " CREATE_DYNAMIC_TABLE
    *&      Form  FIELDCATALOG
    FORM fieldcatalog USING field table f_txt.
      wa_fcat-fieldname = field.
      wa_fcat-tabname   = table.
      wa_fcat-seltext = f_txt.
      APPEND wa_fcat TO it_fcat.
      CLEAR  wa_fcat.
    ENDFORM.                    " FIELDCATALOG
    *&      Form  FIELDCATALOG1
    FORM fieldcatalog1 USING field table f_txt.
      wa_fcatalog-fieldname = field.
      wa_fcatalog-tabname   = table.
      wa_fcatalog-seltext_m = f_txt.
      APPEND wa_fcatalog TO it_fcatalog.
      CLEAR  wa_fcatalog.
    ENDFORM.                    " FIELDCATALOG1 </pre>Thanks
    Venkat.O

  • Error while creating dynamic Table

    Hi All,
    I have a node 'SEG' with 3 attributes, ATTR1.2.3, I am tring to crate dynamic table using this context node. Initialy i am displaying view with button, when click on this button i want to create table dynamically.. if click again one more table i have to create.. its giving dump... here is the code... How to do this???
    data: wd_node_info type ref to if_wd_context_node_info,
            wd_node type ref to if_wd_context_node,
            lr_container type ref to cl_wd_uielement_container,
            lv_tablename type string,
            lt_db_data type ref to data,
            lr_table type ref to cl_wd_table.
      field-symbols: <lt_data> type any table.
      wd_node_info = wd_context->get_node_info( ).
      wd_node = wd_context->get_child_node( name = 'SEG' ).
    lr_container ?= view->get_root_element( ).
      cl_wd_matrix_layout=>new_matrix_layout( container = lr_container ).
    " Creating internal table with the same structure as our dynamic
      context node
      CALL METHOD CL_WD_DYNAMIC_TOOL=>CREATE_TABLE_FROM_NODE
        EXPORTING
          UI_PARENT = lr_container
          TABLE_ID  = 'MY_TABLE'
          NODE      = wd_node
        RECEIVING
          TABLE     = lr_table.
      cl_wd_matrix_data=>new_matrix_data( element = lr_table ).
      lr_table->bind_data_source( path = 'SEG' ).
    Thanks'
    Madhan.

    Hi Sarbjeet,
    The code is working fine, when i use in wddomodify view method without button click on first time.( I checked this by creating another component). But I am creating dynamic table when click on button(view contains one button initially), for this i created two attributes FLAG OF TYPE wdy_boolean and count of type int1. and in button action i write this code :
      DATA lo_el_context TYPE REF TO if_wd_context_element.
        DATA ls_context TYPE wd_this->element_context.
        DATA lv_flag LIKE ls_context-flag.
      get element via lead selection
        lo_el_context = wd_context->get_element( ).
      get single attribute
        lo_el_context->set_attribute(
            name =  `FLAG`
            value = abap_true ).
      DATA lv_count LIKE ls_context-count.
    get element via lead selection
      lo_el_context = wd_context->get_element(  ).
    get single attribute
      lo_el_context->get_attribute(
        EXPORTING
          name =  `COUNT`
        IMPORTING
          value = lv_count ).
    lv_count = lv_count + 1.
    lo_el_context->set_attribute(
        EXPORTING
          name =  `COUNT`
          value = lv_count ).
    and in wddomodify view method following code..
    Method WDDOMODIFYVIEW
    DATA lo_el_context TYPE REF TO if_wd_context_element.
      DATA ls_context TYPE wd_this->element_context.
      DATA lv_flag LIKE ls_context-flag.
      get element via lead selection
        lo_el_context = wd_context->get_element(  ).
      get single attribute
        lo_el_context->get_attribute(
          EXPORTING
            name =  `FLAG`
          IMPORTING
            value = lv_flag ).
      DATA lv_count LIKE ls_context-count.
    get element via lead selection
      lo_el_context = wd_context->get_element(  ).
    get single attribute
      lo_el_context->get_attribute(
        EXPORTING
          name =  `COUNT`
        IMPORTING
          value = lv_count ).
    if lv_flag = abap_true. ......
    Remaining code same post previously************8
    get element via lead selection
      lo_el_context = wd_context->get_element(  ).
    get single attribute
      lo_el_context->set_attribute(
        EXPORTING
          name =  `FLAG`
          value = abap_false ).
    endif.
    endmethod...
    I created like this i am not getting other UI elements(input, ddbykey,button).
    And if i click view button again it going to dump..
    Thanks,
    Madhan.

  • Problem with editable combo box and creating dynamic table values using js

    Hai
    I have used jquery.jec.js to make my dropdown list as editable... I need to create dynamic table values on the onChange event of dropdown using javascript.
    Now am facing the problem in it...
    I am getting duplicate rows in the table... think(assumption) this jquery.jec.js is calling the dropdown again creating duplicate values...
    Please help me out.... Any help is appreciable... Thanks in advance

    Thanks elOpalo, for your valuable response....
    I have found the correct way of doing.
    Before i had my code like this,
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>test</title>
    <script type="text/javascript" src="js/jquery-latest.js"></script>
    <script type="text/javascript" src="js/jquery.jec.js"></script>
    <script type="text/javascript">
    $(function(){
    $('#list').jec();
    function giveAlert(){
         alert('hello');
    </script>
    </head>
    <body>
    <form>
    Combo Box:
    <select id="list" name="list" onChange="giveAlert();">
    <option value="1">one</option>
    <option value="2">two</option>
    </select>
    </form>
    </body>
    </html>
    Now i have changed as the following,
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>test</title>
    <script type="text/javascript" src="js/jquery-latest.js"></script>
    <script type="text/javascript" src="js/jquery.jec.js"></script>
    <script type="text/javascript">
    $(function(){
    $('select.combo').jec();
    $('select.combo')
    .change(function() {
    alert($(this).val());
    }).change();
    </script>
    </head>
    <body>
    <form>
    <table>
    <tr>
    <td>Combo Box:</td>
    <td><select class="combo"><option value="b">banana</option><option value="a">apple</option></select></td>
    </tr>
    </table>
    </form>
    </body>
    </html>
    The problem is with the function i have called on the onChange Event.. Now i have defined it inside the jquery function of dropdown to make it as editable...

  • Create dynamic table using pojo data control

    What are the options we can in order to create dynamic table columns based on pojo data control?
    We have a class A and there are some attributes say A.x, A.y, A.z
    Within class A, we have a collection of class B and has attribute say B.k
    Within class A, we have a collection of class C and has attribute say C.j
    Every instance of class A has same number of instances of class B
    Every instance of class A has same number of instances of class C
    We would like to display a table like this
    A.x, A.y, A.z, [B.k, B.k, ...], [C.j, C.j, ...]
    How should we do that?
    Thanks

    What are the options we can in order to create dynamic table columns based on pojo data control?
    We have a class A and there are some attributes say A.x, A.y, A.z
    Within class A, we have a collection of class B and has attribute say B.k
    Within class A, we have a collection of class C and has attribute say C.j
    Every instance of class A has same number of instances of class B
    Every instance of class A has same number of instances of class C
    We would like to display a table like this
    A.x, A.y, A.z, [B.k, B.k, ...], [C.j, C.j, ...]
    How should we do that?
    Thanks

  • Can I create a table called user

    Dear buddies,
    Can I create a table called user in my database.
    Please guide me.
    Thanks in advance.
    Nith

    user645399 wrote:
    I was required to create one for some reasons by a vendor so that Oracle will work with their tool.
    This tells you more about the vendor than the vendor would like you to know ......
    Like the vendor that told me their product would work with an oracle database, but they preferred SQL Server because "oracle doesn't perform will with more than 5 concurrent connections". Fortunately we were still in product evaluation and I was able to get them cut from the short list.
    After seeing all your replies, now, I have contacted them asking for alternatives and explanations.
    Anyway, Thank You to everyone of you.
    Nith

  • How to create dynamic event handler methods?

    Hello!
    Is it possible to create dynamic event handler methods in the views of WDC and then subscribe to an event of another WD component completely dynamically.
    Many thanks,
    Smitha.

    By first realising AJAX is not Java but JavaScript and then reading a tutorial on JavaScript DOM manipulation and then by reading a tutorial on AJAX and then by applying your knowledge and then in the end by integrating it in your JSP.

  • How to create Dynamic Table Control

    Hi
    How to create Dynamic Table control , The field names and values to be displayed in table control are to be fetched from Add-on Tables.
    Regards
    Prasath

    Hi Jonathan,
    Actually the columns to be displayed are not constant . It will be increased based on the database values, Anyhow it will not exceed 100.
    Please confirm my understanding.
    1. In this case I have to create 100 custom columns and make it visible / invisible based on my requirement and I can set the title at runtime.
    2. How can i assosicate / reassociate the datadictionary reference for the columns that i use. Because I need to show the search help values for the
    dynamic columns.
    Your opinion on this will be helpful.
    Regards
    Prasath

  • Table Type in cl_alv_table_create= create_dynamic_table

    Hi guys,
    The method create_dynamic_table from  cl_alv_table_create has as exporting parameter a fielcatalog table. I want to insert a table type in this table, basically the field INTTYPE from LVC_S_FCAT can do that if u put the value 'h' in it. But I notice, that in method implementations all the cases are considered:
    C
    Character String
    N
    Character String with Digits Only
    D
    Date (Date: YYYYMMDD)
    T
    Time (Time: HHMMSS)
    X
    Byte Sequence (heXadecimal)
    I
    Integer number (4-byte integer with sign)
    b
    1-byte integer, integer number <= 254
    s
    2-byte integer, only for length field before LCHR or LRAW
    P
    Packed number
    F
    Floating point number to accuracy of 8 bytes
    and other, but not 'h'.
    Does anybody knows how create a dynamic table with a table type inside ? The table type has the structure from data dictionary  lvc_t_scol.
    Ionut.

    cl_alv_table_create=>create_dynamic_table( ) is no longer recommended to build dynamic tables.
    RTTC classes are very intuitive and quite easy to maintain.
    DATA:
          gt_struct_fields TYPE cl_abap_structdescr=>component_table,
          gwa_struct_field TYPE cl_abap_structdescr=>component.
    DATA:
          goref_table TYPE REF TO cl_abap_tabledescr,
          gdref_table TYPE REF TO data.
    FIELD-SYMBOLS <gt_dynamic> TYPE STANDARD TABLE.
    TRY.
    *   f1 TYPE c LENGTH 10
        gwa_struct_field-name = `F1`.
        gwa_struct_field-type = cl_abap_elemdescr=>get_c( 10 ).
        APPEND gwa_struct_field TO gt_struct_fields.
        CLEAR gwa_struct_field.
    *   f2 TYPE bukrs
        gwa_struct_field-name = `F2`.
        gwa_struct_field-type ?= cl_abap_typedescr=>describe_by_name( `BUKRS` ).
        APPEND gwa_struct_field TO gt_struct_fields.
        CLEAR gwa_struct_field.
    *   f3 TYPE flighttab
        gwa_struct_field-name = `F3`.
        gwa_struct_field-type ?= cl_abap_typedescr=>describe_by_name( `FLIGHTTAB` ).
        APPEND gwa_struct_field TO gt_struct_fields.
        CLEAR gwa_struct_field.
    *   Use the structure object to build the table
        goref_table = cl_abap_tabledescr=>get(
                      cl_abap_structdescr=>get( gt_struct_fields )
        CREATE DATA gdref_table TYPE HANDLE goref_table.
        ASSIGN gdref_table->* TO <gt_dynamic>.
      CATCH ##no_handler
        cx_sy_struct_creation
        cx_parameter_invalid_range
        cx_sy_table_creation.
    ENDTRY.
    BR,
    Suhas

  • Create dynamic table

    Hi
    I am new to Javascript. Anyone has a standard program to create a dynamic table after getting the input from the user. The number of columns would be 2 and the number of rows depend upon the user input. And the number of rows should not exceed 4. I tried some codes from web but does not seem to work for me. Thanks.

    Sorry, new to JSP. I tried as follows. My basic idea is get the input from the user and generate table according to that.
    <%@page contentType="text/html"%>
    <%@page pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <HTML><HEAD>
        <TITLE>A Colorful and Dynamic Table</TITLE></HEAD>
        <BODY>
            <CENTER>
                <H1>Colorful and Dynamic Table</H1>
                <FORM METHOD=POST>
                    <INPUT TYPE=TEXT NAME=WIDTH  VALUE=15 SIZE=2>               
                    <INPUT TYPE=SUBMIT VALUE="Do it !">
                </FORM>
                <%  String w = request.getParameter("WIDTH"); %>
                <% out.print(w); %>
                <TABLE>
                    <% for(int row=1; row <= w; row++) { %>
                    <TR>
                        <%      for(int col=1; col<=2; col++) { %>
                        <TD> (<%=col%>, <%=row%>)
                        </TD>
                        <% } %>
                    </TR>
                    <% } %>
                </TABLE>         
                <HR>
            </CENTER>
        </BODY>
    </HTML>But something wrong. It is giving me some errors. I need to get the info from the user and then generate the table. Is it possible to do it with JSp or I have to use javascript. Thanks.

  • Procedure for creating dynamic table

    Hi! I'm having a problem with creating a table with the help of procedure. The thing is, I want to pass an (possibly an array of) unknown amount of values - column names, types - to the procedure, that I defined, and then be able to create a (temporary) table with the received data. Possible? Maybe you could give me some hints - any help appreciated.

    899749 wrote:
    Yes, not literally there are million fields, of course :) What I was trying to say -> there are too much fields to create a hidden field array each time, and honestly I don't like this because of content availability through source code.Statement does not make sense.
    If there are too many "fields" (databases have tables and rows and columns - not fields), then how does introducing a new database table reduce these? It is far simpler to only select the rows required, the columns needed for display, and building a "field array" using that - assuming that your definition of such an array matches mine...
    Besides the saneness and logic of using dynamic tables, there are performance considerations. The slowest and most expensive database operation is I/O.
    So what is your justification to spend a lot of I/O on duplicating existing data in the database? Why read data from tables to create so-called dynamic tables? Is that the best spend of database resources?
    Don't know what forms you were talking about - the idea is to possibly use some programming (like php) + html to create a dynamic form. That's why I need a dynamic temporary table to pass the content around (no sessions, please).Forms are typically not dynamic. You do not point code at some arbitrary table structure and say "+form instantiate thyself+". This code will not understand the business rules and validation rules for properly displaying a data entry form for that entity, and applying the rules and logic for processing entered data and storing that in the table.
    Forms are usually (almost always) coded as static - the entry fields are known at design time. The validation rules are known. The business logic to apply is known.
    That begs the question as to not only what you are trying to do (it does not make sense!), but also why? What are the business requirements that need to be met?

  • How to create dynamic tables in jsp page

    Hi,
    Iwant to create a table with 8 rows.each row will have two select boxes and one text box.besides i have add button.intially the screen shows only one row.if user clicks on add button then another row is added.like this upto 8 rows.
    how can solve this problem..
    regards,

    Hi I am not a big programmer but i can suggest a method to u
    try something like this..
    this could be quite adjusted in html page itself.....
    <html>
    <head>
    <script language="javascript">
    var count=1
    fucntion addRow(){
    if(count<8){
    count=count+1
    row.innerHTML=row.innerHTML+"<tr><td><input type='text' name="+count+"></td><td><input type='button' onclick=addRow() value='Add' name='add'></td></tr>"
    else if(count==8){
    row.innerHTML=row.innerHTML+"<tr><td><input type='text' name="+count+"></td><td></td></tr>"
    </script >
    </head>
    <body>
    <form action='Myservlet" method='post'>
    <table>
    <div name='row' name='row'><tr><td><input type='text' name=1></td><td><input type='button' onclick=addRow() value='Add' name='add'></td></tr></div>
    </table>
    </form>
    </body>
    </html>
    I believe it could be quite adjusted @ client side itself.... as per your description...

Maybe you are looking for

  • How to Open a Navigation Link in a new Window?

    Hi guys,    I am trying to add a link to one of my team site. And i have activated the SharePoint server publishing infrastructure service. In the navigation link i am sure the clicked the check box open in new window. But i not getting the new windo

  • How to quickly assess the amount of free space on a hard drive or memory stick?

    Before Mavericks there used to be a little reading in the bottom of a finder window telling you how much space was available in whatever drive you were currently viewing, now i have to click get info every time, is there a quicker way?

  • Why won't my Samsung Stratosphere Charge??

    I've had a Samsung Stratosphere since late July of 2012. For the most part it hasn't given me any problems. However for the past 3 days the phone has had problems charging. Last night it finally died while I was sleeping, I tried to charge it again,

  • Here's my plan:

    Wait for the NHL-playoffs, get a ticket to a whichever game 7, game's over one team's dropped, people throw beach balls on the ice, throw my MBP running Logic 9.01 there with them.

  • Regarding acccess Sequence

    hi Gurus, I am working on TAXINN. I have a error in access sequence. i have created acesss sequence JEXC in which i maintained standard table 40 for country,region,customer classification, and material classification.But at the time of creating condi