Month: January 2009

Empty rows in ITSMobile screens

More fun deploying ITSMobile screens for mobile devices.  This time, I was tasked with finding a way to shrink the screens so they fit better on the handheld devices used in our factories.  It took a lot of research and trial and error, but I finally satisfied my users.  Here’s a summary, all in one place.

First I concentrated on reducing the horizontal size of the screen elements.  This turned out to be pretty easy: I created a custom generation style using this excellent walkthrough.  I overrode the _COMPUTE_WIDTH_STRING method and changed the emfactor value from 1.0 to 0.8.

The vertical dimension proved more challenging. I knew I could save a lot of space by removing all the empty lines at the bottom of every screen, but it took me a while to figure out how to do this.  Here’s the solution I ended up with: In my custom generator class, I overrode the _CONTENT_EMPTY_SPACE method, which is called for every empty cell.  In the case of a empty row the generator writes a single empty cell that spans the entire screen.  To trap this condition I added the following check:

[code]IF pi_columns = _screen_header-columns. [/code]

Inside this block I grabbed the value of the style attribute ( l_replacement-value) and added ” height:1px; “.  Now all the empty rows are shrunk down to 1 pixel in height, effectively removing them.

One last trick – our mobile devices use Internet Explorer which has a feature where the vertical scrollbar is always visible, even when it’s not needed.  I added the following entry to my mobile.css stylesheet to hide the vertical scrollbar and regain some screen real estate:

html, body {
overflow: auto;

SAP ITSMobile login page

Here’s another interesting feature I ran across while setting up ITSMobile.  Some users were able to log in ok, while some were getting this message:

Client, name, or password is not correct; log on again

We finally discovered that the password textbox on the standard login page has a max length of 8 characters. Since longer passwords are valid in SAP, we ended up customizing the login screen to accommodate longer passwords.

To do this, we copied the CL_MOBILE_SYSTEM_LOGIN class to a Z class, and modified the HTM_LOGIN method.  This is the method that outputs the html code for the login page.  You’ll see in the html for the password textbox that is has “maxlength=8”.  Modify this value and activate the class.

To tell ITSMobile to use your custom class, go to transaction SICF (we had to have our Basis group do this) and find your ITSMobile service.  Double-click it to open the modify screen.  Go to the “Error Pages” tab and click the “Configuration” button next to the “System Logon” option.  In the “Logon Layout and Procedure” section, make sure the “User-Specific” option is selected, and enter your Z class name in the Class field.  Adjust links and Images, reactivate the service, and the custom login screen should be in place!

Background task hanging

One of the reasons I started this blog was to document SAP “features” that I had to learn about the hard way.  I just came across another one this week, so here it is.

I’ve implemented the sequential Document Parking workflow (WS00400032), and had it tested and working beautifully.  After moving to a new client for testing, users were complaining that parked documents were not posting after the workflow had completed.  I checked the log and saw the the posting step was not completing:

Workflow task incomplete

I checked session logs and background jobs to see if WF-Batch was getting hung up somewhere, but no dice.  I found a couple posts that said if an error is encountered the step would abort but never show an error message.  I checked ST22 as the other posts suggested, still no luck.

Then, while reviewing the workflow log for the hundredth time, I noticed an error message at the workflow framework level: Execution interrupted (SWF_RUN 611).

Workflow log

Alas, even armed with an error number to search on, I was still unable to find an issue.

So, I resorted to firing up the debugger, anticipating hours of reading SAP code.  Instead, after only a few function calls, the program exited unsuccessfully, and I saw a message about the program needing to be regenerated.  I am using a customized version of the FIPP business object, so I went to SWO1, regenerated my ZFIPP object, and ta-da, everything was back to normal.