Dynamic internal table from SELECT - statement ?

Hi, is it possible to define an internal table just after a select statement is executed so that this internal table holds all the data that come back from the statement ?
thanks in advance,

Check the link -
Re: Create Dynamic internal table
Regards,
Amit

Similar Messages

  • Modify dynamic internal table from dynamic work area using index...

    ASSIGN w_text TO <fs>.
        ASSIGN w_temp TO <fs1>.
        lint_tab_iw49[] = <tab>.
        lint_tab_iw49_t[] = <tab>.
        DELETE ADJACENT DUPLICATES FROM lint_tab_iw49 COMPARING aufnr.
        LOOP AT lint_tab_iw49 INTO lws_tab_iw49.
          READ TABLE lint_object_tab1 INTO lws_object_tab1
                        WITH KEY aufnr = lws_tab_iw49-aufnr.
          IF sy-subrc EQ 0.
    Collect operations in rows of an internal table.
            w_idx = 1.
            WHILE w_idx < 51.
              w_nn = w_idx.
              CONCATENATE 'lws_object_tab1-ZZOPERN' w_nn INTO w_xx.
              ASSIGN (w_xx) TO <fs>.
              CONCATENATE w_text <fs> INTO w_text SEPARATED BY ','.
              w_idx = w_idx + 1.
            ENDWHILE.
    Split operations into an internal table to get operations in rows.
            SPLIT w_text AT ',' INTO TABLE lint_vornr.
            DELETE lint_vornr WHERE vornr = ' '.
            DESCRIBE TABLE lint_vornr LINES w_lines.
    Collect costs in rows of an internal table
            CLEAR: w_idx, w_nn, w_xx, w_text.
            w_idx = 1.
            WHILE w_idx < 51.
              w_nn = w_idx.
              CONCATENATE 'lws_object_tab1-ZZCOST' w_nn INTO w_xx.
              ASSIGN (w_xx) TO <fs>.
              <fs1> = <fs>.
              CONCATENATE w_text <fs1> INTO w_text SEPARATED BY ','.
              w_idx = w_idx + 1.
            ENDWHILE.
    Split costs into an internal table to get costs in rows.
            SPLIT w_text AT ',' INTO TABLE lint_escost.
            DELETE lint_escost WHERE cost = ' '.
            DESCRIBE TABLE lint_escost LINES w_lines_cost.
           Append lines of lint_escost from 1 to w_lines to lint_escost1.
    Collect currencies in rows of an internal table
            CLEAR: w_idx, w_nn, w_xx, w_text.
            w_idx = 1.
            WHILE w_idx < 51.
              w_nn = w_idx.
              CONCATENATE 'lws_object_tab1-ZZCURR' w_nn INTO w_xx.
              ASSIGN (w_xx) TO <fs>.
              <fs1> = <fs>.
              CONCATENATE w_text <fs1> INTO w_text SEPARATED BY ','.
              w_idx = w_idx + 1.
            ENDWHILE.
    Split costs into an internal table to get costs in rows.
            SPLIT w_text AT ',' INTO TABLE lint_curr.
            DELETE lint_curr WHERE curr = ' '.
            DESCRIBE TABLE lint_curr LINES w_lines_curr.
           Append lines of lint_curr from 1 to w_lines to lint_curr1.
          ENDIF.
          PERFORM update_object_tab_for_iw49n.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " modify_object_tab
    *&      Form  update_object_tab_for_IW49N
          text
    -->  p1        text
    <--  p2        text
    FORM update_object_tab_for_iw49n .
      DATA: lws_temp TYPE string VALUE 'where aufnr = lws_tab_iw49-aufnr',
            lw_index TYPE sy-index.
      READ TABLE <tab> TRANSPORTING NO FIELDS WITH KEY ('AUFNR') =
      lws_tab_iw49-aufnr.
      IF sy-subrc EQ 0.
        lw_index = sy-tabix.
        LOOP AT <tab> INTO <wa1> FROM lw_index.
          IF <wa1>-aufnr NE lws_tab_iw49-aufnr.
            EXIT.
          ELSE.
            CLEAR lw_index.
           lw_index = sy-tabix.
            lw_index = 1.
            WHILE lw_index LE w_lines.
              READ TABLE lint_escost INTO lws_escost INDEX lw_index.
              IF sy-subrc EQ 0.
             lw_index = lw_index + 1.
                <wa1>-zzcost1 = lws_escost-cost.
              ENDIF.
              READ TABLE lint_curr1 INTO lws_curr INDEX lw_index.
              IF sy-subrc EQ 0.
                <wa1>-zzcurr1 = lws_curr-curr.
              ENDIF.
              MODIFY <tab> FROM <wa1> "TRANSPORTING ('ZZCOST1') ('ZZCURR1')
                        INDEX sy-tabix.
              IF sy-subrc EQ 0.
              ENDIF.
              lw_index = lw_index + 1.
            ENDWHILE.
          ENDIF.
        ENDLOOP.
      ENDIF. 
    ENDFORM.                    " update_object
    Hi,
    With referene to the code snippet above I want to modify <tab> from <wa1> on specific indices or with specific where condition.
    Is it achievable... How?
    Many thanks in advance.
    Thanks & Regards,
    Shreya

    You might have to split the code in to two parts to keep the formatting intact.

  • Count Index Internal Table or Select Statement

    Hi All,
    I wish to index and display my internal table. How do i do this? for example in my Internal Table I have the following data:-
    Material-----Plant--Index
    ABCD1--  1000--
    1
    ABCD1--  1000--
    2
    ABCD1--  1000--
    3
    ABCD2--  1000--
    1
    ABCD2--  1000--
    2
    Basically based on the unique values in Material and Plant an Index is generated? does that make sense?
    Thanks
    Adeel

    Hi Guys,
    Tried them it doesn't seem to work. I might try a different approach. i have the following loop.
    What i am trying to do is bring the last price of an entry from itab and storing this in itab. Example
    *Material----
    Price----
    Previous Price*
    ABC1  -
    £10----
    £0 (as this is the first record)
    ABC1  -
    £30----
    £10
    ABC2  -
    £15----
    £30 *<----
    ERROR*
    ABC2  -
    £45----
    £15
    So basically it is working exactly how i want it apart from when there is a new Material it isn't clearing the previous price even though there is no previous price....does that make sense? I was thinking of doing something via counting etc... but you guys might know an easier solution. Code is below how can i clear the previous price using the example above.
    Please note this code does exactly what i want apart from clearing the previous price if it doesn;t exist.
    LOOP AT itab.
      MOVE sy-tabix TO chnge.        " sy-tabix counts no of records.
      IF sy-tabix > 1.
        w_num = sy-tabix.
        w_num = w_num - 1.
      MOVE konp-kbetr TO itab-price.
      ENDIF.
    ENDLOOP.

  • Filling Data in Dynamic internal table

    Hello,
    I have 2 internal tables TAB1 and TAB2.
    I have Created Dynamic internal table From TAB1 rows.
    Now I want to fill that Dynm. internal table from TAB2.
    But TAB2  have more Rows with diffarant  names.  I want to move particular field of TAB2 to particular field.of dynamic IT.
    kindly help.

    Hi,
    I am sending the dynamic alv report for your referenece.
    REPORT  YMS_DYNAMICALV.
    type-pools: slis.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>.
    data: alv_fldcat type slis_t_fieldcat_alv,
          it_fldcat type lvc_t_fcat.
    selection-screen begin of block b1 with frame title text-001.
    parameters: p_flds(5) type c.
    selection-screen end of block b1.
    start-of-selection.
    build the dynamic internal table
      perform build_dyn_itab.
    write 5 records to the alv grid
      do 5 times.
        perform build_report.
      enddo.
    call the alv grid.
      perform call_alv.
    Build_dyn_itab
    form build_dyn_itab.
      data: new_table type ref to data,
            new_line  type ref to data,
            wa_it_fldcat type lvc_s_fcat.
    Create fields .
      do p_flds times.
        clear wa_it_fldcat.
        wa_it_fldcat-fieldname = sy-index.
        wa_it_fldcat-datatype = 'CHAR'.
        wa_it_fldcat-intlen = 5.
        append wa_it_fldcat to it_fldcat .
      enddo.
    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>.
    endform.
         Form  build_report
    form build_report.
      data: fieldname(20) type c.
      data: fieldvalue(5) type c.
      data: index(3) type c.
      field-symbols: <fs1>.
      do p_flds times.
        index = sy-index.
    Set up fieldvalue
        concatenate 'FLD' index into
                 fieldvalue.
        condense   fieldvalue no-gaps.
      <b> assign component  index  of structure <dyn_wa> to <fs1>.
       <fs1> =  fieldvalue.</b>
      enddo.
    Append to the dynamic internal table
      append <dyn_wa> to <dyn_table>.
    endform.
    CALL_ALV
    form call_alv.
      data: wa_cat like line of alv_fldcat.
      do p_flds times.
        clear wa_cat.
        wa_cat-fieldname = sy-index.
        wa_cat-seltext_s = sy-index.
        wa_cat-outputlen = '5'.
        append wa_cat to alv_fldcat.
      enddo.
    Call ABAP List Viewer (ALV)
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                it_fieldcat = alv_fldcat
           tables
                t_outtab    = <dyn_table>.
    endform.
    Thanks,
    Shankar

  • Defining Dynamic Internal Table

    Hi everybody,
    I would like to create a dynamic internal table without knowing its structure. I have stored the DDIC field elements that have to be used in a customizing table. I would like to create the internal table depending on the field elements order. The goal is to be able to pass this internal table to an Adobe Forms.
    For example, in some cases I might have to print fieldu2019s content 1, 2, 3, and 4 but in other cases I might have to print fields 3, 1, 4 and 2. I do not know in which order the fields have to be printed.
    I am struggling with the techniques I should use to create my internal table. I do not know if I should use Field Symbols or else.
    Could you provide any coding examples?
    Thanks in advance for your help.
    Best regards,
    Sylvain

    Hi Sylvain
    I have the same requirement to pass the internal table with varying number of columns in the adobe form and the same should be display in the form.,
    i have passed the dynamic internal table from the abap code to the adobe interface and checked teh same value are passed.
    Tried the below solution:
    1)Defined the field symbol of the type Standard table(beacuse the structure for table is not fixed) in the adobe Interface.
    2)Assign the values of the internal table into the field symbol by:
       READ TABLE im_t_output INTO ls_output INDEX 1.
      ASSIGN ls_output-ZALVTAB->* TO <GT_T_OUTPUT>.
    Already checked , the values are coming into the <GT_T_OUTPUT> field symbols.
    3) Drag the field symbol <GT_T_OUTPUT> from the adobe interface to the data context of the form.
    when i am running the program its giving dump with the following error.
    "You attempted to move one data object to another.
      This is not possible here because the conversion of a data object
      of type "h" to type "g" is not supported."
    I think that is beacuse in the form it ia taking the field symbol as the text value not the internal table .
    As you have already solved the problem to pass the internal table of varying number of columns in the adobe for.
    Request you to provide me the code or some guidelines so that i can achieve the same and also request to share hoe you have read the values of the internal table in the adobe form through the adove form language.
    Thanks in advance.
    Regards,
    Sourabh Makhija

  • How to ADD rows to a dynamic internal table??

    My question is simple.
    I have a dynamic internal table and I need to ADD rows to if.
    I read this thread How to modify a dynamic internal table from dynamic work area but they are modifying existing data.
    My internal table is EMPTY and I need to ADD new rows, so I can't use LOOP ASSIGNING.
    How can I do that?
    Any help is welcome!
    Thanks!
    Bettina

    Hi,
      try something similar.
    FIELD-SYMBOLS: <fs> type any.
    FIELD-SYMBOLS: <f1> type any.
    ASSIGN INITIAL LINE TO lo_data ASSIGNING <fs>. " or <f_tab> - not sure w/o editor :-)
    assigning component 1 of structure <fs> to <f1>.
    <f1> = 'aaa'.
    I write it from memory so there can be some syntax errors but focus to command APPEND INITIAL LINE ...
    Regards,
      Karol

  • How to delete records from dynamic internal table.

    Hi Experts,
    Need urgent help!!!
    Issue is with Dynamic internal tables.
    Below is code written by me :
    FORM select_query USING Lw_tabnam
                      TYPE  t682i-kotabnr.
      DATA :  lw_line  TYPE REF TO data,
              lw_line1 TYPE REF TO data.
        CREATE DATA Lw_line    TYPE (lw_TABNAM).
        ASSIGN      Lw_line->* TO   <WA_tbl>.
        CREATE DATA LW_LINE    TYPE STANDARD TABLE OF (Lw_tabnam)
                               WITH NON-UNIQUE DEFAULT KEY.
        ASSIGN      Lw_line->* TO <TBL>.
        SELECT * FROM  (Lw_tabnam)
                 INTO CORRESPONDING FIELDS OF TABLE <TBL>
                 WHERE (t_keys).
    Endform.
    code is working fine.
    here even the table name and where condition are dynamic,everything is fine upto this point.
    Now i have to delete some record from <TBL> based on some conditons.
         for ex : ( here lc_fieldname is KUNNR)
          loop at t_kunnr.
              lw_tabix = sy-tabix.
            Read table <tbl>
                    with key (lc_fieldname) = t_kunnr-kunnr ASSIGNING <wa_tbl>.
            If sy-subrc = 0.
            *Delete
            delete <tbl> from <wa_tbl>
    delete <tbl> index  lw_tabix.
            Endif.
         Endloop.
    The above delete statement doesn't work ,even we can't use index as it gives a syntax error " something related to "index is not allowed in standard table or hash table.
    Can you help me ab't how to delete records in Dynamic internal table?
    Other option that i am thinking of is to create a static table of type dynamic table.
    means, data itab type standard table of <tbl> .I know the syntax is wrong ,however is there any way to do this?
    Thanks in advance ,
    If you have any suggestion ab't this then do let me know.
    bye,
    Gaurav.

    Hi
    I wrote this code and it works fine:
    DATA LW_TABNAM(10) VALUE 'LFA1'.
    DATA : LW_LINES TYPE REF TO DATA,
           LW_LINE  TYPE REF TO DATA.
    FIELD-SYMBOLS: <TABLE> TYPE TABLE,
                   <WA>    TYPE ANY.
    CREATE DATA LW_LINES TYPE TABLE OF (LW_TABNAM)
    WITH NON-UNIQUE DEFAULT KEY.
    ASSIGN LW_LINES->* TO <TABLE>.
    CREATE DATA LW_LINE TYPE (LW_TABNAM).
    ASSIGN LW_LINE->* TO <WA>.
    DO 10 TIMES.
      APPEND INITIAL LINE TO <TABLE>.
    ENDDO.
    SY-TABIX = 4.
    DELETE <TABLE> INDEX SY-TABIX.
    WRITE SY-SUBRC.
    I hope it help you
    Max

  • Populate Final internal table from Dynamic internal table

    Hello,
    I have ti display data in ALV grid whose structure is fixed. I am dynamically selecting data iin an internal table.
    Now from this dynamic internal table, i need to populate my final internal table whose structurte is fixed.
    Please help.
    Rgds,
    Himanshu

    Hello Himanshu,
    When you say dynamic internal table there are two things one is the actual structure and other one is field table that holds information for all the fields used to create dynamic internal table.
    No if you want to move data from dynamic table to fixed internal table then you can try as follows:
    1.
    field-symbols <field_name> TYPE C.
    field-symbols <field_value> TYPE C.
    Now you either use
    LOOP AT fields_itab.
    ASSIGN fields_itab-fieldname to <field_name>.
    ASSIGN COMPONENT <field_name> OF STRUCTURE <structure_name> TO <field_value>
    Now you move value from <field_value> to required field in fixed internal table.
    i.e.
    itab-fieldname = <field_value>.
    Other way to do this:
    If you fields order is constant then you can also use index in assign component statement.
    do <no_of_fields> times.
        ASSIGN COMPONENT sy-index OF STRUCTURE <structure_name> TO <field_value>.
    rest is same as first method.
    Hope this help!
    I have given sudo code and you need to work on it little.
    Thanks,
    Augustin.

  • Logic for retreiving the values from a dynamic internal table

    Hi all,
    I have an issue with the logic to fetch data from a dynamic internal table into fields. let me give you guys an example the sy-tfill = 9 (subject to vary). I need to populate the fields.
    Regards,
    Sukumar

    Hi,
    this is for printing out the info in a dynamic table,
    it will work likewise to insert data.
    PARAMETERS:
      p_tabnam TYPE tabname DEFAULT 'DB_TABLE_NAME'.
    DATA:
      lv_dref TYPE REF TO data,
      ls_dd03l LIKE dd03l,
      lt_fieldname TYPE TABLE OF fieldname,
      ls_fieldname TYPE fieldname.
    FIELD-SYMBOLS:
      <fs> TYPE STANDARD TABLE,
      <wa_comp> TYPE fieldname,
      <wa_data> TYPE ANY,
      <wa_field> TYPE ANY.
    REFRESH lt_fieldname.
    SELECT * FROM dd03l INTO ls_dd03l
                       WHERE as4local = 'A'
                         AND as4vers  = '0000'
                         AND tabname  = p_tabnam
                       ORDER BY position.
      ls_fieldname = ls_dd03l-fieldname.
      APPEND ls_fieldname TO lt_fieldname.
    ENDSELECT.
    IF NOT ( lt_fieldname[] IS INITIAL ).
      CREATE DATA lv_dref TYPE TABLE OF (p_tabnam).
      ASSIGN lv_dref->* TO <fs>.
      SELECT * FROM (p_tabnam) INTO TABLE <fs>.
      WRITE:
        / 'CONTENTS OF TABLE', p_tabnam.
      LOOP AT <fs> ASSIGNING <wa_data>.
        SKIP.
        WRITE:
          / 'LINE', sy-tabix.
        ULINE.
        LOOP AT lt_fieldname ASSIGNING <wa_comp>.
          ASSIGN COMPONENT sy-tabix OF STRUCTURE <wa_data> TO <wa_field>.
          WRITE:
            / <wa_comp>, <wa_field>.
        ENDLOOP.
      ENDLOOP.
    ENDIF.
    grtz
    Koen

  • How to delete data from dynamic internal table

    Hi,
    I have dynamic internal table and I have some slection screen fields , using these selection screen fields
    (select -options), I have to filter the data? assigning will work with READ , but I have select options not the parametre,
    and also delete will not work for dynamic table..
    as we cannot use assigning with delete..
    So how to do this?
    and one more thing is , I cannot filter the data while selection( in select, I cannot filter the data-> as it's not coming directly from table, it's coming from buffer),
    so now after selection of data, I need to filter the data from dynamic table.
    Is there any way to do this?
    Regards,
    Mrunal

    Hi matt,
    I tried with below code as  you said. But I am getting dump. can you help?
    here is my piece of code.
    FIELD-SYMBOLS: <LS_DATA> type any,
                               <LT_DATA> TYPE table,
                                <L_FIELD> type any.
        ASSIGN <l_buffer_entry>-dataptr->* TO <LS_DATA>.
        ASSIGN <l_buffer_entry>-dataptr->* TO <LT_DATA>.
    LOOP AT <LT_DATA> ASSIGNING <LS_DATA>.
    ASSIGN COMPONENT 'BUKRS' OF STRUCTURE <LS_DATA> TO <L_FIELD>.
    IF <L_FIELD> NOT IN SO_BUKRS.
    DELETE <LT_DATA>.
    ENDIF.
    UNASSIGN <L_FIELD>.
    ASSIGN COMPONENT 'BELNR' OF STRUCTURE <LS_DATA> TO <L_FIELD>.
    IF <L_FIELD> NOT IN SO_BELNR.
    DELETE <LT_DATA>.
    ENDIF.
    UNASSIGN <L_FIELD>.
    ENDLOOP.
    and here is the description of my dump:->>>
    You attempted to access an unassigned field symbol
    (data segment 32772).
    This error may occur for any of the following reasons:
    - You address a typed field symbol before it is set using ASSIGN
    - You address a field symbol that points to a line in an internal table
      that has been deleted
    - You address a field symbol that had previously been reset using
      UNASSIGN, or that pointed to a local field that no longer exists
    - You address a global function interface parameter, even
      though the relevant function module is not active,
      that is it is not in the list of active calls. You can get the list
      of active calls from the this short dump.

  • How to transfer data from a dynamic internal table

    Hi All
    I want to transfer data from a dynamic internal table<dyn_table>
    to a non dynamic internal table itab which should have the same structure as <dyn_table>.
    How can this be done?
    Regards,
    Harshit Rungta

    As stated earlier this can be done only through field symbols...
    You cannot create an non dynamic internal table with ANY structure...using DATA statement
    If the strucutre is defined well and good...you can create an non-dynamic internal table...
    If you do not know the structure then the internal table has to be dynamic...and to be generated using field symbols
    DATA: lv_ref TYPE REF TO data.
    FIELD-SYMBOLS: <fs_dyn_table> TYPE STANDARD TABLE.
    * You create a dynamic internal table...
    CREATE DATA lv_ref LIKE (your_dynamic_internal_table).
    ASSIGN lv_ref->* TO <fs_dyn_table>.
    Now...do the transfer.
    <fs_dyn_table> = "your_dynamic_internal_Table
    Hope it helps!

  • Populate data from dynamic internal table

    Hi
    I have dynamic internal table <lt_paxxxx>. Iam fillling <lt_paxxxx> in the following way.
    select * into table <lt_paxxxx> from (infty-dbname).
    I have to pass data of <lt_paxxxx> to another internal table lt_final.
    'lt_final' should contain fields like <lt_paxxxx>, infty name, DB name.
    Could you please help me out how to pass <lt_paxxxx> data to 'LT_FINAL'.

    loop at <it_table>
           into <is_table>.
        loop at it_fieldcatalog
             into is_fieldcatalog.
          assign component is_fieldcatalog-fieldname
                 of structure <is_table>
                 to <field1>.
          concatenate 'IT_TABLE-'
                              is_fieldcatalog-fieldname
                             into w_field.
         assign (w_field) to <field2>.
         check sy-subrc eq space.
          move <field1> to <field2>.
        endloop.
       append it_table
      endloop.
    regards

  • Select query for picking data in a dynamic internal table

    Dear All,
    Please help.
    <u>The code is :</u>
    p_table1 = itab_final-tabname1.
            p_field1 = itab_final-fieldname1.         
            SELECT (p_field1) FROM (p_table1) INTO CORRESPONDING FIELDS OF TABLE <dyntable1>.      
    It is working fine when the domain is of CHAR
    The piece of code is not working where domain is DATS, CURR, DEC, etc.
    What shall I do so that it works for other domains also. Please its urgent......
    <u>ERROR that came:</u>
    An exception occurred. This exception will be dealt with in more detail
    below. The exception, assigned to the class 'CX_SY_OPEN_SQL_DB', was not
    caught, which                                                         
    led to a runtime error. The reason for this exception is:             
    The data read during a SELECT access could not be inserted into the    
    target field.                                                          
    Either conversion is not supported for the target field's type or the  
    target field is too short to accept the value or the data are not in a 
    form that the target field can accept

    Check below code
    REPORT zpwtest .
    *** Tables
    DATA: lt_data TYPE REF TO data.
    DATA: lt_fieldcatalog TYPE lvc_t_fcat.
    data : p_field type string ,
           p_table type string .
    *** Structure
    DATA: ls_fieldcatalog TYPE lvc_s_fcat.
    *** Data References
    DATA: new_line TYPE REF TO data.
    *** Field Symbols
    FIELD-SYMBOLS: <fs_data> TYPE REF TO data,
                   <fs_1> TYPE ANY TABLE,
                   <fs_2>,
                   <fs_3>.
    ls_fieldcatalog-fieldname = 'MANDT'.
    APPEND ls_fieldcatalog TO lt_fieldcatalog.
    ls_fieldcatalog-fieldname = 'CARRID'. "Fieldname
    ls_fieldcatalog-inttype = 'C'. "Internal Type C-> Character
    APPEND ls_fieldcatalog TO lt_fieldcatalog.
    ls_fieldcatalog-fieldname = 'CONNID'.
    ls_fieldcatalog-inttype = 'N'.
    APPEND ls_fieldcatalog TO lt_fieldcatalog.
    ls_fieldcatalog-fieldname = 'FLDATE'.
    ls_fieldcatalog-inttype = 'D'.
    APPEND ls_fieldcatalog TO lt_fieldcatalog.
    ls_fieldcatalog-fieldname = 'PRICE'.
    ls_fieldcatalog-inttype = 'P'.
    APPEND ls_fieldcatalog TO lt_fieldcatalog.
    ls_fieldcatalog-fieldname = 'CURRENCY'.
    ls_fieldcatalog-inttype = 'C'.
    APPEND ls_fieldcatalog TO lt_fieldcatalog.
    ASSIGN lt_data TO <fs_data>.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
         EXPORTING
           it_fieldcatalog = lt_fieldcatalog
         IMPORTING
           ep_table = <fs_data>
         EXCEPTIONS
           generate_subpool_dir_full = 1
           OTHERS = 2
    IF sy-subrc <> 0.
    ENDIF.
    *** So <FS_1> now points to our dynamic internal table.
    ASSIGN <fs_data>->* TO <fs_1>.
    *** Next step is to create a work area for our dynamic internal table.
    CREATE DATA new_line LIKE LINE OF <fs_1>.
    *** A field-symbol to access that work area
    ASSIGN new_line->*  TO <fs_2>.
    <b>
    p_field = 'mandt carrid connid fldate price currency' .
    p_table = 'sflight' .
    *** And to put the data in the internal table
    SELECT (p_field)
      FROM (p_table)
      INTO CORRESPONDING FIELDS OF TABLE <fs_1>.
    </b>
    *** Access contents of internal table
    LOOP AT <fs_1> ASSIGNING <fs_2>.
      ASSIGN COMPONENT 5 OF STRUCTURE <fs_2> TO <fs_3>.
      WRITE: / <fs_3>.
    ENDLOOP.

  • Deleting from Dynamic Internal table

    Hi,
    How can we delete data from dynamic internal table...
    I have a dynamic internal table <fs_dyn_table> which is of type any and can have any fields...
    I want to delete all those records which have a value of '10' in a field named field1
    I have written my delete statement in the following manner..
    DELETE <fs_dyn_table> WHERE field1 = '10'.....but it is not working...it gives me an error...stating that the line type of table must be statically defined.

    Hi,
    Loop on the internal table into a field-symbol of line type same as the internal table.
    Use assign component statement and then delete the corresponding record.
    Regards,
    Ankur Parab

  • Deleting selected record in Dynamic Internal table

    Hi Friends,
    I want to delete selected row from a dynamic internal table. The selected entry should be deleted from Adobe and as well as Webdynpro abap.
    Kindly help me how to solve this problem.
    Thanks in advance.
    Regards,
    Phani.

    Hi Matthias,
    Thanks a lot for responding.
    In my adobe i kept a check box to delete the record. It should delete the selected ones. But right now, its deleting one by one.
    I have coded following script for delete button:
    IT_TIME_SHEET --> is my internal table
    G_ROW_STATUS is the field to track the action performed.
    var tlength = xfa.resolveNodes("IT_TIME_SHEET.DATA[*]").length;
    for ( var i=0; i<tlength; i++
    if(xfa.resolveNode("IT_TIME_SHEET.DATA["i"].FLAG").rawValue ==
    1 )
    IT_TIME_SHEET.DATA.instanceManager.removeInstance(i);
    G_ROW_STATUS.rawValue = "DELETE";
    In the Webdynpro abap following code I wrote:
        row_count = 1.
        FIELD-SYMBOLS <wa> TYPE zshr_time_sheet_time.
        LOOP AT it_time_sheet ASSIGNING <wa>.
          <wa>-srl_no = row_count.
          row_count = row_count + 1.
        ENDLOOP.
        last_row = <wa>-srl_no.
          DELETE it_time_sheet WHERE srl_no EQ last_row.
    Suppose if two records checkboxes are selected I can loop at the internal table IT_TIME_SHEET in webdynpro and delete where checkbox is selected.
    But problem is once user deletes records, adobe is deleting only one record and if i delete two records from webdynpro it looks like something wrong for the user.
    Please help me how to solve this problem.
    Regards,
    Phani.

Maybe you are looking for

  • Snow Leopard Time Machine process question/possible problem

    For starters I want to say that I am not dealing with my own machine, but a friend's, so there's some missing information. Any help would be greatly appreciated! Ok, so my best friend bought a 15" MBP thru me during my short time as an Apple retail e

  • ITunes 11 sorting tracks problem

    Hi All, I recently replaced the hard drive on an Acer laptop (running on Windows 7) and so I needed to re-install iTunes. Unfortunately I installed iTunes 11. I then re-impoted all of my music from an external hard drive. I do like to keep my music l

  • Why can't I print PDF files from my iPad or smart phone. Just started this recently.

    Not able to print PDF files from either my iPad or smart phone

  • Confused about logical table source

    Hi, I'm confused about logical table source(LTS), there are 'General', 'Column Mapping', 'Content' tabs in LTS, in General tab ,there are some information,like 'Map to there tables' and 'joins', just here, we have created relationships in physical la

  • ALSB Proxy Service error calling Business service

    I have an external webservice on Weblogic 8.1 SP5, and I configured Business Service in ALSB 2.6, that is able to invoke the external webservice. But When I create Proxy Service based on the existing Business service and try to invoke the proxy servi