ABAP: Stay logged into SAPGUI indefinitely

Sometimes you’re doing something midway on your system, and you’re interrupted for a meeting or lunch or whatever. You come back and you’ve been automatically logged out, losing whatever you were working on earlier.

Prior to our upgrade to ECC6, you can simply keep yourself logged in by making timed calls to function module SAPGUI_PROGRESS_INDICATOR. Once upgraded however, the code has changed, causing it to no longer extend your GUI session.

For those who missed out on the old code that does this, here it is:

FUNCTION Z_SAPGUI_PROGRESS_INDICATOR.
*”———————————————————————-
*”*”Local Interface:
*”  IMPORTING
*”     VALUE(PERCENTAGE) DEFAULT 0
*”     VALUE(TEXT) DEFAULT SPACE
*”———————————————————————-
DATA : OUT_TEXT LIKE SY-UCOMM,
PERC     TYPE I,
MODNO    TYPE I.

IF SY-BATCH <> SPACE.
EXIT.    “do nothing in batch
ENDIF.

IF PROG_INDI_CHECKED = SPACE.
GET PARAMETER ID ‘SIN’ FIELD PROG_INDI_MODE.
PROG_INDI_CHECKED = ‘X’.
ENDIF.
IF PROG_INDI_MODE = ’0′.
EXIT.    “do nothing if turned off via SPA/GPA
ENDIF.

OUT_TEXT = TEXT.
PERC     = PERCENTAGE.
MODNO    = SYST-MODNO.
IF PERC < 0.   PERC = 0.   ENDIF.
IF PERC > 100. PERC = 100. ENDIF.

CALL FUNCTION ‘SAPGUI_PROGRESS_INDICATOR’
DESTINATION ‘SAPGUI’
KEEPING LOGICAL UNIT OF WORK
EXPORTING TEXT       = OUT_TEXT
PERCENTAGE = PERC
MODN       = MODNO
EXCEPTIONS SYSTEM_FAILURE
COMMUNICATION_FAILURE.
SYST-SUBRC = 0.

ENDFUNCTION.

Upgrading my 3.1.3 Spirit iPhone 3GS jailbreak to 4.2.1 greenpois0n

Just some notes for future reference.

Steps taken:

  1. Update stock firmware to 4.2.1
  2. Follow iClarified steps using greenp0is0n.
  3. Reinstalled Cydia apps, etc.

Encounters:

  • greenpois0n JB stopped at “firmware download etc etc 60000ms”. Waited 10 mins after that but it wouldn’t budge. Just reset the device and restart the whole JB process.
  • Old jailbreak files were not removed, particularly stuff in /var/stash. Will need to remove the old duplicate to get some space back.
  • Infinifolders is a good SBCategories replacement. :)

Wireless proxy configuration for your jailbroken iPhone

You are on your company’s WiFi network. You’ve been able to access intranet sites so far, but now you’d like to access an external site via the company’s HTTP proxy. Your company, however, does not provide a proxy auto-configuration URL. You are therefore stuck with having to add or remove the proxy manually in your iPhone WiFi settings each time you’d like to access external or local sites, respectively.

So how can we make things easier? Simple, create your own proxy.pac file.

Create a text document on your computer. In this file, write the JavaScript code necessary to help Safari use your proxy only when needed. See this Wikipedia page for examples. Here’s what mine looks like:

function FindProxyForURL(url, host) {

proxy = “PROXY companyproxy.address.com:8080″;

// Next, we want to send all traffic to company.net browser direct
if (dnsDomainIs(host, “.my.intranet.domain.com”)) {
return “DIRECT”;
}

// Loopback and localhost goes browser direct always.
if ((host == “localhost”) ||
(shExpMatch(host, “localhost.*”)) ||
(host == “127.0.0.1″)) {
return “DIRECT”;
}

// Test to see if host is an IP address
reip = /^\d+\.\d+\.\d+\.\d+$/g;

if (reip.test(host)) {

// Check for local IP address
if (isInNet(host, “192.168.0.0″, “255.255.0.0″)) {
return “DIRECT”;
}

}

// Default return condition is the proxy, since itâ??s assumed that everything
// else is on the Internet.
return proxy;

} // End of function

Save and name the file as proxy.pac. One site recommended that the file encoding be set to UTF-8, which I followed and it seems fine. Take this file and copy it to anywhere on your iPhone using tools such as iFunbox or iFile or SSH. I put mine in /var/mobile/Documents.

Now go back to your iPhone WiFi Settings in Settings –> Wi-Fi. Tap on the > button of your WiFi network to view its settings. Swipe all the way down and change HTTP Proxy to Auto, and in the URL field type in the file location, e.g. file:///var/mobile/Documents/proxy.pac. Exit, and all your programs should now automatically detect whether a proxy should be used whenever you are on this WiFi network.

SPCA confusion

The SPCA is great and all, taking in strays and whatnot, but seriously, their administration and ‘customer service’ could use some work. Love their doctors though.

As you may know, both our cats are formally adopted from SPCA.

Cat #1: Shcamper. Not yet neutered since he was still a ‘teenage’ kitten when we picked him up. The neutering fee should be free as part of the RM100 adoption fee. Called them to see if we can walk-in or schedule an appointment and the lady on the phone flat out said that they don’t do neutering. Told us to go to the Kembiri clinic instead. And we did, but the guy told us that actually SPCA cats should be neutered by SPCA back at Jalan Kerja Ayer Lama. Since we were already there we might as well proceed, with an additional RM50 donation for the procedure.

Cat #2: Chewmil. Spayed by SPCA but still shows signs of heat. Called SPCA to get her checked out but the girl on the phone said they don’t tend to adopted cats after one month of adoption. Like lepas tangan only right? Will most likely have to spend another RM100 for another procedure at Kembiri. Poor girl.

It would have been great if these people behind their desks would take the trouble to explain to people exactly how and what the process is. If there’s going to be just one month of support, at least say so in the beginning. I don’t know if these people are there just for the job or for the cats, but please lah, be more emphatic with the people you deal with.

2-month mega update~!

Hello world! While you’ve not heard from me for so long, trust me, a lot has happened in the meantime. Sorry for the lack of updates, though. Continue reading ’2-month mega update~!’