Field Symbol -  Assign type conflict.

Hi, i active successfully my program. This is the code:
DATA ls_g_oref_appl(21) TYPE C.
FIELD-SYMBOLS: <fs_appl> TYPE REF TO cl_ftr_mj_appl.
ls_g_oref_appl = '(SAPLTB4E)g_oref_appl'.
ASSIGN (ls_g_oref_appl) TO <fs_appl>.
But when i execute it, i get a dump with this message:
"ASSIGN_TYPE_CONFLICT : You attempted to assign a field to a typed field symbol,but the field does not have the required type. "
Also, i get sy-subrc = 0, so the field symbol <fs_appl> has a value assign.
Any suggestions? I tried by changing the type of the field to ANY, but it didnt compile.
Thanks for the help,
Karla

Hi Daniel, I verified again the type of  g_oref_appl, and it is :  cl_ftr_mj_appl.  I check the top of the include and g_oref_appl is there :
' DATA g_oref_appl TYPE REF TO cl_ftr_mj_appl.  '
Hi, Naren, also i tried with the TYPE ANY, but it doesnt compile.
I notice this:
  CLASS cl_ftr_mj_appl DEFINITION ABSTRACT.
Is there a problem with field symbols and abstracts class???
Thanks for all your help,
Karla.
Edited by: Karla Tinoco on Mar 5, 2008 11:46 PM

