Query on field symbols

Hi all,
one basic question.
I tried to find it but could not get.
This is is to declare an internal table .
data : lr_ref TYPE REF TO data.
how do we similarly declare a work area?
Regards,
Harshit Rungta

Hi Harshit,
We can modify them same as we update the static tables.
For eg -
<ls_ecamiopracc_mid>-vkont = lv_account
<ls_ecamiopracc_mid>-xaccexist = lc_x.
Hope this resolves your query.
Regards,
Manish

Similar Messages

  • Query about field symbol

    Hi,
    Can we write a query like this using field symbol.
    <FS> is a field symbol mapped onto an internal table.
    select * from dbtab into corresponding field of internal_tab for all entries in <FS>
    where field1 = <FS>-field1.
    It gives a syntax error when I check this query. Even if I turn field1 into a field symbol <FS1> to hold the field name, it gives an error.
    Could anyone advice in this context.
    Thanks for the help in advance.
    Regards,
    Vijay

    Vijay,
    Its not a limitation.
    You would have declared your table like this, right?
    FIELD-SYMBOLS : <FT> TYPE TABLE.
    Now, unless you assign this to table, the field symbols will not have a structure, right. This assignment happens only at runtime. So, there is no way that the system can identify <FT>-field1 at design time and compile the same, right?
    However, the question is if you know the structure at design time, why do you want to use a field symbols for the table?
    Regards,
    Ravi
    Note : Please mark the helpful answers

  • Error while trying to run Bex Query -------- Field symbol is not assigned.

    Hello Every body,
    I am facing the following error after giving some value in Selection screen and trying to run the Bex Query
    ERROR : Field symbol is not assigned.
    Thanks in advance,
    Praveen

    can u plz give details of variables, what it is build on and the value u r inputing,
    also is thr any dump.
    double click on the error message it shows u. it will give u the detailed error message. post that too

  • Problem using field symbols in Query...

    Hi,
    I am fetching the name of the table and field which I will be using in the query using field symbols. But it gives syntax error...
    select single OBJECTTABLE OBJECTFIELD into help_numtab from Zobjectname
    where OBJECTNAME  = P_OBJECT.
    field-symbols : <number> type any.
    field-symbols : <module> type any.
    ASSIGN help_numtab-OBjectfield to <number>.
    ASSIGN help_numtab-OBjecttable to <module>.
    /* Here <number> = MATNR and <module> = MARA.
    select <NUMBER> into table help_item
                     from <MODULE>
                          where ERNAM = SY-UNAME.
    This gives a syntax error which says <module> is not defined in ABAP DDIC.

    instead of field symbols, you ccan try this..
    select (help_numtab-OBjectfield) into table help_item
    from (help_numtab-OBjecttable)
    where ERNAM = SY-UNAME.
    ~Suresh

  • 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

  • Field symbol   query

    Hi to all,
    My query is how to access a internal tables's field  through field symbol.
    What is the syntax  and  different methods to do this.
    Also tell me the use of field synbol in real time.
    Thanks..

    hi,
    check these..
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/frameset.htm
    http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/field_sy.htm

  • 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

  • Opening query in BEx field symbol issue

    Hi,
    I'm facing a problem in opening BEx Analyzer 7.0.
    After starting BEx and logging on to the system a "BI Server error"-popup appears mentioning that there is a problem in the communication with the BI-server and that therefore the connection to the BI-server has been broken. The detailed error is: "Field symbol has not yet been assigned".
    When clicking OK and logging on for the second time there is no problem.
    Does anyone know how I can solve this?
    Thanks,
    Michel Scheres

    Hi,
    Front end is not installed properly. You can contact basis team it will resolve.
    Regards,
    Ajay.

  • UrGENT-DUMP while querying database table into itab(Assigned field Symbol)

    Hi,
    __I am getting a dump whose description is as follows__-
    "" In an SQL array select, the internal table used to hold the
    selected records must be at least as wide as the database table
    from which the records are being read.
    In this particular case, the database table is 820 bytes wide,
    but the internal table is only 814 bytes wide.""
    The following code had been written:
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_tabl TYPE dd02l-tabname.                                      "Table Name
    SELECTION-SCREEN END OF BLOCK b1.
    FIELD-SYMBOLS: <fs_itab> TYPE STANDARD TABLE,
                   <fs_wa> TYPE ANY,
                   <fs_itab1> TYPE STANDARD TABLE,
                   <fs_wa1> TYPE ANY.
    FORM generate_internal_tab .
      DATA: o_itab TYPE REF TO data,
            o_wa TYPE REF TO data,
            o_itab1 TYPE REF TO data,
            o_wa1 TYPE REF TO data.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name       = p_tabl
        CHANGING
          ct_fieldcat            = it_fcat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
    *Create Dynamic Table for it_fcat
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = it_fcat
        IMPORTING
          ep_table                  = o_itab
        EXCEPTIONS
          generate_subpool_dir_full = 1
          OTHERS                    = 2.
      IF sy-subrc EQ 0 OR o_itab IS NOT INITIAL.
        ASSIGN o_itab->* TO <fs_itab>.
        CREATE DATA o_wa LIKE LINE OF <fs_itab>.
        ASSIGN o_wa->* TO <fs_wa>.
      ENDIF.
    *Download the file to Application server
        SELECT *
          FROM (p_tabl)
          INTO TABLE <fs_itab>.
    So i am geting a dump in placing contents of table(p_tabl) into <fs_itab>.Should the type declarations be changed???
    Please give me an solution to resolve this dump.
    Thanks and regards-
    Sumita

    You are trying to put more fields in the internal table than what is declared presently for itab. Check if one of the fields is selected but not being passed on to a internal table field.

  • Query in Optimal Coding - Assigning INT TAB to FIELD SYMBOLS dynamically.

    TABLES: tkesk.
    DATA: itkesk type table of tkesk.
    DATA: BEGIN of itab_RP occurs 11,
    tabname type string,
    END of itab_RP.
    DATA : wa_rp like line of itab_Rp,
    wa_onemore like line of itkesk.
    FIELD-SYMBOLS: <fs> LIKE itkesk.
    ITAB_RP-tabname = 'ITKESK'.
    APPEND ITAB_RP.
    LOOP at ITAB_RP into wa_rp.
    <i><b>*How to assign the table itkesk to the field symbol
    *which is available in wa_rp dynamically instead of assigning it directly)</b></i>
    *ASSIGN wa_rp-tabname to <fs>.
    ASSIGN itkesk to <fs>.
       LOOP at <fs> into wa_onemore.
       WRITE : 'hi'.
       endloop.
    ENDLOOP.

    Is this even possible ?
    Thanks
    Mark

  • Field symbols and logical databases

    Hi,
    How to use field symbols in an abap HR program with logical database? For most of the reports and interfaces in HR, I have used GET PERNR with logical database to fetch data from the tables. I understand that this method of programming using logical databses, is less coding and improves the performance. I am curious to know the usage of field pointers here. How does this help? Is it necessary from a performance point of view? I would like to look at an example that has LDB and field symbols used in combination. I did not find one in the threads.
    Any thoughts and what do you recommend?
    Thanks in advance,
    VG

    Field-Symbols utilize memory more efficiently.Hence Better utilization of memory better is performance.
    Memory utilization is one of the factor for performance.
    [LDBFIELD-SYMBOLS|https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/generictemplatetoAccessLDB]
    [Field Symbols|https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/abap%252bsyntax]
    Hope this resolves your query.
    Regards,
    Gurpreet

  • Field symbols values passing as parameter to Methods

    Hi ,
    Can we pass fields symbols as parameter to methods ? I want to use field symbols values in my where in clause in methods, thereafter I want to pass my internal table to calling method.
    Thanks,
    Ujjwal

    Hi,
    I have create an class in which have I have create a method to written a select query to extract value from a table. The table name is passed by user. the select used is:
    select * from (tab) into CORRESPONDING FIELDS OF TABLE data.
    this method has 2 parameter:
    tab of type sting (importing).
    data of type ANY TABLE (exporting).
    and i am using the following code to get the data:
    data:  itab TYPE TABLE OF t578w.
    field-SYMBOLS <ab> TYPE any.
    ASSIGN 'T578W' to <ab>.
    CALL METHOD Z_GET_TABLE_DATA=>GET_TABLE " Z_GET_TABLE_DATA is the class name & GET_TABLE  is method name
        EXPORTING
          tab  = <ab>
        IMPORTING
          data = itab.
    You can code in similar way.
    I hope it helps.
    Regards
    Arjun
    Edited by: Arjun Thakur on Apr 23, 2009 3:16 PM

  • ABAP Objects v/s Field Symbols

    Hi,
    My query is:
    In ABAP Objects, reference variables can be assigned to each other.
    We can also assign the reference variable to a field symbol.
    Does that mean, that we can achieve the same functionality(like accessing a method of the class) using the field-symbols?
    If so, why not use field-symbols instead of objects? What are the other differences?
    Please provide your opinions.
    Regards
    s.a.k

    Hi,
    We can have any number of Field Symbols refering to One Variable or Object, but all these Field symbols refer to same memory location they donto have individual memory locations.
    Where are in Object, if diffrent objected are created refreing to one object all the objects have diffrent memory locations.
    Read the documentation of Field symbols and ABAP Objects you will get the clear diffrene.
    Regards,
    Kumar M.

  • Problem With Insert statement using field symbols with unicode enabled

    I was writng a function module for dyanamic operations on the table. We are using the field symbols, function module is unicode enabled.
    Assign statements are working fine, with which we created work are <fs_wa_header> and internal table <fs_tb_item> dynamically based on the table name (IM_TB_HENAME) which we get as import parameter.
    we have query which is giving us dump.
    INSERT  (IM_TB_HENAME)  FROM <FS_WA_HEADER>.

    Hi
    INSERT (IM_TB_HENAME) FROM <FS_WA_HEADER> is good for inserting a line in the database, so IM_TB_HENAME has to have the name of dictionary table.
    U should write:
    INSERT  <FS_WA_HEADER> INTO (IM_TB_HENAME).
    But I believe you can't use the variable IM_TB_HENAME, you should use another field-symbols:
    ASSIGN (IM_TB_HNAME) TO <FS_TB_ITEM>.
    INSERT  <FS_WA_HEADER> INTO <FS_TB_ITEM>.
    Max

  • FOR ALL ENTRIES... with FIELD SYMBOL

    Is it possible to use FOR ALL ENTRIES with a FIELD-SYMBOL that points to a data reference of type STANDARD TABLE ?
    I have the following:
      SELECT * FROM mara
        INTO TABLE table
        FOR ALL ENTRIES IN another_table
        WHERE matnr EQ another_table-matnr.
    The code above is what exists, (working), but I'm improving the program and one of the improvements is to allow dynamic querying by providing a field symbol instead of a hard-coded table like "another_table". But I get the message "the specified type has no structure and therefore no component called "MATNR".
    My code just have the field symbol that points to a previously data reference created for a table passed as a parameter (this is working, having checked via debugging) replacing "another_table" and <fs>-matnr instead of "another_table-matnr".
    What solutions would you guys suggest ?
    Thanks
    Avraham

    Why is that that the commented line doesn't work, but under debugging I can reach <ls_items>-matnr ?
    Everything is fine with <lt_items>, it contains 8 lines, and debugging shows <ls_items> receiving one line each loop pass, just as expected. I wanted to understand why/when does this error of "has no structure therefore there is no component"... appears.
    LOOP AT <lt_items> INTO <ls_items>.
    *    SELECT SINGLE * INTO ls_mara FROM mara WHERE mara~matnr = <ls_items>-matnr.
        IF sy-subrc = 0.
          APPEND ls_mara TO lt_mara.
        ENDIF.
      ENDLOOP.

Maybe you are looking for

  • ITunes won't open after FW migration between G5 10.4.11 and iMac 10.6.2

    I just got my wonderful iMac i7 machine and used the migration assistant to move everything from my G5 OS 10.4.11 machine to the iMac. Everything has worked without a hitch except I have to re-active Photoshop and I had to re-input my Aperture serial

  • IPhone 5 Battery = Terrible

    I regret upgrading to the iPhone 5.  I've read some people claim it's the iOS.  I honestly don't know. What I do know is that my iPhone 4 had no problems with battery.  It functioned quite well for being 2 years old.  I really miss it now. I've gone

  • How to fix iphone 4s wifi not working

    How to fix wifi not working on iphone 4s after it is updated to ios 7 ? Here is what fixed my wife's phone after several weeks of no wifi. We had removed the Sims card and transferred to another phone which was running ios 6. My son was visiting and

  • Standby db monitoring in OEM

    I have 11g oem grid. The standby db's are displayed as down in the OEM as it in Mount. Is there a way to monitor or configure OEM to manage the standby databases.

  • CMP and Stored Procedures

    Is it possible to invoke a stored procedure from within a method in the home interface of an entity bean using CMP 2.0? The entity bean has been deployed to OC4J.