Assigning object reference values to field symbols

Okay.......has anyone out there figured out how to assign the reference value of an object (you know the value you see in the debugger for example: .........to a field symbol.
I know there has to be a way and was wondering if anyone has successfully achieved this. Its easy to assign a memory area to a field symbol if its an itab like this below:
field-symbols: <fs>.
data: v_fieldname(20) type c.
v_fieldname = '(SAPLMEREQ)MARA'.
assign (v_fieldname) to <fs>.
This shouldn't be impossible with code like:
field-symbols: <fs> type ref to object.
data: v_ref(100) type c.
v_ref = '{O:666*\FUNCTION-POOL=MEREQ\CLASS=LCL_REQ_ITEM_STATE}'.
assign (v_ref) to <fs>.
I just know that the code above doesn't work....
Any suggestions? And please......no questions about "why" or "what do I want to accomplish?" .....
Mike

Hello Michael
I assume you have not yet seen the following links:
ABAP OO - MEREQ (Purchase Req) - Protected Attributes
[Accessing the Inacessible - Local Classes within Global Classes|https://wiki.sdn.sap.com/wiki/display/ABAP/AccessingtheInacessible-LocalClasseswithinGlobalClasses]
Regards
  Uwe

Similar Messages

  • To Modify a field value with field symbols

    we had a requirement like we are getting in a floating point value in a field of an IDoc segment like 12.327- .Here if we see that the negative sign is after the floating point value and if we try to insert this into a database then it will throw out an error.Before inserting the value we need to covert the incoming value in the form -12.327.
    I used the field symbols inorder to get the values and to change them.
    But iam not able to modify the internal table from the new value.
    Here is my sample code.
    DATA: IT_MBEW TYPE TABLE OF MBEW,
          WA_MBEW TYPE MBEW,
          IT_DFIES TYPE TABLE OF DFIES,
          WA_DFIES TYPE DFIES,
          IT_DD03L TYPE TABLE OF DD03L,
          WA_DD03L TYPE DD03L,
          L_FIELD TYPE VALUE,
          WA_VALUE TYPE mbew,
          L_MBEW TYPE DDOBJNAME VALUE 'MBEW'.
    FIELD-SYMBOLS: <FS1> TYPE ANY.
    FIELD-SYMBOLS: <FS3> TYPE ANY.
    FIELD-SYMBOLS: <FS2> TYPE ANY.
    SELECT * INTO CORRESPONDING FIELDS OF TABLE IT_MBEW
      FROM MBEW  WHERE MATNR = '000000000000100110'.
    LOOP AT IT_MBEW INTO WA_MBEW.
      WA_MBEW-SALK3 = - 354471.
      MODIFY IT_MBEW FROM WA_MBEW.
    ENDLOOP.
    To call the FM inorder to get the fieldnames for MBEW table
    CALL FUNCTION 'DDIF_FIELDINFO_GET'
      EXPORTING
        TABNAME              = L_MBEW
        FIELDNAME            = ' '
       LANGU                = SY-LANGU
        LFIELDNAME           = ' '
       ALL_TYPES            = ' '
        GROUP_NAMES          = ' '
        UCLEN                =
      IMPORTING
        X030L_WA             =
        DDOBJTYPE            =
        DFIES_WA             =
        LINES_DESCR          =
    TABLES
       DFIES_TAB            = IT_DFIES
        FIXED_VALUES         =
    EXCEPTIONS
       NOT_FOUND            = 1
       INTERNAL_ERROR       = 2
       OTHERS               = 3
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    SELECT TABNAME FIELDNAME DATATYPE POSITION INTO CORRESPONDING FIELDS OF TABLE
             IT_DD03L FROM DD03L
             WHERE TABNAME = 'MBEW'
             AND   DATATYPE = 'CURR'
             ORDER BY POSITION ASCENDING.
    *LOOP AT IT_MBEW INTO WA_MBEW.
    LOOP AT IT_MBEW assigning <fs1>.
    ASSIGN WA_MBEW TO <FS1>.
    do.
      LOOP AT IT_DD03L INTO WA_DD03L.
        READ TABLE IT_DFIES INTO WA_DFIES WITH  KEY FIELDNAME = WA_DD03L-FIELDNAME
                                          DATATYPE = WA_DD03L-DATATYPE.
        IF SY-SUBRC = 0.
          ASSIGN WA_DFIES-FIELDNAME TO <FS2>.
          ASSIGN COMPONENT SY-TABIX OF STRUCTURE <FS1> TO <FS3>.
          MOVE <FS3> TO L_FIELD.
          CONDENSE L_FIELD.
          CALL FUNCTION 'CLOI_PUT_SIGN_IN_FRONT'
            CHANGING
              VALUE = L_FIELD.
          IF SY-SUBRC = 0.
            ASSIGN L_FIELD TO <FS3>.
                    MODIFY ITMBEW INDEX SY-TABIX FROM <FS3>._    
    ENDIF.
        ENDIF.
      ENDLOOP.
    *enddo.
    ENDLOOP.
    The Modify statement is not working.....Plesae help me in this regard.
    Thanks
    Srinivas

    Hello.
    When you write,
    LOOP AT it_mbew ASSIGNING <fs1>.
    ENDLOOP.
    you don't need to use statements:
    ASSIGN WA_MBEW TO <FS1>
    nor
    MODIFY it_mbew
    after that.
    If you just write:
    LOOP AT it_mbew ASSIGNING <fs1>.
      <fs1>-field1 = 'A'.
      <fs1>-field2 = 'B'.
    ENDLOOP.
    all records of it_mbew will have field1 = 'A' and field2 = 'B'.
    The point is, statement LOOP assigning <fs1> will make the field symbol to became a pointer to the records of the internal table. So, if you change the field symbol, you are changing the internal table already.
    Regards.
    Valter Oliveira.

  • How to assign ranges ( select-option)to field symbol

    Hi ,
    I have following scenario
    ranges : r_test1 for agr_1251,
                 r_test2 for agr_1251.
    In runtime i am getting which range i have to populate in a field v_rname.for now let it me v_rname  = 'r_test2'
    i want to assign (v_rname ) to <field -symbol> ie is range to field symbol.
    and i want to update the <field -symbol>-sign ='I'
                                        <field -symbol>-LOW ='some value'
                                        append <field -symbol>.
    This is the logic i want to follow,  for this how should i have to declare the field symbol ? I couldn't assign a range to field symbol . Please help me.
    thanks
    Murali

    Try this
    FIELD-SYMBOLS : <field_symbol>  TYPE ANY TABLE.
    ASSIGN (v_rname) to <field_symbol>.
    <field -symbol>-sign ='I'
    <field -symbol>-LOW ='some value'
    append <field -symbol>.
    This should work because your range is a table.
    Hope this helps you.

  • 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

  • Create Object References for Key field

    Hi Experts,
    Question 1- Do we have any standard task that create BOR object reference using key field?
    Question 2 - If not, i have created a task with key field as import parameter and BOR type as return object reference. No i am just using macro "SWC_CREATE_OBJECT OBJREF_ARD 'AssetRequestDocument'  ASSETREQUESTID." where ASSETREQUESTID is key field. OBJREF_ARD is object ref type.
    Problem comes here - Its not getting instantiated, i debugged an saw it checks for logical system in the FM OWN_LOGICAL_SYSTEM_GET, i guess since SWO_CREATE is remote enabled FM it is checking for OWN_LOGICAL_SYSTEM_GET function. In our system for the client there is no logical system defined and i dont have any idea how to customize table T000 for logical system.
    Note - There is nothing related to communication between two system.
    Can anyone help me out?
    Thanks in Advance,
    Pritam Kunal

    Hello,
    It's a method. You make a task which calls that method and passes in the BOR type and its key.
    It instantiates an instance of the BOR and passes it back out.
    So, no, it's not a generic BOR!
    regards
    Rick Bakker
    Hanabi Technology

  • Assigning value to Field - Symbol ( which is type of internal table field )

    Hi All,
      I am facing problem to assign the value to a field symbol. My requirement is creating a dynamic internal table and populate values into that internal table, so that i can display the values .
      I am having a structure with fields like status , Plant1 name , Plant2 name.....Plant n .
      So i declared an internal table it_tab with this structure.
      I am having one more table which having number of records for Plant1 ,Plant 2 ,....Plant n based on some condition.
      I need to count the number of records for Plant1 and i need to put in the internal table it_tab.
      For this i created field-symbol .
    Here, t_deployment table will have the plants 1,2,3...and
         t_devobject will have some records for these plants.
    LOOP AT T_DEPLOYMENT. 
    clear w_count.
    LOOP AT T_DEVOBJECT WHERE ZDEPLOYMENT = T_DEPLOYMENT-DOMVALUE_L AND
                              ZADSTATUS = '10'.
    w_count = w_count + 1.
    ENDLOOP.
    concatenate 'it_tab-' t_deployment-domvalue_l into var_bet_name.
    assign var_bet_name to <bet_var_name>.
    now my internal table field i.e. it_tab-plant1 came into <bet_var_name> . But i want to assign a value for it.
    at last what i need is it_tab-plant1 = w_count.
    whaterver the w_count has value that needs to assign to it_tab-plant1. But i don't want to assign directly it it_tab-plant1. I want to assign dynamically. Because tommorrow some more plants added to t_deployments , i don't want to make changes to my program. It should take care....w/o changing the program.
    I tried the following statement.
    (<bet_var_name>) = w_count. But its not working.
    Please let me know how i can get this.
    Thanks in Advance.
    Pavan.

    Hi pavan,
    As ur requirement is creating a dynamic internal table,
    try the following way,
    remember the fieldcat should be of type LVC not SLIS.
    BUILD LT_LVCFIELDCAT in a way that, the value from the internal table becomes the fieldname
    ex:-
    loop at it_models INTO WA_MODELS.
        LS_LVCFIELDCAT-FIELDNAME = WA_models-MODEL.
        LS_LVCFIELDCAT-SELTEXT = WA_models-MODEL.
    append ls_lvcfieldcat to lt_lvcfieldcat.
    endloop.
    DATA: DREF TYPE REF TO DATA,WA_REF TYPE REF TO DATA.
    FIELD-SYMBOLS: <TEMP_TAB> TYPE TABLE, <TEMP_WA> TYPE ANY.
    CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG = LT_LVCFIELDCAT
        IMPORTING
          EP_TABLE        = DREF.
      ASSIGN dref->*  TO <TEMP_TAB>.
    now basing on the fieldcatalog <temp_tab> is build.
    NOW FILL <TEMP_TAB>.
    WHILE FILLING, ASSIGN COMPONENT IDX/NAME.....
    this statement will be very usefull.
    i hope this will be help full.
    pls reward the points if it helps u.
    regards
    Hyma

  • Assigning field value to Field symbol

    Dear Experts,
    I have one program which works fine in non unicode system.. The program contains Assign statement with offset and length..
    This program dumps in Unicode system due to this instruction.. The field which i want to assign to field symbol is type P field..
    Is there any ways to avoid the dump?
    Thank you in Advance..

    Hi,
    isn't it an ABAP question in an EP forum?
    Romano

  • How to populate values of field symbols?

    HI,
    I need to pass values into a field-symbol (defined as a dynamic Work Area) and append the values later on into another field-symbol (defined as a dynamic Table) by inserting the work area to the table. The insert statement in the screen shot below is syntetically correct but when I uncomment
    *      <gw_itab>-tplnr = 'TPLNR'.
    *      <gw_itab>-pmsog = 'PMSOG'.
    *      <gw_itab>-k_pro = 'K_PRO'.
    I get a syntax error. During debugging if I pass the values of the work area, they are properly appended into the table.
    Could somebody show me the code on how to atain this programatically?
    Thanks for your help
    Carl

    From the short dump:
    "<GT_ITAB> has line type "v" and the length 24, but the work area has line type "g" and the length 8".
    The code you included in your first screenshot is not the code that it dumped on... Looking at the shortdump here's what you have.
    lv_fieldname = '<GW_ITAB>-TPLNR'.
    assign (lv_fieldname) to <gw_itab>.
    <gw_itab> = 'TPLNR'.
    insert <gw_itab> into table <gt_itab>.
    This code doesn't make any sense...
    What you're saying is:
    <gw_itab> points to <gw_itab>-tplnr. So now it points to just a field of the structure, not the whole structure.... Then you say that field is set to 'TPLNR'. So you set the field of the original structure called TPLNR to be the string "TPLNR"...
    If that's really what you're trying to do then try changing it to:
    field-symbols: <field> type any.
    lv_fieldname = '<GW_ITAB>-TPLNR'.
    assign (lv_fieldname) to <field>.
    <field> = 'TPLNR'.
    insert <gw_itab> into table <gt_itab>.

  • Error in Moving values to field symbols. - CX_SY_CONVERSION_NO_NUMBER

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

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

  • Assignment on Multi-Valued Lookup field

    Hi experts,
    Is it possible to assign value to a multi-valued lookup field using assignment.
    For example, "Products" is the main table. In the products table I have a multi-valued attribute "PLANT". Product table contains a field "PLANT" of type look-up multivalued to the Plants table.
    So, is it possible to assign Plant attribute values to PLANT Look-up multivalued field in the main table using assignment??
    Is not, then is there any other work around solution to acheive this requirement?
    Best Regards,
    Shiv

    hi,
    So, is it possible to assign Plant attribute values to PLANT Look-up multivalued field in the main table using assignment??
    No this is not possible, to get the values of the plant attributes you again have to lookup at the plant master data and fetch the values from there in the routine.
    regards,
    Arvind.

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

  • Assigning Table/Structure Types using Field-Symbols

    Hello Gurus,
    How can we assign a table or structure type to a particulart internal table?
    What I want to do is to make my data declaration for i_tab reusable.
    i.e.
    DATA: v_tab  TYPE string.
    v_tab = 'MARA'.
    DATA  : i_tab  TYPE STANDARD TABLE OF v_tab.
    The purpose is to make the declaration flexible so program can change v_tab to any table names like LIPS, KNA1...etc making the i_tab flexible and reusable enough. Can anyone help me please? I try to use field-symbols, but I can not achieve what I want. Any bright ideas please?

      DATA: dref TYPE REF TO data.
      FIELD-SYMBOLS: <table> TYPE STANDARD TABLE,
                     <line>  TYPE ANY.
      PARAMETERS: pa_tab TYPE tabname DEFAULT 'BUT000'.
      CREATE DATA dref TYPE STANDARD TABLE OF (pa_tab).
      ASSIGN dref->* TO <table>.
      SELECT * FROM (pa_tab) INTO TABLE <table>
               UP TO 10 ROWS.
    LOOP AT <table> ASSIGNING <line>.
    ENDLOOP.
    <LINE> will take the structure of the table line at runtime.
    This is quite flexible.
    But you can also declare it like this, as we did with the <table>:
    DATA: dref1 TYPE REF TO data.
    CREATE DATA dref1 TYPE (pa_tab).
    ASSIGN dref1->* TO <line>.
    This way <line> will already have the correct structure, even before the <ASSIGNING>.
    Edited by: Micky Oestreich on Mar 24, 2009 8:21 AM

  • How to Remove Previous Values in Field Symbols

    Hi,
    My code goes like this.
    Loop at i_vbap.
    read table itab assigning <fs>.
    if sy-subrc = 0.
    endif.
    Endloop.
    This is good if my subrc for read is always 0. however, if my subrc = 4, my <fs> still contains the previous values. How do i clear my <fs> with the previous values?
    Thanks,
    Jim

    Hi
    In your code please do the following
    Loop at i_vbap.
    Unassign <fs>.
    read table itab assigning <fs>.
    if sy-subrc = 0.
    endif.
    The problem would arise if you are using <fs> below without it being assigned.
    It would cause a short dump.
    So change your coding appropriately.
    Endloop.

  • Internal table to field symbol

    hi all,
    type-pools : abap.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>,
                   <dyn_field>.
    data: dy_table type ref to data,
    dy_line type ref to data,
    xfc type lvc_s_fcat,
    ifc type lvc_t_fcat.
    *data : dyn_itab2 type ANY table.
    selection-screen begin of block b1 with frame.
    parameters: p_table(30) type c.
    selection-screen end of block b1.
    start-of-selection.
    BREAK-POINT.
    perform get_structure.
    perform create_dynamic_itab.
    perform get_data.
    PERFORM OUTPUT.
    *perform write_out.
    form get_structure.
    data : idetails type abap_compdescr_tab,
    xdetails type abap_compdescr.
    data : ref_table_des type ref to cl_abap_structdescr.
    Get the structure of the table.
    ref_table_des ?=
    cl_abap_typedescr=>describe_by_name( p_table ).
    idetails = ref_table_des->components.
    *idetails] = ref_table_des->components[.
    loop at idetails into xdetails.
    clear xfc.
    xfc-fieldname = xdetails-name .
    xfc-datatype = xdetails-type_kind.
    xfc-inttype = xdetails-type_kind.
    xfc-intlen = xdetails-length.
    xfc-decimals = xdetails-decimals.
    append xfc to ifc.
    endloop.
    endform.
    form create_dynamic_itab.
    Create dynamic internal table and assign to FS
    call method cl_alv_table_create=>create_dynamic_table
    exporting
    it_fieldcatalog = ifc
    importing
    ep_table = dy_table.
    here i want  to assighn the structure of dy_table to internal atble.
    assign dy_table->* to <dyn_table>.
    Create dynamic work area and assign to FS
    create data dy_line like line of <dyn_table>.
    assign dy_line->* to <dyn_wa>.
    endform.
    form get_data.
    Select Data from table.
    select * into table <dyN_table> UP TO 10 ROWS
    from (p_table).
    endform.
    Write out data from table.
    FORM OUTPUT.
    loop at <dyn_table> into <dyn_wa>.
    do.
    assign component sy-index
    of structure <dyn_wa> to <dyn_field>.
    if sy-subrc = 0.
    exit.
    endif.
    if sy-index = 1.
    write:/ <dyn_field>.
    else.
    write: <dyn_field>.
    endif.
    enddo.
    endloop.
    ENDFORM.
    how can i achieve this one.
    regards
    siva

    Hi,
    Check this Code ...
    LOOP AT <dyn_table> INTO <dyn_wa>.
        DO.
          ASSIGN COMPONENT sy-index
          OF STRUCTURE <dyn_wa> TO <fs_field> .
          IF sy-subrc NE 0.
            EXIT.
          ENDIF.
          IF sy-index = 1.
            WRITE:/ <fs_field>.
          ELSE.
            WRITE: <fs_field>.
          ENDIF.
        ENDDO.
      ENDLOOP.
    For reference check below code
    DATA: it_fieldcat        TYPE lvc_t_fcat                         . " Field catalog
    DATA: wa_fieldcat  LIKE LINE OF it_fieldcat. " Field catalog
    DATA: it_dyn_table      TYPE REF TO data,     " Dynamic table
          it_wa_dyn_table   TYPE REF TO data.     " Dynamic table
    *       Field sysmbols           Begin with <fs>                      *
    FIELD-SYMBOLS:  <fs_dyn_table>       TYPE STANDARD TABLE, " Dynamic tbale
                    <fs_dyn_table_temp>  TYPE ANY           , " Dynamic tbale
                    <fs_field>           TYPE ANY           , " Temp field for data assignment
                    <fs_field_temp>      TYPE ANY           . " Temp field for data assignment
    *       Macro                                                         *
    * Macro Defination
    * Building field catalog using macro defination
    DEFINE m_fieldcat.
      wa_fieldcat-fieldname   = &1.
      wa_fieldcat-scrtext_l   = &2.
      wa_fieldcat-coltext     = &2.
      wa_fieldcat-no_zero     = &3.
      wa_fieldcat-hotspot     = &4.
      wa_fieldcat-outputlen   = &5.
      wa_fieldcat-emphasize   = &6.
    * Appending workarea to internal table
      append wa_fieldcat to it_fieldcat.
      clear wa_fieldcat.
    END-OF-DEFINITION.
    *&      Form  f005_prepare_field_catalog
    *       text
    form f005_prepare_field_catalog .
      REFRESH: it_fieldcat.
    * Build the field catalog
      m_fieldcat text-007 text-008 c_blank  c_blank c_30 c_blank.
      m_fieldcat text-009 text-010 c_blank  c_blank c_30 c_blank.
      SORT it_final_temp BY equnr point.
      SORT it_final BY equnr point psort idate.
      w_date1 = so_date-low.
    * Loop to generate grid column at run time
    * Loop - Till the lower date not equal to higer date
      WHILE so_date-high GE w_date1.
    * Changing date into actual date format using edit mask
        WRITE w_date1 TO w_var4 USING EDIT MASK '__-__-____'.
        m_fieldcat w_var4 w_var4 c_flag c_blank c_12 c_blank.
        w_date1 = w_date1 + c_count.
        CLEAR w_var4.
      ENDWHILE.
    *&      Form  f007_create_dynamic_table
    *       text: Create dynamic table
    form f007_create_dynamic_table .
    * Call method to create dynamic internal table
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = it_fieldcat
        IMPORTING
          ep_table                  = it_dyn_table
        EXCEPTIONS
          generate_subpool_dir_full = 1
          OTHERS                    = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
           WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      SORT it_final_temp BY equnr point.
      SORT it_final BY equnr point psort idate.
      ASSIGN it_dyn_table->* TO <fs_dyn_table>.
      CREATE DATA it_wa_dyn_table LIKE LINE OF <fs_dyn_table>.
      ASSIGN it_wa_dyn_table->* TO <fs_dyn_table_temp>.
      IF it_final_temp IS NOT INITIAL.
        LOOP AT it_final_temp INTO wa_final_temp.
    * Assign equipment number and it's field data to field symbols (Dynamic table)
    * Assign field name to field symbol
          ASSIGN text-007 TO <fs_field_temp>.
    * Assign component name and it's value to dynamic table
          ASSIGN COMPONENT <fs_field_temp> OF STRUCTURE <fs_dyn_table_temp> TO <fs_field>.
    * Assign equipment number value to field symbol
          <fs_field> = wa_final_temp-equnr.
    * Assign Short Description and it's field data to field symbols (Dynamic table)
    * Assign field name to field symbol
          ASSIGN text-009 TO <fs_field_temp>.
    * Assign component name and it's value to dynamic table
          ASSIGN COMPONENT <fs_field_temp> OF STRUCTURE <fs_dyn_table_temp> TO <fs_field>.
    * Assign short description value to field symbol
          <fs_field> = wa_final_temp-psort.
    * Loop to assign value of run time generated column.
          IF it_final IS NOT INITIAL.
            LOOP AT it_final INTO wa_final WHERE equnr = wa_final_temp-equnr
                                            AND point = wa_final_temp-point.
              w_date1 = wa_final-idate.
              WRITE w_date1 TO w_var4 USING EDIT MASK '__-__-____'.
              ASSIGN w_var4 TO <fs_field_temp>.
              ASSIGN COMPONENT <fs_field_temp> OF STRUCTURE <fs_dyn_table_temp> TO <fs_field>.
              <fs_field> = wa_final-cdiff.
              CLEAR: wa_final, w_var4, w_date1.
            ENDLOOP.
          ENDIF.
          CLEAR: wa_final_temp.
    * Assign field symbol temporary table to final dynamic table
          APPEND <fs_dyn_table_temp> TO <fs_dyn_table>.
          CLEAR: <fs_dyn_table_temp>.
        ENDLOOP.
      ENDIF.
    endform.                    " f007_create_dynamic_table

  • Field Symbol not assigned Error SAP R3 46c

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

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

Maybe you are looking for

  • Spend limit check not getting validated while raising a shopping cart

    Hi Experts, Can someone suggest me what could be the reason, I had a problem with a role when ever I assign a role to a user XXXX_EBP_EMPLOYEE_1350. which means if a user raises a shopping cart for the value greater than 1350 Euros system will check

  • How to attach a file fin the middle tier in the workflow notification

    My requirement 1) File is there in the middle tier (file name : invoice_99.pdf ) 2) From workflow notification I need to read that file (invoice_99.pdf) and open it from the notification when user click on it can you please let me know is there any w

  • Strat Sequence...

    Hello Everyone, I am  new to the Portal, Presently I am learning about IC WebClient UI (Portal). It would be very helpfull for me, If anyone tell me about  Startup sequence in IC WebClient and where and how  I can change the component in toolbar and

  • Question about ex println.

    Marry christmas all. prepare for a stupid question. After a look in API I see 10 PrintStream.println() all with diffrent arguments. So for example I can do . System.out.println("A simple String); System.out.println(120)And the method with the rigth a

  • Regarding Import format for FDM Maploader

    Dear All , I m trying to import a Maploader file in which i have specified all the dimensions . However only Entity and Account dimension is getting populated . Neither ICP nor Custom 1 to 4 are getting populated . Hence while exporting i m getting t