Feb 2007

Balmer Spends Two Days Cleaning a PC?

This story is just too pat:

Ballmer spent almost two days trying to rid the PC of worms, viruses, spyware, malware and severe fragmentation without success.


Really? Steve Ballmer, CEO of Microsoft, considers it a good use of his time to spend two days on ridding a PC from malware? After a few minutes, it would probably have been cheaper to just ditch it and buy a new one. Or at least do a wipe-'n'-install.
|

I'm not here


HowManyOfMe.com
LogoThere are:
0
people with my name
in the U.S.A.

How many have your name?

|

Update to Generic ALV Grid Report Class

A while back (seven months, to be precise), I posted an entry about a generic ALV Grid report class. It's proven very useful to me in many situations, even if it's not for a straight report. In on case, I called a BAPI which returned a table of messages. To present these messages to the user, I used the report class. Heck, the structure of the message list is already in the data dictionary, so it's just a cut and paste job of the sample code.

But there's an embarrassing bug in the class and example, for which I have a fix, but I didn't get around to posting it until now.

The bug is that the container never gets destroyed. As a consequence, when you flip back and forth between selection screen and report output, a new container gets added every time you execute the report. It gets very silly very quickly. The solution is to destroy the container whenever we leave the display of the table. Here's how:

First, add a method to the class:

method FREE .
   CALL METHOD g_container->free.
endmethod.

Next, call this method before you leave the screen. Modify module user_command_9000 thusly:

module USER_COMMAND_9000 input.
   case sy-ucomm.
     when 'BACK'.
       set screen 0.
       CALL METHOD g_report->free.
       leave screen.
     when 'EXIT'.
       set screen 0.
       CALL METHOD g_report->free.
       leave screen.
     when 'CANCEL'.
       set screen 0.
       CALL METHOD g_report->free.
       leave screen.
   endcase.
endmodule. " USER_COMMAND_9000 INPUT


Aaaand... that's it. Now every time we move from the grid display to the selection screen, the container is destroyed, and when the report is re-run, a fresh, new container is created. Beautiful!
|