Move-corresponding in table type Field-Symbols

Hi,
    I have to use one statement in field-symbol similar to "move-corresponding" in normal internal table.Is it possible to use statement similar to "Move-corresponding in field-symbols".
For Eg:
Field-symbols <FA_IT> type standard table.
data:begin of wa_ekk,
   f1 type i,
   f2 type werks_d,
   f4 type posnr,
   end of wa_ekk,
it_ekk  like standard table of wa_ekk.
begin of wa_final,
   f1 type i,
   f2 type werks_d,
   f3 type i,
   f4 type n,
end of wa_final,
it_final like standard table of wa_final.
assign it_ekk to <fs_it>.
Loop at <fs_it>.
*???????-i dont know how to move the value to it_final
*---I know I can use assign component statement
*-to move each field  to the target field
but for that we need to know the field name or index position of the structure-
Endloop.
My requirment is now i want to move the content of <fs_it> into it_final internal table.
I know that In normal itab we can use "move-corresponding" to move the value from it_ekk to it_final.
In the same way how to use it in field-symbol concept.
Requirement:Real time Processing of Internal table
1) Content of it_ekk:
f1   f2       f4
12  1000  0023
23  2000  0037
2)After ASSIGN statement:
Content of <fs_it> is:
f1   f2       f4
12  1000  0023
23  2000  0037
3)Now I want to move the content of <fs_it> to it_final
Output of It_final:
F1   F2    F3    F4
12  1000   ---    0023
23  2000   ---    0037
Regards,
Vigneswaran S

Andrey's code is going to work only if you are running it in a non-unicode system.
See code below for a Unicode system using similar effect to "Move-Corresponding" statement.
FIELD-SYMBOLS: <fs_ekk> LIKE wa_ekk,
               <fs_final> LIKE wa_final.
ASSIGN it_ekk TO <fs_it> .
LOOP AT <fs_it> ASSIGNING <fs_ekk>.
  ASSIGN <fs_ekk> TO <fs_final> CASTING.
  CLEAR <fs_final>-f3.
  APPEND <fs_final> TO it_final.
ENDLOOP.
Hope this solves your problem and please don't forget to reward points.
Cheers,
Sougata.

