Posts

Showing posts from December, 2011

Leaving Sender File Deletion to FTP Service

When a file is picked up and processed by File Sender Channel, it is either archived or deleted to avoid being processed again in the next poll. In order to remove the file from the source directory, the sender channel sends a DELE command. Some FTP service providers do not want the PI system to delete the file and rather wish to have FTP service do that task after the message is processed. In order to allow such scenario, SAP has introduced a new parameter:  ftp.ignoreSourceFileDeletion . This parameter can be set in the advanced mode. The default value of this parameter is false, which means that the channel can delete the sender file. If this parameter is set to true, DELE command issued by the channel is ignored even if archive/delete option is selected as 'Processing Mode'.

FTP Scripts for UNIX and Windows

Here are example FTP scripts to get a file from an FTP server. UNIX: With this script, pass the ftp server hostname, user ID, password and file name with the command. If the script's name is myftpscript.ksh here is how you should use this script: myftpscript.ksh ftp_server user pass file_name #!/bin/ksh HOST=$1 USER=$2 PASSWD=$3 FILE=$4 # Change to working directory cd /ftp_working_directory #Delete existing file if [ -f ${FILE} ]; then rm ${FILE} fi #Download file from ftp server ftp -vn $HOST <<END_FTP > /ftp_working_directory/ftplog 2>&1 quote USER $USER quote PASS $PASSWD ascii get $FILE bye END_FTP exit 0 Windows: Again, pass the ftp server hostname, user ID, password and file name with the command. If the script's name is myftpscript.cmd here is how you should use this script: myftpscript.cmd ftp_server user pass file_name @ECHO OFF set PATH=C:\ftp_working_directory;%PATH% pushd "C:\ftp_working_directory...

SAP Tools for SQL Server Administration

Tweaking the SAP installation tool SAPinst, SAP has provided as set of tools that can be used to perform the following tasks on MS SQL Server: Perform a system copy (for SAP kernel <= 640) Convert to a schema-based configuration from dbo-based one Upgrade SQL Server 2000 to SQL Server 2005 or higher You can download the SAP Tools for MS SQL Server (STM) from http://service.sap.com/msplatforms --> SQL Server . Apply security patch from SAP note 1375494 before using the tool and change any DB specific profile parameters. Example: Change dbs/mss/server=$(SAPDBHOST) to dbs/mss/server=<db hostname> Usage of the tool for above mentioned tasks is pretty straightforward. Once you have downloaded and extracted the tool, go to <Path to STM tool folder>STM\<Your Platform> and call sapinst.exe. The dialogue screens will guide you from there.

DB Connection Issues - PI to Microsoft SQL Server

1. Database connection hangs during logon When connecting to SQL Server DB with a JDBC sernder/receiver Communication Channel, if the channel errors out during logon due to poor performance of MS SQL server (for example), you can adjust the timeout for logon by adding the following parameter in the advanced mode section of the channel configuration driver:loginTimeout   30 This parameters changes the default logon timeout from 15 seconds (version 3 sqljdbc.jar or sqljdbc4.jar) or unlimited (sql driver version 1.2) to the custom value of this parameter (in seconds). 2. SQL Statement Execution hangs If the SQL statement execution hangs, the Communication Channel hangs. Again the timeout for the Channel to wait for execution can be controlled from advanced mode section of the channel configuration. Add the following parameter: driver:lockTimeout    300000 The default lockTimeout is unlimited, you can set this parameter (in ms) in order to avoid hang situation. ...

How to Fix Uneven HTTP Load Balancing in SAP PI

