Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Internal Table

Former Member
0 Kudos

Hi Experts ,

  In Dynamic Internal Table , If I modify any record ,for input values in Dev it is working fine .But when I run this in quality I am getting Dump Because CLEAR statement clears the internal table <T_DYNTABLE> data after modify . Can you please give any solution <signs of hastiness removed by moderator>



ASSIGN COMPONENT V_MB OF STRUCTURE <WA_DYNTABLE> TO <L_FIELD>.

<L_FIELD> = V_TOTAL.

MODIFY <T_DYNTABLE> FROM <WA_DYNTABLE> INDEX 24 TRANSPORTING (V_MB).

       CLEAR : <WA_DYNTABLE>

Message was edited by: Thomas Zloch

5 REPLIES 5

Private_Member_49934
Contributor
0 Kudos

did you do the below code ? Check the bold code. And by the way waht is the dump? Field symbol  not assigned? if so then the sy-subrc check is absolute must when working with field symbol

LOOP AT <T_DYNTABLE>  ASSIGNING <WA_DYNTABLE>.

ASSIGN COMPONENT V_MB OF STRUCTURE <WA_DYNTABLE> TO <L_FIELD>.

<L_FIELD> = V_TOTAL.

IF SY-SUBRC = 0.

MODIFY <T_DYNTABLE> FROM <WA_DYNTABLE> INDEX 24 TRANSPORTING (V_MB).

       CLEAR : <WA_DYNTABLE>

ENDIF.

ENDLOOP.

Kartik2
Contributor
0 Kudos

Dear Shek Syed,

I guess you are doing something like this,

loop at <t_dyntable> assigning <wa_dyntable>.

...

modify...

clear <wa_dyntable>.

endloop.

here, as each and every record of your internal table is being assigned to the work area <wa_dyntable> in the loop statement, the field symbol <wa_dyntable> will point to the current record that is being processed inside the loop. if you try to clear it inside the same loop, then definitely all the entries will be cleared.

my suggestion, do not clear the work area field symbol.

Hope it helps, thank you.

Regards,

kartik

Former Member
0 Kudos

Hi Karthik ,

I too do like this & i solved the solution .

But what you said exactly right

0 Kudos

Dear Shek syed,

If your question is answered then please mark it so. Thank you.

Regards,

kartik

Former Member
0 Kudos

Hi Syed,

You should not clear work area as its a Field Symbol.

Remove CLEAR : <WA_DYNTABLE> from your code.