12-03-2007 4:46 AM
Hello,
When i execute this code, I am getting a run-time short dump. The error says: 'Overwritten protection field'. The error says that we cannot modify the field-symbols. The error points to the highlighted portion of the code. How to overcome the error?
FIELD-SYMBOLS: <xth_data> TYPE HASHED TABLE,
<ls_data> TYPE /1SEM/_YS_DATA_150ZBPSMA03,
<ls_chas> TYPE /1SEM/_YS_CHAS_150ZBPSMA03,
<ls_kyfs> TYPE /1SEM/_YS_KYFS_150ZBPSMA03.
DATA: tmpamount TYPE F,
tmpvtype TYPE /BI0/OIVTYPE.
tmpvtype = '020'.
LOOP AT xth_data ASSIGNING <ls_data>.
ASSIGN COMPONENT 'S_CHAS' OF STRUCTURE <ls_data_new> TO <ls_nchas>.
ASSIGN COMPONENT 'S_KYFS' OF STRUCTURE <ls_data_new> TO <ls_nkyfs>.
IF ( <ls_chas>-0fiscper >= '012' ) AND ( <ls_chas>-0vtype = '10' ).
tmpamount = <ls_kyfs>-0amount * 100.
<b> <ls_kyfs>-0amount = tmpamount.
<ls_chas>-0vtype = tmpvtype.</b>
ENDIF.
ENDLOOP.
Thanks
null
12-03-2007 4:51 AM
I think you need to put ASSIGN statement.
Try to do like:
ASSIGN TMPAMOUNT TO <ls_kyfs>-0amount.
ASSIGN TMPVTYPE TO <ls_chas>-0vtype.
Regards,
Naimesh Patel
12-03-2007 4:51 AM
I think you need to put ASSIGN statement.
Try to do like:
ASSIGN TMPAMOUNT TO <ls_kyfs>-0amount.
ASSIGN TMPVTYPE TO <ls_chas>-0vtype.
Regards,
Naimesh Patel
12-03-2007 5:33 AM
Hello Naimesh,
It didn't help.
I tried as you suggested. The error i get is:
<ls_kyfs>-amount is not defined as a field symbol.
Thanks.
12-03-2007 5:54 AM
hi,
try this.
LOOP AT <b><xth_data></b> <b>into</b> <ls_data>.
ASSIGN COMPONENT 'S_CHAS' OF STRUCTURE <ls_data_new> TO <ls_nchas>.
ASSIGN COMPONENT 'S_KYFS' OF STRUCTURE <ls_data_new> TO <ls_nkyfs>.
IF ( <ls_chas>-0fiscper >= '012' ) AND ( <ls_chas>-0vtype = '10' ).
tmpamount = <ls_kyfs>-0amount * 100.
<ls_kyfs>-0amount = tmpamount.
<ls_chas>-0vtype = tmpvtype.
ENDIF.
ENDLOOP.
12-03-2007 8:52 AM
Hello Kamini,
It didn't help either. I get an error - Field-Symbol <ls_data> has not yet been assigned.
Thanks