11-27-2009 10:50 AM
Hi,
I am getting this short dump error .please advise what i need to do.
Error analysis
A new value is to be assigned to the field "<GFS_F1>", although this field is
entirely or partly protected against changes.
The following are protected against changes:
- Character literals or numeric literals
- Constants (CONSTANTS)
- Parameters of the category IMPORTING REFERENCE for functions and
methods
- Untyped field symbols not yet assigned a field using ASSIGN
- TABLES parameters if the actual parameter is protected against changes
- USING reference parameters and CHANGING parameters for FORMs, if the
actual parameter is protected against changes and
- Accesses using field symbols if the field assigned using ASSIGN is
protected (or partially protected, e.g. key components of an internal
table with the type SORTED or HASHED TABLE) against changes
- Accesses using references, if the field bound to the reference is
protected (or partially protected) against changes
- External write accesses to READ-ONLY attributes,
- Content of a shared object area instance accessed using a shared lock
(ATTACH_FOR_READ).
The problem is with this line <gfs_f1> = i_nodata. of below code.
FORM init_structures USING tabname tab i_nodata.
REFRESH git_nametab.
CALL FUNCTION 'NAMETAB_GET'
EXPORTING
langu = sy-langu
tabname = tabname
TABLES
nametab = git_nametab
EXCEPTIONS
no_texts_found = 1.
LOOP AT git_nametab INTO gwa_nametab.
CLEAR gfd_char.
gfd_char(2) = 'I_'.
gfd_char+2(5) = gwa_nametab-tabname.
gfd_char+7(1) = '-'.
gfd_char+8(10) = gwa_nametab-fieldname.
ASSIGN (gfd_char) TO <gfs_f1>.
<gfs_f1> = i_nodata.
ENDLOOP.
ENDFORM. "init_structures
Regards
11-27-2009 12:50 PM
Hello Sanjay,
The possible reason for the error can be bcoz of the two two reasons.
Make shure you declare
field-symbols <gfs_f1> type DNTAB.
Map the data of the form parameter i_nodata to a another variable of type DNTAB.
Hope this helps,
Murthy.
11-27-2009 10:57 AM
Hi Sanjay,
i_nodata is in USING parameters of your form. If you want to change you have to declare i_nodata as CHANGING.
Regards,
Frisoni
11-27-2009 11:02 AM
11-27-2009 11:49 AM
Hi,
I have done as advised by you but i am still getting the same error.
" A new value is to be assigned to the field "<GFS_F1>", although this field is
entirely or partly protected against changes."
I have used the data key word to declare "<GFS_F1>", and not constant then why it is giving this message.
Kindly advise.
Regards
11-27-2009 12:12 PM
ASSIGN (gfd_char) TO <gfs_f1>.
<gfs_f1> = i_nodata.
I guess this field <gfs_f1> is pointing to an internal table, correct? Is there a key field involved or sorted table? Give some more details on to what this fields symbol is pointing to (I_tabname-fieldname).
11-27-2009 12:24 PM
PLS FIND DETAILS AS BELOW.
DATA: gfd_char(21) TYPE c.
FIELD-SYMBOLS: <gfs_f1> .
11-27-2009 12:35 PM
Ok, but what I meant was this: What is the content of the field symbol the moment the dump occurs. You are dynamically setting the value of this field symbol at runtime based on GIT_TABNAME.
11-27-2009 12:50 PM
Hello Sanjay,
The possible reason for the error can be bcoz of the two two reasons.
Make shure you declare
field-symbols <gfs_f1> type DNTAB.
Map the data of the form parameter i_nodata to a another variable of type DNTAB.
Hope this helps,
Murthy.
11-27-2009 7:39 PM
Hi Sanjay,
<gfs_f1> = i_nodata.
Here <gfs_f1> is assigned to have structure same as gfd_char.
And i_nodata , I assume , is an internal table.
You cannot assign internal table data to a workarea.
Here's what you can do:
Go in debugging mode.
Check what is the structure of both variables.
Only if both are similar , it can be copied.
Regards,
Nisha Vengal.