04-24-2012 12:43 PM
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
04-24-2012 12:49 PM
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.
04-24-2012 12:50 PM
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
04-24-2012 1:06 PM
Hi Karthik ,
I too do like this & i solved the solution .
But what you said exactly right
04-24-2012 3:04 PM
Dear Shek syed,
If your question is answered then please mark it so. Thank you.
Regards,
kartik
04-24-2012 12:58 PM
Hi Syed,
You should not clear work area as its a Field Symbol.
Remove CLEAR : <WA_DYNTABLE> from your code.