Mostly SAP related…
SAP
Logon Popup in the WebClient
Jun 9th
We recently experienced a problem at a customer that drove everyone up the wall. Between 15:00 and 17:00 in the afternoon the user would get a spontaneous Java login popup. Once this happened the ITS would also require the user to log in again.
These login screens aren’t unknown. You normally get them at every customer the first time you log into the WebClient. In order to enable the sending of real time notifications to the client(i.e Broadcasts, Alerts and Telephony) a Java Applet is used to continuously poll the ICF(BC->Notify->Polling Service). This applet requires a login to SAP. The ITS also requires the user to log in again.
So you fix this by sending your local basis consultant a mail telling him to please set the parameters below and restart the instance:
- login/create_sso2_ticket = 2
- login/accept_sso2_ticket = 1
Problem solved, no multiple logins required, that is until 3 O’Clock in the afternoon…
We searched for notes, interrogated Desktop Support, logged the problem with SAP, sniffed the network, checked java versions, moved users, reinstalled machines, etc… We can’t figure out what happens 8 hours after a user has logged in?
By the way, below is a couple of notes you may find helpful:
- Note 996854 – MYSAPSSO2 cookie gets deleted while launching IC Webclient
- Note 1075935 – Logon Popup from IC webclient from the Applet
- Note 1021530 – Alert message is shown after a delay(about 15 minutes)
- Note 1097546 – Polling applet creates many sockets
Eventually, SAP responds on the note after 2 months, that we should check our Single Sign On configuration and they provide the link below.
http://help.sap.com/saphelp_nw04/helpdata/en/88/4b353a03e5494ce10000000a114084/frameset.htm
And there it is!!!
login/ticket_expiration_time => Default = 60 hours
Turns out the default is not 60 hours, but 8 hours. 8 Hours after the user logged in, the ticket expires, requiring them to reauthenticate. I still can’t believe I didn’t think of/find it/RTFM’d this earlier.
Quick Guide to Patching your SAP System
Jun 1st
I need to upgrade our internal demo systems every once in a while. Now, as I don’t unleash my Basis skills on customers everyday I tend to forget how its done. I decided to record the steps here to save me a bit of time next time around. Please treat any advice given here with care(I’m no expert at this) and read the official guides and help files.
Applying patches to an SAP system is not as simple as, say updating your Windows PC. There is no auto update or one click upgrade process. I will be surprised if there ever will be. The thing is, SAP actually allows you a lot of freedom and flexibility in changing the way it works(Windows doesn’t). The price you pay is a slightly complex upgrade process.
Doing a full Support Pack update of an SAP system broadly involves the following:
1. Log in to the Service Market Place and select the packages to be downloaded. Admittedly, this is a bit easier now with SP Stacks.
2. Log on to your Solution Manager System(Maintenance Optimizer) to confirm your download basket. If you don’t do this you can’t download your Patches. I must still figure out what the benefit of this is.
3. Download the files using the SAP Download Manager.
4. Use sapcar to extract the patches. You can use the command sapcar -xvf <filename.car> from command line to do this. An easy way to extract these files in Windows is to register the extensions .CAR or .SAR to open automatically in Explorer.
You can do this by opening Windows Explorer and going to Tools->Folder Options and clicking on the File Types Tab.
Create a new type for the .CAR/.SAR file types and create a default action as shown in the screen shot below( Copy SAPCAR.EXE to your C:\Windows directory first).
You can now “mass extract” all your patches at once by selecting all 50+ files in Windows Explorer and hitting enter on them. If you do this on a laptop now would be a good time for a coffee break.
5. Now the real upgrade can start. Always update your kernel to the latest release first. This involves the following:
- Determine your global kernel directory. Goto transaction AL11 and look for directory mapped to DIR_CT_RUN. In my case(on Linux) this is /usr/sap/<SID>/SYS/exe/run.
- Log in with your <sid>adm user. This will ensure you preserve the correct rights to your files.
- Backup this directory by copying it to somewhere safe.
- Overwrite the files in your DIR_CT_RUN directory with the new kernel files extracted in step 4. These files aren’t used by the SAP System, so you can safely overwrite them while the system is still running.
- On Windows I would recommend rebooting the box, on Unix environments you only need to stop and start the instance.
- During the startup of the instance a program called sapcpe will copy the new kernel files in DIR_CT_RUN to DIR_EXE_ROOT(usr/sap/<SID>/exe).
6. Now, do a full off line database backup and keep in a safe place.
7. Copy the ABAP Support Pack files extracted in Step 4 to the following location on the SAP Server: /usr/sap/trans/EPS/in.
8. Log on to the SAP System in client 000 with your own user(not SAP* or DDIC).
9. Execute transaction SPAM(what a name…).
10. Load the Support Packages. On the SPAM main menu goto Support Package->Load Packages->From Application Server.
11. Now we hit the stage where P.P.P.P.P.P. You have to read all the notes on all the patches for all the components you want to upgrade. There are many dependencies here and it is easy to stuff up. But a few points:
- Make sure TMS is configured properly and actually working(i.e. test with a transport). This is important on new installs and has burned me in the past.
- Always upgrade SPAM to the latest version first. Always!
- Read the notes on optimal queue definitions, make them as long as possible, but keep the next point in mind…
- Don’t overshoot(see note 70228 for explanation). This is critical if you have add-ons such as XRPM, WFM or even CRM 2007(which now requires a CRT(Conflict Resolution Transport) after every ABAP support pack).
- Write down all the steps you took and queues you used as this will help in the upgrade of downstream systems.
12. If you read the plethora of notes before hand and manage to follow them correctly everything should go fine.
13. If you do it Cowboy style(and ignore point 12 like I do
), SPAM failure is likely. You could try the following, in order:
- Restart the Process. Always do this 2 or 3 times before proceeding, especially with BASIS/ABAP support packs.
- Search for notes on the Service Market Place. You are probably not the first one to mess up. Also, sometimes the support packs contain errors.
- Try to reset the queue and process again.
- If you absolutely have to back out and SPAM does not allow you to reset the queue, you can do the following if you are brave. Run Function Module OCS_RESET_QUEUE in SE37 with the parameters IV_TOOL=SPAM and IV_FORCE=X. Just realize that this will leave your system in an inconsistent state. You may need to do some significant manual fixing.
- Log it with SAP.
- Restore your backup and try again.
Eventually you should have an up-to-date, everything recompiling, SAP System.
Oh, and if you are unlucky enough to use a J2EE stack as well. Good Luck…
Messages in the WebClient
Jan 26th
I liked the idea of Nigel James to post handy tips for his own future reference. I decided to shamelessly copy him and post some of my own tips here. I will try to post them as I come across them.
So, you can use the code below in a controller class to display messages to the user.
data: lr_msg_service type ref to cl_bsp_wd_message_service,
lv_msg type symsgv.lr_msg_service = view_manager->get_message_service( ).
lv_msg = '<YOUR_MESSAGE_VARIABLE>'.
CALL METHOD lr_msg_service->add_message
EXPORTING
iv_msg_type = if_genil_message_container=>mt_error
iv_msg_id = '<YOUR_MESSAGE_CLASS>'
iv_msg_v1 = lv_msg
iv_msg_number = '<YOUR_MESSAGE_NO>'
iv_important_info = abap_true.My Table Mover(Part 1)
Nov 27th
I am currently doing more development work than I want to or supposed to do. So, I will start this blog on a rather technical note by taking you through a small development I did the other day. Hopefully someone finds this useful.
I needed to move a table from one SAP system to another system in a different landscape. It was the ideal opportunity to do a bit of interesting coding for a change (you can normally do this using a transport, once you get past the bureaucracy).
Now, I am not going to discuss the merits of the program I did develop or if it should even be used in an SAP system. All I am going to say is that changing SAP tables directly is extremely risky and should never be done in Productive Systems. It just turns out that this program was ideal for showing some not so common ABAP techniques.
My requirements definition for the Table Mover were as follows:
- Download multiple tables at once
- Upload multiple tables at once
- Be able to open/edit the downloaded file in Excel
Ok, so in order to meet requirement 1 and 2 I needed to include the table name in download structure. Requirement 3 meant I needed to use tab-delimited text or CSV. So I ended up with the following definition for a line type:

So this program will upload and download files in Ascii format. The first 16 characters will contain the table name and the rest of the row will be table contents in tab delimited format.
The old GUI_UPLOAD, GUI_DOWNLOAD, etc. Function Modules have been flagged as Obsolete in NetWeaver 7.0(AKA 2004s or whatever SAP decides to rename it to in future). Therefore I used the following methods to do my file processing:
- cl_gui_frontend_services=>file_open_dialog
- cl_gui_frontend_services=>gui_upload
- cl_gui_frontend_services=>gui_download
I had to upload and download the files without taking the tab-separator into account because I don’t know the structure of the table until I have uploaded the record.
In the next post I will discuss the details of the uploading and downloading mechanism.
In the meantime, here is the source code of the program. I wrote the program very quickly, so apologies for lack of error checking, testing, structure, etc. Source Code – Table Mover
