How to use field-symbols in MODIFY ... TRANSPORTING and SORT

Hi,
I need to increase the performance of an abap report using the field-symbols. More exactly  the code is the following.
TYPES:
  BEGIN OF itab_structure.
     INCLUDE STRUCTURE nameofstructure.
  TYPES:
     RECNO   LIKE sy-tabix,
  END OF itab_structure.
DATA:
  itab TYPE STANDARD TABLE OF  itab_structure
       WITH HEADER LINE
       WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
SORT itab ASCENDING BY f1.
LOOP AT itab WHERE f1 = '10'.
    itab-fn= value-n.
MODIFY itab
             TRANSPORTING  fx fy fz ft     
                    WHERE  f1   = c1_filed AND
                                  f2   = c2_field.
ENDLOOP.
I need your suggestions in this kind of conversion or solution.
SORT itab ASCENDING BY f1 (<-- I don't know if in this case the better performances should be obtained using field symbols and in which way)
FIELD-SYMBOLS: <fs_itab_line> TYPE LINE OF itab.
LOOP AT itab ASSIGNING <fs_itab_line> WHERE
<fs_itab_line>-f1 = '10'.
MODIFY itab 
             TRANSPORTING  fx fy fz ft     
                    WHERE  f1   = c1_filed AND
                                  f2   = c2_field.
(I don't know if in this case the better performances should be obtained using field symbols and in which way)
ENDLOOP.
I wish to implement the field symbols or the better performance in terms of execution time in all my abap code, where it is possible.
Any suggestion will be well appreciated.
Thanks in advance for your kind support.
Regards,
       Giovanni

Dear All,
I have appeciated your suggestions and I can conclude these points in my case:
1) The "sort" statement is not optimized in a different way using filed-symbols
2) The loop with "where" condition on a standard table is performed using filed-symbols
But ... my last point to investigate is about the statement MODIFY table TRANSPORTING f1, f2 WHERE conditions.
More exactly, in my code the execution logic of the abap code expects a global modification of the same table at the end of every (primary) loop, using the MODYFY statement.
In other words in my code I can locate two loops on the same table in the following logic:
LOOP AT table1 WHERE f1 = '10'. (#1)
      updates to table1
      set c1_filed, c2_filed
      LOOP AT table1.   (#2)            
         IF f1 = c1_filed AND
            f2 = c2_filed.
           table1-fx = 'x'.
           table1-fy = 'y'.
           table1-fz = 'z'.
           table1-ft = 't'.   
         ENDIF.                 
         MODIFY table1.            
      ENDLOOP.   (#2)              
ENDLOOP.   (#1)
In better way (maybe more fast in terms of execution time) to modify a set of lines (MODIFY...TRANSPORTING...WHERE):
LOOP AT table1 WHERE f1 = '10'.
   table1-fx= 'x'.
   table1-fy= 'y'.
   table1-fz= 'z'.
   table1-ft= 't'.
   MODIFY itab
      TRANSPORTING fx fy fz ft
   WHERE f1 = c1_filed AND
         f2 = c2_field.
ENDLOOP.
My aim is to use field-symbols everywhere possible for speeding up the execution of my code,by maintaining this logic.
My proposal should be the following but I need your kind opinion.
FIELD-SYMBOLS: <fs_#1_line> TYPE LINE OF table1.
FIELD-SYMBOLS: <fs_#2_line> TYPE LINE OF table1.
LOOP AT table1 WHERE f1 = '10' ASSIGNING <fs_#1_line>. (#1)
      updates to table1
      set c1_filed, c2_filed
      LOOP AT table1 ASSIGNING <fs_#2_line>.  (#2)            
         IF <fs_#2_line>-f1 = c1_filed AND
            <fs_#2_line>-f2 = c2_filed.
           <fs_#2_line>-fx = 'x'.
           <fs_#2_line>-fy = 'y'.
           <fs_#2_line>-fz = 'z'.
           <fs_#2_line>-ft = 't'.   
         ENDIF.                 
      ENDLOOP.   (#2)              
ENDLOOP.   (#1)
Your kind support is very important for me.
Thanks in advance.
Regards,
     Giovanni

Similar Messages

  • How to use field symbols

    can anyone tell me how to use field symbols. What effect it has on performance of a program?
    what r its avantages?
    iam working on a report where iam facing a lot of problems in performance issue. can anyone tell how field symbols are useful in this regard?
    thanx to all

    Check the below links
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm
    FIELD-SYMBOLS
    Basic form
    FIELD-SYMBOLS <fs>.
    Additions
    1. ... STRUCTURE s DEFAULT wa
    2. ... TYPE t
    3. ... TYPE LINE OF t
    4. ... LIKE s
    5. ... LIKE LINE OF s
    Effect
    This statement declares a symbolic field called <fs>. At runtime, you can assign a concrete field to the field symbol using ASSIGN . All operations performed with the field symbol then directly affect the field assigned to it.
    You can only use one of the additions.
    Example
    Output aircraft type from the table SFLIGHT using a field symbol:
    FIELD-SYMBOLS <PT>.
    TABLES SFLIGHT.
    ASSIGN SFLIGHT-PLANETYPE TO <PT>.
    WRITE <PT>.
    Addition 1
    ... STRUCTURE s DEFAULT wa
    Effect
    Assigns any (internal) field string or structure to the field symbol from the ABAP/4 Dictionary ( s ). All fields of the structure can be addressed by name: <fs>-fieldname . The structured field symbol points initially to the work area wa specified after DEFAULT .
    The work area wa must be at least as long as the structure s . If s contains fields of the type I or F, wa should have the structure s or at least begin in that way, since otherwise alignment problems may occur.
    Example
    Address components of the flight bookings table SBOOK using a field symbol:
    DATA SBOOK_WA LIKE SBOOK.
    FIELD-SYMBOLS <SB> STRUCTURE SBOOK
    DEFAULT SBOOK_WA.
    WRITE: <SB>-BOOKID, <SB>-FLDATE.
    Addition 2
    ... TYPE t
    Addition 3
    ... TYPE LINE OF t
    Addition 4
    ... LIKE s
    Addition 5
    ... LIKE LINE OF s
    Effect
    You can use additions 2 to 5 to type field symbols in the same way as FORM parameters (see also Type assignment of subroutine parameters). ASSIGN performs the same type checks as with USING parameters of FORM s.

  • How to use FIELD-SYMBOLS to declare a table

    How to use FIELD-SYMBOLS to declare a table?

    hi yong,
    this will be very general:
    FIELD-SYMBOLS : <gf_table> TYPE ANY TABLE.
    or
    to do like a specific table from your program
    FIELD-SYMBOLS : <gf_table> TYPE itab.
    itab is of course your internal table from your program.
    ec

  • How to use field symbols in program

    how to use field symbols can any one explain with example please..
    Regards,
    venki...

    Hi
    Field Symbols
    Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.
    Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.
    Field symbols are similar to dereferenced pointers in C (that is, pointers to which the content operator * is applied). However, the only real equivalent of pointers in ABAP, that is, variables that contain a memory address (reference) and that can be used without the contents operator, are reference variables in ABAP Objects.
    All operations programmed with field symbols are applied to the field assigned to it. For example, a MOVE statement between two field symbols moves the contents of the field assigned to the first field symbol to the field assigned to the second field symbol. The field symbols themselves point to the same fields after the MOVE statement as they did before.
    You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks the compatibility of the field symbol and the field you are assigning to it during the ASSIGN statement.
    Field symbols provide greater flexibility when you address data objects:
    If you want to process sections of fields, you can specify the offset and length of the field dynamically.
    You can assign one field symbol to another, which allows you to address parts of fields.
    Assignments to field symbols may extend beyond field boundaries. This allows you to address regular sequences of fields in memory efficiently.
    You can also force a field symbol to take different technical attributes from those of the field assigned to it.
    The flexibility of field symbols provides elegant solutions to certain problems. On the other hand, it does mean that errors can easily occur. Since fields are not assigned to field symbols until runtime, the effectiveness of syntax and security checks is very limited for operations involving field symbols. This can lead to runtime errors or incorrect data assignments.
    While runtime errors indicate an obvious problem, incorrect data assignments are dangerous because they can be very difficult to detect. For this reason, you should only use field symbols if you cannot achieve the same result using other ABAP statements.
    For example, you may want to process part of a string where the offset and length depend on the contents of the field. You could use field symbols in this case. However, since the MOVE statement also supports variable offset and length specifications, you should use it instead. The MOVE statement (with your own auxiliary variables if required) is much safer than using field symbols, since it cannot address memory beyond the boundary of a field. However, field symbols may improve performance in some cases.
    check the below links u will get the answers for your questions
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/field_sy.htm
    http://searchsap.techtarget.com/tip/1,289483,sid21_gci920484,00.html
    Syntax Diagram
    FIELD-SYMBOLS
    Basic form
    FIELD-SYMBOLS <fs>.
    Extras:
    1. ... TYPE type
    2. ... TYPE REF TO cif
    3. ... TYPE REF TO DATA
    4. ... TYPE LINE OF type
    5. ... LIKE s
    6. ... LIKE LINE OF s
    7. ... TYPE tabkind
    8. ... STRUCTURE s DEFAULT wa
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Untyped Field Symbols ad Cannot Use Field Symbols as Components of Classes.
    Effect
    This statement declares a symbolic field called <fs>. At runtime, you can assign a concrete field to the field symbol using ASSIGN. All operations performed with the field symbol then directly affect the field assigned to it.
    You can only use one of the additions.
    Example
    Output aircraft type from the table SFLIGHT using a field symbol:
    FIELD-SYMBOLS <PT> TYPE ANY.
    DATA SFLIGHT_WA TYPE SFLIGHT.
    ASSIGN SFLIGHT_WA-PLANETYPE TO <PT>.
    WRITE <PT>.
    Addition 1
    ... TYPE type
    Addition 2
    ... TYPE REF TO cif
    Addition 3
    ... TYPE REF TO DATA
    Addition 4
    ... TYPE LINE OF type
    Addition 5
    ... LIKE s
    Addition 6
    ... LIKE LINE OF s
    Addition 7
    ... TYPE tabkind
    Effect
    You can define the type of the field symbol using additions 2 to 7 (just as you can for FORM parameters (compare Defining the Type of Subroutine Parameters). When you use the ASSIGN statement, the system carries out the same type checks as for USING parameters of FORMs.
    This addition is not allowed in an ABAP Objects context. See Cannot Use Obsolete Casting for FIELD SYMBOLS.
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See Defining Types Using STRUCTURE.
    Effect
    Assigns any (internal) field string or structure to the field symbol from the ABAP Dictionary (s). All fields of the structure can be addressed by name: <fs>-fieldname. The structured field symbol points initially to the work area wa specified after DEFAULT.
    The work area wa must be at least as long as the structure s. If s contains fields of the type I or F, wa should have the structure s or at least begin in that way, since otherwise alignment problems may occur.
    Example
    Address components of the flight bookings table SBOOK using a field symbol:
    DATA SBOOK_WA LIKE SBOOK.
    FIELD-SYMBOLS <SB> STRUCTURE SBOOK
    DEFAULT SBOOK_WA.
    WRITE: <SB>-BOOKID, <SB>-FLDATE.
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • How to use Field-symbol with dynamic select query

    Can anybody tell me, how to use field-symbols in the dynamic select query.

    FIELD-SYMBOLS <fs> { typing | STRUCTURE struc DEFAULT dobj }.
    1. ... typing
    2. ... STRUCTURE struc DEFAULT dobj
    The FIELD-SYMBOLS statement declares a field symbol <fs>. The name conventions apply to the name fs. The angle brackets of the field symbols indicate the difference to data objects and are obligatory. You can declare field symbols in any procedure and in the global declaration section of an ABAP program, but not in the declaration section of a class or an interface. You can use a field symbol in any operand position in which it is visible and which match the typing defined using typing.
    After its declaration, a field symbol is initial - that is, it does not reference a memory area. You have to assign a memory area to it (normally using the ASSIGN statement) before you can use it as an operand. Otherwise an exception will be triggered.
    eg.
    FIELD-SYMBOLS <fs> TYPE ANY.
    DATA: BEGIN OF line,
            string1(10) VALUE '0123456789',
            string2(10) VALUE 'abcdefghij',
          END OF line.
    WRITE / line-string1+5.
    ASSIGN line-string1+5(*) TO <fs>.
    WRITE / <fs>.
    output:
    56789
    56789
    reward if helpful
    anju

  • How to use the Variants in SAP Transportation and what is its use ?

    Hi experts,
    How to use the Variants in SAP Transportation and what is its use & How to create a variant in SAP ?
    Can anybody answer this ?
    Regards,
    Shakti

    Hi,
    If you are asking about "slection vairants" in SPRO settings of "shipment cost document" then
    When it is activated,
    each user can have his own slecetion  and list criteria for
    1. List shippment costs:calculation
    2. List shippment costs: settlement
    This can be directly saved from VI01 screen by the user.
    from environment> lists
    This is user specific only.
    Hope this helps.
    Regards,
    Sharan

  • How to use field symbol in select

    Hi,
        CONCATENATE 'WTG0' LV_MON INTO LV_FNAME.
        ASSIGN (LV_FNAME) TO <FS>.
        SELECT SINGLE <FS>  FROM COSP INTO LV_SAPRST
             WHERE OBJNR = LV_OBJ AND GJAHR = LV_YEAR AND WRTTP = '4' AND KSTAR = GT_INOUT-SAKNR
       Error message :    Unknown column name "<FS>" . field list. . field list. field list. 
       actually ,  if i use  if command,  i can do,  but i want to use simple code by fieldsymbol.
       is it possible in select command?
    Thanks in advance
    Benjamin

    Hi
    Hope it will help you.
    reward if help.
    Field Symbols
    Field symbols are placeholders or symbolic names for other fields. They do not physically reserve space for a field, but point to its contents. A field symbol cam point to any data object. The data object to which a field symbol points is assigned to it after it has been declared in the program.
    Whenever you address a field symbol in a program, you are addressing the field that is assigned to the field symbol. After successful assignment, there is no difference in ABAP whether you reference the field symbol or the field itself. You must assign a field to each field symbol before you can address the latter in programs.
    Field symbols are similar to dereferenced pointers in C (that is, pointers to which the content operator * is applied). However, the only real equivalent of pointers in ABAP, that is, variables that contain a memory address (reference) and that can be used without the contents operator, are reference variables in ABAP Objects.
    All operations programmed with field symbols are applied to the field assigned to it. For example, a MOVE statement between two field symbols moves the contents of the field assigned to the first field symbol to the field assigned to the second field symbol. The field symbols themselves point to the same fields after the MOVE statement as they did before.
    You can create field symbols either without or with type specifications. If you do not specify a type, the field symbol inherits all of the technical attributes of the field assigned to it. If you do specify a type, the system checks the compatibility of the field symbol and the field you are assigning to it during the ASSIGN statement.
    Field symbols provide greater flexibility when you address data objects:
    If you want to process sections of fields, you can specify the offset and length of the field dynamically.
    You can assign one field symbol to another, which allows you to address parts of fields.
    Assignments to field symbols may extend beyond field boundaries. This allows you to address regular sequences of fields in memory efficiently.
    You can also force a field symbol to take different technical attributes from those of the field assigned to it.
    The flexibility of field symbols provides elegant solutions to certain problems. On the other hand, it does mean that errors can easily occur. Since fields are not assigned to field symbols until runtime, the effectiveness of syntax and security checks is very limited for operations involving field symbols. This can lead to runtime errors or incorrect data assignments.
    While runtime errors indicate an obvious problem, incorrect data assignments are dangerous because they can be very difficult to detect. For this reason, you should only use field symbols if you cannot achieve the same result using other ABAP statements.
    For example, you may want to process part of a string where the offset and length depend on the contents of the field. You could use field symbols in this case. However, since the MOVE statement also supports variable offset and length specifications, you should use it instead. The MOVE statement (with your own auxiliary variables if required) is much safer than using field symbols, since it cannot address memory beyond the boundary of a field. However, field symbols may improve performance in some cases.
    check the below links u will get the answers for your questions
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/content.htm
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/field_sy.htm
    http://searchsap.techtarget.com/tip/1,289483,sid21_gci920484,00.html
    Syntax Diagram
    FIELD-SYMBOLS
    Basic form
    FIELD-SYMBOLS <fs>.
    Extras:
    1. ... TYPE type
    2. ... TYPE REF TO cif
    3. ... TYPE REF TO DATA
    4. ... TYPE LINE OF type
    5. ... LIKE s
    6. ... LIKE LINE OF s
    7. ... TYPE tabkind
    8. ... STRUCTURE s DEFAULT wa
    The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Cannot Use Untyped Field Symbols ad Cannot Use Field Symbols as Components of Classes.
    Effect
    This statement declares a symbolic field called <fs>. At runtime, you can assign a concrete field to the field symbol using ASSIGN. All operations performed with the field symbol then directly affect the field assigned to it.
    You can only use one of the additions.
    Example
    Output aircraft type from the table SFLIGHT using a field symbol:
    FIELD-SYMBOLS <PT> TYPE ANY.
    DATA SFLIGHT_WA TYPE SFLIGHT.
    ASSIGN SFLIGHT_WA-PLANETYPE TO <PT>.
    WRITE <PT>.
    Addition 1
    ... TYPE type
    Addition 2
    ... TYPE REF TO cif
    Addition 3
    ... TYPE REF TO DATA
    Addition 4
    ... TYPE LINE OF type
    Addition 5
    ... LIKE s
    Addition 6
    ... LIKE LINE OF s
    Addition 7
    ... TYPE tabkind
    Effect
    You can define the type of the field symbol using additions 2 to 7 (just as you can for FORM parameters (compare Defining the Type of Subroutine Parameters). When you use the ASSIGN statement, the system carries out the same type checks as for USING parameters of FORMs.
    This addition is not allowed in an ABAP Objects context. See Cannot Use Obsolete Casting for FIELD SYMBOLS.
    In some cases, the syntax rules that apply to Unicode programs are different than those for non-Unicode programs. See Defining Types Using STRUCTURE.
    Effect
    Assigns any (internal) field string or structure to the field symbol from the ABAP Dictionary (s). All fields of the structure can be addressed by name: <fs>-fieldname. The structured field symbol points initially to the work area wa specified after DEFAULT.
    The work area wa must be at least as long as the structure s. If s contains fields of the type I or F, wa should have the structure s or at least begin in that way, since otherwise alignment problems may occur.
    Example
    Address components of the flight bookings table SBOOK using a field symbol:
    DATA SBOOK_WA LIKE SBOOK.
    FIELD-SYMBOLS <SB> STRUCTURE SBOOK
    DEFAULT SBOOK_WA.
    WRITE: <SB>-BOOKID, <SB>-FLDATE.
    Related
    ASSIGN, DATA
    Additional help
    Declaring Field Symbols

  • How to use field symbols  while creating a new RFC Bapi

    Hi all,
    I have written a RFC Bapi in the traditional way.
    I need to replace all with field symbols (import. export. tables and source code).
    What is the syntax ?
    Any sample codng will be more helpful.
    Regards
    Senthil

    Please search for available information on "field symbols" before posting
    Thread locked
    Thomas

  • How to use FIELD-SYMBOLS with TYPE ANY?

    Hi!
    I need to write a function which gets an import string parameter containing a field name like MATNR. In this function I have to "map" this string to a real variable so that I can access the field which is represented by the string. I tried it like this but it does not work:
    FUNCTION ZTEST1.
    ""Lokale Schnittstelle:
    *"  IMPORTING
    *"     REFERENCE(I_MARA) TYPE  MARA
      DATA: FIELD_NAME(30) VALUE 'I_MARA'.
      FIELD-SYMBOLS : <FS_ANY> TYPE ANY.
      Assign (FIELD_NAME) to <FS_ANY>.
    Does not work (I guess because of 'type any')
      WRITE: <FS_ANY>-MATNR.
    ENDFUNCTION.
    How can I solve this problem?
    Thanks,
    Konrad

    This code is far from perfection...But at least it could help you to find the right track -;)
    REPORT ydummy_atg.
    DATA: w_mara TYPE STANDARD TABLE OF mara.
    START-OF-SELECTION.
      SELECT *
      INTO TABLE w_mara
      FROM mara.
      PERFORM test TABLES w_mara.
    *&      Form  test
    FORM test TABLES t_mara.
      DATA: field_name(30) VALUE 'T_MARA',
            new_line TYPE REF TO data,
            flag TYPE c,
            w_tabix TYPE sy-tabix.
      FIELD-SYMBOLS : <fs_any> TYPE ANY,
                      <l_line> TYPE ANY,
                      <l_field> TYPE ANY.
      ASSIGN (field_name) TO <fs_any>.
      CREATE DATA new_line LIKE LINE OF t_mara.
      ASSIGN new_line->* TO <l_line>.
      LOOP AT t_mara.
        MOVE t_mara TO <l_line>.
        ASSIGN COMPONENT 2 OF STRUCTURE <l_line> TO <l_field>.
        <l_field> = <l_line>.
        WRITE:/ <l_field>.
      ENDLOOP.
    ENDFORM.                    " test
    Greetings,
    Blag.

  • How to use field symbols in dynamic select query

    I have a requirement to take the table name from selection screen and get data from that table 
      SELECT * FROM (P_TBLNM)
      INTO TABLE  <ITAB>
      WHERE <condition>.
    I have declared field symbol as type any table , but i am getting dump saying fieldsymbol is not getting assigned .
    Any pointers , please help.

    Hi laxmi,
    for your second question, try this one:
    DATA : ref_table_des TYPE REF TO cl_abap_structdescr,
    <itab> TYPE STANDARD TABLE,
    <wtab> TYPE ANY,
    dref TYPE REF TO DATA.
    DATA: <knumh>.
    ref_table_des ?= cl_abap_typedescr=>describe_by_name( P_TBLNM ).
    create data dref type handle ref_table_des.
    assign dref->* to <wtab>.
    create data dref like standard table of <wtab>.
    assign dref->* to <itab>.
    SELECT * FROM (P_TBLNM)
    INTO TABLE <itab>
    WHERE <condition>.
    LOOP AT <itab> ASSIGNING <wtab>.
    assign component 'KNUMH' of structure <wtab> to <knumh>.
    SELECT * FROM KONP
    APPENDING TABLE GI_KONP
    WHERE KNUMH = <knumh>.
    ENDLOOP.
    Regards,
    Richard
    Edited by: richard santos on Nov 17, 2009 8:16 AM

  • Modify DB by single field using Field Symbol

    Hi,
      please help me ,actually i have not use the field symbol in any object. i have one requirement ,i have to modify the DB by field STATUS using Field symbol ,
    I am sending u my code so please help me how can i modify DB using field symbol..
              gw_msg3_status1   = k_status1 .
              LOOP AT gi_msg3 INTO gs_msg3.
                gs_msg3-status  = gw_msg3_status1 .
                gs_msg3-issue   = lw_issuno.
           MODIFY gi_msg3 FROM gs_msg3 TRANSPORTING status.
                MODIFY gi_msg3 INDEX sy-tabix FROM gs_msg3 TRANSPORTING issue status.
              ENDLOOP.
    Thanks & Regards,
    Meenakshi

    perform dboperation_table using 'SET' 'BIRTHDT' '=' <fs>.
        perform dboperation_table using 'WHERE' 'PARTNER' '='  <fs>
        perform dboperation_update using 'BUT000'.
    form dboperation_table
    using p_type
          p_var1
          p_var2
          p_var3.
      data: t_l type cmst_str_data.
      data: d_cx_root            type ref to cx_root,
            d_text               type string.
      try.
          clear t_l.
          if p_var3 is not initial.
            t_l = p_var3.
            condense t_l.
            concatenate '''' t_l '''' into t_l.
          endif.
          concatenate p_var1 p_var2 t_l into t_l
          separated by space.
          case p_type.
            when 'SET'.   append t_l to g_s_t.
            when 'WHERE'. append t_l to g_w_t.
          endcase.
        catch cx_root into d_cx_root.
          d_text = d_cx_root->get_text( ).
          message a398(00) with  d_text.
      endtry.
    endform.                    "DBOPERATION_table
    form dboperation_update
    using  p_tabname type zdboperation-tabname.
      data: tabname type bus_table.
      data: d_cx_root            type ref to cx_root,
            d_text               type string.
      try.
          tabname-tabname = p_tabname.
          call function 'ZDBOPERATION_UPDATE'
            in update task
            exporting
              tabname     = tabname
            tables
              where_table = g_w_t
              set_table   = g_s_t.
        catch cx_root into d_cx_root.
          d_text = d_cx_root->get_text( ).
          message a398(00) with  d_text.
      endtry.
    endform.                    "DBOPERATION_update
    Hope it will help you.
    Regards,
    Madan.

  • How to populate one internal table from another using field symbols

    Hi Gurus,
      I have a problem. I have to populate one internal table (sructure t_otput) from another internal table (sructure t_from) using field symbol.
    Structure for from table.
    types: begin of t_from,
             year(4) type c,
             ww(2) type c,
             site type marc-werks,
             demand type i,
           end of t_from.
    Structure for output table.
    types: begin of t_display,
             title(30),
             WW1(10),
             WW2(10),
             WW3(10),
           end of t_display.
    The from table looks like this:
    Year | WW | Site | Demand
    2005 | 1  | OR1  | 12.00
    2005 | 2  | OR1  | 13.00
    2005 | 3  | OR1  | 14.00
    The display table which has to be populated should look like this:
    Title  | WW1   | WW2   | WW3
    OR1    |       |       |
    Demand | 12.00 | 13.00 | 14.00
    How to populate display table using field symbol?
    Please give code snippets
    Thanks,
    Gopal

    Gopal,
    Here is the code, however I am not vary clear about the ORG1 and Demand display that you have shown in the display. I am sure with this code it should not be a big deal to tweak in whatever manner you want.
    TABLES : marc.
    TYPES: BEGIN OF type_display,
    title(30),
    ww1(10),
    ww2(10),
    ww3(10),
    END OF type_display.
    TYPES: BEGIN OF type_from,
    year(4) TYPE c,
    ww(2) TYPE c,
    site TYPE marc-werks,
    demand TYPE i,
    END OF type_from.
    data : t_from type table of type_from,
           t_display type table of type_display.
    field-symbols : <fs_from> type type_from,
                    <fs_display> type type_display.
    data : wa_from type type_From,
           wa_display type type_display.
    wa_from-year = '2005'.
    wa_from-ww   = '1'.
    wa_from-site = 'OR1'.
    wa_from-demand = '12.00'.
    insert wa_from  into table t_from.
    wa_from-year = '2005'.
    wa_from-ww   = '2'.
    wa_from-site = 'OR1'.
    wa_from-demand = '13.00'.
    insert wa_from  into table t_from.
    wa_from-year = '2005'.
    wa_from-ww   = '3'.
    wa_from-site = 'OR1'.
    wa_from-demand = '14.00'.
    insert wa_from  into table t_from.
    data : variable(3) type c.
    field-symbols : <fs_any> type any.
    break-point.
    Loop at t_from assigning <fs_from>.
    variable = 'WW'.
    wa_display-title = <fs_from>-site.
    concatenate variable <fs_from>-ww into variable.
    assign component variable of structure wa_display to <fs_any>.
    <fs_any> = <fs_from>-demand.
    endloop.
    append wa_display to t_display.
    clear wa_display.
    loop at t_display assigning <Fs_display>.
      write :/ <fs_display>.
    endloop.
    Note : Please award points if this helps you.
    Regards,
    Ravi

  • Very Urgent: how to define field symbols in class using se24 Points assured

    hi all
    I am new to abap oo programming. I am using se24 to build a class
    where some methods have code which involves working with field sybmols but i am not able to figure out way for how to define field symbols in the attributes section.
    I tried defining like : fld_sym type ref to  dbtab-fld
    but in the method implementation if i try to use it like assign fld to <fld_sym> there it says fld_sym is not defined as a field symbol.
    So can anyone please guide me how to define field symbols in se24.
    Also what should be the general steps while creating a class using se24.
    Points assured
    thanks

    Hi
    Global classes are like Global fun modules in which the Methods and code is already written and is mainly used for Reusability purpose.
    Goto SE24 tcode and see the std global classes like
    CL_ABAP_CHAR_UTILITIES
    see the links
    chk out the links below:
    General Tutorial for OOPS
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907
    Have a look at these links for OO ABAP.
    http://www.sapgenie.com/abap/OO/
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
    http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/5c65b0dd-eddf-4512-8e32-ecd26735f0f2/prefinalppt.ppt
    http://www.allsaplinks.com/
    http://www.sapgenie.com/abap/controls/index.htm
    http://www.esnips.com/doc/2c76dc57-e74a-4539-a20e-29383317e804/OO-abap.pdf
    http://www.esnips.com/doc/0ef39d4b-586a-4637-abbb-e4f69d2d9307/SAP-CONTROLS-WORKSHOP.pdf
    http://help.sap.com/saphelp_erp2005/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
    SDN Series:
    https://www.sdn.sap.com/irj/sdn/developerareas/abap?rid=/webcontent/uuid/35eaef9c-0b01-0010-dd8b-e3b0f9ed7ccb [original link is broken]
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf
    Basic concepts of OOPS
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b6cae890-0201-0010-ef8b-f970a9c41d47
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/1591ec90-0201-0010-3ba8-cdcd500b17cf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc
    http://www.henrikfrank.dk/abapuk.html
    http://www.erpgenie.com/abap/OO/
    Reward oints if useful,
    Aleem.

  • Can I use field symbol in AT events? How?

    Hi all,
    I want to use field symbol in <b>AT END OF</b> event
    Can I use field symbol in such event as it takes table fields only.
    Kinldy look in to pseudo:
    Loop itab.
             AT END OF <FS1>.
             ENDAT.
    Endloop.
    I tried in my program but it's giving me a short dump.
    If it is possible to use field symbol in AT events, kindly tell me how..??
    Thanks in Advance.
    Sagar

    Hi,
    i don't know your reqirement but it is possible:
    DATA: t1(4), t2 TYPE i.
    FIELD-GROUPS: header.
    INSERT t2 t1 INTO header.
    t1 ='AABB'. t2 = 1. EXTRACT header.
    t1 ='BBCC'. t2 = 2. EXTRACT header.
    t1 ='AAAA'. t2 = 2. EXTRACT header.
    t1 ='AABB'. t2 = 1. EXTRACT header.
    t1 ='BBBB'. t2 = 2. EXTRACT header.
    t1 ='BBCC'. t2 = 2. EXTRACT header.
    t1 ='AAAA'. t2 = 1. EXTRACT header.
    t1 ='BBBB'. t2 = 1. EXTRACT header.
    t1 ='AAAA'. t2 = 3. EXTRACT header.
    t1 ='AABB'. t2 = 1. EXTRACT header.
    SORT BY t1 t2.
    *Here begins the definition of the field symbols
    FIELD-SYMBOLS:
    <t1> TYPE ANY,
    <t2> TYPE ANY.
    ASSIGN t1 TO <t1>.
    ASSIGN t2 TO <t2>.</b>
    LOOP.
      AT FIRST.
        WRITE 'Start of LOOP'.
        ULINE.
      ENDAT.
      AT NEW <t1>.
        WRITE / '   New T1:'.
      ENDAT.
      AT NEW <t2>.
        WRITE / '   New T2:'.
      ENDAT.
      WRITE: /14 t1, t2.
      AT END OF <t2>.
        WRITE / 'End of T2'.
      ENDAT.
      AT END OF <t1>.
        WRITE / 'End of T1'.
      ENDAT.
      AT LAST.
        ULINE.
      ENDAT.
    ENDLOOP.
    Regards,
    Gianpietro

  • How to create field catalog using field-symbols in normal alv report?

    hi all,
    how to create field catalog using field-symbols in normal alv report? i.e, using function modules...reuse_alv_list_display/grid_display?
    regards,
    jack

    HI
    LIKE THIS
    TYPE-POOLS : slis.
    DATA : t_fieldcat TYPE slis_t_fieldcat_alv,
           st_fieldcat TYPE slis_fieldcat_alv.
    st_fieldcat-fieldname     = 'STATUS'.
      st_fieldcat-seltext_l     = 'STATUS INDICATOR'.
      st_fieldcat-outputlen     = 17.
      APPEND st_fieldcat TO t_fieldcat.
      CLEAR st_fieldcat.
      st_fieldcat-fieldname     = 'VBELN'.
      st_fieldcat-do_sum        = ' '.
      st_fieldcat-seltext_l     = 'Sales Document No.'.
      st_fieldcat-outputlen     = 10.
      APPEND st_fieldcat TO t_fieldcat.
      CLEAR st_fieldcat.
      st_fieldcat-fieldname     = 'AUDAT'.
      st_fieldcat-do_sum        = ' '.
      st_fieldcat-seltext_l     = 'Document Date'.
      st_fieldcat-outputlen     = 10.
      APPEND st_fieldcat TO t_fieldcat.
      CLEAR st_fieldcat.
      st_fieldcat-fieldname     = 'VBTYP'.
      st_fieldcat-do_sum        = ' '.
      st_fieldcat-seltext_l     = 'Document Type'.
      st_fieldcat-outputlen     = 4.
      APPEND st_fieldcat TO t_fieldcat.
      CLEAR st_fieldcat.
      st_fieldcat-fieldname     = 'AUART'.
      st_fieldcat-do_sum        = ' '.
      st_fieldcat-seltext_l     = 'Category'.
      st_fieldcat-outputlen     = 1.
      APPEND st_fieldcat TO t_fieldcat.
      CLEAR st_fieldcat.
      st_fieldcat-fieldname     = 'AUGRU'.
      st_fieldcat-do_sum        = ' '.
      st_fieldcat-seltext_l     = 'Reason'.
      st_fieldcat-outputlen     = 3.
      APPEND st_fieldcat TO t_fieldcat.
      CLEAR st_fieldcat.
      st_fieldcat-fieldname     = 'NETWR'.
      st_fieldcat-do_sum        = 'X'.
      st_fieldcat-seltext_l     = 'Net Amount'.
      st_fieldcat-outputlen     = 15.
      APPEND st_fieldcat TO t_fieldcat.
      CLEAR st_fieldcat.
      st_fieldcat-fieldname     = 'WAERK'.
      st_fieldcat-do_sum        = ' '.
      st_fieldcat-seltext_l     = 'Unit'.
      st_fieldcat-outputlen     = 5.
      APPEND st_fieldcat TO t_fieldcat.
      CLEAR st_fieldcat.
    *sortinfo
      st_sort-fieldname = 'AUART'.
      st_sort-up        = 'X'.
      st_sort-subtot    = 'X'.
      APPEND st_sort TO t_sort.
      CLEAR st_sort.
      st_sort-fieldname = 'VBTYP'.
      st_sort-up        = 'X'.
      st_sort-subtot    = ' '.
      APPEND st_sort TO t_sort.
      CLEAR st_sort.
      st_sort-fieldname = 'WAERK'.
      st_sort-up        = 'X'.
      st_sort-subtot    = 'X'.
      APPEND st_sort TO t_sort.
      CLEAR st_sort.
      st_sort-fieldname = 'VBELN'.
      st_sort-up        = ' '.
      st_sort-subtot    = 'X'.
      APPEND st_sort TO t_sort.
      CLEAR st_sort.
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         i_list_type     = 0
       IMPORTING
         et_events       = it_eventcat
       EXCEPTIONS
         list_type_wrong = 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.
      IF grid = 'X'.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
         I_INTERFACE_CHECK                 = ' '
         I_BYPASSING_BUFFER                = ' '
         I_BUFFER_ACTIVE                   = ' '
          i_callback_program                = g_program
          I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
         I_CALLBACK_USER_COMMAND           = ' '
          I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
         I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
         I_CALLBACK_HTML_END_OF_LIST       = ' '
         I_STRUCTURE_NAME                  =
         I_BACKGROUND_ID                   = ' '
         I_GRID_TITLE                      =
         I_GRID_SETTINGS                   =
         IS_LAYOUT                         =
           it_fieldcat                       = t_fieldcat
         IT_EXCLUDING                      =
         IT_SPECIAL_GROUPS                 =
          it_sort                           = t_sort
         IT_FILTER                         =
         IS_SEL_HIDE                       =
         I_DEFAULT                         = 'X'
         I_SAVE                            = ' '
         IS_VARIANT                        =
         IT_EVENTS                         =
         IT_EVENT_EXIT                     =
         IS_PRINT                          =
         IS_REPREP_ID                      =
         I_SCREEN_START_COLUMN             = 0
         I_SCREEN_START_LINE               = 0
         I_SCREEN_END_COLUMN               = 0
         I_SCREEN_END_LINE                 = 0
         I_HTML_HEIGHT_TOP                 = 0
         I_HTML_HEIGHT_END                 = 0
         IT_ALV_GRAPHICS                   =
         IT_HYPERLINK                      =
         IT_ADD_FIELDCAT                   =
         IT_EXCEPT_QINFO                   =
         IR_SALV_FULLSCREEN_ADAPTER        =
       IMPORTING
         E_EXIT_CAUSED_BY_CALLER           =
         ES_EXIT_CAUSED_BY_USER            =
          TABLES
            t_outtab                          = it_final
          EXCEPTIONS
            program_error                     = 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.
    REWARD IF USEFULL

Maybe you are looking for

  • HTML Markup Doesn't Show in PDF Report

    I've got an Application Express screen from which I'm generating an Oracle Report, using APEX 3.0 and Oracle Reports 10g. Calling the report, I specify DESFORMAT=PDF. For the most part, this works fine. I'm able to display BOLD text and font colors a

  • OOTB approval worfklow not creating task when require checkout is set as Yes on the document library

    HI, I set the document library versioning to "require check-out" to yes. I set the workflow settings to create an approval workflow and "start the workflow when the item is created". I create a new document from the document template, save and check-

  • Flash xml data loading and unloading specs

    hi i am trying to get specification information that i cannot find anywhere else. i am working a large flash project and i would like to load xml data into the same swf object/movieclip repeatedly. as i do not want the previously loaded items to unlo

  • SXMB_MONI - Message Status - Automatic Restart

    Hello, When a message in transferred, in transaction SXMB the message has an "AUTOMATIC RESTART" icon. Other messages stuck in the queue and are waiting for the message to restart. Only after some time, the "AUTOMATIC RESTART" icon converts to "Red F

  • PE9 and Canon HF S100 .mts files

    I have been searching the forums for a while and looking through the help file trying to find out why the video I shoot with my Canon HF S100 camera is crap after PE9 gets done with it. Granted I am new to all of this, so I am not pointing any finger