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

Similar Messages

  • Problem with DESCRIBE field-symbol statement?

    Hi
    I havw written following querry but it's showing error. My doubt is there any resctriction field symbols in DESCRIBE query.
    i wrote
    describe field <a> type typ  length in character mode.
    Is that syntax correct?

    When you use the Describe statement with the field symbols, it will do the describe on the field which was assigned to it.
    Like:
    FIELD-SYMBOLS: <fs> TYPE ANY.
    DATA: l_char TYPE char10.
    l_char = 'TEST'.
    ASSIGN l_char TO <fs>.
    DATA: l_len TYPE i.
    DESCRIBE FIELD <fs> LENGTH l_len IN CHARACTER MODE.
    write: / '<fs>:', <fs>.
    WRITE: / 'Length', l_len.
    Here descirbe gives the property of the L_CHAR because it was assigned to field symbol <FS>.
    Regards,
    Naimesh Patel

  • Problem with the field-symbols

    Hi all,
            i am unable to delete the  data in the internal table.
            i am sending the code.
          BEGIN OF t_oprtn,
           budat LIKE afru-budat,
           vornr LIKE afru-vornr,
           grund LIKE afru-grund,
           gmein LIKE afru-gmein,
           gmnga LIKE afru-gmnga,
           expfl(1),
           END OF t_oprtn,
    FIELD-SYMBOLS: <fs_collect>         TYPE STANDARD TABLE.
    FIELD-SYMBOLS: <fs_wa_collect>      TYPE ANY.
        CREATE DATA i_collect TYPE STANDARD TABLE OF t_oprtn
                              WITH DEFAULT KEY.
        CREATE DATA wa_collect TYPE t_oprtn.
      ASSIGN i_collect->*       TO <fs_collect>.
      ASSIGN wa_collect->*      TO <fs_wa_collect>.
      SELECT abudat avornr agrund  aarbid astokz darbpl a~aufnr
             bplnbez cmaktx agmnga agmein
             INTO TABLE i_final
             FROM afru AS a INNER JOIN afko AS b
                                       ON aaufnr = baufnr
                            INNER JOIN makt AS c
                                       ON bplnbez = cmatnr
                            INNER JOIN crhd AS d
                                       ON aarbid = dobjid
             WHERE a~budat IN s_budat
    LOOP AT i_final INTO wa_final.
      MOVE-CORRESPONDING wa_final TO <fs_wa_collect>.
        COLLECT <fs_wa_collect> INTO <fs_collect>.
      ENDLOOP
    how to write a delete statement for -  <fs_collect>.
    Plz tell me the delete statement where GMNGA is '0'.   " GMNGA IS A CONFIRM QUANTITY.
    Plz reply its urgent.
    Edited by: hari prasad on May 30, 2008 1:15 PM
    Edited by: hari prasad on May 30, 2008 1:20 PM

    Try:
    field-symbols: <f_temp> type any.
    loop at <fs_collect> assigning <fs_wa_collect>.
       assign component 'GMNGA' of structure <fs_wa_collect> to <f_temp>.
    if <f_temp> is initial.
       delete <fs_collect>.
    endif.
    endloop.
    regards,
    S. Chandramouli.
    Edited by: Chandramouli Subburathinam on May 30, 2008 5:08 PM

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

  • 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

  • Problem with the program symbols in quality

    Dear all,
    I am facing a problem with the program symbols.
    I have added new global fields in development, i have called those definations in text names. It is working fine.
    After transporting these  program changes in to quality these new global definations are not displaying in quality and varibles are not working.
    Please give me some suggestion.
    Thanks and advance

    Hi Chandra,
    Please check the following.....
    (1)The transport request status in se10 and see if has been successfully imported to QA..
    (2)if all the declarations or code have been collected in a Transport and not saved as temporary objects
    To confirm the same we have to compare the code in quality and development and see if they are the same
    Pls check and revert
    Regards
    Byju

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

  • Problem with currency  field in smart form

    hi
    friends ..
    i had problem with currency field in smartform iam printing 5 currecny
    fields after the main window .But not getting printed on right way gets printed down from the given mesaurement and i get lot of gap betwen the
    each fields for ex.
    33,260.00
    120.00
    0.00
    0.00
    0.00
    i thought the the problem is with space .so iwanted to condense it but cannot as it is currency field so move into character fields .but the user want out put in currency format like 22,60.20 if i  get the value in char variable i get 2260.20 which i dont want .
    so pls help me how to condense or shift left and print the currency field on right place.
    regards
    answers will be rewarded points.

    hi,
    this is a normal problem u can avoid this by moveing these currencu value to a character field then print the char field us ing condece... &var(C)&..
    eve if not solve the problem use the TEMPLATE node..
    Please Close this thread.. when u r problem is solved. Reward all Helpful answers
    Regards
    Naresh Reddy K

  • Problem with a field set to refresh after insert at Row level

    hello all,
    i have a problem with a field (a serial) which is set by a db trigger at insertion. The field "refresh after insert" is properly set in the Entity and everything is refreshed correctly when i insert data via an adf form in a jspx but when i want to insert programmatically nothing is refreshed. I insert data this way :
    ViewObject insertVO = findViewObject("myView");
    Row newRow = insertVO.createRow();
    newRow.setAttribute("mandatoryAttribute1",value1);
    newRow.setAttribute("mandatoryAttribute2",value2);
    <more init here but not the serial since it will be set by the DB trigger>
    insertVO.insertRow(newRow);
    but when i want to get back the value with "newRow().getAttribute("TheSerial");" i always get a null back and not the value set by the db trigger.
    One way to get the serial is to commit after each insert but i don't want to commit between inserts.
    i've tried to unset the refresh after insert and override the createDef() method to setUseReturningClause(false) as it's is advised in chapter 26.5 of the ADF 4GL dev. guide but in this case i have an exception JBO-29000: JBO-26041.
    How can i get the value back properly ?
    thanks
    -regards

    The data for the newly created row doesn't get inserted into the database until the commit is executed, so the insert trigger isn't called.
    If you need to get the value without committing, then you should implement the trigger programmatically and drop the trigger from the database. The code below shows how you could do this.
    ViewObject insertVO = findViewObject("myView");
    Row newRow = insertVO.createRow();
    SequenceImpl seq = new SequenceImpl("MY_SEQ", insertVO.getDBTransaction());
    Long next = (Long)seq.getData();
    newRow.setAttribute("primaryAttribute", new Number(next));
    ...You will need to replace MY_SEQ and primaryAttribute with the correct values for your example, but this should acheive what you want.

  • 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

  • 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

  • Problem related to field-Symbol?

    HI All,
    I am writting the below coding, Please tell me whether the Field Symbol will act as a table or not as I want to append a lot of data to field symbol. Please tell me is there any problem in the code.
    LOOP AT lt_vepoequi_keys into ls_vepoequi_keys.
            READ TABLE lt_vekp ASSIGNING <ls_vekp_str> with key
              matnr = ls_vepoequi_keys-matnr.
            IF sy-subrc = 0.
              <ls_vekp_str>-stoff = ls_vepoequi_keys-stoff.
              <ls_vekp_str>-sonum = ls_vepoequi_keys-sonum.
              <ls_vekp_str>-lagkl = ls_vepoequi_keys-lagkl.
              <ls_vekp_str>-lagkt = ls_vepoequi_keys-lagkt.
    endif.
    endloop.

    Hi Abhinav,
    you have internal table (say it_employee) with fields name,age,senior_category.
    now when you loop this internal table you will need workarea.
    loop at it_employee into wa_employee.
                      if wa_employee-age > 60.
                            wa_employee-senior_category = 'YES'.
                      else.
                              wa_employee-senior_category = 'NO'.
                      endif.
                              modify it_employee from wa_employee. 
                     endloop.
    now one use of Field-symbols is : when internal table is huge and when you loop with workarea and modify internal table each time, it takes time. So if we use Field-symbols performance would increase.
    loop at it_employee assigning into <fs_employee>.
                      if <fs_employee>-age > 60.
                            <fs_employee>-senior_category = 'YES'.
                      else.
                              <fs_employee>-senior_category = 'NO'.
                      endif.
                endloop.
    Now  you see in the above code, i have not used modify statement because when i loop internal table, the field symbol points directly to the memory of internal table.
    So during loop if i assign any value to the field symbol then it directly changes the internal table value, so there wont be any need to use modify statement.
    Hope you are clear with this example....
    Regards
    Sajid

  • 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

  • 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

  • How to access a field of a structure with a field symbol?

    Dear all,
    Currently I'm trying to access the fields of a structure (called "ls_tbl") dynamicly. The code looks as follows (of course the field symbols are defined correctly ;-):
        ASSIGN lv_f1 TO <lv_f1>.
        ASSIGN lv_f2 TO <lv_f2>.
        lv_pp = ls_tbl-(<lv_f1>).
        lv_pt = ls_tbl-(<lv_f2>).
    Unfortunatly I get the following error message:
    <<The data object "LS_TBL" does not have a component called "".>>          
    I really do not understand why ABAP is trying to interpret the field symbol name as a string. Does anybody have a clue how to access the field of ls_tbl with the help of a field symbol?
    Many thanks!!!

    Hi ,
    Please check the below sample code .
    data : begin of st_table,
                myfiledname type c value '1',
                myfiledname1 type c value '2',
           end of st_table .
    data : lv_filedname(11) type c value 'MYFILEDNAME'
    filed-symbols : <fs> type any,
                    <fs_table> type any.
    assign st_table to <fs_table>.
    Assign lv_filedname to <fs> .
    assign component <fs> of structure <fs_table> to lv_pp.
    Regards,
    Ratheesh BS

Maybe you are looking for