Similar Messages

  • Define structure with table type fields using keyword "TYPES"

    Hi Gurus,
    Using keyword "TYPES", I want to define a structure in which there is a field must be table type. It seems not allowed. For example:
        TYPES tt_items TYPE TABLE OF sflight.
        TYPES: BEGIN OF str,
          field1 TYPE i,
          field_tabl TYPE tt_items.
        TYPES:  END OF str.
    Then I got a syntax error:
    "TT_ITEMS" is a generic type. Use of this type is only possible for     typing field symbols and formal parameters. -     
    What should I do if I want to have a table type field in it?
    Thanks a lot.

    include type EKKO includes the whole strucutre of EKKO.
    if you see the structure in debug mode, it_ekko contains the fields of EKKO as well as the field CHK of type C.
    In your case you can do this
    TYPES: BEGIN OF str.
    INCLUDE TYPE sflight.  " includes whole structure of SFLIGHT
    TYPES : field1 TYPE i. " include the field1 of type I
    TYPES: END OF str.
    DATA : it_str TYPE TABLE OF str, " internal table
           is_str TYPE str.          " work area
    Regards
    Gopi

  • Delete row from internal table using field symbol.

    Hi friends,
      I created dynamic internal table using field symbol. I want to delete some data using where clause.
    for example. i want to use like,
        DELETE <FS> WHERE KUNNR = WA_KNA1-KUNNR.
    Like the above statment it won't work. How i can use delete with where clause in field symbols.
    Hope any one can help me.
    Thanks and regards
    Srikanth. S

    hi Srikanth,
    I think you have to LOOP through the whole internal table and check each line and decide to delete or not:
    LOOP at <itab> INTO <wa>.
    ASSIGN COMPONENT 'KUNNR' OF STRUCTURE <wa> TO <field>.
    CHECK <field> IS ASSIGNED.
    IF <field> EQ WA_KNA1-KUNNR.
    DELETE ...
    ENDIF.
    UNASSIGN <field>.
    ENDLOOP.
    hope this helps
    ec

  • Creating dynamic internal table(Not field symbol table)

    Hi Experts,
    I am facing problem creating Intarnal table
    I have fieldcatalog, I want create dynamic internal table(Not field symbol table).
    I have written----
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
       i_style_table             =
         it_fieldcatalog           = it_fldcat
          it_fieldcatalog           = me->gt_fieldcat
       i_length_in_byte          =
        IMPORTING
          ep_table                  = lt_new_table
       e_style_fname             =
        EXCEPTIONS
         generate_subpool_dir_full = 1
         OTHERS                    = 2.
        ASSIGN lt_new_table->* TO <gt_dyn_repdata>.
        CREATE DATA ls_new_line LIKE LINE OF <gt_dyn_repdata>.
        ASSIGN ls_new_line->* TO <gs_dyn_repdata>.
    above logic creating dynamic field symbol table.... But I want create normal internal table.
    Thanks,
    Rajasekhar

    Hi
    What do you mean?
    It needs to use the field-symbol, this is the price to pay if it wants a dynamic object
    Max

  • Dynamic Internal table with field symbol

    I made the report where the user enters two different tables and two fields that are to be compared.
    Eg. If I enter (MARA & NAME1) and (MARC & NAME2) , I wish to compare all the entries of Mara-name1 against all entries in Marc-name2.
    <u>The code I need to write is:</u>
    DATA:
      gdo_data      TYPE REF TO data.
    DATA:
      gdo_data1      TYPE REF TO data.
    FIELD-SYMBOLS:
      <gt_itab>     TYPE table,
        <wa> LIKE <gt_itab>,                        "<gt_itab>,
      <gs_entry>    TYPE ANY.
    FIELD-SYMBOLS:
      <gt_itab1>     TYPE table,
        <wa1> LIKE <gt_itab>,                        "<gt_itab>,
      <gs_entry1>    TYPE ANY.
    PARAMETERS:
      p_table    TYPE tabname,            "    DEFAULT 'KNA1',
      p_fld      TYPE fieldname.          "  DEFAULT 'KUNNR'.
    PARAMETERS:
      p_table1    TYPE tabname,            "    DEFAULT 'KNA1',
      p_fld1      TYPE fieldname.
    DATA: var TYPE fieldname.
    var = p_fld.
    DATA: var1 TYPE fieldname.
    var1 = p_fld1.
    START-OF-SELECTION.
      CREATE DATA gdo_data TYPE TABLE OF (p_table).
      ASSIGN gdo_data->* TO <gt_itab>.
      CREATE DATA gdo_data1 TYPE TABLE OF (p_table1).
      ASSIGN gdo_data1->* TO <gt_itab1>.
      SELECT * FROM (p_table) INTO CORRESPONDING FIELDS OF TABLE <gt_itab>.
      SELECT * FROM (p_table1) INTO CORRESPONDING FIELDS OF TABLE <gt_itab1>.
    <b>  LOOP AT <gt_itab> ASSIGNING <gs_entry>.
        READ TABLE <gt_itab1> ASSIGNING <gs_entry1>
             WITH KEY (var1) = <gt_itab>-(var).
        IF sy-subrc EQ 0.
          MESSAGE 'Success' TYPE 'S'.
        ENDIF.
      ENDLOOP.</b>
    END-OF-SELECTION.
    But the portion in bold is creating error: <b><gt_itab> is a table without a header lineand therefore has no component called "".</b>
    please help.

    Hi Amit
    Try like this
    LOOP AT <gt_itab> ASSIGNING <gs_entry>.
    READ TABLE <gt_itab1> ASSIGNING <gs_entry1>
    WITH KEY (var1) = <b><gs_entry></b>-(var).
    IF sy-subrc EQ 0.
    MESSAGE 'Success' TYPE 'S'.
    ENDIF.
    ENDLOOP.
    Regards,
    Atish

  • Dynamic internal  tables using field symbols

    Hello,
    Is it possible to create a dynamic table where the no of fields in the internal table can be created dynamically(using field symbols).
    Say sometimes internal tables with 10 fields and depending upon the requirement the fields can be dynamically increased or decreased in runtime.
    Thanks.

    Hi,
    Go through the following code....
    *Data definitions
    *** Tables
    data: lt_data type ref to data.
    data: lt_fieldcatalog type lvc_t_fcat.
    *** Structure
    data: ls_fieldcatalog type lvc_s_fcat.
    *** Data References
    data: new_line type ref to data,
          fs_data type ref to data.
    *** Field Symbols
    field-symbols: <fs_data> type ref to data,
                   <fs_1> type any table,
                   <fs_2>,
                   <fs_3>.
    *Populating the internal table with fieldnames required for our dynamic
    *internal table
    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.
    *Calling the method CREATE_DYNAMIC_TABLE
    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.
    *Assigning Field-Symbol to our dynamic internal table
    assign lt_data to <fs_data>.
    *Internal Table is ready, now to put data in that table
    *** 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>.
    *** And to put the data in the internal table
    select
          mandt
          carrid
          connid
          fldate
          price
          currency
                  from sflight
                  into corresponding fields of table <fs_1>.
    *** Access contents of internal table
    loop at <fs_1> assigning <fs_2>.
    do 5 times.
    assign component sy-index of structure <fs_2> to <fs_3>.
    write:  <fs_3>.
    enddo.
    skip 1.
    endloop.
    top-of-page.
    write:/5 'FUJITSU CONSULTING COMPANY' inverse color 6,
           50 sy-datum inverse color 6,
           70 sy-pagno inverse color 6.
    uline.
    <REMOVED BY MODERATOR>
    Vijay C
    Code Formatted by: Alvaro Tejada Galindo on Apr 14, 2008 1:47 PM

  • "Read table" and field symbols

    Hello all,
    I have a (hopefully simple) question. Let's suppose I want to do the following:
    loop at itab1 assigning <fs1>.
      read table itab2 assigning <fs2> with table key <fs1>-field1.
      if sy-subrc eq 0.
        move <fs2>-field1 to ls_out-field1.
      endif.
      read table itab3 assigning <fs3> with table key <fs1>-field2.
      if sy-subrc eq 0.
        move <fs3>-field1 to ls_out-field2.
      endif.
    endloop.
    It's also possible to do the following instead:
    loop at itab1 assigning <fs1>.
      unassign: <fs2>,
                <fs3>.
      read table itab2 assigning <fs2> with table key <fs1>-field1.
      read table itab3 assigning <fs3> with table key <fs1>-field2.
      if <fs2> is assigned.
        move <fs2>-field1 to ls_out-field1.
      endif.
      if <fs3> is assigned.
        move <fs3>-field1 to ls_out-field2.
      endif.
    endloop.
    My question is: is it "better" to check sy-subrc after each read, and then do a move statement within that if statement, or is it better to check whether the field symbol is assigned each time I want to fill in a field and read everything at the same time?
    I'm only really concerned about the case where you don't want to drop out of the loop after the read (so if the read fails you just don't fill any data in). I'm also discounting potential human error (otherwise the sy-subrc method wins hands-down).

    Just to close this one (albeit somewhat belatedly). I asked Harry Dietz (the ABAP Performance blogging fella) what he would suggest, and he says sy-subrc all the way. Checking that an integer is zero is considerably faster than checking for the assignment, or otherwise, of a field symbol. Furthermore, whilst the field symbol method has the potential to be faster than the sy-subrc method given some compiler optimizations, unfortunately these optimizations don't exist in the ABAP compiler - they're there in the Java compiler though! Shame really. Apparently the ABAP compiler is a pretty simple beast.
    Anyway - thanks Harry for clearing this one up!

  • Sum for Dynamic Fields in a Dynamic Table with Field Symbol

    Hi All,
    I currently have an report which I am looking to update with some totals.  The information is currently output in an ALV which is fed data from a dynamic table defined with a field symbol.  The modification that needs to be applied is a summation per currency code where each of the fields to be summed is a dynamically named field at runtime.  I am now just looking to see if anyone has any recommendations on how to obtain these totals it would be appreciated.  I have no problem doing the leg work in piecing the solution together but am just stuck on which approach I should be investigating here.  I have looked into several options but do to the fact that the totals are for dynamic fields in a dynamic table and it is a field symbol I am having some difficulties thinking of the easiest approach to obtain these totals.
    Below is a simple sample of what the report currently looks like and what we are looking to add.
    ====================================================================================
    As-Is Report:
    DETAILED DATA ALV
    Company Code  |  Plant  |  2006 Total  |  2007 Total  |  2008 Total |  CURRENCY
    0001          |   ABCD  |    1,500     |    1,200     |    1,700    |    USD
    0001          |   BCDE   |    2,300     |    4,100     |    3,600    |    GBP
    0003          |   DBCA  |    3,200     |    1,600     |    6,200    |    USD
    Addition 1:
    TOTALS PER CURRENCY
    Currency                |  2006 Total  |  2007 Total  |  2008 Total |
    USD              |    4,700     |    2,800     |    7,900    |
    GBP                       |    2,300     |    4,100     |    3,600    |
    Addition 2:
    CONVERSIONS TO USD
                                          |  2006 Curr   |  2006 USD    |  2008 Curr   |  2006 USD   |
    USD                       |  4,700 USD   |  4,700 USD   |  7,900 USD  |  7,900 USD  |
    GBP   (1.5GBP/1 USD)    |  2,300 GBP   |  1,150 USD   |  2,300 GBP  |  1,800 USD  |
    ====================================================================================
    Any recommendations will be appreciated.

    Hi,
    We cannot use the key word SUM in the loop at assigning statement.
    The way i see is
    When  you are creating the first dynamic internal table , create one more with  the structure below:
    Currency | 2006 Total | 2007 Total | 2008 Total |
    Then while populating the data into first itab,also move the contents to the second itab using collect statement.

  • How to assign a whole internal table to field symbol

    Can anyone explain me that , can we assign the whole internal table to a field symbol .If yes please explain with some simple example by assigning an internal tabl data to a field symbol and how to loop on to that field symbol to write the data from it.
    Please don't paste the F1 help .
    Thanks,
    Rose.

    hi
    good
    check this code
    ) Defining the table records and the field symbol in a similar type.
    just an ordinary standard table
    TYPES: BEGIN OF it_vbak_line,
    vbeln LIKE vbak-vbeln,
    vkorg LIKE vbak-vkorg,
    vtweg LIKE vbak-vtweg,
    spart LIKE vbak-spart,
    kunnr LIKE vbak-kunnr,
    END OF it_vbak_line.
    DATA: it_vbak TYPE TABLE OF it_vbak_line.
    FIELD-SYMBOLS: <it_vbak_line> TYPE it_vbak_line.
    or as a screaming fast hash table for keyed reads
    TYPES: BEGIN OF it_vbpa_line,
    vbeln LIKE vbak-vbeln,
    kunnr LIKE vbak-kunnr,
    END OF it_vbpa_line.
    DATA: it_vbpa TYPE HASHED TABLE OF it_vbpa_line
    WITH UNIQUE KEY vbeln.
    FIELD-SYMBOLS: <it_vbpa_line> TYPE it_vbpa_line.
    2) In ITAB processing, utilize the ASSIGNING command.
    loop example
    LOOP AT it_vbak ASSIGNING <it_vbak_line>.
    look at records--populate it_zpartner
    read example
    READ TABLE it_vbpa ASSIGNING <it_vbpa_line>
    WITH TABLE KEY vbeln = <it_vbak_line>-vbeln.
    3) Refer to the field symbol's fields in the loop or after the read.
    wa_zpartner-vkorg = <it_vbak_line>-vkorg.
    wa_zpartner-vtweg = <it_vbak_line>-vtweg.
    wa_zpartner-spart = <it_vbak_line>-spart.
    wa_zpartner-kunag = <it_vbak_line>-kunnr.
    wa_zpartner-kunwe = <it_vbpa_line>-kunnr.
    See the code example below for further detail. The code was written in R/3 4.6C and should work for all 4.x versions.
    thanks
    mrutyun^

  • Can I pass a table using field-symbols to a PERFORM

    Can I pass an internal table using a field-symbol via a PERFORM that is stored in another program.
    For example, I want to pass lt_data using a field-symbol.  If I can do this, please tell me how to define a field-symbol for a table and how I setup the parameters on the FORM.
       perform TEST_FIELD_SYMBOLS in program zadd_data
                      changing lt_data[]
                       if found.
    Thanks.
    Regards,
    Ryan

    Since in ABAP all FORM-paramters are passe call-by reference, it makes imho no difference if u pass a table directly or via a fieldsymbol.
    U can pass a REF TO DATA to a form and then assign it to an FS like shown in the following example.
    TYPES: BEGIN OF s_data,
             data TYPE c,
           END OF s_data,
           s_tab TYPE STANDARD TABLE OF s_data.
    TYPES: r_tab TYPE REF TO data.
    START-OF-SELECTION.
      DATA: t_foo TYPE s_tab.
      DATA: ref_foo TYPE r_tab.
      GET REFERENCE OF t_foo INTO ref_foo.
      PERFORM my_form_fs USING ref_foo.
    FORM my_form_fs USING u_ref TYPE r_tab.
      FIELD-SYMBOLS: <fs> TYPE s_tab.
      DATA: w_tab TYPE s_data.
      ASSIGN u_ref->* TO <fs>.
      w_tab-data = 'X'.
      APPEND w_tab TO <fs>.
    ENDFORM.
    This also works for external performs....
    Best regards,
        Sebastian
    Message was edited by:
            Sebastian Rötzel

  • Internal table to field symbol

    hi all,
    type-pools : abap.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>,
                   <dyn_field>.
    data: dy_table type ref to data,
    dy_line type ref to data,
    xfc type lvc_s_fcat,
    ifc type lvc_t_fcat.
    *data : dyn_itab2 type ANY table.
    selection-screen begin of block b1 with frame.
    parameters: p_table(30) type c.
    selection-screen end of block b1.
    start-of-selection.
    BREAK-POINT.
    perform get_structure.
    perform create_dynamic_itab.
    perform get_data.
    PERFORM OUTPUT.
    *perform write_out.
    form get_structure.
    data : idetails type abap_compdescr_tab,
    xdetails type abap_compdescr.
    data : ref_table_des type ref to cl_abap_structdescr.
    Get the structure of the table.
    ref_table_des ?=
    cl_abap_typedescr=>describe_by_name( p_table ).
    idetails = ref_table_des->components.
    *idetails] = ref_table_des->components[.
    loop at idetails into xdetails.
    clear xfc.
    xfc-fieldname = xdetails-name .
    xfc-datatype = xdetails-type_kind.
    xfc-inttype = xdetails-type_kind.
    xfc-intlen = xdetails-length.
    xfc-decimals = xdetails-decimals.
    append xfc to ifc.
    endloop.
    endform.
    form create_dynamic_itab.
    Create dynamic internal table and assign to FS
    call method cl_alv_table_create=>create_dynamic_table
    exporting
    it_fieldcatalog = ifc
    importing
    ep_table = dy_table.
    here i want  to assighn the structure of dy_table to internal atble.
    assign dy_table->* to <dyn_table>.
    Create dynamic work area and assign to FS
    create data dy_line like line of <dyn_table>.
    assign dy_line->* to <dyn_wa>.
    endform.
    form get_data.
    Select Data from table.
    select * into table <dyN_table> UP TO 10 ROWS
    from (p_table).
    endform.
    Write out data from table.
    FORM OUTPUT.
    loop at <dyn_table> into <dyn_wa>.
    do.
    assign component sy-index
    of structure <dyn_wa> to <dyn_field>.
    if sy-subrc = 0.
    exit.
    endif.
    if sy-index = 1.
    write:/ <dyn_field>.
    else.
    write: <dyn_field>.
    endif.
    enddo.
    endloop.
    ENDFORM.
    how can i achieve this one.
    regards
    siva

    Hi,
    Check this Code ...
    LOOP AT <dyn_table> INTO <dyn_wa>.
        DO.
          ASSIGN COMPONENT sy-index
          OF STRUCTURE <dyn_wa> TO <fs_field> .
          IF sy-subrc NE 0.
            EXIT.
          ENDIF.
          IF sy-index = 1.
            WRITE:/ <fs_field>.
          ELSE.
            WRITE: <fs_field>.
          ENDIF.
        ENDDO.
      ENDLOOP.
    For reference check below code
    DATA: it_fieldcat        TYPE lvc_t_fcat                         . " Field catalog
    DATA: wa_fieldcat  LIKE LINE OF it_fieldcat. " Field catalog
    DATA: it_dyn_table      TYPE REF TO data,     " Dynamic table
          it_wa_dyn_table   TYPE REF TO data.     " Dynamic table
    *       Field sysmbols           Begin with <fs>                      *
    FIELD-SYMBOLS:  <fs_dyn_table>       TYPE STANDARD TABLE, " Dynamic tbale
                    <fs_dyn_table_temp>  TYPE ANY           , " Dynamic tbale
                    <fs_field>           TYPE ANY           , " Temp field for data assignment
                    <fs_field_temp>      TYPE ANY           . " Temp field for data assignment
    *       Macro                                                         *
    * Macro Defination
    * Building field catalog using macro defination
    DEFINE m_fieldcat.
      wa_fieldcat-fieldname   = &1.
      wa_fieldcat-scrtext_l   = &2.
      wa_fieldcat-coltext     = &2.
      wa_fieldcat-no_zero     = &3.
      wa_fieldcat-hotspot     = &4.
      wa_fieldcat-outputlen   = &5.
      wa_fieldcat-emphasize   = &6.
    * Appending workarea to internal table
      append wa_fieldcat to it_fieldcat.
      clear wa_fieldcat.
    END-OF-DEFINITION.
    *&      Form  f005_prepare_field_catalog
    *       text
    form f005_prepare_field_catalog .
      REFRESH: it_fieldcat.
    * Build the field catalog
      m_fieldcat text-007 text-008 c_blank  c_blank c_30 c_blank.
      m_fieldcat text-009 text-010 c_blank  c_blank c_30 c_blank.
      SORT it_final_temp BY equnr point.
      SORT it_final BY equnr point psort idate.
      w_date1 = so_date-low.
    * Loop to generate grid column at run time
    * Loop - Till the lower date not equal to higer date
      WHILE so_date-high GE w_date1.
    * Changing date into actual date format using edit mask
        WRITE w_date1 TO w_var4 USING EDIT MASK '__-__-____'.
        m_fieldcat w_var4 w_var4 c_flag c_blank c_12 c_blank.
        w_date1 = w_date1 + c_count.
        CLEAR w_var4.
      ENDWHILE.
    *&      Form  f007_create_dynamic_table
    *       text: Create dynamic table
    form f007_create_dynamic_table .
    * Call method to create dynamic internal table
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = it_fieldcat
        IMPORTING
          ep_table                  = it_dyn_table
        EXCEPTIONS
          generate_subpool_dir_full = 1
          OTHERS                    = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
           WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      SORT it_final_temp BY equnr point.
      SORT it_final BY equnr point psort idate.
      ASSIGN it_dyn_table->* TO <fs_dyn_table>.
      CREATE DATA it_wa_dyn_table LIKE LINE OF <fs_dyn_table>.
      ASSIGN it_wa_dyn_table->* TO <fs_dyn_table_temp>.
      IF it_final_temp IS NOT INITIAL.
        LOOP AT it_final_temp INTO wa_final_temp.
    * Assign equipment number and it's field data to field symbols (Dynamic table)
    * Assign field name to field symbol
          ASSIGN text-007 TO <fs_field_temp>.
    * Assign component name and it's value to dynamic table
          ASSIGN COMPONENT <fs_field_temp> OF STRUCTURE <fs_dyn_table_temp> TO <fs_field>.
    * Assign equipment number value to field symbol
          <fs_field> = wa_final_temp-equnr.
    * Assign Short Description and it's field data to field symbols (Dynamic table)
    * Assign field name to field symbol
          ASSIGN text-009 TO <fs_field_temp>.
    * Assign component name and it's value to dynamic table
          ASSIGN COMPONENT <fs_field_temp> OF STRUCTURE <fs_dyn_table_temp> TO <fs_field>.
    * Assign short description value to field symbol
          <fs_field> = wa_final_temp-psort.
    * Loop to assign value of run time generated column.
          IF it_final IS NOT INITIAL.
            LOOP AT it_final INTO wa_final WHERE equnr = wa_final_temp-equnr
                                            AND point = wa_final_temp-point.
              w_date1 = wa_final-idate.
              WRITE w_date1 TO w_var4 USING EDIT MASK '__-__-____'.
              ASSIGN w_var4 TO <fs_field_temp>.
              ASSIGN COMPONENT <fs_field_temp> OF STRUCTURE <fs_dyn_table_temp> TO <fs_field>.
              <fs_field> = wa_final-cdiff.
              CLEAR: wa_final, w_var4, w_date1.
            ENDLOOP.
          ENDIF.
          CLEAR: wa_final_temp.
    * Assign field symbol temporary table to final dynamic table
          APPEND <fs_dyn_table_temp> TO <fs_dyn_table>.
          CLEAR: <fs_dyn_table_temp>.
        ENDLOOP.
      ENDIF.
    endform.                    " f007_create_dynamic_table

  • How to build a internal table of field symbols.

    Hi,
    I want to build a internal table, which consists of several field symbols. Each field symbol points to an entry of  other internal tables. All of these tables have different structure definition. How can I implement it. If it is possible, it can save a lot of table query time.
    I will be very appreciate for your help.
    Best Regards, Jun

    hello jun
    i hope the following example give the some idea to build internal table fileds with differen field symbol data types.
    FIELD-SYMBOLS:<f1> type any,<f2> TYPE ANY.
    data:BEGIN OF itab,
         t1 type i value 10,
         t2(30) type c value 'john',
       t3 type p DECIMALS 3 value '4.7658',
       END OF itab.
      ASSIGN itab to <f1>.
      DO 3 TIMES.
      ASSIGN COMPONENT sy-index OF STRUCTURE <f1> TO <f2>.
      WRITE <f2>.
      ENDDO.
    types:begin of it_line,
          i1 type i,
          t1 type string,
          p1 type p DECIMALS 3,
      end of it_line.
      data:itab1 type table of  it_line.
    FIELD-SYMBOLS:<f1>.
      ASSIGN itab1 to <f1>.
    and also u can refer the following links
    1->  http://help.sap.com/saphelp_wp/helpdata/en/fc/eb387a358411d1829f0000e829fbfe/content.htm
    2--> http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3923358411d1829f0000e829fbfe/content.htm
    Thanks&Regards
    sreenivas p

  • How to assign tables to field-symbols

    how can i assign tables to field-symbols

    Hi Raj,
    Declare a fields symbol of type table, see below syntax:
    FIELD-SYMBOLS <FS> [<type>|STRUCTURE <s> DEFAULT <wa>].
    and then create an internal table and write the below code;
    ASSIGN itab to <fs>.
    Refer below eg:
    TYPES: BEGIN OF line,
             col1 TYPE c,
             col2 TYPE c,
           END OF line.
    DATA: wa TYPE line,
          itab TYPE HASHED TABLE OF line WITH UNIQUE KEY col1,
          key(4) TYPE c VALUE 'COL1'.
    FIELD-SYMBOLS <fs> TYPE ANY TABLE.
    ASSIGN itab TO <fs>.
    also see below link:
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb387a358411d1829f0000e829fbfe/content.htm
    Regards,
    Sunil

  • Page break handeling when using table type field

    Hello everyone
    I've created an adobe form using tcode SFP.
    A table, "T1", is containing fields where one of it is a TABLE TYPE (Let give the following name "T1-FT1").
    So the structure can look like:
    T1-F1
    T1-F2
    T1-FT1-FTF1
    T1-FT1-FTF2
    basically the structure is like to have documents containing several items where those items have several serial number.
    I need to have page break per documents, per items and serial number where those one have specific header page different than the document itself.
    I need to have a page break per T1 records with specifc header.
    So for each new records of T1, I have to create a new page with it's specific header.
    The table T1-FT1 is starting on the current page, but if I have to many records to stay on the page I need to create another page with it's specific header that is different than the page 1.
    My problem is the page break handling.
    I can have the pagination tab at the Table1 and row1 level but I don't have the pagination tab at the T1-FT1 level.
    Here is what my hierarchy:
    _MasterPage
    __Page1
    __Page2
    _MainSubForm
    __Subform1
    ___Table1
    ____Row1
    _____Subform
    ______Table2
    ________Row2
    Example of Data:
    T1-F1 ___ T1-F2 __ T1-FT1-FTF1 __ T1-FT1_FTF2
    A _______ B _____  1 ___________  1
    A _______ B _____  1 ___________  2
    B _______ C _____  1 ___________  1
    B _______ D _____  1 ___________  2
    B _______ D _____  1 ___________  3
    The final page break layout should look like:
    Page1
    Header1
    A B
    ___ 1 1
    ___ 1 2
    Page2
    Header1
    B C
    ___ 1 1
    ___ 1 2
    Page 3
    Header2
    B C
    ___ 1 3
    Because there is not enough room on page 2 for the last record of the table T1-FT1, a new header is used on page 3.
    Actually several problems occurs. I cannot have the proper page break set to avoid empty pages as first or last page.
    The pagination tab stop to be available after the Row1. So we cannot set page break at the table2 and row2.
    The page break contidion doesn't work. "Well I didn't succeed to make it work".
    Any idea on how to handle those page break at table2 level?
    Is anyone had to create a PDF form where we have the date into several level of structure?
    Regards
    dstj
    Edited by: dstj on Feb 18, 2010 10:59 PM
    Edited by: dstj on Feb 18, 2010 11:00 PM

    I have the exact same issue. Could not find a solution. In my case, there are multiple subforms printed one below the other. If an expandable subform overflows into a new page, the last line overlaps with the text of next subform. I have added blank spaces between the subforms but, that does not solve the issue.
    Finally, I have managed to minimize the occurrence of the issue by doing the following. Only turn on the flag "Allow Page breaks within content" for subforms that can really spread over many pages. All other subforms, turn the flag off. This minimizes the possibility of overlapping.

  • How to access the table type field in the structure

    Hi All,
    I have a BADI CRM_MKT_ADR_SEARCH and a method CHANGE_SEARCH_RESULTS in this method I have a parameter CT_BP_CP_CHANNEL .This parameter has type CRMT_BP_CP_CHANNEL_TAB(this is table type) this has the line type CRMT_BP_CP_CHANNEL(this is structure) in this line type we have one field addrnumber.How to access this field in my method?Please help me in this regard.

    data lw_tab type CRMT_BP_CP_CHANNEL.
    loop at CRMT_BP_CP_CHANNEL_TAB into lw_tab.
       lv_field = lw_tab-addrnumber.
       <further processing>
    endloop.

Maybe you are looking for

  • Export Marathi Data in Marathi Language

    I have used jquery to print data in html report, data display in marathi laguage in .aspx page , but when pessing print button it will be display in english laguage, so what i do display data in marathi laguage, The data is like, <link href="js/jquer

  • Error while cancelling the Invoice

    Dear Gurus The Billing document was raised on a wrong customer on may month. Now that was realized, and that invoice was canceled but wrongly the date was given as may month. The FI period was closed for may month and the current period is july. So t

  • Blank pages when printing to laserjet pro 200 color MFP M276nw

    When printing to my Laserjet pro 200 color MFP M276nw, the pages are all blank.  I have tried turning the printer off and tried unplugging and replugging.  That didn't help.  Pages are still blank.  Any suggestions? This question was solved. View Sol

  • Getting list of pageids  and list of tabnames??

    Hi All! I am on windows 2000. i have portal deployed. how do i get list os all page-ids and list of all tabnames(including subtabs) on a particular jsp(portal) page, using the java pdk api?? A sample code will really help! thanks, sa pa

  • How to display stock count on partlist page

    Hi everyone Can anybody tell me which aspx or ascx file I need to modify in order to display the stock count on the partlist page where now only presents Image PartNo     Description Price and AddtoCart button. Thanks and regards Sky