Thursday 31 July 2014

How to Lock/ Unlock transactions in SAP ( SM01 )

SM01 is a very useful transaction. Not only can you lock transactions from being used at all in the system, but as a general SAP use it can also be used to look up transaction codes, whether for functional information or simply because you forgot which code you need!


1. In SM01, Type the T.Code which u want to lock (for example here, ST03)  and pressEnter do not select the Tick box, Directly click on the tcode and press Lock
/Unlock
 button.  

Monday 21 July 2014

Difference between support packages, kernels & SAP Note

Snote :-

By implementing an SAP Note an error in a single program or 
Transaction is removed.
You can apply these using SNOTE

Support Package:-

Applying an SAP Support Package, all errors are corrected that
Were known, SAP Support Package is nothing but bunch of corrections.
(Collection of corrections of serious errors in the ABAP/4 Repository)
You can apply this using transaction SPAM
 Kernel :-

SAP Kernel is the core of the application. Like all other applications the Kernel contains the executable files (.EXE files for stating various processes in SAP.
That’s the reason when a Kernel upgrade is done it means new versions of the various EXE files replace the older versions.
 With regards to advantages, it is an appropriate question in this context since the Kernel is a must (.EXE)

Friday 18 July 2014

What is SAP Spool process work flow?

Step 1. A dialog user or a background process initializes a print request.


Step 2. The print requests are stored in a location which is determined by a parameter ‘RSPO/Store_location = G’.........(G- Global directory at OS level) or
‘RSPO/Store_location = DB’......(DB- In database tables)


This location is referred as “Temse”( Temporary Sequential File).
‘Temse’ stores spool requests
Temse is stored in Global directory when it is referred as ‘G’. It is stored in database tables TST01 ; TST03. If it is referred as ‘DB’ .

By default the value is ‘DB’.

G: (Global Directory on Application Server):

1. If G is specified it is stored at OS level
2. The printing will be faster if there are less no of documents. Because from file system to spooler

The communication faster than database to host spooler



Advantages:

1. No special attention is required to backup the spool requests.
2. RDBMS rules are inherited to spool requests, because they are in the Database

Disadvantages:

1.A dedicated backup has to be planned to save the contents of Global directory.
2. When the records are more the printing consumes more time because of ‘Lack of indexes’ at file system.

Step 3 Spool process gets initiated and reads the contents from ‘TST01’ name of the Author, no of copies name of the printer and spool data from ‘TST03’. And converts spool requests into “Output Requests’ (Printer specific requests). 

What is Spool Administration In SAP?

It is used to output the document to a printer, fax, email and SMS etc.

It is only the process which is used to display the documents before they get printed.
Once a spool request is generated in the system, It can be printed to any printer with n no of copies, at any time.
Where as normal printing, the document will not be available once it is printed.
We can change the output format at any time.


work process used for spool administration is 
 
SPOOL 'S' 

 
It is used to print the documents to a printer or output to a fax machine etc. There should be atleast 1 Spool process in the entire system. It is also possible to configure more spool process depending on the print/ spool volume


The spool process are configured by parameter ‘RDISP/WP_NO_SPO’
Depending on the resources as many no of spool processes can be configured.


What is a background Job in SAP?

Background jobs are non-interactive processes that run behind the normal interactive operations. They run in parallel and do not disturb interactive(foreground)  processes and operations.

It is scheduled from SM36. You can analyze it from SM37 by viewing its job log.
Advantages of Background Jobs 
  • It reduces manual effort &  automates the task.
  •  It can be scheduled as per user’s choice.
  •  It reduces user interaction and can run seamlessly in the background without user input
  •  Once you define the variant for background job, the user doesn’t have to worry about value input in the field. Thus, user confusion is also reduced.
  •  Ideal for time- consuming/ resource intensive  programs which can be scheduled to run in the night(when system load is low).
Background jobs are classified in three categories -
  1. Class A (High/critical Priority) :-  Some tasks are urgent or critical and  must be scheduled with class A priority job. Class A priority reserves one or more background work processes. Users have to decide how many background work processes should be assigned to Class A priority job. Suppose a user chooses 2 background work processes for this category then available background work processes for class B and C = (Total number of work processes set in operation modes RZ03)- (Background work processes allowed to class A category).
  2. Class B(Medium Priority):- Once Class A jobs are completed , Class B job will start executing in the background before class C jobs.
  3. Class C(Low Priority):-It runs after both  class A and class B jobs are completed.

How to change profile parameter in SAP (RZ10)?

Step-by-step procedure: (Profile Parameter Change – RZ10)

  • Login to the SAP system
  • Hit the transaction code ‘RZ10′
  • Click Utilities and click import profiles
  • Click back (F3)
  • Place the cursor at profile and click f4
  • Double click on Default profile
  • Select the Extended maintenance and click change
  • Click Parameter (Create F5)
  • Place the cursor at parameter name and click F4
  • Click a small triangle shape which is available on top of the box
  • Type *login* and hit enter
  • Double click on ‘login/no_automatic_user_sapstar’ parameter or search for parameter which you want to change
  • Type the NEW parameter value
  • Click ‘Copy’ Tab and click back (F3)
  • Click ‘Copy’ Tab again to transfer The changed profile
  • Click Back (F3)
  • Click Save, Click back and Click Yes to activate the profile
  • Log out from the SAP system
  • Stop the SAP System (Server)
  • Start the SAP System (Server)

you can validate changes in parameter value through T-Code RZ11 after system restart.

How to Define Default Client in SAP?

You can set the SAP to default client login via parameter "login/system_client" means every time when you are going to login in SAP you will find 100 as client as shown in below image


 This can be done using transaction code RZ10 . As an example, you can set the parameter to client 100 in transaction code RZ10. A restart is needed to make the changes activated.

Wednesday 16 July 2014

How to delete an SAP Lock?

How to delete an SAP lock ?

SAP lock is set by the executing work

process when a user/job wants a change access to data.

Whenever a lock to be set the respective workprocess checks in the locktable whether a respective lock conflicts the existing entries in the locktable. If so, a lock is refused. If there is no conflict, then a lock is set.

There are different types of locks :

Write locks (E) : This is also known as exclusive lock mode as the lock data can be edited by only one user. Any other requests from workprocesses to set another write lock or read lock are rejected. A cumulate lock can be applied on the lock data by the same lock owner again.

Read locks (S) : This is also known as shared lock mode as several users can have read access to the locked data at the same time. Additional read lock requests are entertained even if they are from different users. However a write lock is rejected.

Enhanced write locks (X) : This is also known as exclusive non-cumulative lock mode. An enhanced write lock can be requested only once even if it is by the same transaction.

Difference between write locks(E) and Enhanced write lock(X) is write locks can be set and released by the same transaction several times but X type locks can also be set once even by the same transaction.

Optimistic locks (O) : These locks are set up when the users displays the data in change mode. Several optimistic locks can be setup on the same data. Optimistic locks are read locks(S) at first and converted to write lock (E) when the users wants to save the data. If an optimistic locks on a data is changed to write lock(E), all other optimistic locks on that data will be deleted.

Locks that are set by an application program are released by the program itself or they are released by the update program once the database has been changed.

Transaction code SM12 can be used to monitor SAP locks.
Here you have option of selecting locks based on following parameters
  • tablename
  • lock argument
  • client
  • username
In case, as part of monitoring, if you encounter some old sap locks and after thorough analysis, you would like to delete these, it can be done in the following ways :
  • Select the locks and delete the lock from SM12
  • Identify the user who has set the respective lock and end the user session using SM04 transaction code

Tuesday 15 July 2014

SAP OS Level Directory Structure

Main directory

/usr/sap  - physical parent directory
/usr/sap/trans  - transport directory
/usr/sap/SID  - SAP system parent directory
/usr/sap/SID/SYS  - contain common & global SAP system files(i.e. profile, global, and exe directory)
/usr/sap/SID/<instance_name>  - contain SAP instance specific directories(i.e. data, log, and work)
/sapmnt  - directory structure for sharing common files to all system belonging into the same group
/sapmnt/SID  - link or share folder of directory /usr/sap/<SID>/SYS
/oracle  - directory of the whole database system
/oracle/stage  - directory that used for database installation and upgrades
/oracle/SID  - directory of the whole database application and data files

Shared directory:

/sapmnt/SID/profile  - SAP instance profile
/sapmnt/SID/global  - SAP central system log
/sapmnt/SID/exe  - SAP executable application directory
Transport directory:
/usr/sap/trans  - main transport directory
/usr/sap/trans/bin  - contain TPPARAM file (global transport parameter)
/usr/sap/trans/data  - contain transport data file
/usr/sap/trans/log  - transport logs, trace and statistic file
/usr/sap/trans/buffer  - special buffer with the SID of every system in the transport group (including control information)
/usr/sap/trans/cofiles  - control file directory
/usr/sap/trans/sapnames  - contain information of SAP User that performs export and keep tracks of each transport status
/usr/sap/trans/tmp  - temporary directory
/usr/sap/trans/actlog  - action log files (managed by SAP system)
/usr/sap/trans/olddata  - archived transport files
/usr/sap/trans/backup  - directory of logical backup with R3trans program
/usr/sap/trans/serial  - contain serialization of tp

How to Protect Special Users in SAP?

How To Protect Special Users In SAP

Default Passwords for Special Users
User
Description
Client
Default Password
SAP*
SAP Net Weaver AS system super user
000, 001, all new clients
Hard-coded password is PASS.
DDIC
ABAP dictionary and software logistics super user
000, 001
Master password set during installation.
EARLYWATCH
Dialog user for the Early Watch service in client 066
066
Master password set during installation.
SAPCPIC
User for remote connections to legacy SAP systems (4.5)
000, 001, all new clients
ADMIN
TMSADM
User for transport management system (TMS)
000
Master password set during installation.
 

Since above users have standard names and passwords, you must secure them against unauthorized use by outsiders who know of their existence.






How to protect SAP*
It is not possible to delete the SAP* user. The suggested measure is to create a new super-user account with a complex password, and deactivatethe SAP* default account.
This can be done by activating the profile parameterlogin/no_automatic_user_sap* or login/no_automatic_user_sapstar.
Even though the SAP* account is being deactivated, the default password for this account must be changed.

How to protect DDIC
As for the DDIC user, this account cannot be deleted or deactivated either. And therefore, the best protection is to change its default password.

How to protect EARLYWATCH
The EARLYWATCH account is used specifically for the Early Watch service, and its password must be changed, and the account locked out. It should be unlocked when required, and re-locked after use.

How to protect SAPCPIC
The SAPCPIC user can be either disable or its default password can be changed. Either method involves disabling certain functionality. Therefore, this is an organization-specific issue where the functionality required will decide which method is best.

Monday 14 July 2014

How to post and delete system message in sap?

System Message in Sap.
            Occasionally, SAP system will be shut down due to various maintenance activities like kernel upgrade, offline backup, client copy etc. Before doing any of these activities it is best practice to communicate to SAP users that system won’t be available during that time so that users will plan their work accordingly.

Steps for sytem message in Sap.
1.This system message can be posted using SM02 transaction code in SAP.
2.A message like “R3 system unavailable in between10pm to 6 am due to planned Offline Backup activity. Please plan your work accordingly” can be posted to keep the customers informed about the downtime of the system.
3.Go to Transaction SM02 and click on create button as shown below :
4.This pops up another window as shown below. In this window, you can compose the message that is to be published. In that window, you will have to provide details like client number, server name, logon language, expires on, delete on fields as shown below.
5.If specific client is specified in the above window, only users of that client can view the system message posted. If an SAP system consists of more than one application server, you need to select application server on which this message should appear. 
6.Specify expires on field to mention the system when this message should expire so that message won't be visible to users after that. 

7.The delete on field is used to mention the date and time on which the posted message should be deleted from the system. 
8.Incase you would like to delete the system message manually, you can even do so, by selecting the system message and clicking on delete icon as shown below.
9.System prompts to confirm deletion as below.  Message gets deleted if confirmed by pressing Yes button in the below screen.
10.Click yes to conform delete system message.

How to Apply SAP NOTE in SAP?

What is SAP Note ?
SAP releases  notes on regular basis to provide the corrections/minor improvements to the existing bugs/issues/functionalities. Since periodicity of release of Support packages is very less, to resolve customer issues SAP releases notes to customers on regular basis to fix bugs.
Steps for Applying SAP Note.
   we can apply in two methods
                    1.Direct Download SNOTE
                     2.Upload SNOTE.

Download SNOTE.
1.Goto SNOTE T-code
2.Click goto and then download sap note
3.Enter the SAP note number.
4.Click Execute button.
5.now the downloaded Sap note is shows in "new" section.
6.select the downloaded Sap note in the new section and then click Execute.
7.now new pop up will come click yes.
8.again one popup will come click continue or press enter.
9.now create transport request.
10.click new to create new transport request.
11.enter the short description and click save.
12.click continue or enter.
13.now click continue button.
14.prossesing SNOTE.

Upload Sap Note.
1.Goto SNOT T-code.

2.click Goto and then upload sap note.
3.select the file where you downloaded and saved.
4.now it added in the new section.
5.select and press execute.
6.the output as shown as,
7.the message will show the SAP Note is implemented or not.

Sunday 13 July 2014

Daily Monitoring T-Codes for SAP Basis

SAP Basis Daily Monitoring T-codes


Proactive monitoring of the SAP systems, will help to understand issues in advance & helps us to take corrective actions and  thus will lead to lesser downtime of the systems, improving profitability of the business organisation.

SM50 : (Process Overview)

This transaction code will be useful to view the processes that are running currently in an sap insance. In this view you can check whether there are free workprocesses to execute the processes. If all the workprocesses are in running state and no work process is idle it means that wait times will increase for the processes that are waiting in the dispatcher queue leading to performance degradation. If you find that there are no free workprocceses for maximum times that you may consider, increasing the number of workprocesses.

SM66 : (Global process overview)

This transaction code will be useful to view the processes that are running across all instances/application servers of a SAP system. Similar to SM50 checks can be done in this transaction as well.

SM51 : (Application servers status)

This transaction code will be useful to view all the hostnames and application servers status. If any application server is down, the same can be identified using status of the server column. We can also figure out different Message types (Dialog, Batch, Update, Upd2, Spool, ICM etc) configured for the respective servers.

SM12 : (Lock entry list)

This transaction code will be useful to view all the sap locks that are present in the system. As part of monitoring, we need to look for any old sap locks that are more than 1 day. If any such locks, we need to analyse the reason for that lock for such longer duration and take actions accordingly. A lock can be set for such a long duration due to a long running background job or a lock is not released due to an application error or a program terminated abruptly but lock not released etc.

ST22  : (ABAP Dumps )

This transaction code will be useful to view all the abap dumps that have occured in the system on a given day. As part of daily monitoring, it is the responsibility of the basis administrator to analyse the dumps and take necessary actions to avoid issues.

Some of the examples of abap dumps are timeout issue, database space issue, spool overflow issue etc

SM21 : (System log)

This transaction is useful to view the log of the sap system for various operations. This log will be very useful to identify various issue in advance and to take necessary measures. System log is the place to check out for any timeout, network issues, database space issues, message server issues, spool overflow, locktable overflow etc issues.
SM13 : (Update Requests overview)

This transaction is useful to figure the status of update system. Incase an update is inactive we can figure out the same from this transaction and necessary action can be taken and update can be activated again.

In case of canceled updates, analysis to be done whether to repeat update.

ST02 : (Tune summary )

This transaction will be used to monitor

  •  Buffer statistics like hitratio, swaps, db access details, size of buffer and free size of buffer etc

  •  Important statistics related to  Roll area, Page area, Extended memory and heap memory

  • Call statistics like select, insert, update and delete

As a basis administrator, it is our responsibility to ensure there is more hit ratio for the buffers and less swaps to ensure efficient performance of the sap system. In case you see there are more swaps and less hit ratios for most of the buffers, then tuning buffers to be carried out to ensure optimal performance.
  DB12 (Backup logs) : This transaction is useful to check the details of 

  • last successful backup
  • overview of database backups ( Success / failure of backup with log details)
  • Archiving directory status (Free space of oraarch )
  • Overview of redolog files ( Number of redologs that are not yet backed up)
  • overview of redolog backups (Success / failure of backup with log details)
DB13 (DBA Planning calender) :

This transaction will be useful to schedule various database backups & clean up jobs like ( whole database backup offline/online, Full backup online/offline, incremental backup offline/online, redolog backup, update statistics, check db, cleanup logs, compress database, verify database, initialize tape and validate structure jobs).

In this transaction, you can also check the status of every job that was scheduled and can reschedule in case of failures.

DB14  (DBA operations log) :

This transaction will be useful to check the status of following :

  • Database backup
  • Redolog backup
  • BRSPACE log (extend tablespace issues etc)
  • BRCONNECT operations (Update optimiser statistics , database check etc)
  As an sap basis administrator it is our responsibility to check and ensure backups and other cleanup jobs are successful everyday. Incase of failures, should figure out root cause and take actions like rescheduling and ensure these jobs are successful.

SM37 ( Job status overview) :

This transaction will be useful to have an overview of jobs with different statuses.
As part of daily monitoring, SAP basis administrator should use this transaction to findout canceled jobs and active jobs(for eg: long running - more than 24hrs etc).

Incase of canceled jobs, root cause for the failure to be figured out from the logs of the respective job and to be actioned by rescheduling etc.
Incase of long running jobs, we need to figure out the reason for long running and action them accordingly.

In SM37, using extended job selection option, we can even select the jobs based on start condition, steps (like abap program, external command or external program), period etc

ST04 (Database alert logs and performance) :

This transaction will be useful for (oracle) database administration. In this screen, goto Alerts and drill down further. Click on "Database Check" to find out any errors or warnings related to database like MISSING_STATISTICS, STATS_TOO_OLD, LAST_BACKUP_FAILED, LAST_ARCHIVE_FAILED etc. After going through the error or warning in details take necessary corrective actions based on the error like running update stats again, re-triggering backup etc

Under Alerts, you can view Alert monitor which will summarize status of the database under different heads like

  • Space Management
  • Performance
  • Backup/restore
  • SAP Consistency
  • Health
Drill down on each of these to find out potential problems. These are color coded for ease of administrator (Red for errors, yellow for Warnings and Green for OK status)

For Eg: If PSAPSR3 tablespace is >90%, you can see Space management in red color. Then it is the responsibility of Basis administrator to take necessary actions on the same.

SP01 ( Check Spool status ) :

This transaction is useful to find out the status of spool request and output request. In SP01 transcation, you can list the spool requests or output requests between a given interval.

In the list generated, you can check out the status of spool requests and findout any errors by drilling down further.

For eg: if so many spools are in waiting status, find out whether output device is available or not.

If many spool are in error status, figure out if there is any network issue and take necessary actions.


If  customers complain that they are not able print anything from SAP, check out whether there is any spool overflow.