How to keep Field symbol reference

HI ALL ,
I have method with that assign field symbol on it and I want to keep the reference of it ,
does it impossible ?
For instance
ASSIGN cs_structure TO <ls_structure>. "both are type any and are always structure with fields f1...fn
    assign_request(
      EXPORTING
        is_fields = ls_fields
        ev_out    = es_field "F2
      CHANGING
        cs_str  = <ls_structure>
es_field = '1'
Here I have method that in the method I always need to return  field from the structure  (es_field - I dont know how to define it
type any or type ref to data )
my question is assume in <ls_structure>  I have field called F2 and I want to receive it but to keep the reference i.e.
if i do after the method call es_field = '1' the field F2 on structure <ls_structure>  will contain '1'.
There is a way to do that ?
Regards
Joy

HI Naimesh
I already try to define es_field as type ref to data but the issue is that for instance
field symbol  <lv_field> type any.
ASSIGN cs_structure TO <ls_structure>.
inside the method assign_request I am doing ...
ASSIGN COMPONENT 'F2'  OF STRUCTURE cs_str TO <lv_field>.
GET REFERENCE OF <lv_field> INTO ev_out.
call to the method
    assign_request(
      EXPORTING
        is_fields = ls_fields
        ev_out    = es_field 
      CHANGING
        cs_str  = <ls_structure>
and after the method assign_request
ASSIGN es_field->* to <lv_field>.
<lv_field> = '1.'
Now I except that cs_structure and <ls_structure> that have field F2 you see that value '1' but its not working ,
what i miss here ?
Regards
joy

Similar Messages

  • 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

  • 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.

  • 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 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 keep field as mandatory in function module

    I have one field in import parameter can you please suggest how to keep it as mandatory
    Thnx

    In IMPORT parameter tab you have one checkbox OPTIONAL, if you check it that field will be optional otherwise it is mandatory.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • How to pass field symbol or table from one view to another view in abap web dynpro?

    I am creating an Inbound Outbound ALV report in ABAP Web Dynpro. However at selection-screen I have select options and fetching is done at view2. Problem is we can pass parameter using inbound outbound parameters but how to pass internal table or field-symbols from one view to another view? I made use of Assistance Class too but its not very clear to me. Please give me some example or code to sort this problem out.

    I am creating an Inbound Outbound ALV report in ABAP Web Dynpro. However at selection-screen I have select options and fetching is done at view2. Problem is we can pass parameter using inbound outbound parameters but how to pass internal table or field-symbols from one view to another view? I made use of Assistance Class too but its not very clear to me. Please give me some example or code to sort this problem out.

  • 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 move field symbol internal table to internal table with header line?

    Dear all,
    hi...hereby i would like to ask how i can move field symbol internal table to a internal table?
    as i know field symbol internal table is without header line..
    so, may i know how to do this....to move field symbol internal table to internal table which consist of header line and field and record will same as field symbol internal table...in additional, my field symbol internal table is dynamic table mean everytime will have flexible columns..?
    Please advise...
    Thanks
    Regard,
    ToToRo.
    Edited by: @ToToRo@ on Aug 20, 2009 6:16 AM

    Hello,
    Try this way:
    If both the type of internal tables are same then you can directly assign dynamic internal table to static internal table.
    itab = <itab>.
    Suppose you have field symbol internal table <itab> which is different in structure from ITAB.
    Now, you can create <wa> as follow:
    FIELD-SYMBOLS <wa>.
    DATA wa TYPE REF TO DATA.
    CREATE DATA wa TYPE LINE OF <itab>.
    ASSIGN wa->* to <wa>.
    This way your work area is read.
    Using [ASSIGN COMPONENT|http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb3923358411d1829f0000e829fbfe/content.htm] syntax you can read required component of <wa>.
    Finally you can use that value to load static internal table.
    You can also refer to my thread on [Dynamic table|Re: Creating Dynamic table].
    Hope this helps!
    Thanks,
    Augustin.
    Edited by: Augustarian on Aug 20, 2009 10:06 AM

  • How to compare field symbols

    Dear experts,
    I have a piece of code like this..
    ASSIGN (lv_field)  TO <f1>.
          IF NOT <f1> IS INITIAL.
            CONCATENATE 'IS_BUS000_EEW' '-' lv_fieldname INTO lv_field.
            ASSIGN (lv_field)  TO <f1>.
            CONCATENATE 'LS_BUT000-' lv_fieldname INTO lv_field2.
            ASSIGN (lv_field2) TO <f2>.
            <f2> = <f1>.       "
          ENDIF.
    After assigning <f1> to <f2>, in runtime <f2> is getting a value '  .  .    '(like 'xx.xx.xxxx' spaces are missing when the question is posted). Now my requirement is that, if <f2> is '   .  .    '  i want to clear <f2>. So please let me know how do we compare the field symbols(for type DATS) with values like '  .  .    '.
    Edited by: Shwetha H S on Apr 2, 2008 6:56 AM

    Dear experts,
    I have a piece of code like this..
    ASSIGN (lv_field)  TO <f1>.
          IF NOT <f1> IS INITIAL.
            CONCATENATE 'IS_BUS000_EEW' '-' lv_fieldname INTO lv_field.
            ASSIGN (lv_field)  TO <f1>.
            CONCATENATE 'LS_BUT000-' lv_fieldname INTO lv_field2.
            ASSIGN (lv_field2) TO <f2>.
            <f2> = <f1>.       "
          ENDIF.
    After assigning <f1> to <f2>, in runtime <f2> is getting a value '  .  .    '(like 'xx.xx.xxxx' spaces are missing when the question is posted). Now my requirement is that, if <f2> is '   .  .    '  i want to clear <f2>. So please let me know how do we compare the field symbols(for type DATS) with values like '  .  .    '.
    Edited by: Shwetha H S on Apr 2, 2008 6:56 AM

  • How to pass field symbol as parameter to a method

    Hi,
    I have a field symbol of type table,also i have a method with parameter (say vbeln), i need to pass the range value in <fs> as the parametrs to the method.,
    How can I acheive this,
    A code snippet eill help me a lot.,
    Thank you.
    Arjun.G

    Hi,
    Example code :
    field-symbols : <fs> type table.
    CALL METHOD cl_gui_frontend_services=>gui_upload
      CHANGING
        data_tab                = <fs>
    *  EXCEPTIONS
    *    file_open_error         = 1
    *    file_read_error         = 2
    *    no_batch                = 3
    *    gui_refuse_filetransfer = 4
    *    invalid_type            = 5
    *    no_authority            = 6
    *    unknown_error           = 7
    *    bad_data_format         = 8
    *    header_not_allowed      = 9
    *    separator_not_allowed   = 10
    *    header_too_long         = 11
    *    unknown_dp_error        = 12
    *    access_denied           = 13
    *    dp_out_of_memory        = 14
    *    disk_full               = 15
    *    dp_timeout              = 16
    *    not_supported_by_gui    = 17
    *    error_no_gui            = 18
    *    others                  = 19
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Remember : parameter should be of type standard table.
    Regards,
    Mohaiyuddin

  • How to modify field symbol of type Index Table with other field symbol of type any.

    Hello Experts,
    How is it possible to update an filed symbol table of type Index table with other filed symbol table.
    e.g.
    Field symbol :  <lt_table1> type Index table.
    Field symbol : <lt_table2> type Index table.
    after some code...at run time these table filled like following.
    <lt_tabel1 > has  value fore column  like c11 , c12 , c13 
    <lt_table2> has value for column like C11     , C12 , C13 , C14 , C15 . some extra  values from <lt_table1>
    Now I want to be modify <table1> one entires like C12 with <table2 > col C12.
    how I can achieve this.
    Regards,
    Chetan.

    Hi,
    did you try  ASSIGN COMPONENT xx OF STRUCTURE <IT_TABEL1> TO <IT_TABLE2>.
    xx will contain the number of the column
    or maybe, if you have the description with a field catalog or other, that will be easier ..
    regards
    Fred

  • 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

Maybe you are looking for

  • Can't seem to open my world on blackberry app to enable me to create a new blackberry ID!

    Helo there I have been struggling for days now, surfed the web and I just can't seem to find any answers for my problem! I don't know could it be my software that needs to be updated or what the exact problem is. I download app world with ease but th

  • Print HU label from Outbound delivery using output determination

    Hi,   We have a business requirement to print HU labels from outbound delivery. The steps followed are 1) User executes VL02N 2) User clicks on packing 3) Material is entered to pack. HU is automatically generated. 4) After saving the delivery, outpu

  • I cannot install iTunes 10.5.

    I have tried installing iTunes 10.5 two different ways and both times the installation process concludes unsuccessfully. First, I tried downloadinng straight from iTunes. It says new software is available for download. I click OK, it goes through the

  • Does the installation of virtual box harms the MacBook

    I am an IT student and I am about to download Ubuntu in my Mac. According to the research I have done I found that a virtual box should be downloaded to run Ubuntu (Please correct me if I am wrong). Does this make my mac run slow? Are there any other

  • Beginers question - where to find Links.* options?

    Hello! And again me I try again to script and have dificulties to find how to accsess such things like Actual PPi, Scale etc. I need to get that information to be able to rescale images with PS. So far i "know"  .name  and thats it. Thanks!