Similar Messages

  • Field Symbols Assign Type Conflict

    Hi,
        I am working on a BAdi Implementation and have the following code.
    <b>method IF_EX_DPR_ATTRIBUTES~SET_DEFAULTS_UPON_CREATION .
      FIELD-SYMBOLS:
        <ls_attributes> TYPE dpr_ts_project_ext.
      ASSIGN cs_attributes TO <ls_attributes>  .
      CASE flt_val.
        WHEN cl_dpr_co=>sc_ot_project.
          <ls_attributes>-extended_attributes-ZZSOL_PRJ_ID = 'C0001'.
      ENDCASE.
    ENDMETHOD.</b>
    This is the sample implementation code provided by SAP. However, when I implement the above code, the system dumps at the statement
    <i>  ASSIGN cs_attributes TO <ls_attributes> .</i>
    and cs_attributes is of type any.
    I tried the same code by adding "CASTING" at the end of above line. But, it still gives the dump. Below, is the dump message.
    Note
    The following error text was processed in the system BS3 : Error in ASSIGN in the program ZCL_IM_DPR_ATTRIBUTES=========CP .
    The error occurred on the application server acequad_BS3_30 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Form: IF_EX_DPR_ATTRIBUTES~SET_DEFAULTS_UPON_CREATION of program ZCL_IM_DPR_ATTRIBUTES=========CP
    Form: IF_EX_DPR_ATTRIBUTES~SET_DEFAULTS_UPON_CREATION of program CL_EX_DPR_ATTRIBUTES==========CP
    Form: ATTRIBUTES_DEFLTS_UPON_ACTION of program CL_DPR_BADI_SERVICES==========CP
    Form: ATTRIBUTES_DEFAULTS_UPON_CREA of program CL_DPR_BADI_SERVICES==========CP
    Form: SET_DEFAULTS_UPON_CREATION of program CL_DPR_PROJECT================CP
    Form: SET_DEFAULTS_UPON_CREATION of program CL_DPR_PROJECT_O==============CP
    Form: CONSTRUCTOR of program CL_DPR_PROJECT_O==============CP
    Form: IF_DPR_APPL_OBJECT_FACTORY~CREATE_PROJECT of program CL_DPR_APPL_OBJECT_FACTORY====CP
    Form: CREATE of program CL_DPR_BSP_APPLICATION========CP
    Form: DO_HANDLE_EVENT of program CL_DPR_BSP_C_TOOLS============CP
    Any ideas on how to use field symbols in the above context??
    Thanks,
    Rajesh

    Hi Rajesh,
    The reason it is dumping is because the actually type of the variable passed in CS_ATTRIBUTES is not fixed this is why they have specified it's type as type any.
    The sample code in this regard is not correct, you should fist check the value of FLT_VAL to determine what type of variable CS_ATTRIBUTES actually is.
    In the BADI documentation there is a list of values for field FLT_VALUE and the corresponding data type of CS_ATTRIBUTES for that value (According to the documentation the data type for FLT_VAL sc_ot_project is DPR_TS_PROJECT_INT).
    method IF_EX_DPR_ATTRIBUTES~SET_DEFAULTS_UPON_CREATION .
    FIELD-SYMBOLS:
    <ls_attributes> TYPE dpr_ts_project_int.
    <i><b>* ASSIGN cs_attributes TO <ls_attributes> .</b></i>
    CASE flt_val.
    WHEN cl_dpr_co=>sc_ot_project.
      <i><b>ASSIGN cs_attributes TO <ls_attributes> .</b></i>
      <ls_attributes>-extended_attributes-ZZSOL_PRJ_ID
                = 'C0001'.
    ENDCASE.
    ENDMETHOD.
    In this example you will ultimately end up with multiple field symbols for representing the CS_ATTRIBUTES parameter, one field symbol for each filter value you intend handling.
    From
      De Wildt

  • Assign Type conflict with field symbols

    I have two tables tab1 & tab2, want to assign field values from tab1 to tab2 suing field symbols. Deatils are :
    TYPES: BEGIN OF ty_tab1,
        item1   TYPE char20,
        item2   TYPE char20,
        val1 type i,
        val2 type i,
    END OF ty_tab1,
    BEGIN OF ty_tab2,
        item1 TYPE char20,
        item2 TYPE char20,
    END OF ty_tab2.
    DATA: it_tab1 TYPE TABLE OF ty_tab1,
                it_tab2 TYPE TABLE OF ty_tab2.
      FIELD-SYMBOLS <fs_tab1> TYPE ty_tab1.
                     <fs_tab2t> type ty_tab2.
      LOOP AT it_tab1 assigning <fs_tab1>.
        READ TABLE it_tab2  assigning <fs_tab2> WITH KEY item1 = <fs_tab1>-item1
                                                                                    item2 = <fs_tab1>-item2.
        IF sy-subrc EQ 0.
          ASSIGN COMPONENT 'ITEM1' OF STRUCTURE <fs_tab1> TO <fs_tab2>.
         ASSIGN COMPONENT 'ITEM2' OF STRUCTURE <fs_tab1> TO <fs_tab2>.
        endif.
    endloop.
    Getting error msg
    You attempted to assign a field to a typed field symbol, but the field does not have the required type.         
    whats the reason of error.
    Edited by: Matt on May 27, 2011 8:59 AM - added  tags

    Taken from example dump
    A new value is to be assigned to the field "...", although this field is
    entirely or partly protected against changes.
    The following are protected against changes:
    - Character literals or numeric literals
    - Constants (CONSTANTS)
    - Parameters of the category IMPORTING REFERENCE for functions and
    methods
    - Untyped field symbols not yet assigned a field using ASSIGN
    - TABLES parameters if the actual parameter is protected against changes
    - USING reference parameters and CHANGING parameters for FORMs, if the
    actual parameter is protected against changes and
    - Accesses using field symbols if the field assigned using ASSIGN is
    protected (or partially protected, e.g. key components of an internal
    table with the type SORTED or HASHED TABLE) against changes
    - Accesses using references, if the field bound to the reference is
    protected (or partially protected) against changes
    - External write accesses to READ-ONLY attributes,
    - Content of a shared object area instance accessed using a shared lock
    (ATTACH_FOR_READ).
    You likely fall in one of these cases. Check each and if still unsure please share your code so we can reproduce the error.
    Regards
    Marcin

  • Problem with slis_t_specialcol_alv Field Symbol Assignment

    I have created a dynamic internal table (runtime determined number of columns) to contain data to be displayed in an ALV. I’ve also made ensured that the last column of the dynamic itab is of type <b>'slis_t_specialcol_alv'</b> and named <b>‘CINFO’</b> to contain color information for that particular row. In the code below the dynamic itab is pointed to by field symbol <dyn_table> while the work area for it would be <dyn_wa>.
    Somewhere down the line I attempt to assign the ‘CINFO’ component of the current row of the itab to a field symbol called <fs_cinfo> typed as ‘slist_t_specialcol_alv’ (Same as CINFO).
    I used the code:
    ASSIGN COMPONENT 'CINFO' OF STRUCTURE <dyn_wa> TO <fs_cinfo>.
    This gives me the runtime error:
    <i>Type conflict in the ASSIGN statement in the program "ZHRR001_TEMMATRIX".
    You attempted to assign a field to a typed field symbol,
    but the field does not have the required type.    </i>     
    I am unsure why this happens as both the component CINFO and FS <fs_cinfo> are of type slist_t_specialcol_alv.
    For some odd reason though during debugging, I took a look at the <dyn_wa> structure and the component type of CINFO was displayed as “C”???
    Here is the relevant portion of code (creation of dynamic itab and attempting to assign <fs_cinfo>)
    FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
                   <dyn_wa>.
    FIELD-SYMBOLS: <fs_cinfo> TYPE slist_t_specialcol_alv.
    DATA: lw_cinfo TYPE slis_specialcol_alv.
    DATA:          li_fldcat TYPE lvc_t_fcat,
                   lw_fldcat TYPE lvc_s_fcat.
    *Create internal table fields (they will be called Field1, Field2, etc)
    *Last column will be named 'CINFO' to contain row color information
    DO l_alvcolumncount TIMES.
      index = sy-index.
      IF index <> l_alvcolumncount.
        CLEAR lw_fldcat.
        CONCATENATE 'Field' index INTO lw_fldcat-fieldname .
        CONDENSE lw_fldcat-fieldname NO-GAPS.
        lw_fldcat-datatype = 'STRING'.
    *    lw_fldcat-intlen = 5.
        APPEND lw_fldcat TO li_fldcat .
      ELSE.
        CLEAR lw_fldcat.
        lw_fldcat-fieldname = 'CINFO'.
        CONDENSE lw_fldcat-fieldname NO-GAPS.
        lw_fldcat-datatype = 'slis_t_specialcol_alv'.
        APPEND lw_fldcat TO li_fldcat.
      ENDIF.
    ENDDO.
    * Create dynamic internal table and assign to FS
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog = li_fldcat
      IMPORTING
        ep_table        = new_table.
    ASSIGN new_table->* TO <dyn_table>.
    *Create dynamic work area and assign to FS
    CREATE DATA new_line LIKE LINE OF <dyn_table>.
    ASSIGN new_line->* TO <dyn_wa>.
      ASSIGN COMPONENT 'CINFO' OF STRUCTURE <dyn_wa> TO <fs_cinfo>.
    * Color this cell
      lw_cinfo-fieldname = fieldname.
      lw_cinfo-color-col = 6.
      APPEND lw_cinfo TO <fs_cinfo>.
    Message was edited by: Sow Yong Wong

    Hello Sow
    There is a big problem in the program: you are mixing types used for FM-based ALV (SLIS_...) and ABAP-OO based ALV (LVC_...).
    For ABAP-OO based row colouring you have to define your itab like this:
    TYPES: ty_s_outtab.
      INCLUDE TYPE kna1. " just an example
    TYPES: rowcolor(4)  TYPE c.
    TYPES: END OF ty_s_outtab.
    TYPES: ty_t_outtab TYPE STANDARD TABLE of ty_s_outtab
                       WITH DEFAULT KEY.
    In the layout (LVC_S_LAYO) you have to set <b>ls_layout-info_fname = 'ROWCOLOR'</b>.
    ROWCOLOR has to be filled according to <b>Cxyz</b> whereas
    - x = color
    - y = inverse on/off
    - z = intensified on/off
    For documentation please refer to <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907">An Easy Reference to ALV Grid Control</a>
    Regards
      Uwe

  • DATA_OFFSET_TOO_LARGE dump for field symbol assignment/offset

    Hi,
    I am getting a DATA_OFFSET_TOO_LARGE dump for field symbol assignment/offset.
    Dump says, 'In the running program "ZTEST", the field "<WA_FINAL>" of the type "u" and length 2174 was to be accessed with the offset 2204. However, subfield accesses with an offset specification that is not smaller than the field length are not permitted.'
    Here <WA_FINAL> have to be 'TYPE any' to avoid assignment conflicts later in the logic.
    It's basically dumping at <WA_FINAL>+V_LEN(V_OFF) = WA_DATA-FIELD1.
    Here V_LEN LIKE DD03L-LENG & V_OFF LIKE DD03L-LENG.
    Please suggest how to get rid of this dump.
    Regards,
    Ritesh.

    The dump is very clear, your field is smaller than the offset.
    The problem is most likely how you are calculating v_len and v_off.
    You could change that, but there is probably an easier and faster way to do what you are trying there. Is <wa_final> something like a line from a file or what?

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

  • Error in Field symbol assignment

    What is wrong in following code ???
    At line --> (Bold) I am gettin sy-subrc 4.
    field-symbols: <F> type any,
                         <FSVALUE> type any.
        SPLIT P_QUOTATION_TEXT-TEXT_LINE AT CRLF INTO TABLE I_SPLIT.
        IF NOT I_SPLIT[] IS INITIAL.
          LOOP AT I_SPLIT ASSIGNING <F>.
    -->      ASSIGN COMPONENT SY-TABIX OF STRUCTURE <F> TO <FSVALUE>.
            IF SY-SUBRC = 0.
              WA_TEXT-ITM_NUMBER = P_QUOTATION_TEXT-ITM_NUMBER.
              WA_TEXT-TEXT_ID = C_HEADERTEXT.
              WA_TEXT-LANGU  =  'EN'.
              WA_TEXT-FORMAT_COL = '*'.
              WA_TEXT-TEXT_LINE = <FSVALUE>.
              APPEND WA_TEXT TO I_TEXT.
              CLEAR WA_TEXT.
            ENDIF.
          ENDLOOP.

    I'll try to get clearer
    SPLIT P_QUOTATION_TEXT-TEXT_LINE AT CRLF INTO TABLE I_SPLIT.
    You are splitting at CRLF, fine. I_split has only one field or none if you want to get more thecnical.
    LOOP AT I_SPLIT ASSIGNING <F>.
    Here you are starting to loop at each entry of i_split, assigning each entry to , again only one field
    ASSIGN COMPONENT SY-TABIX OF STRUCTURE <F> TO <FSVALUE>.
    Again, this will never work because as you are declaring it i_split doesn't have an structure, also  doesn´t have an structure only one field
    It doesn't make any sense that you are assigning the same field to another field-symbol when you already have one.
    And even if you used the type I told you, it would only work in the first pass because only in the first pass you can assign the component 1 of the structure because the structure only has one field, there would not be any component 2,3... etc.
    Again I don't understand what you are trying to do, if you want to assign that loop pass text to a table, just pass the field-symbol you already have

  • 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

  • Field Symbol Assignment

    Hi,
    I have a doubt regarding the field symbol assignment.
    In my program, I have logic as below.
    <b>  W_1STCNTFLD = 'E_INV_AGING_STRU-PDISCCNTP1'.
      W_2NDCNTFLD = 'E_INV_AGING_STRU-PDISCCNTP2'.
      ASSIGN (W_1STCNTFLD) TO <FS1>.
      ASSIGN (W_2NDCNTFLD) TO <FS2>.</b>
    While debugging, when I see the values of the Field Symbols <b><FS1></b> and <b><FS2></b> after assignment, they are <b>0, 0</b>. Why is it like that..?
    In general, what does a Field Symbol hold..? the value of the variable being assigned or the Memory location of that variable..?
    When I remove the paranthesis while assigning like below,
      <b>ASSIGN W_1STCNTFLD TO <FS1>.</b>
    it is storing the value of the variable(<b>E_INV_AGING_STRU-PDISCCNTP1</b>) to <b><FS1></b> instead of '0'.
    And what is the difference between   <b>ASSIGN (W_1STCNTFLD) TO <FS1></b> and   <b>ASSIGN W_1STCNTFLD TO <FS1></b>..? I mean, when we put paranthesis to the variable and when we remove the paranthesis.
    Please clarify my doubts. Thanks in advance.
    Thanks & Regards,
    Paddu.

    when you use the paranthesis,(W_1STCNTFLD) actually equals to ('E_INV_AGING_STRU-PDISCCNTP1'),and the 'E_INV_AGING_STRU-PDISCCNTP1' must be the label of a data object,it can't be a string!
    please refer to the following document(coming from sap abap keywords document):
    Alternative 2
    ... [TABLE FIELD] (name)
    Alternative 3
    ... oref->(attr_name)
    Alternative 4
    ... {class|(class_name)}=>{attr|(attr_name)}
    Effect
    There are three dynamic variants for mem_area, where the storage area is not specified directly, but as the content of character/type data objects enclosed within parentheses.
    In the first variant (name), the label in name is built exacltly like the direct specification. When the statement is executed, the content of name must be the label of a data object that can contain offset/length specifications, strucuture component selectors, and component selectors for the assignment of attributes in classes or objects (since Release 6.10). The content of name must be specified in uppercase letters.
    The optional addition TABLE FIELD before (name) is only possible outside of classes. This addition limits the search area - where the data object specified in (name) is searched for (see below) - to the interface work areas for the current program group declared using TABLES. If TABLE FIELD is specified, casting_spec and range_spec cannot be specified explicitly.
    If the label in name is a field symbol or a form parameter with an unstructured type, components can be addressed, as of Release 6.10, through structure component selectors. The components must exist when the statement is executed.
    The second variant oref->(attr_name) is a special case of the first variant for the assignment of an instance attribute to a field symbol - where the object reference variable oref is specified statically. The label of the attribute is specified dynamically in the character-type field attr_name and must not be specified in uppercase letters.
    The third variant {class|(class_name)}=>{name|(attr_name)} is a special case of the first variant for the assignment of a static attribute to a field symbol where the class name class and the name of the attribute name can be specified both directly and dynamically in character-type fields class_name or attr_name. The contents of attr_name and class_name do not have to be in uppercase letters. If the class name is specified dynamically and the attribute is specified directly, no offset/length specifications can be made for the attribute.
    If a data object is specified dynamically, this is searched for in accordance with the following hierarchy.
    Within the local data objects of the current procedure
    Within the attributes, visible in a method, of the actual class, where , in instance methods, the self reference me-> is set explicitly before the label
    Within the global data of the current program
    Within the interface work areas of the main program of the current program group declared with TABLES
    Within the attributes of the object to which oref refers, if the label has the expression oref-> (as of Release 6.10)
    Note
    Only for internal use can the label in name also have the form (PROG)DOBJ, whereby PROG is the name of an ABAP program and DOBJ is the name of a global data object of this program. If the program PROG is loaded during execution of the statement ASSIGN in the same internal mode as the current program is loaded, the data object (PROG)DOBJ in this program is searched for and the field symbol points to this data object after successful assignment.
    Example
    Dynamic access to an attribute of an object (Dynamic Access) through a field symbol.
    CLASS c1 DEFINITION.
      PUBLIC SECTION.
        METHODS m1 IMPORTING oref TYPE REF TO object
                             attr TYPE string.
    ENDCLASS.
    CLASS c1 IMPLEMENTATION.
      METHOD m1.
        FIELD-SYMBOLS <attr> TYPE ANY.
        ASSIGN oref->(attr) TO <attr>.
        WRITE <attr> ...
      ENDMETHOD.
    ENDCLASS.

  • Field symbol assign problem

    Hi ,
    Please find below code when I tried in version 4.6 code works correctly . but in 6.0 it gives short dump..
    Here.
      FIELD-SYMBOLS : <fs_table> TYPE ANY TABLE.
    FIELD-SYMBOLS : <fs_work_area> TYPE yatsdzz00.
    ASSIGN pr_data_changed->mp_mod_rows->* TO <fs_table>.
    LOOP AT <fs_table> ASSIGNING <fs_work_area>. (In there system gives short dump)
    Thanks in advance.

    Hai,
    Use CASTING or CASTING TYPE (mytype) after LOOP AT <fs_table> ASSIGNING <fs_work_area>.
    ie:
    FIELD-SYMBOLS : <fs_table> TYPE ANY TABLE.
    FIELD-SYMBOLS : <fs_work_area> TYPE yatsdzz00.
    ASSIGN pr_data_changed->mp_mod_rows->* TO <fs_table>.
    LOOP AT <fs_table> ASSIGNING <fs_work_area> <b>CASTING or CASTING TYPE (mytype).</b>
    For more information click the below link:
    http://help.sap.com/saphelp_46c/helpdata/EN/fc/eb35de358411d1829f0000e829fbfe/frameset.htm
    I hope it helps you.
    Reward points if it helps you.
    Regds,
    Rama chary.Pammi

  • Passing value from field symbol / variable type ref to data to variable

    hey ,
    DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.
      DATA: RT_CARRID TYPE REF TO DATA.
      FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE
    .* Retrieve the data from the select option
      RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_WEIGHT).
    Assign it to a field symbol
      ASSIGN RT_CARRID->* TO <FS_CARRID>.
    how can i pass RT_CARRID or <FS_CARRID> to a varible with type vbap-netgrw ( net weight ) ?
    thanks
    ASA

    >
    ASA MOKED wrote:
    > hey ,
    >
    >
    > DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.
    >   DATA: RT_CARRID TYPE REF TO DATA.
    >   FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE

    > .* Retrieve the data from the select option
    >   RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_WEIGHT).
    > * Assign it to a field symbol
    >   ASSIGN RT_CARRID->* TO <FS_CARRID>.
    create a work area of type <FS_CARRID>.
    field-symbol: <fs_wa> type line of <FS_CARRID>.
    loop at <FS_CARRID> into <fs_wa>.
    lv_netgr = <fs_wa>-netgr.

  • Dynamic Field-Symbol assignment - Short Dump

    Create three programs as mentioned:
    REPORT  zforms.
    *&      Form  form_fs_assign
    *       text
    FORM form_fs_assign.
      FIELD-SYMBOLS <fs> TYPE table.
      DATA: fs_itab LIKE STANDARD TABLE OF tab_matnr WITH HEADER LINE.
      break-point.
      ASSIGN ('(ZPROGRAM1)ITAB[]') TO <fs>.
      IF sy-subrc EQ 0.
        fs_itab[] = <fs>[].
        LOOP AT fs_itab.
          WRITE / fs_itab-matnr.
        ENDLOOP.
      ELSE.
        Write:/ sy-repid, 'field-symbol not assigned'.
      ENDIF.
    ENDFORM.                    "form_fs_assign
    REPORT zprogram1.
    DATA: itab LIKE STANDARD TABLE OF tab_matnr WITH HEADER LINE.
    itab-matnr = '1111'.
    APPEND itab.
    itab-matnr = '2222'.
    APPEND itab.
    WRITE:/ sy-repid.
    PERFORM form_fs_assign IN PROGRAM zforms.
    SUBMIT zprogram2.
    REPORT zprogram2.
    break-point.
    *-- enter (ZPROGRAM1)ITAB[] in the variable and press enter
    * the yellow icon stating that it doesn't exist appears
    * but when the following form is called, it does checks
    * the <fs> assign and doesnt gives any runtime error
    * while in Pricing routine, the similar situation
    * does gives the error
    PERFORM form_fs_assign IN PROGRAM zforms.
    *Execute zprogram1 and debug, works fine..*
    *Execute zprogram2, (ZPROGRAM1)ITAB[] doesn't exist, still it doesn't leads to short dump*
    *BUT, a very similar situation in a Pricing Requirment Routine leads to a short dump:*
    *Runtime Error          GETWA_NOT_ASSIGNED*
    *ShrtText    Field symbol has not yet been assigned.*
    *Pricing Routine Code Snippet:*
    *-- {3. -
    determine qualifying prior invoices in memory----
    FIELD-SYMBOLS: <fs_vbrk> TYPE table.
                FIELD-SYMBOLS: <fs_vbpa> TYPE table.
                FIELD-SYMBOLS: <fs_komv> TYPE table.
                DATA g_it_vbrk LIKE STANDARD TABLE OF vbrkvb WITH HEADER LINE.
                DATA g_it_vbpa LIKE STANDARD TABLE OF vbpavb WITH HEADER LINE.
                DATA g_it_komv LIKE STANDARD TABLE OF konv WITH HEADER LINE.
                DATA: l_vbrk_lines TYPE i.
                ASSIGN ('(SAPLV60A)XVBRK[]') TO <fs_vbrk>. <- "Error occurs here
                ASSIGN ('(SAPLV60A)XVBPA[]') TO <fs_vbpa>.
                ASSIGN ('(SAPLV60A)XKOMV[]') TO <fs_komv>.
                g_it_vbrk[] = <fs_vbrk>.
                g_it_vbpa[] = <fs_vbpa>.
                g_it_komv[] = <fs_komv>.
                DESCRIBE TABLE g_it_vbrk LINES l_vbrk_lines.
                READ TABLE g_it_vbrk INDEX l_vbrk_lines.
    ** remember to make vkorg and vtweg check for vbrk invoices
                DELETE g_it_vbrk WHERE vbeln = g_it_vbrk-vbeln.
                DELETE g_it_vbpa WHERE vbeln = g_it_vbrk-vbeln OR parvw <> 'WE'.
                DELETE g_it_komv WHERE knumv = g_it_vbrk-vbeln OR kschl <> 'ZF02' OR kbetr = 0.

    Hello friends,
    Rich,
    The piece of code you suggested didn't work, and still led to the short dump.
    Naimesh,
    I agree that XVBRK is not declared globally, and if it is a Table, and declared as global work area using Tables, we could have used it directly using ASSIGN (VBRK)...
    But, since its not the case, I am not able to do so...
    Still, my requirement remains the same. I have to get the invoices created (in memory) but not saved during a collective billing run.
    And the required data is available in the (SAPLV60A)XVBRK internal table, from which I am able to retrieve it for the first time, but clicking on the conditions tab in the item details leads to this short dump, becs (SAPLV60A)XVBRK[] isn't available at that moment. Still, if it is not available I suppose it should just set the sy-subrc to 4 instead of ending into a short-dump.
    Jürgen Hartwig,
    I know ZPROGRAM 1 can't work in ZPROGRAM 2, but it doesnt leads to the short dump either, does it? But in case of pricing it gives the run time error, this is exception I want to handle!
    XVBRK is not declared globally, but since SAPLV60A calls a perform in SAPLV61A, it remains in the ABAP stack and we can access it using (SAPLV60A)XVBRK[] kind of assignment.
    When the same is called during Item Conditions display, its PBO is in the stack but not other forms (in which it might have defined).
    Rich, is there a way to get all the variables available in scope at any instance during runtime?
    Well, Jürgen, I though it Germany it was called "schmutzig zuweisen" :-)... by the way, the same method has been used at several places in standard SAP programs with the sy-subrc check.
    Reference Data:
    when the assignment happens successfully, the ABAP Stack looks similar to:
    Call | Program   | Subroutine
    10   | SAPLV61A  | some_subrountine
    09   | SAPLV61A  | some_subrountine
    08   | SAPLV61A  | some_subrountine
    07   | SAPLV60A  | some_subrountine
    06   | SAPLV60A  | some_subrountine
    05   | SAPLV60A  | some_subrountine
    04   | SAPLV60A  | some_subrountine
    03   | SAPLV60A  | some_subrountine
    02   | SAPLV60A  | some_XKOMV_AUBE..subrountine
    01   | SAPLV60A  | PAI_some_subrountine
    when the assignment doesnt happens, the ABAP Stack looks similar to:
    04   | SAPLV61A  | some_subrountine
    03   | SAPLV61A  | some_subrountine
    02   | SAPLV61A  | some_subrountine
    01   | SAPLV60A  | PBO_some_subrountine

  • Assign Type conflict error

    Hi,
    I am trying to load the data from PSA to write optimised DSO in production and it is throwing me an error 'Short dump :Assign Type conflict error".
    I have no routines in the transformations.Source data types are matching with target data types.
    Is there any way I could resolve this issue.
    Thanks,
    Chandra

    Hi,
    I had this problem when i was loading the sales cube. the problem was UOM was not maintained in the system. Then I maintained UOM in the bi and solved the issue. JUst check if your data from the source has got the master data in bi.
    Thanks
    Srikanth

  • Select options field is giving type conflict when calling a class.

    hai guys,
           i have a field SALESORD in subscreen as a SELECT-OPTIONS field for vbeln.
    Now i created a class,with SALESDETAILS  of type TABLE as a parameter of a method.
    when i call the method(after creating an object) the SALESDETAILS parameter is supposed to take the SALESORD field.
      but it gives me a type conflict error.
    i wonder why..coz both fileds have same type..
    how to resolve the issue..
    helpful answers will be rewarded.
    thank you.

    Hi Shravan,
    Pass the select-options vbeln values into a temporary table and pass this table into the method.
    <b>Reward for helpful answers</b>
    Satish

  • Run Time: type conflicts in field symbol

    In this statement i am getting run time error : assign component.
    type conflicts in field symbol
    FIELD-SYMBOLS:
        <fs_tab> TYPE ANY table,
         <wa_tab> TYPE ANY,
         <fs_field> type crmd_orderadm_h.
    DATA:      w_data    TYPE REF TO data.
    CREATE DATA w_data TYPE STANDARD TABLE OF (c_tabname) WITH NON-                     UNIQUE DEFAULT KEY.
        ASSIGN w_data->* TO <fs_tab>.
    SELECT * FROM (c_tabname)
              INTO CORRESPONDING FIELDS OF TABLE <fs_tab>
      LOOP AT <fs_tab> ASSIGNING <wa_tab>.
          DO.
            ASSIGN COMPONENT sy-index OF STRUCTURE <wa_tab> TO <fs_field>.
    *Writeing: fs_field here*
    Enddo.

    FIELD-SYMBOLS: <fs_field> type crmd_orderadm_h.
    <fs_field> type any.
    i cannot pass "
      lv_header_guid =    <fs_field>-guid.
    complete code as follows.
      LOOP AT <fs_tab> ASSIGNING <wa_tab>.
          DO.
            ASSIGN COMPONENT sy-index OF STRUCTURE <wa_tab> TO <fs_field>.
    *i am assining fs_field-guid here. Thats why i am taking this field symbol as type "crmd_orderadm_h"*
    *bold* * <fs_field>-guid.*bold**
            lv_header_guid =    <fs_field>-guid.
            iv_header_guid = lv_header_guid.
            REFRESH: lt_header_guid.
            INSERT iv_header_guid INTO TABLE lt_header_guid.
            REFRESH: im_orderadm_h,im_text.
            CALL FUNCTION 'CRM_ORDER_READ'
              EXPORTING
                it_header_guid       = lt_header_guid
              IMPORTING
                et_orderadm_h        = im_orderadm_h
                et_text              = im_text
              EXCEPTIONS
                document_not_found   = 1
                error_occurred       = 2
                document_locked      = 3
                no_change_authority  = 4
                no_display_authority = 5
                no_change_allowed    = 6
                OTHERS               = 7.
            IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
            ENDIF.
          ENDDO.

Maybe you are looking for

  • Unable to replicate data to BI using LO Extraction

    Hi, I unable to replicate from ECC(LO Extraction)the data...when i replicate the data from ECC i got some of the folling the data sources... 80BPARTNERH 80BPARTNERH Change BI7CLNT001 80PLANTH 80PLANTH Change BI7CLNT001 Aggregated Status for Area of R

  • Help needed in c programming

    hi i am writing a c program using fstream. can anyone tell me where can i post my questions here in apple discussion board? i just don't know in which section does my problem fits.

  • Zen V (video 4gb) + winxp + drivers (now in english ;

    Well first time i placed this message in dutch but well.. i forgot.. it will be too hard to read for most :smileyvery-happy:.. so again in english:?I bought a Zen V 4gb mp3 player and my pc had winxp with service pack 3 installed but at first after p

  • Error 1158, AS 3, CS4

    I searched the forums for the error, but the methods they used couldn't help my program, it's an Actionsctipt file in AS3 with CS4. I am receiving error 1158: Syntax error: missing left brace ({) before the function body. Source: public function Dire

  • How do you view your call history?

    How do you view your recent calls?