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.

Similar Messages

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

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

  • 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

  • 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

  • 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

  • BPC NW: Field symbol not assigned in BADi as Endroutine

    HI Experts,
    I have a problem when working with BADis as Endroutines in a TransformationFile.
    Guided by the "How To... Use Start and End Routine" I followed the different steps and for the Start Routine everything works fine. My problem is when trying to call the TransformationFile with the Endroutine I get a  GETWA_NOT_ASSIGNED dump telling me that: Field symbol has not yet been assigned.
    I'm using quite the same code as given in the How To. I introduced some checks, but  I did not get any positive results. Can anybody help, please? The How To is made for master data, I assume the error comes from this side, but I can't assure it.
    The code in the Badi is:
    field-symbols:
           type any.
    data: lt_columns type table of string.
    data: lt_column_data type table of string.
    data: lt_message type uj0_t_message.
    data: lt_error_reason type uj0_t_message,
          lv_tabix like sy-tabix.
    data:
          lo_dataref      type ref to data,
          lv_cuenta_asig  type zmap_cuentas-cuenta_asignado.
    Assign importing data reference to field symbol
    assign ir_data->* to  IS ASSIGNED.
    Create work area for importing data
    create data lo_dataref like line of .
    Create new internal table for exporting data
    check .
    Get CUENTA value from custom table or other datasource
    loop at .
    The error occurs when assigning the first pointer.
    By the way, I'm working on BPC 7.5 SP07 for NW.
    Hope someone can help. Thanks very much in advance,
    Àlex

    Hi Kaylan,
    thank you very much for your quick answer.
    Sorry, I think I haven't made quite clear my point.
    I want to use the Endroutine BADi in a Transformation File for Transaction Data, therefor there is no InfoObject directly involved. I use the Transformation File in the Package "Import Transaction Data". The How To I mentioned, and the only one I found that is more or less near to my problem describes how to use Endroutines and BADis for the Import of Master Data.
    Looking at the different tests I have done, as our system team is not giving us a debug user, the dump happens at the assignment of the first field symbol: assign ir_data->* to . Therefor I assume that  ir_data contains no data and this causes the dump.
    My main question is, can I use the code of the mentioned How To for the package "Import Transaction Data" at all? Or do I have to use different tables or table names for this package? How and where do I get them?
    You have an idea? Would be very helpful! Thanks in advance!
    Cheers
    Àlex

  • Using Field symbol to fetch data from another program

    I have a requirement where i need to fetch value  of a field from one of the function pool so i have written a sample progam to check the logic but its doest seems to work its giving dump.
    Basically i want to know how to use <programname><fieldname> with fieldsymbol.
    REPORT ztest1.
    DATA test(25) VALUE 'ggg'.
    submit ztest.
    report ztest.
    constants: lv_memory(25) type c value '(ZTEST1)TEST'.
    field-symbols: <fs2> type char25 .
    assign (lv_memory) to <fs2>.
    write : <fs2>.
    I am getting same field symbol assignment dump

    Hi Rahul,
    You can use this concept in between the FUNCTION MODULES where both are
    under same FUNCTION GROUP ( as both the FM's have same global memory area ).
    And also if you are calling an FM or method from your program  ,you can have the data of the calling program in that called FM or METHOD.
    Hope this may help you.
    Regards,
    Smart Varghese

  • Problem With Insert statement using field symbols with unicode enabled

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

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

  • Problem with field symbols

    Hi ,
    I have to use an internal table in a form which can have differnet structures at diffrenet points of time. 
    As the internal table is dynamic , I have declared a field symbol for this.I need to use th efields in this internal table for processing inside a loop.But because i have to use an untyped field symbol , I am getting an error that the field QUANT is not there in <fs_order_tab>.
    Please let me know what to do in such a situation.Thanks in advance.
    FIELD-SYMBOLS :<fs_order_tab> TYPE STANDARD TABLE,
                                 <fs_order_wa>  TYPE ANY.
    ASSIGN i_so TO <fs_order_tab>.
    ASSIGN wa_so TO <fs_order_wa>.
    LOOP AT<fs_order_tab> into <fs_order_wa>..
    l_quant = <fs_order_wa>-QUANT.
    ENDLOOP.

    Hi Rashmi,
    Kindly follow the steps given  below. 
    After assigning the internal table to the field symbol,
      create 1 more field symbols of the following type
    <fs_quant>     TYPE vbep-bmeng,
      Create 1 constant.
        CONSTANTS: lc_quant  TYPE c LENGTH 5 VALUE 'QUANT'.
      and then assign the field quantity  to the field symbol
          ASSIGN COMPONENT lc_quant  OF STRUCTURE <fs_order_wa> TO <fs_quant>.
    Inside the loop write the following statement
      l_quant = <fs_quant>
    Hope this helps in solving your query.
    Edited by: Kadian.Arjun on Nov 22, 2010 9:56 AM

  • Problem with field-symbol values not updating

    H i ,
          I have following piece of code :
    Assigning Dynamic Table to Field Symbol
        ASSIGN ist_dyn_table->* TO <gs_dyn_table>.
    *   Creating Structure for dynamic table
        CREATE DATA gs_dyn_line LIKE LINE OF <gs_dyn_table>.
    *   Creating line type for the Dynamic Values
        ASSIGN gs_dyn_line->* TO <gs_line>.
    *   Populating values in the dynamic table
        LOOP AT ist_pwcl_main INTO wa_pwcl_main.
          ASSIGN COMPONENT gc_fld_werks OF STRUCTURE <gs_line> TO <gs_field>.
       1   IF sy-subrc EQ 0.
       2        <gs_field> = wa_pwcl_main-werks.
       3      ENDIF.
       5  IF <gs_field> IS ASSIGNED.
       6     <gs_field> = wa_pwcl_main-vbeln.
          ENDIF.
      7 IF <gs_field> IS ASSIGNED.
      8  <gs_field> =  wa_pwcl_main-posnr.
          ENDIF.
       IF <gs_field> IS ASSIGNED.
            <gs_field> = wa_pwcl_main-quant.
          ENDIF.
    on debugging  at line 2 <gs_filed> contains the value of werks .
    but at line 6 <gs_field> contains value of vbeln as 0 and at 8 of posnr as 0 .
    What can be the problem ? Other values are getting assigned properly .
    Plz help ...
    Regards .

    Hi,
    Assigning Dynamic Table to Field Symbol
        ASSIGN ist_dyn_table->* TO <gs_dyn_table>.
      Creating Structure for dynamic table
        CREATE DATA gs_dyn_line LIKE LINE OF <gs_dyn_table>.
      Creating line type for the Dynamic Values
        ASSIGN gs_dyn_line->* TO <gs_line>.
      Populating values in the dynamic table
        LOOP AT ist_pwcl_main INTO wa_pwcl_main.
          ASSIGN COMPONENT gc_fld_werks OF STRUCTURE <gs_line> TO <gs_field>.
       1   IF sy-subrc EQ 0.
       2        <gs_field> = wa_pwcl_main-werks.
       3      ENDIF.
       5  IF <gs_field> IS ASSIGNED.
       6     <gs_field> = wa_pwcl_main-vbeln.
          ENDIF.
      7 IF <gs_field> IS ASSIGNED.
      8  <gs_field> =  wa_pwcl_main-posnr.
          ENDIF.
       IF <gs_field> IS ASSIGNED.
            <gs_field> = wa_pwcl_main-quant.
          ENDIF.
    Based on your coding above, <gs_field> has been assigned with data type 'WERKS' (i'd assume component gc_fld_werks found from structure <gs_line> is a plant typed), which is a CHAR(4) data type.
    Meaning, if <gs_field> is assigned with Plant type value, e.g. <gs_field> = '1000', field symbol <gs_field> will contain 4 character only.
    At line 6, if wa_pwcl_main-vbeln = '0000201000', <gs_field> is only capturing '0000' only. This is also happened to line 8.
    However, it looks like that <gs_field> is getting over-write if ASSIGNED statement returns SY-SUBRC = 0.
    Hope this helps.
    Regards,
    Patrick

  • Doubt regd Field Symbols

    Hi SDN's
    I have createad dynamic internal table using the method cl_alv_table_create=>create_dynamic_table from the blog
    /people/rich.heilman2/blog/2005/07/27/dynamic-internal-tables-and-structures--abap
    i am struck at the last point. what i wanted to know is the the internal table is in the form of a Field Symbol <FS> . But i have an internal table which already contains the data.. how do i move the data from internal tables to the Dynamic internal table.. I had already posted previously, but not able to understand .. can some body help me in understanding to get the data from Internal table to the dynamic internal table
    <b>My internal table</b> is in the below format
    Alloc no|ChargeCode     |Amount     |
    A119     |301          |100     |
    A119     |301          |200     |
    A119     |302          |150     |
    A119     |302          |250     |
    A119     |303          |100     |
    A229     |301          |100     |
    A229     |321          |100     |
    A239     |301          |100     |
    A239     |303          |50     |
    and i have the <b>dynaic internal table</b> format as below
    Alloc No|301     |302     |303     |321     |
    A119     |300     |400     |100     |NIL     |
    A229     |100     |NIL     |NIL     |100     |
    A239     |100     |NIL     |50     |NIL     |
    Please help me in understanding to move the data in to the above format

    Hi Pratyu Usha,
    I started dealing with it recently, so I'll try to help...
    I built the dynamic table row after row.
    To do this efficiently, the static (non-dynamic) table must be sorted by "Alloc No".
    Then you need a field-symbol for the work-area line of the dynamic table:
    ASSIGN LOCAL COPY OF INITIAL LINE OF <dynamic-table> TO <line>.
    where <dynamic-table> is the field-symbol representing your dynamic table.
    then you loop at your static table, and for each line of the static table you assign the right column of the dynamic table's line to other field-symbol:
    ASSIGN COMPONENT StaticTable-ChargeCode OF STRUCTURE <line> TO <field>.
    where <field> is another field-symbol and StaticTable is your static table...
    For example, suppose that you're currently in the first row of your static table - <field> will point to the column named "301" of the work-area of your dynamic table.
    now you just put the value inside that column:
    <field> = StaticTable-Amount.
    OR if you want to sum the value:
    ADD StaticTable-Amount to <field>.
    Now, at end of "Alloc no", you need to add your dynamic work-area to the dynamic table:
    APPEND <line> TO <dynamic-table>.
    CLEAR: <line>.
    There.
    That should work.
    Please let me know!
    Alon

  • Changing screen feild values through field symbols

    hi
    I am working on SAPMF02D user exit, it requires validation of searchterm1 feild, I have successfully completed this part with the help of field symbols, but the problem i am facing is that, after performing validation checks, searchterm1 feild would be updated, this I am not able to do, so far I have done the following:
    DATA: fld(30) VALUE '(SAPLSZA1)ADDR1_DATA-SORT1'.
    FIELD-SYMBOLS: <f1> TYPE ANY .
    * Assign screen field values to field symbol
    ASSIGN (fld) TO <f1>.
    * get the value from field symbol into our field
    IF <f1> IS ASSIGNED.
      acc1 = <f1>.
    ENDIF.
    .. *Perform validation and updation on 'acc1'
    * get the updated values back into screen feild
    <f1> = acc1.
    now this last thing is not working for me,, and the data does not get updated in screen/database....
    I have tried using ' comit work' statement , but no use,
    I require help on this issue and its quite urgent.
    Thank you all for your time.

    Thank you again for the reply,
    I am sorry , I am not able to use to that FM either,, I just cannot understand the parameters it is taking and how to provide them.
    I have already used the FM "DYNP_UPDATE_FIELDS"  and "DYNP_UPDATE_FIELDS" , as:
    <f1> = acc1.
    scrfields-fieldname = 'ADDR1_DATA-SORT1'.
    scrfields-fieldvalue = <f1>.
    APPEND scrfields.
    CALL FUNCTION 'DYNP_VALUES_UPDATE'
      EXPORTING
        dyname                     = 'SAPLSZA1'
        dynumb                     = '0301'
      TABLES
        dynpfields                 = scrfields[]
    * EXCEPTIONS
    *   INVALID_ABAPWORKAREA       = 1
    *   INVALID_DYNPROFIELD        = 2
    *   INVALID_DYNPRONAME         = 3
    *   INVALID_DYNPRONUMMER       = 4
    *   INVALID_REQUEST            = 5
    *   NO_FIELDDESCRIPTION        = 6
    *   UNDEFIND_ERROR             = 7
    *   OTHERS                     = 8
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    but it did not helped my cause either..
    Any help would be highly appreciated,
    thank you

Maybe you are looking for

  • Problems with RoboHelp 8 HTM and JavaHelp

    Hello, I was working with RoboHelp 7 and created help. Now I import my files in RoboHelp 8 and have some problems: 1. In design view files look just fine, but when I generate javaHelp i have some unwanted characters. At the begining of all pages and

  • Fonts For numeric fields

    Hi all,   In my smart form, I have a table containig columns as Material description, Quantity,Unit & Amount . While Printing smartform, data is not coming properly. Means, material description,Unit 's data are printing at upper part of table cell &

  • Can't update to iOS 5.1

    I want to know why I cant update my iphone to the latest iOS? Anyone having the same problem?

  • Can not create EmployeePrivateAdrUS

    Hi, I am trying to create EmployeePrivateAdrUS. I used lsmw to create a new employee and I could see the record in SAPGUI. But in my code, I could see the BAPIRETURN1 gave the message "Personnel number not yet assigned". What is wrong? The following

  • Re: My blackberry 8310 has a white screen with a box in the middle?

    hey im having the same problem. my phone is the curve 8330. i know its kinda old but, still it was a good one and i dont want it to die on me. when i turn on the phone i get a box or like a window with a circle then a square and a triangle in side it