Starting from SAP NetWeaver 7.1, the Java stack does not have a dispatcher node as it was the case with earlier release. The job of the dispatcher--load balancing the incoming HTTP requests to J2EE server nodes--is now taken over by ICM. The ICM is designed to load balance http sessions (stateful http calls), which is not optimal for applications like PI which primarily uses stateless calls. The result is decreased message throughput. In order to optimize load balancing on SAP PI (7.1 to 7.3) add the parameters below in the SAP instance profile: j2ee/HTTP/request_strategy = STATELESS j2ee/HTTP/request_STATELESS_0=0,7,2,0,1,0 j2ee/HTTP/request_STATELESS_1=0,3,3,0.9,0.01,1 j2ee/HTTP/request_STATELESS_2=0,2,6,1,1,0.01 j2ee/HTTP/request_STATELESS_3=0,5,2,0,0.01,1 j2ee/HTTP/request_STATELESS_4=1,1,0,0,2,0.5 j2ee/HTTP/request_STATELESS_5=1,3,1,0,1,0.01 j2ee/HTTP/request_STATELESS_6=1,6,1,0,20,0.5 j2ee/HTTP/request_STATELESS_7=1,4,3,0,0.0001,0.0001 Restart ABAP+Java i...

Disabling VM Container in PI systems

The ABAP work processes on SAP NetWeaver 7.1 onward have an embedded "Virtual Machine Container". These are tiny java engines useful for Business Suite products like CRM, SRM and ERP. As PI systems are also built on NetWeaver, VMC is available on the ABAP stack of the PI system. PI does not require VMC and hence VMCs can be disabled to save memory and CPU resources. To turn VMC off, set the following parameter in ABAP Instance or Default Profile: vmcj/enable = off

Switch Deletion Procedure in SAP XI

In a normal deletion procedure, when a message is eligible for deletion, it is deleted from the table with SQL delete statements. There will be a lot of deletion statements running on the table which also has inserts going on as new messages are processed. In order to make deletion faster, switch deletion was introduced. This procedure means that 2 set of tables are used in XI. At any time one set is used for storing the XI messages. When message pass the retention time, they are marked as logically deleted, but not really deleted from the table yet. As the messages keep accumulating, the fill level of the persistence layer crosses the threshold defined by DROP_MAX_TABLE_LOAD. When this threshold is crossed, the inactive set is activated and all the messages that are within retention time are copied into the active set of tables. The messages marked as logically deleted remain in the old set of tables. These tables are then truncated. This way, the messages are deleted in a single sh...

Deleting SXMSPFRAWH Data in SAP XI

Image
The performance headers for XI messages are maintained in SXMSPFRAWH table. You should run SAP_XMB_PERF_REORG job (ABAP report SXMS_PF_REORG) regularly to keep this table from growing endlessly with new XI messages coming in. If you have not run this job for years or months, this table might already have a huge amount of data. Before you schedule SAP_XMB_PERF_REORG job, do the following: 1. Call SXMB_ADM, go to Integration Engine Configuration -> Category PERF and set these parameters: 2. Call transaction SE11 and create an index with the following details: Table name: SXMSPFRAWH Index ID:      AGG Short description: Index for aggregation Choose: "Non-unique index" and "Index in all database systems" Field names: SENDER RECEIVER COMPONENTID PROCMODE SOURCE LASTTS 3. Run SAP_XMB_PERF_REORG job (ABAP report SXMS_PF_REORG) on a weekend or during low activity time. Do not set this job as a periodic one yet as the first run will delete all the ...

Analyzing High CPU Usage by J2EE of SAP XI System

Image
If you have found the Adapter Engine processing messages very slowly or not responding, one of the first thing you might do is check the CPU usage. If the server node is found to be using unusually high CPU, follow these steps to troubleshoot the problem (assuming that you are using AIX). 1. Collect information on the CPU used by individual threads Call the following command to take a snapshot of the CPU usage of individual threads ps -mp <PID> -o THREAD > threadscpu`date`.txt <PID> should be the process ID of the server node. The sixth column of the output shows the thread's CPU usage. Note that this column can show values more than 100. 2. Take thread dump or stack trace using jcmon Follow the linked post which contains the detailed steps to take a thread dump 3. Repeat the steps 1 and 2 3-5 times Repeat steps 1 and 2 3-5 times with a time interval of about 30 sec between each pair. 4. Match the thread IDs from ps command to the thread IDs in the...

DNS Caching in SAP JVM

