01-18-2017 12:15 PM
Hello Experts,
I have a issue with a ABAP program that he teminited with dump .
Its
Its possible to optimizate the folowing code ?
01-18-2017 12:40 PM
01-23-2017 7:51 PM
Yep, treat a gushing wound with a blood infusion. Stellar advice.
01-23-2017 10:24 PM
Jelena, good point, bad analogy... Often trauma patients are hooked up to blood (in my days, more commonly plasma these days) while looking for a way to get the bleeding stopped. Does save lives - just saying 🙂
01-25-2017 2:07 PM
Raghu, thanks for the info. Important difference - "while looking for a way to get the bleeding stopped". Folks here seem to believe that "increase memory size" is a permanent solution. At least no one other than Matthew advised OP to look for the root cause.
01-23-2017 12:41 PM
Increase the memory size..check with your BASIS team or restrict the amount of data you have given in selection.
01-23-2017 1:33 PM
You've not really given enough information for a proper answer.
You need to determine if this issue is due to a memory leak (faulty programming) or just too much data. In either case, the fix is not to increase the amount of memory you have - except in rare cases you'll just run into the new limit.
To work out whether it's a memory leak, run in debug. Check the amount of data in <wt_fs_tables> before the loop start - use the memory analyser to see how much memory it's actually using. As you go through the loop, watch <wt_fs_tablez> and see how its memory usage increases.
Check whether the method containing this bit of code is being called multiple times.
One more piece of advice. Your variable naming is absolutely terrible. I assume that "fs" is for field symbols? That's a complete waste, because the little brackets < > tell you it's a field symbol. And tables and tablez are utter meaningless names. Please spend some effort making your code readable and comprehensible.
01-23-2017 4:18 PM
Ding ding ding!!!!
Very limited info yet so many people willing to throw bad information at him hoping they are right. Uggg
I agree with your points. I suspect that <wt_fs_tables> and <wt_fs_tablez> point to the same table. He is looping one while inserting to it....basically he keeps extending the table by one on each loop, so it will just keep looping.....and keep adding records....and loop again on the new record....and add a new one....etc etc......so of course his internal table is "blowing up". BUT....he hasn't told us too much more.
01-23-2017 10:21 PM
I suspect that <wt_fs_tables> and <wt_fs_tablez> point to the same table
That is exactly what I thought looking at the code... what are the table sizes to begin with? That would be useful information!
Matthew, you brought up another pet peeve of mine. As a consultant, I have written code for many, many, clients and very often I am handed a huge manual and told to follow some cockamamie naming convention. For example, if it is local call start with 'l', next a 'v' to denote it is a variable (really, really?), next 'c' because it is a character, then local to where, so I end up with a variable lvc_funcname_counter... Argh!
01-24-2017 8:20 AM
If you haven't already seen it, you'll find this interesting
https://blogs.sap.com/2014/12/29/abap-modern-code-conventions/
01-23-2017 10:26 PM
and how do you propose to solve this problem with parallel processing?
01-24-2017 11:07 AM
Use the below mentioned link https://wiki.scn.sap.com/wiki/display/ABAP/FETCH+and+OPEN+CURSOR+Analysis
Also check if you can aggregare on some field ?
Use the PACKAGE SIZE in your query.
01-24-2017 11:28 AM
01-24-2017 12:33 PM
01-24-2017 12:58 PM
01-24-2017 1:17 PM
I don't know why you want me to have a crystal ball to answer a query could you be specific what you meant ? don't beat around the bush this is forum for technical questions not for debating ones personal opinions
01-24-2017 2:03 PM
Thank you so much for your answers
the amount of data in <wt_fs_tables> before the loop is 2 219 336.
01-24-2017 2:18 PM
You need to check in the debugger and/or dump analysis the memory consumption. The number of records in the table doesn't give the whole picture.
If you want meaningful responses, then provide additional info, e.g., screenshot of the memory analysis.
01-25-2017 2:13 PM
+1 to Suhas. There are tools available in SAP to troubleshoot such issues. Google it.
01-24-2017 2:13 PM
I don't know why you want me to have a crystal ball to answer a query could you be specific what you meant ?
You would understand the "pun", if you realise why your answer got 6 "down votes" (read: at the time of posting this comment) ... and with this i rest my case!
01-24-2017 4:18 PM
When I run the program manually , I get any errors. but when this program running in parallel with another programs I get the dump mensionned below.
01-24-2017 5:43 PM
What do you mean "manually" here - SE38 or the debugger? And, can you help us understand what you mean by "running in parallel with another programs". What other programs are running? Do you normally test by making sure there are no other users or background jobs running?
01-24-2017 4:18 PM
Besides the crystal ball, I need crystal-something-else to understand the relationship between that article about portioning up data fetches and running them in parallel processes to the question here, which has nothing to do with the database. And, using PACKAGE SIZE on an internal table - sorry future readers for the in-the-moment cultural reference - all I can think of is a certain comment on "alternate facts" by someone who is really worried about things being YUUGGE!
01-26-2017 4:30 PM
Wow ! can't believe this much happened since i last visit ! Thanks all for the information.