Skip to Content
author's profile photo Former Member
Former Member

Function Module question

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Dec 03, 2007 at 04: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 03, 2007 at 05: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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.