The hostname and ip address information are maintained in the JVM's DNS cache. The information on the hostnames for which ip address could not be resolved is maintained in a negative cache. The entries in these caches have the following default time to live: SAP JVM 6.1: DNS cache: 30 seconds DNS negative cache: 10 seconds SAP JVM 5.1 and 4.1: DNS cache: Until JVM is restarted (infinite caching) DNS negative cache: 10 seconds If a hostname is resolved to a worng ip address due to an error in the DNS or hosts file, the wrong entry will remain there as long as the JVM restarts (in case of 5.1 and 4.1) and 30 sec (in case of 6.1). You can alter this behaviour with the following JVM parameter, which can be configured using the configtool. -Dsun.net.inetaddr.ttl=<timeout in seconds, 0 means "no caching", -1 means "infinite caching"> You can also change the settings in java.security file located at sapjvm_X/jre/lib/security folder. This file wil...

Recommended Free Applications for iPad

Image
If you are new to using iPad , iPhone or iPod, you should know that there are a host of free applications available. Some of the free applications are are too good to be available for free. Here is a list of some of the applications that come highly recommended: Flipboard is a news application with an excellent design. If you are not too much interested in design aspects and rather want news from a larger number of sources try Zite . Soundcloud is a music application which helps you discover new music and listen to those you already know. This application lets you record and upload sound; share and like streams on facebook, twitter and tumblr. Stanza is a great application for reading books on iPad, iPod or iPhone. This application integrates a host of free ebook databases like Gutenberg and Munseys. This application has been bought out by Amazon.com and may soon disappear due to thier vested interests in Kindle . Download it while it lasts. Evernote i...

Exporting and Importing SLD Data

To take a backup of SLD data and restore it if  a recovery is required or to copy SLD data from one SAP NetWeaver system to another, you should export the SLD content to files and import them back. Exporting SLD Content: 1. Log in to Visual Admin and stop "SAP XI AF Messaging" and "SAP XI AF CPA Cache" services under Server --> Services 2. Open SLD page from http://<host:javaport>/sld 3. Select Administration --> Backup 4. Create backup files for all instances 5. Start "SAP XI AF Messaging" and "SAP XI AF CPA Cache" services from Visual Admin Importing SLD Content: 1. Open SLD page from http://<host:javaport>/sld 2. Select Administration --> Import 3. Import the exported files 4. You can check Administration --> Server Log to verify if the import was successful. 5. Restart "SAP XI AF Messaging" and "SAP XI AF CPA Cache" services from Visual Admin

Statistics on Frequently Updated Tables

We have seen earlier how DBSTATC table is helpful in individually maintain statistics on a table (for example to prevent any statistics update on a particular table after you have collected statistics and found them resulting in a good performance). SAP has provided a predefined statistics on the following tables that are known to have very dynamic content. Currently, the following tables/indexes are included: PAYR (column PERNR) UPSITX (column DELNUM) TBTCO (columns SDLSTRTDT, STATUS, EVENTID, EVENTPARM) TRBAT2, TRBAT, TATAF, DDXTT, DDXTF ARFCRSTATE, ARFCSDATA, ARFCSSTATE, QREFTID, TRFCQDATA, TRFCQIN, TRFCQOUT, TRFCQSTATE SXMSPMAST, SXMSPEMAS, SXMSPVERS, SXMSPERROR, SXMSCLUP, SXMSCLUR, SXMSPHIST, SXMSPMAST2, SXMSPEMAS2, SXMSPVERS2, SXMSPERRO2, SXMSCLUP2, SXMSCLUR2, SXMSPHIST2 /SAPAPO/MATLOC (columns LOCID, SATID) /SAPAPO/ORDADM_I (column ANCHOR) LTAK (column KQUIT) AFKO (column AUFNT) MLST (columns AUFPL, PLNNR) SMOFCDBHD, SMOFCMPDAT, SMOFCMPHD, SMOFCMPOBJ, SMOEJOBID, ...

Preventing Resource Crunch by IDoc Ack in XI

