cancel
Showing results for 
Search instead for 
Did you mean: 

Memory overload

Former Member
0 Kudos

Hello,

If I scroll through a relatively large grid in script, my computer's memory flows completely over (Over 2 GB visible in taskmanager, only 1 GB available physically).

Now I understand that the grid's values are read into memory while getting visible on the screen. But it of course also slows down my computer considerably.

Is there a way to free up the memory used by the rows I already scrolled passed?

This is the code:

Set grd = Session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell")

With grd

'Cellen vullen

For Iy = 0 To .rowcount - 1 Step .VisibleRowCount

.firstVisibleRow = Iy

Next Iy

End With

Regards, bas.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

These memory problems were caused by SAP GUI 710 patchlevel 11.

Problem solved by installing patch level 17.

Former Member
0 Kudos

And to add to that:

The memory doesn't get freed up untill I completely close the SAP GUI, including logon-pad.

Leaving the grid doesn't free up memory.

script_man
Active Contributor
0 Kudos

Hi Bas,

I have found that this phenomenon has nothing to do with the script. This can also manually create in the grid. One of the possible solutions to the problem is that it sorts the grid in between again.

For example:


ly_ = 0
set grd = Session.findById("wnd[0]/usr/cntlGRID1/shellcont/shell")
With grd
For ly = 0 to .rowcount - 1 step .VisibleRowCount
.firstVisibleRow = ly
if ly / 5000 > 1 + ly_ then
   .selectColumn "ORDER_NR"
   .pressToolbarButton "&SORT_ASC"
   .selectColumn "ORDER_NR"
   .pressToolbarButton "&SORT_DSC"
   ly_ = ly_ + 1
end if
Next
End With

Of course, the parameter ORDER_NR must be adjusted.

Regards,

ScriptMan

Former Member
0 Kudos

Hi Scriptman,

Thanks for your answer. Yes, I noticed it is not the script causing this. Scrolling a grid manually has the same effect. It's just the SAPgui not freeing up memory space. Even when the grid is not on the screen anymore the data will stay in memory. Opening the grid again and scroll through it, just adds up to what's already in memory.

I'am sorry to say, but your solution didn't work.

I even tried deleting rows from top while I was scrolling down. But that also didn't free up any memory.

Regards, Bas.

script_man
Active Contributor
0 Kudos

Hi Bas,

I am sorry that I have not expressed myself correctly. The grid should not be scrolled. It is to sort. The best in the first column first descending and then ascending. After that, the memory must be freed.

The above example sorts the scrolling grid to every 5,000 new rows.

Regards,

ScriptMan

Edited by: ScriptMan on Nov 12, 2010 1:24 PM

Former Member
0 Kudos

Hi Scriptman,

No, you did express yourself correctly. Maybe I didn't in my reply.

I understand what you're saying, but it doesn't work. Actually, the sorting also increases memory usage.

Regards, Bas.

Edited by: Bas Prins on Nov 12, 2010 2:04 PM

script_man
Active Contributor
0 Kudos

Hi Bas,

Let there be specific. What is the transaction in SAP? Maybe I can understand it in this way.

Regards,

ScriptMan

Former Member
0 Kudos

Okay,

I'm in IW39 (maintenance workorders), but step to workorder operations from there. The system will tell that I'm still in IW39, but the overview will look like IW49.

The grid has 15 columns and 5847 rows. (I set the interval for sorting in your earlier proposal to 1000 instead of the 5000)

Regards, Bas.

script_man
Active Contributor
0 Kudos

Hi Bas,

Unfortunately I do not have access to the transaction IW39. Suppose you have at least 2 layouts for the report, you can try, to switch between this.

For example:


. . .
if ly / 1000 > 1 + ly_ then
 .pressToolbarButton "&MB_VARIANT"
session.findById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell").setCurrentCell 8,"TEXT"
session.findById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell").selectedRows = "8"
session.findById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell").clickCurrentCell
.pressToolbarButton "&MB_VARIANT"
session.findById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell").setCurrentCell 7,"TEXT"
session.findById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell").selectedRows = "7"
session.findById("wnd[1]/usr/ssubD0500_SUBSCREEN:SAPLSLVC_DIALOG:0501/cntlG51_CONTAINER/shellcont/shell").clickCurrentCell
 ly_ = ly_ + 1
end if
. . .

The commands after you press the button "MB_Variant" you must create itself.

Regards,

ScriptMan

Former Member
0 Kudos

Well, thanks again Sriptman,

I tried your suggestion manually, not in code. But changing layout doesn't help. Also again, it even adds some more MB in memory.

I am starting to wonder if there's something wrong with my gui (710 with patch 11) or PC. A user shouldn't have to run into memory problems just by scrolling a list, isn't it?

Regards, Bas.

script_man
Active Contributor
0 Kudos

Hi Bas,

Good that you mention it. I work with SAP GUI 7.1 patch level 12 Perhaps here lies the difference.

Regards,

ScriptMan

Former Member
0 Kudos

Just tried it on my colleague's machine who is stil on 640 patchlevel 26. No problem there, almost no memory increase.

I've been on the wrong foot all along.

Time to call our service desk

Thanks anyway scriptman. You've been great in your attempts to help me.