Skip to Content
0
Jun 01, 2008 at 01:19 PM

The private attribute are protected in run time?

30 Views

Hi Guru,

I have an private attribute ITAB_REF in my class ZCLASS. ITAB_REF is a data reference and it will point to different internal tables(ITABS) in ZCLASS when the ZCLASS is initialized base on different condition. The ITABS are also private attributes of ZCALSS.In ZCLASS there have a private method CLEAR_ITAB and the coding is below:

FIELD-SYMBOLS <ft> TYPE STANDARD TABLE.
ASSIGN me->itab_ref TO <ft>.
CLEAR <ft>.

When I run the program the system generate a run-time error MOVE_TO_LIT_NOTALLOWED_NODATA on statement CLEAR <ft>.Below are the analysis:

    The program tried to assign a new value to the field "<ft>" even
     though
    it is protected against changes.

    The following objects are protected:
    - Character or numeric literals
    - Constants (CONSTANTS)
    - Parameters of the category IMPORTING REFERENCE for functions
      and methods
    - Untyped field symbols to which a field has not yet been assigned
      using ASSIGN
    - TABLES parameters if the corresponding actual parameter is protected
      against changes
    - USING reference parameters and CHANGING parameters for FORMs if
      the actual parameter for this is protected against changes
    - Field symbols if the field assigned using ASSIGN or ASSIGNING
      is protected against changes
    - External write accesses to READ-ONLY attributes
    - Key components of lines in internal tables of the type HASHED or
      SORTED TABLE
      SORTED TABLE.

It seems that the analysis tell me the <ft> or itab_ref or itab is protected and the value can not be changed. But I do not know where the data objects are protected since all the ATTRIBUTEs are not read-only. So any friends can tell me what happend or where is the possible error??The private attribute are protectd in run-time? Thanks very much in advance.

Best regards

Joe

Edited by: Joe.GR Chen on Jun 1, 2008 9:19 PM