Field symbols - casting error

Hi,
   I created a table dynamically and assigned it to field symbol. Now i want to write the contents of the internal table to a flat file in app server. Here is what i am doing.
parameters: p_table(30) type c default 'PA0008',
            p_file LIKE RLGRAP-FILENAME default '/usr/sap/tmp/test.txt'.         " Path to save files to
FIELD-SYMBOLS: <w_table> type standard table,
               <w_wa>   TYPE any,
               <w_field> type any.
DATA: w_dyn_wa type ref to data,
      w_dyn_table type ref to data.
CREATE DATA w_dyn_wa TYPE (p_table). "Suitable work area
ASSIGN w_dyn_wa->* TO <w_wa>.
create data w_dyn_table type standard table of (p_table).
assign w_dyn_table->* to <w_table>.
data w_dyn_data(5000) type c.
SELECT * FROM (p_table) INTO table <w_table> where endda >= sy-datum.
Data: w_temp type string.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE encoding default.
IF SY-SUBRC = 0.
  loop at <w_table> into <w_wa>.
  w_temp = ''.
    do.
      assign component sy-index of structure <w_wa> to <w_field>.
      if sy-subrc <> 0.
        exit.
      endif.
      concatenate w_temp <w_field> into w_temp respecting blanks.
      if sy-index = 1.
        transfer '' to p_file.
      endif.
     transfer <w_field> to p_file no end of line.
    enddo.
   transfer w_temp to p_file no end of line.
   write:/ w_temp.
  endloop.
endif.
close dataset p_file.
when i run the program with PA0008 i am getting a casting error "Object not char like". How do i get rid of this error?. I tried moving the contents of field symbol to a string and appending it. It worked, but i lost the exact formatting of data in the file. In other words, it got rid of extra blanks. I need exact structure of internal table in the file.
Thanks,
Sandeep
Thanks,
Sandeep

Hi
Have u tried to use MOVE statament instead of CONCATENATE?
do.
assign component sy-index of structure <w_wa> to <w_field>.
if sy-subrc <> 0.
exit.
endif.
DESCRIBE FIELD <W_FIELD> LENGTH V_LEN.
MOVE <W_FIELD> TO w_temp+V_OFFSET(V_LEN).
V_OFFSERT = V_OFFSET + V_LEN.
Max