When the IDocs are processed, the acknowledgements are sent by SXMS_REFRESH_ADAPTER_STATUS report. These acknowledgements are processed using XBTB$* queues. The report can process up to 9999 acknowledgements in a single run. This can result in a sudden resource crunch in an SAP XI system for a short span of time affecting other messages. The sudden flood of acknowledgements can also affect the performance of the sender system. To prevent this, implement SAP note 1111968 and using the transaction SXMB_ADM, set the parameter EO_INBOUND_PARALLEL with CENTRAL subparameter under the category Tuning. Choose a suitable value (which indicates the number of queues that can be used). The default is 20. IF you cannot implement the note, increase the frequency of SXMS_REFRESH_ADAPTER_STATUS report.

Rebuilding SAP Indexes

Disk based databases require optimisations that reduce the amount of data that is being read from the disks. Index is one such optimisation. Indexes are sorted and usually created on columns that are include in the WHERE clause of most heavily used sql statements. When I query tries to fetch a set of records, matching a particular selection criteria, instead of reading the complete table, the query checks a suitable index. The index then provides location of the particular records in the table. Now the data blocks containing those particular records are read. Indexes are not an all weather ally. Poor selection of columns and too many updates to tables can make indexes do the opposite of their intended function. Index fragmentation When an indexed field in a table is changed repeatedly, the data is deleted from the index and re-inserted at a new block in the index. The new entries are always added to the right side of the index tree and therefor deletion is relatively to the le...

Locking All SAP Users Except DDIC and SAP*

You can lock an SAP system from almost all SAP users without using any special script. This method locks all users except DDIC and SAP*, so you may perform a maintenance work using these user IDs. You can lock the users using the following command: tp locksys <SID> pf=<tp profile> To unlock: tp unlocksys <SID> pf=<tp profile> If you require more IDs to be accessible during the maintenance, the users should log in before you run the lock command as this command doesn't affect already logged in users. You can lock and unlock the users, without using tp, using SU10 or directly updating UFLAG field in the table USR02. You can lock a client using the function module SCCR_LOCK_CLIENT from any client and unlock it using SCCR_UNLOCK_CLIENT.

How to Patch SAP SDM

SDM comes bundled as SDMKIT.jar with J2EERT<SP_Number>_<Patch_level>-<Counter>.SAR file which can be downloaded from SMP. Extact the jar file from J2EERT using the following command: SAPCAR -xvf J2EERT<SP_Number>_<Patch_level>-<Counter>.SAR J2EE-RUNT-CD/SDM/SDMKIT.JAR To patch SDM: 1. Go to /usr/sap/<SAPSID>/<Instance>/SDM/program directory 2. Stop SDM server by running the following command ./StopServer.sh 3. Change SDM mode to standalone using the following command ./sdm.sh jstartup mode=standalone 4. Copy SDMKIT.jar to a temporary folder (let us sat SDMINST) 5. Extract SDMKIT.jar using the following command jar -xvf SDMKIT.JAR 6. Start the update script ./update.sh You will be prompted to give the installation directory (give /usr/sap/<SAPSID>/<Instance>/SDM/program as input) 7. Go to /usr/sap/<SAPSID>/<Instance>/SDM/program 8. Change SDM mode to integrated using the following command ./sdm.s...

Updating Seeburger Adapters with PI 7.3 Upgrade

If you are planning to upgrade your XI system to PI 7.3 and have Seeburger adapter installed, check if 2.1.5 or newer version of Seeburger adapter is being used. As this version is supported in the newer PI release, all you need to do is take a backup of the configurations and simply upgrade XI. If you are using older release, ensure that any of the following minimum release is installed: 1.6Q10 1.7Q3 1.8 Any of the newer seeburger release after 1.8 If you are not using 2.1.5 or newer release, follow these steps when upgrading XI: 1. Stop all Sender channels, wait for all the transactions to complete and stop rest of the channels relevant to interfaces using Seeburger adapter 2. Export Seeburger addressbooks, Digital Signature configuration, Mapping Variables, Message Monitor entries, Message Splitter configuration, Property Store data and Resource Managment configuration from Seeburger Workbench 3. Copy the exported data to a backup location 4. Trigger the PI upgrade process 5. Selec...