Similar Messages

  • Even though am using Field-Symbol correctly, showing error!!!

    Hello
    Below is my code,
    LOOP AT itab_data INTO <fs_data>.
       CHECK <fs_data>-error_flag = 'X'.
       READ TABLE itab_docnum INTO <fs_docnum>
        WITH KEY docnum = <fs_data>+4(16)
        BINARY SEARCH.
    LOOP AT itab_data INTO <fs_data>.
       CHECK <fs_data>+1(10) <> 'END_REC'(025) AND
             <fs_data>+1(10) <> 'BEGIN_REC'(026).
         ASSIGN <fs_data>+1(*) TO <fs_edid2> CASTING.
         <fs_data> = <fs_edid2>.
       MOVE-CORRESPONDING <fs_data> TO w_edi_dd.
       <fs_data>+1    = w_edi_dd.
    But, am getting the below error message in SLIN/Extended Prog Check.
    Fieldsymbol <FS_DATA> is not assigned to a field
    (The message can be hidden with "#EC *)
    1) I do not understand why am getting this (if itab contains any data then ONLY the loop will be executed right?)
    2) How to correct this?
    Thank you

    Hello,
    Correct method of using a field-symbol is to assign it first with the structure.
    You use INTO if working with work area. Example:
    LOOP AT itab_data INTO w_data.
    Use assigning keyword when using field-symbol in case of LOOP...ENDLOOP.
    LOOP AT itab_data ASSIGNING <fs_data>.
    Check below link on 'Assigning Data Objects to Field Symbols':
    http://help.sap.com/SAPhelp_nw04/helpdata/en/fc/eb3860358411d1829f0000e829fbfe/frameset.htm
    Hope it helps!
    Regards,
    Saba
    Edited by: Saba Sayed on Feb 27, 2011 11:35 PM

  • 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

  • RUn time error while  saving po    Field symbol has not yet been assigned.

    Hi Experts,
    I am getting abap dump while saving PO in ME21N  plz seee the below dump  plzzzzzzzzzzzzzzzzzzzzz help me
    Runtime Errors         GETWA_NOT_ASSIGNED
    Date and Time          19.06.2009 11:24:46
    Short dump has not been completely stored (too big)
    Short text
         Field symbol has not yet been assigned.
    What happened?
         Error in the ABAP Application Program
         The current ABAP program "SAPLKKBL" had to be terminated because it has
         come across a statement that unfortunately cannot be executed.
    What can you do?
         Note down which actions and inputs caused the error.
         To process the problem further, contact you SAP system
         administrator.
         Using Transaction ST22 for ABAP Dump Analysis, you can look
         at and manage termination messages, and you can also
         keep them for a long time.
    Error analysis
         You attempted to access an unassigned field symbol
         (data segment 106).
         This error may occur if
         - You address a typed field symbol before it has been set with
           ASSIGN
         - You address a field symbol that pointed to the line of an
           internal table that was deleted
        - You address a field symbol that was previously reset using
          UNASSIGN or that pointed to a local field that no
          longer exists
        - You address a global function interface, although the
          respective function module is not active - that is, is
          not in the list of active calls. The list of active calls
          can be taken from this short dump.
    How to correct the error
        If the error occures in a non-modified SAP program, you may be able to
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the following
        keywords:
        "GETWA_NOT_ASSIGNED" " "
        "SAPLKKBL" or "LKKBLF99"
        "GEN_FIELD_OUT2"
        If you cannot solve the problem yourself and want to send an error
        notification to SAP, include the following information:
        1. The description of the current problem (short dump)
           To save the description, choose "System->List->Save->Local File
        (Unconverted)".
        2. Corresponding system log
           Display the system log by calling transaction SM21.
           Restrict the time interval to 10 minutes before and five minutes
        after the short dump. Then choose "System->List->Save->Local File
    (Unconverted)".
    3. If the problem occurs in a problem of your own or a modified SAP
    program: The source code of the program
       In the editor, choose "Utilities->More
    Utilities->Upload/Download->Download".
    4. Details about the conditions under which the error occurred or which
    actions and input led to the error.
    em environment
    SAP-Release 700
    Application server... "gplqty"
    Network address...... "128.12.0.19"
    Operating system..... "Windows NT"
    Release.............. "5.2"
    Hardware type........ "8x AMD64 Level"
    Character length.... 16 Bits
    Pointer length....... 64 Bits
    Work process number.. 0
    Shortdump setting.... "full"
    Database server... "GPLQTY"
    Database type..... "MSSQL"
    Database name..... "GPQ"
    Database user ID.. "gpq"
    Char.set.... "C"
    SAP kernel....... 700
    created (date)... "Aug 4 2008 02:33:25"
      create on........ "NT 5.2 3790 Service Pack 1 x86 MS VC++ 14.00"
      Database version. "SQL_Server_8.00 "
      Patch level. 172
      Patch text.. " "
      Database............. "MSSQL 7.00.699 or higher, MSSQL 8.00.194"
      SAP database version. 700
      Operating system..... "Windows NT 5.0, Windows NT 5.1, Windows NT 5.2, Windows
       NT 6.0"
      Memory consumption
      Roll.... 16192
      EM...... 16759360
      Heap.... 0
      Page.... 237568
      MM Used. 12036016
      MM Free. 530432
    er and Transaction
      Client.............. 410
      User................ "SAP_SUPPORT"
      Language key........ "E"
      Transaction......... "ME21N "
      Transactions ID..... "9E955CDE97CBF1648B4C001A64C7B85A"
      Program............. "SAPLKKBL"
      Screen.............. "SAPLKKBL 0500"
      Screen line......... 3
    Information on where terminated
        Termination occurred in the ABAP program "SAPLKKBL" - in "GEN_FIELD_OUT2".
        The main program was "RM_MEPO_GUI ".
        In the source code you have the termination point in line 2908
        of the (Include) program "LKKBLF99".
    Source Code Extract
    Line  SourceCde
    2878       else.
    2879         assign <fs11> to <field>.
    2880         gs_fc = gs_sfc11.
    2881       endif.
    2882     when 012.
    2883       if gs_out_flags-slave ne 'X'.
    2884         assign <fm12> to <field>.
    2885         gs_fc = gs_mfc12.
    2886       else.
    2887         assign <fs12> to <field>.
    2888         gs_fc = gs_sfc12.
    2889       endif.
    2890     when 013.
    2891       if gs_out_flags-slave ne 'X'.
    2892         assign <fm13> to <field>.
    2893         gs_fc = gs_mfc13.
    2894       else.
    2895         assign <fs13> to <field>.
    2896         gs_fc = gs_sfc13.
    2897       endif.
    2898     when 014.
    2899       if gs_out_flags-slave ne 'X'.

    Hi,
    this error occurs when you try to address a field-symbol before it has been assigned to a field or
    the assignment has failed.
    Use following code to remove this dump
    Assign <mara-matnr> to <fs>.
    if sy-subrc <> 0.
      Error Message.
    Endif.
    Hope it helps,
    Raj

  • Getting a runtime error in block alv that field symbol has been assigned

    hi to all experts ,
    im getting a runtime error that field symbol has not been assigned in functionmodule reuse_alv_block_list_display
    i tried a lot to rectify the error ,im unable to do it thats i have posted here
    *& Report  ZHAI_ALV_BLOCK_LIST
    REPORT  ZHAI_ALV_BLOCK_LIST.
    type-pools:slis.
    tables:mara.
    DATA:BEGIN OF  IT_MARA OCCURS 0,
            MATNR LIKE MARA-MATNR,
            MBRSH LIKE MARA-MBRSH,
            MATKL LIKE MARA-MATKL,
            END OF IT_MARA.
    data: begin of IT_DESC OCCURS 0,
             MATNR like MAKT-MATNR,
             MAKTX like MAKT-MAKTX,
         end of IT_DESC.
    data: begin of IT_MARD occurs 0,
            MATNR like mard-matnr,
            WERKS  like  mard-werks,
            LGORT  like  mard-lgort,
            LABST like mard-labst,
          end of IT_MARD.
    data: IT_FCAT TYPE SLIS_T_FIELDCAT_ALV ,
          WA_FCAT LIKE LINE OF IT_FCAT,
          IT_FCAT1 type  slis_t_fieldcat_alv,
          WA_FCAT1 LIKE LINE OF IT_FCAT1,
          IT_FCAT2 TYPE SLIS_T_FIELDCAT_ALV,
          WA_FCAT2 LIKE LINE OF IT_FCAT2,
          wa_layout type  SLIS_LAYOUT_ALV,
          it_event type SLIS_T_EVENT,
          wa_event like line of it_event,
         wa_layout like line of it_layout,
          V_REPID LIKE SY-REPID.
    select-options:so_matnr for mara-matnr.
    start-of-selection.
    perform f_select_data.
    DEFINE ADD_CATALOGUE1.
    WA_FCAT-COL_POS = &1.
    WA_FCAT-fieldname = &2.
    WA_fcat-tabname = &3.
    wa_fcat-emphasize = &4.
    wa_fcat-ref_tabname = &5.
    APPEND WA_FCAT TO IT_FCAT.
    END-OF-DEFINITION.
    DEFINE ADD_CATALOGUE2.
    WA_FCAT1-COL_POS = &1.
    WA_FCAT1-fieldname = &2.
    WA_fcat1-tabname = &3.
    wa_fcat1-emphasize = &4.
    wa_fcat1-ref_tabname = &5.
    APPEND WA_FCAT1 TO IT_FCAT1.
    END-OF-DEFINITION.
    DEFINE ADD_CATALOGUE3.
    WA_FCAT2-COL_POS = &1.
    WA_FCAT2-fieldname = &2.
    WA_fcat2-tabname = &3.
    wa_fcat2-emphasize = &4.
    wa_fcat2-ref_tabname = &5.
    APPEND WA_FCAT2 TO IT_FCAT2.
    END-OF-DEFINITION.
    perform f_build_fcat.
    *perform f_build_fcat1.
    perform f_build_fcat2.
    PERFORM F_BUILD_LAYOUT.
    PERFORM F_BUILD_EVENTS.
    PERFORM F_BLOC_DISPLAY.
    *&      Form  f_select_data
    FORM f_select_data .
    select matnr
           mbrsh
           matkl
         from mara into  table it_mara where matnr
    in so_matnr.
    if it_mara[] is not initial.
    select matnr
           maktx
           from makt
           into   table it_desc
           for all entries in it_mara
           where matnr eq it_mara-matnr.
    endif.
    if it_desc[] is not initial.
    select matnr
           werks
           lgort
           labst
           from mard
           into  table it_mard
           for all entries in it_desc
           where matnr eq it_desc-matnr.
    endif.
    ENDFORM.                    " f_select_data
    *&      Form  f_build_fcat
    FORM f_build_fcat .
    ADD_CATALOGUE2:
    '1' 'MATNR' 'IT_MARA' 'C500' 'MARA',
    '2' 'MBRSH' 'IT_MARA' 'C600' 'MARA',
    '3' 'MATKL' 'IT_MARA' 'C300' 'MARA'.
    ENDFORM.                    " f_build_fcat
    **&      Form  f_build_fcat1
    FORM f_build_fcat1 .
    ADD_CATALOGUE1:
    '1' 'MATNR' 'IT_DESC' 'C500' 'MAKT',
    '2' 'MAKTX' 'IT_DESC' 'C600' 'MAKT'.
    ENDFORM.                    " f_build_fcat1
    *&      Form  f_build_fcat2
    FORM f_build_fcat2.
    ADD_CATALOGUE3:
    '1' 'MATNR' 'IT_MARD' 'C500' 'MARD',
    '2' 'WERKS' 'IT_MARD' 'C600' 'MARD',
    '3' 'LGORT' 'IT_MARD' 'C200' 'MARD',
    '4' 'LABST' 'IT_MARD' 'C300' 'MARD'.
    ENDFORM.                    " f_build_fcat2
    *&      Form  F_BLOC_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM F_BLOC_DISPLAY .
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
      EXPORTING
        I_CALLBACK_PROGRAM             = SY-REPID.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = wa_layout
        IT_FIELDCAT                      = it_fcat
        I_TABNAME                        = 'IT_MARA'
        IT_EVENTS                        = it_event
      IT_SORT                          =
      I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = IT_MARA
    EXCEPTIONS
      PROGRAM_ERROR                    = 1
      MAXIMUM_OF_APPENDS_REACHED       = 2
      OTHERS                           = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = wa_layout
        IT_FIELDCAT                      = it_fcat1
        I_TABNAME                        = 'IT_DESC'
        IT_EVENTS                        = IT_EVENT
      IT_SORT                          =
      I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = IT_DESC
    EXCEPTIONS
      PROGRAM_ERROR                    = 1
      MAXIMUM_OF_APPENDS_REACHED       = 2
      OTHERS                           = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = wa_LAYOUT
        IT_FIELDCAT                      = IT_FCAT2
        I_TABNAME                        = 'IT_MARD'
        IT_EVENTS                        = IT_EVENT
      IT_SORT                          =
      I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = IT_MARD
    EXCEPTIONS
      PROGRAM_ERROR                    = 1
      MAXIMUM_OF_APPENDS_REACHED       = 2
      OTHERS                           = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.                    " F_BLOC_DISPLAY
    *&      Form  F_BUILD_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM F_BUILD_LAYOUT .
    wa_layout-edit = 'X'.
    wa_layout-window_titlebar = 'MOHAMMED ABDUL HAI'.
    wa_layout-zebra = 'X'.
    ENDFORM.                    " F_BUILD_LAYOUT
    *&      Form  F_BUILD_EVENTS
          text
    -->  p1        text
    <--  p2        text
    FORM F_BUILD_EVENTS .
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
       I_LIST_TYPE           = 0
    IMPORTING
       ET_EVENTS             = IT_EVENT
    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.
    SORT IT_EVENT BY NAME.
    READ TABLE it_event INTO wa_event WITH KEY NAME = 'TOP_OF_PAGE' bINARY
    SEArch.
    if sy-subrc eq 0.
    wa_event-form = 'F_TOP_OF_PAGE'.
    ENDIF.
    MODIFY IT_EVENT FROM WA_EVENT INDEX SY-TABIX TRANSPORTING FORM.
    READ TABLE IT_EVENT INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND' BINARY SEARCH.
    WA_EVENT-FORM = 'F_USER_COMMAND'.
    MODIFY IT_EVENT FROM wa_event INDEX SY-TABIX TRANSPORTING FORM.
    ENDFORM.                    " F_BUILD_EVENTS

    Hi,
    When does this runtime error occur? When displaying output (calling FM) or.....
    I copied your coding and made a few minor changes and It's working fine for my now:
    REPORT ZHAI_ALV_BLOCK_LIST.
    TYPE-POOLS:slis.
    TABLES:mara.
    DATA:BEGIN OF it_mara OCCURS 0,
    matnr LIKE mara-matnr,
    mbrsh LIKE mara-mbrsh,
    matkl LIKE mara-matkl,
    END OF it_mara.
    DATA: BEGIN OF it_desc OCCURS 0,
    matnr LIKE makt-matnr,
    maktx LIKE makt-maktx,
    END OF it_desc.
    DATA: BEGIN OF it_mard OCCURS 0,
    matnr LIKE mard-matnr,
    werks LIKE mard-werks,
    lgort LIKE mard-lgort,
    labst LIKE mard-labst,
    END OF it_mard.
    DATA: it_fcat TYPE slis_t_fieldcat_alv ,
          wa_fcat LIKE LINE OF it_fcat,
          it_fcat1 TYPE slis_t_fieldcat_alv,
          wa_fcat1 LIKE LINE OF it_fcat1,
          it_fcat2 TYPE slis_t_fieldcat_alv,
          wa_fcat2 LIKE LINE OF it_fcat2,
          wa_layout TYPE slis_layout_alv,
          it_event TYPE slis_t_event,
          wa_event LIKE LINE OF it_event,
    *      wa_layout like line of it_layout,
    v_repid LIKE sy-repid.
    SELECT-OPTIONS:so_matnr FOR mara-matnr.
    START-OF-SELECTION.
      PERFORM f_select_data.
      DEFINE add_catalogue1.
        wa_fcat-col_pos = &1.
        wa_fcat-fieldname = &2.
        wa_fcat-tabname = &3.
        wa_fcat-emphasize = &4.
        wa_fcat-ref_tabname = &5.
        append wa_fcat to it_fcat.
      END-OF-DEFINITION.
      DEFINE add_catalogue2.
        wa_fcat1-col_pos = &1.
        wa_fcat1-fieldname = &2.
        wa_fcat1-tabname = &3.
        wa_fcat1-emphasize = &4.
        wa_fcat1-ref_tabname = &5.
        append wa_fcat1 to it_fcat1.
      END-OF-DEFINITION.
      DEFINE add_catalogue3.
        wa_fcat2-col_pos = &1.
        wa_fcat2-fieldname = &2.
        wa_fcat2-tabname = &3.
        wa_fcat2-emphasize = &4.
        wa_fcat2-ref_tabname = &5.
        append wa_fcat2 to it_fcat2.
      END-OF-DEFINITION.
      PERFORM f_build_fcat.
      PERFORM f_build_fcat1.
      PERFORM f_build_fcat2.
      PERFORM f_build_layout.
      PERFORM f_build_events.
      PERFORM f_bloc_display.
    *& Form f_select_data
    FORM f_select_data .
      SELECT matnr
      mbrsh
      matkl
      FROM mara INTO TABLE it_mara WHERE matnr
      IN so_matnr.
      IF it_mara[] IS NOT INITIAL.
        SELECT matnr
        maktx
        FROM makt
        INTO TABLE it_desc
        FOR ALL ENTRIES IN it_mara
        WHERE matnr EQ it_mara-matnr.
      ENDIF.
      IF it_desc[] IS NOT INITIAL.
        SELECT matnr
        werks
        lgort
        labst
        FROM mard
        INTO TABLE it_mard
        FOR ALL ENTRIES IN it_desc
        WHERE matnr EQ it_desc-matnr.
      ENDIF.
    ENDFORM. " f_select_data
    *& Form f_build_fcat
    FORM f_build_fcat .
      add_catalogue2:
      '1' 'MATNR' 'IT_MARA' 'C500' 'MARA',
      '2' 'MBRSH' 'IT_MARA' 'C600' 'MARA',
      '3' 'MATKL' 'IT_MARA' 'C300' 'MARA'.
    ENDFORM. " f_build_fcat
    **& Form f_build_fcat1
    FORM f_build_fcat1 .
      add_catalogue1:
      '1' 'MATNR' 'IT_DESC' 'C500' 'MAKT',
      '2' 'MAKTX' 'IT_DESC' 'C600' 'MAKT'.
    ENDFORM. " f_build_fcat1
    *& Form f_build_fcat2
    FORM f_build_fcat2.
      add_catalogue3:
      '1' 'MATNR' 'IT_MARD' 'C500' 'MARD',
      '2' 'WERKS' 'IT_MARD' 'C600' 'MARD',
      '3' 'LGORT' 'IT_MARD' 'C200' 'MARD',
      '4' 'LABST' 'IT_MARD' 'C300' 'MARD'.
    ENDFORM. " f_build_fcat2
    *& Form F_BLOC_DISPLAY
    * text
    FORM f_bloc_display .
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
        EXPORTING
          i_callback_program = sy-repid.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
      is_layout = wa_layout
      it_fieldcat = it_fcat1
      i_tabname = 'IT_MARA'
      it_events = it_event
    *IT_SORT =
    *I_TEXT =
      TABLES
      t_outtab = it_mara
      EXCEPTIONS
      program_error = 1
      maximum_of_appends_reached = 2
      OTHERS = 3
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
      is_layout = wa_layout
      it_fieldcat = it_fcat1
      i_tabname = 'IT_DESC'
      it_events = it_event
    *IT_SORT =
    *I_TEXT =
      TABLES
      t_outtab = it_desc
      EXCEPTIONS
      program_error = 1
      maximum_of_appends_reached = 2
      OTHERS = 3
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
      is_layout = wa_layout
      it_fieldcat = it_fcat2
      i_tabname = 'IT_MARD'
      it_events = it_event
    *IT_SORT =
    *I_TEXT = ' '
      TABLES
      t_outtab = it_mard
      EXCEPTIONS
      program_error = 1
      maximum_of_appends_reached = 2
      OTHERS = 3
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM. " F_BLOC_DISPLAY
    *& Form F_BUILD_LAYOUT
    FORM f_build_layout .
      wa_layout-edit = 'X'.
      wa_layout-window_titlebar = 'MOHAMMED ABDUL HAI'.
      wa_layout-zebra = 'X'.
    ENDFORM. " F_BUILD_LAYOUT
    *& Form F_BUILD_EVENTS
    FORM f_build_events .
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        IMPORTING
          et_events       = it_event
        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.
      SORT it_event BY name.
    READ TABLE it_event INTO wa_event WITH KEY name = 'TOP_OF_PAGE' BINARY
    SEARCH.
      IF sy-subrc EQ 0.
        wa_event-form = 'F_TOP_OF_PAGE'.
      ENDIF.
      MODIFY it_event FROM wa_event INDEX sy-tabix TRANSPORTING form.
    READ TABLE it_event INTO wa_event WITH KEY name = 'USER_COMMAND' BINARY
    SEARCH.
      wa_event-form = 'F_USER_COMMAND'.
      MODIFY it_event FROM wa_event INDEX sy-tabix TRANSPORTING form.
    ENDFORM. " F_BUILD_EVENTS

  • Error in Moving values to field symbols. - CX_SY_CONVERSION_NO_NUMBER

    Hi Friends,
    I have asigned the component 'ICON' to the field symbol . While i am adding the value to the field symbol it is going for Dump.
    Erro Message :
    Unable to interpret "@08\QGreen Light; Go; Okay@ " as a number.
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_CONVERSION_NO_NUMBER', was not
         caught and
        therefore caused a runtime error.
        The reason for the exception is:
        The program attempted to interpret the value "@08\QGreen Light; Go; Okay@ " as
         a number, but
        since the value contravenes the rules for correct number formats,
        this was not possible.
    Code :
      ASSIGN COMPONENT 'ICON' OF STRUCTURE <line> TO <fs_icon>.
      add wa_result-icon to <fs_icon>.
    Please find the information and i waiting for your valuable anwers.
    Thanks,
    Shankara Narayan

    HI,
    What do you mean by adding the value?
    Do you want to move the value of wa_result-icon to the field-symbols <fs_icon>.
    use move statement or use '=' operator.
    ADD will try to do an addition.
    You cannot add character fields. It will surely give a dump.
    Do as follows:-
    Move wa_result-icon to <fs_icon>.
    Regards,
    Ankur Parab

  • Regarding error "Field symbol is not assigned." during print preview

    Hi experts,
        I am getting dump while trying print preview for particular POs in ME23n transaction(ECC 6.0). Please refer the below dump error:
    Runtime Errors         GETWA_NOT_ASSIGNED_RANGE
    Date and Time          29.09.2009 19:30:39
    Short dump has not been completely stored (too big)
    Short text
         Field symbol is not assigned.
    What happened?
         Error in the ABAP Application Program
         The current ABAP program "SAPLSTXC" had to be terminated because it has
         come across a statement that unfortunately cannot be executed.
    What can you do?
         Note down which actions and inputs caused the error.
         To process the problem further, contact you SAP system
         administrator.
         Using Transaction ST22 for ABAP Dump Analysis, you can look
         at and manage termination messages, and you can also
         keep them for a long time.
    Error analysis
         A field symbol that was not assigned was accessed
         (data segment no. 32769).
        The field symbol is no longer assigned because there was an attempt
        makde previously in a Unicode program to set the field symbol using
        ASSIGN with offset and/or length specification. Here, the memory
        addressed by the offset/length specification was not within the
        allowed area.
    How to correct the error
        If the error occures in a non-modified SAP program, you may be able to
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the following
        keywords:
        "GETWA_NOT_ASSIGNED_RANGE" " "
        "SAPLSTXC" or "LSTXCFFT"
        "FT_COMPOSE"
        If you cannot solve the problem yourself and want to send an error
        notification to SAP, include the following information:
        1. The description of the current problem (short dump)
           To save the description, choose "System->List->Save->Local File
        (Unconverted)".
       2. Corresponding system log
          Display the system log by calling transaction SM21.
          Restrict the time interval to 10 minutes before and five minutes
       after the short dump. Then choose "System->List->Save->Local File
       (Unconverted)".
       3. If the problem occurs in a problem of your own or a modified SAP
       program: The source code of the program
          In the editor, choose "Utilities->More
       Utilities->Upload/Download->Download".
       4. Details about the conditions under which the error occurred or which
       actions and input led to the error.
    I am getting this dump only for few POs.. Rest of the POs are able to print. I am not able to find notes for this issue. Is there any SAP notes available for that  or Is there any configuration issue related to this?
    Please provide solution for thsi as soon as possible.
    Thanks and Regards 
    Subbu

    A field symbol is not assigned, but thats what the dump is telling you. Mostly this happens, when fields or function modules are stored by name, like the fieldnames in the fieldcatalog in an ALV report. It a field referenced in such a way does not exist you will get this error. Always store fieldnames and function names in capital letters and check mistyping of 1L 8B and so on.

  • Get_static_attributes_table: Field symbol error

    Hi,
    I'm trying to build a dynamic context node, edit the data and save the changes.  Referring the link " http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/80a3de18-ee00-2d10-bfb3-946d7e00fd91 " which has similar solution.
    But I'm facing the problem in on_data_check method in the call statement of get_static_attributes_table.
    DATA : LO_ND_PROJECTS TYPE REF TO IF_WD_CONTEXT_NODE,
                 LO_EL_PROJECTS TYPE REF TO IF_WD_CONTEXT_ELEMENT.
    FIELD-SYMBOLS : <FS_CONTEXT> TYPE STANDARD TABLE.
      LO_ND_PROJECTS = WD_CONTEXT->GET_CHILD_NODE( NAME = 'NEW_NODE' ).
      LO_EL_PROJECTS = LO_ND_PROJECTS->GET_ELEMENT( ).
    CALL METHOD LO_ND_PROJECTS->GET_STATIC_ATTRIBUTES_TABLE
      IMPORTING
      TABLE = <FS_CONTEXT>.
    When executing the application, I'm getting the error "Field symbol has not yet been assigned. "
    Any pointers to resolve this?

    data : wa_param like line of r_param->t_modified_cells.
    data : lo_nd_projects type ref to if_wd_context_node,
    lo_el_projects type ref to if_wd_context_element.
    field-symbols : <fs_context> type standard table,
    <fs_context2> type any,
    <fs_variable2> type any,
    <fs_variable> type any.
    lo_nd_projects = wd_context->get_child_node( name =
    'NEW_NODE' ).
    lo_el_projects = lo_nd_projects->get_element( ).
    data : lt_dyn_table type ref to data,
    lt_fieldcat type lvc_t_fcat,
    lw_fieldcat like line of lt_fieldcat.
    clear lt_fieldcat.
    lw_fieldcat-fieldname = 'FLD1'.
    lw_fieldcat-datatype = 'string'.
    lw_fieldcat-outputlen = '24'.
    lw_fieldcat-coltext = 'FLD1'.
    lw_fieldcat-seltext = lw_fieldcat-coltext.
    append lw_fieldcat to lt_fieldcat.
    lw_fieldcat-fieldname = 'FLD2'.
    lw_fieldcat-datatype = 'string'.
    lw_fieldcat-outputlen = '24'.
    lw_fieldcat-coltext = 'FLD2'.
    lw_fieldcat-seltext = lw_fieldcat-coltext.
    append lw_fieldcat to lt_fieldcat.
    call method cl_alv_table_create=>create_dynamic_table
    exporting
    it_fieldcatalog = lt_fieldcat
    importing
    ep_table = lt_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.
    assign lt_dyn_table->* to <fs_context>.
    call method lo_nd_projects->get_static_attributes_table
    importing
    table = <fs_context>.
    loop at r_param->t_modified_cells into wa_param.
    *Loop at changed entries and modify them in the dynamic internal table
    read table <fs_context> index wa_param-index into <fs_context2>.
    assign component wa_param-attribute of structure <fs_context2> to <fs_variable>.
    assign wa_param-r_value->* to <fs_variable2>.
    move <fs_variable2> to <fs_variable>.
    Using Dynamic ALV with Web Dynpro ABAP with Editable Fields
    Endloop.
    lo_nd_projects = wd_context->get_child_node( name = u2018NEW_NODEu2019 ).
    lo_el_projects = lo_nd_projects->get_element( ).
    lo_nd_projects->bind_table( <fs_context> ).

  • BADI Implementation field symbol error in code...

    Hi,
    My requirement is to provide barcode for a particular equipment in trasaction IE06. I've implemented badi for that too.
    But the problem is when pressing the print barcode button its gives barcode for all equipments rather than giving for particular one.
    I think issue is in the code ..here in code field symbol is used for processing the selected equipment buut its not working..
    the code is as follows..
    METHOD if_ex_badi_eam_list_fcode~execute_function_code.
      BREAK-POINT.
      CONSTANTS: lc_formname TYPE fpname VALUE 'Z_BARCODE_PRINT_FORM',
                 lc_cat TYPE char2 VALUE 'EQ'.
      CONSTANTS: lc_formname1 TYPE fpname VALUE 'Z_BARCODE_PRINT_FUNCTIONAL_LOC',
               lc_cat1 TYPE char2 VALUE 'FL'.
      DATA: lv_fname TYPE funcname,
            lv_equip TYPE string,
            lv_outparamas TYPE sfpoutputparams,
            lw_objects TYPE rihequi_list,
            LW_OBJECTS1 TYPE  RIHIFLO_LIST.
    *  DATA: ls_objects type REF TO ANY." TABLE."RIHEQUI_LIST.
      FIELD-SYMBOLS <ls_objects> TYPE ANY.
      IF sy-tcode EQ 'IE06'.
    *    lc_formname = 'Z_BARCODE_PRINT_FORM'.
        CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
          EXPORTING
            i_name     = lc_formname
          IMPORTING
            e_funcname = lv_fname.
        CALL FUNCTION 'FP_JOB_OPEN'
          CHANGING
            ie_outputparams = lv_outparamas
          EXCEPTIONS
            cancel          = 1
            usage_error     = 2
            system_error    = 3
            internal_error  = 4
            OTHERS          = 5.
        IF sy-subrc <> 0.
          MESSAGE 'An error occured in processing the background job' TYPE 'E'.
          EXIT.
        ENDIF.
        LOOP AT it_selected_objects INTO lw_objects.
          lv_equip = lw_objects-equnr.
          CALL FUNCTION lv_fname
            EXPORTING
    *   /1BCDWB/DOCPARAMS        =
              item_no                  = lv_equip
              item_cat                 = lc_cat
    * IMPORTING
    *   /1BCDWB/FORMOUTPUT       =
    * EXCEPTIONS
    *   USAGE_ERROR              = 1
    *   SYSTEM_ERROR             = 2
    *   INTERNAL_ERROR           = 3
    *   OTHERS                   = 4
          IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    *      ENDIF.
          CLEAR: lv_equip,lw_objects.
          UNASSIGN <ls_objects>.
        ENDLOOP.
        CALL FUNCTION 'FP_JOB_CLOSE'
    * IMPORTING
    *   E_RESULT             =
    * EXCEPTIONS
    *   USAGE_ERROR          = 1
    *   SYSTEM_ERROR         = 2
    *   INTERNAL_ERROR       = 3
    *   OTHERS               = 4
        IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    Please Help....

    Hi Akshay,
    1. It is not a standard program, it is a custom one.
    2. Try to fix the bug such that field symbol gets assigned.
    3. Place the necessary checks before trying to read the field-symbol, i.e. IF <FIELD> IS ASSIGNED. ... ENDIF.
    Cheers,
    Aabhas

  • Error in drill down of  RRI-  Field Symbol not assigned

    Dear all,
    I am trying to call a SAP transaction on click of the jump target. I have created the jump target in the following way ..let me know if I am wrong ..
    Goto RBBS transaction . Specifed the sender report as 0SD_C01/0SD_C01_Q025 (Sales Volume Analysis) and target as r/3 client 210 and specifed the transaction Va01 as target.
    But when I executed the report and did a right click ..on the context menu I coudl see the desription of the Jump target I have created and upon clicking I received a error ..field symbol not assigned ..
    Can any let me know the cause of the error ..and how to resolve.. do i need to give any extra parameters while creating jump target..
    Thanks,
    Gupta

    Hello Gayathri,
    One you got the dump you can select debugger button in top-left corner screen.
    That will take you to the execution snap shot where you can check all the field symbols and find out which one is not
    assigned. accordingly you can find out what is missing on input side to avoid this dump.
    Hope this helps!
    Thanks,
    Augustin.

  • In getting error in field symbols

    your attempted to assign a field to a type filed symbols but the field dose not have the required type.
    iam getting runtimes error like this what should i do for this.
    regards,
    sivakumar

    Hi,
    Do not assign any particular data type to your field symbol definition.
    field-symbols: <fs> type any.
    assign p_matnr to <fs>.
    assign sy-datum to <fs>.
    regards
    Subramanian

  • Wat is the use of casting in field symbols

    wat is the use of casting in field symbols?

    When you assign a data object to a field symbol, you can cast to any data type. This means that any area of memory can be viewed as having assumed a given type. You can then address parts of fields symbolically without having to use offset/length addressing.
    A cast is performed using the CASTINGaddition of the ASSIGN statement. The CASTINGaddition allows you to assign a data object to a field symbol where the type of the data object is incompatible with that of the field symbol. There are two types of casting: casting with an implicit type declaration and casting with an explicit type declaration.
    For details please have a look at below link:
    [Casting|http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb3930358411d1829f0000e829fbfe/frameset.htm]
    I hope it helps.
    Thanks,
    Vibha
    Please mark all the useful answers

  • Field Symbol error in program SAPMZF01

    Hi All,
    I am doing upgrade from R/3 Enterprise to ECC 6.0. When i do the EPC for the standard program SAPMZF01, in the section "Field Attributes" i get following error:
    *Program: SAPMZF01   Include: MZF01TOP     Row:  468
    Fieldsymbol <FIELD> is not assigned to a field
    (This message can be hidden with "#EC  )
    Is it ok to comment the field symbol, or is there any other way to solve this error.
    Thanking you in advance
    Best Regards
    Akshay

    Hi Akshay,
    1. It is not a standard program, it is a custom one.
    2. Try to fix the bug such that field symbol gets assigned.
    3. Place the necessary checks before trying to read the field-symbol, i.e. IF <FIELD> IS ASSIGNED. ... ENDIF.
    Cheers,
    Aabhas

  • Field Symbol not assigned Error SAP R3 46c

    Good day,
    so what i want is:
    assigning a component of a field symbol to another field-symbol to access its values.
    This works very well in SAP 47 releases but doesn t work in sap 46c or do i do something wrong?
    REPORT Z_GL_FIELDSYMBOLS .
    Data:
    begin of mytest,
      int type i,
      int2 type i,
    end of mytest,
    l type string.
    Field-Symbols: <f> type any,
                   <g> type any.
    Start-of-selection.
    assign mytest to <f>.
    l = '<f>-int'.
    assign (l) to <g>.
    <g> = '1'.
    write :/ <g>.
    end-of-selection.
    Is there any way to do what i want to do apart from the statement "CREATE SUBROUTINE POOL"?

    the only problem is:
    i know the components of the structure only at runtime, i.e.
    i don´t know if my field 'int' exists. perhaps its name is 'intsomewhat', you know?
    so i have to do a dynamic assign...
    You have to know,
    in my actual coding i assigned a reference to a data object to the field symbol..
    thus,
    something like
    assign dref->* to <fs>
    was done.
    now i want to access single components of the field symbol.
    the name of the components are known and are stored in a string.
    hmmmm.
    so the string contains something like '-MATNR'.
    if i assign this string to a field-symbol nothing happens
    in my system.
    the same coding works without an error in a 47 system.
    Message was edited by: Gideon Lenz

  • Runtime error "field symbol not assigned"

    hi friends i have designed a report in alv form. and there is one runtime error afer user selectin screen.
    "field symbol has not been yet assigned"
    what could be the problem

    Please check the field catalog you have created
    ls_fieldcatalog-tabname = 'GT_FINAL'.
      ls_fieldcatalog-fieldname ='PSPNR'.
    *  ls_fieldcatalog-coltext = text-001.
      ls_fieldcatalog-col_pos = 1.
    *  ls_fieldcatalog-do_sum = 'X'.
    *  ls_fieldcatalog-outputlen = 20.
      APPEND ls_fieldcatalog TO  gt_fieldcatalog.
      CLEAR ls_fieldcatalog.
    or if you are using filed symbols than
    ASSIGN COMPONENT 'GTFINAL' OF STRUCTURE gt_final
    thanks

Maybe you are looking for