Daily Monitoring Work Processed Overview

33
Daily Monitoring Work Processed Overview ( SM51 ) How to apply SQL Trace for expensive SQL statements ( ST05 ) Common ABAP Dumps (ST22) and troubleshooting in SAP How to Remove locked entries in SAP ( SM12) ) How to Lock/ Unlock transactions in SAP ( SM01 ) How to post system message in SAP ( SM02 ) How to Close / Terminate a user session in SAP (SM04) How to send popup / individual message to a specific user in SAP ( SE37 ) SAP Directories (AL11) Transport Cycle of SAP with Case Study from Development To Quality & from Quality To Production How to transport request to different client; in the same SAP system ( SCC1 ) How to check the size of the client in SAP How to Lock / Unlock Client in SAP How to configure Frontend printer in SAP ( SPAD ) How to check the spool requests generated in SAP ( SP01 ) Printer (Spool) Troubleshooting in SAP & Common errors in SAP Spool Administration How to Import Device Type (Printer Type) for Spool / Printing administration in SAP How to schedule the background job in SAP (SM36) Few Important values to be monitored in ST02 & ST06/ST06N List of common database errors found in SM21 in SAP What is lock table over flow ? How to resolve lock table overflow issue ? SAP system is full – what to do as Basis consultant Work Processed Overview ( SM51 ) Over many years I have been working alongside ABAP developers and functional consultants. During this time I have been asked many times if a certain job is still running because it seems like it has been running for ever and the programmer or consultant need it to complete asap. So instead of repeating the process of checking for them I will

Transcript of Daily Monitoring Work Processed Overview

Daily MonitoringWork Processed Overview ( SM51 ) How to apply SQL Trace for expensive SQL statements ( ST05 )

Common ABAP Dumps (ST22) and troubleshooting in SAP How to Remove locked entries in SAP ( SM12) ) How to Lock/ Unlock transactions in SAP ( SM01 )How to post system message in SAP ( SM02 ) How to Close / Terminate a user session in SAP (SM04) How to send popup / individual message to a specific user inSAP ( SE37 ) SAP Directories (AL11) Transport Cycle of SAP with Case Study from Development To Quality & from Quality To Production How to transport request to different client; in the same SAP system ( SCC1 ) How to check the size of the client in SAP How to Lock / Unlock Client in SAP How to configure Frontend printer in SAP ( SPAD ) How to check the spool requests generated in SAP ( SP01 ) Printer (Spool) Troubleshooting in SAP & Common errors in SAP Spool Administration How to Import Device Type (Printer Type) for Spool / Printing administration in SAP How to schedule the background job in SAP (SM36) Few Important values to be monitored in ST02 & ST06/ST06NList of common database errors found in SM21 in SAPWhat is lock table over flow ? How to resolve lock table overflow issue ?SAP system is full – what to do as Basis consultant

Work Processed Overview ( SM51 )

Over many years I have been working alongside ABAP developers and functional consultants. During this time I have been asked many times if a certain job is still runningbecause it seems like it has been running for ever and the programmer or consultant need it to complete asap. So instead of repeating the process of checking for them I will

show them how to check the issue for themselves. This is what I want to share with you too. A good start is to check the work processes activity in your SAP system.Checking the Work ProcessesFirst of all, you have you need to determine if your SAP system in a single server system or makes use of multiple application servers. In case of any doubt, simply start the transaction SM51.The following screen will be displayed: (Or something similar)

In this example the SAP system only has 1 application server. (See the indication at the bottom *** 1 active servers ***)It doesn’t mean there is only one server configured on this system, but that only one is up and running for now, and because we want to check the work processes, that’s the onlyinformation we need to know.So here you have two options, which are in this case do exactly the same thing. Either go to the SM50 transaction and double-click the Server Name. Please note, if you had more than one server being displayed then the only option left would be to double-click the Server Name to open the SM50 transaction on the targeted server.By Double-Clicking or going to SM50 you have a screen similar to the one below:

Let’s go through the different columns of data and determinewhat each column means:• No: The is the work process number. Each work process is numbered in SAP, and this number is used to identify the associated logs.• Type: This is the type of Work Process:o DIA stands for Dialog.o BGD for Background.

o UPD for Update.o ENQ Enqueue server.o UP2 Update 2.o SPO for Spool.• PID: This is the Process Id at the OS level. This could beuseful if you need to kill a work process directly from the operating system.• Status:o Running – it’s actually doing something.o Waiting – The system is waiting for a task to process.o On Hold – The system is waiting on an external process to finish before proceeding. In this example the process is “frozen”.• Reason: Contains the reason for a process to be On Hold (see above); SLEEP waits for a server request to be processed, RFC (remote function call) was initiated, and it waits for its completion.• Restart: Indicates if the process would restart automatically after it died.• Err: The number of times the work process died. This should usually report 0.• Sem: A number in this column would indicate the system is waiting for a Semaphore to be completed. For example: This is like a table lock where 2 programs are executing something against the same table.• CPU: In order to populate this info, you have to click on the clock button at the top of the screen. Then it would give you the time spent processing this process. It’s commonto find some work processes with 0 in the CPU time value column, in fact from an optimal point of view, you should have 1 Dialog work process with a 0 value or close to it. This would indicate the system is not overloaded by the number of requests.• Time: Indicates the number of seconds spent in the currentexecution; typically background processes will have a high value.• Report: As the name suggests, it’s the report being executed.• Client: The client where the process is being executed.

• User Names: The User Name of the person that is executing the report?• Action: Would contain the actions against the database, for example, a Sequential Read would indicate the report is currently scanning a table.• Table: It gives you the name of the table being read if anaction is indicated in the previous column.As you can see, from this screen you can quickly check the global work process activity on your server.The screen is not auto refreshed as most of the SAP screens,so make use of the Refresh button or press F5 on a regular basis, as this screen is only a snapshot.

Detailed View Of The SAP Work Process ActivityNow, let’s imagine you wanted to see more details on what the report using the work process numbered 2 is doing. Double click the row to generate the following screen:

You can now see a detailed view of what the work process is actually doing.We have access to a detail report of the Database activity, number of records, number of accesses as well as a detailed report on the Memory consumption.From here, you can often find all you need to now about yourrunning job and decide if everything is running as it shouldor if something has gone amiss.

How to apply SQL Trace for expensive SQL statements ( ST05 )

In ST05, click the "Activate Trace with Filter" button:

Enter your user id and the name of the report/transaction. This is so that we can try to limit the records in the trace. If you want to trace another user, simply enter theiruser id:

Click Execute to start the trace:

Now in a separate session (preferably) run the transaction/program with the performance problem.Once you have experienced the problem, you can go back into ST05 and click "Disable Trace" (by default it will remember the trace details and disable the running trace, you won't need to re-enter all the details):

Still within ST05, click "Display Trace":

The system remembers the last trace recorded and should automatically populate the details, but you can always enterthem for date/time, user id etc:

The SQL trace records are displayed.The poor performing SQL has it's time (duration) in microseconds (millionths of a second) highlighted in red if it exceeds 10000 microseconds, 10 milliseconds or 0.01 seconds:

(1 second = 1000 milliseconds = 1000000 microseconds)

You can settle issues related to expensive SQL statements with the help of ABAP’rs

Common ABAP Dumps (ST22) and troubleshooting in SAPTop ABAP Dumps… (ST22)ABAP short dumps are something which trouble any SAP user (sometimes help the user to understand the system needs better). We normally do a search for SAP notes or contact

SAP to solve these dumps. But hardly takes any chance to understand the meaning of the dumps. Here I am listing some ‘famous’ ABAP dumps and trying to explain what are they. Please note that the solutions provided here may different from case to case. These should be used just as a ’first aid’. 1) STORAGE_PARAMETERS_WRONG_SETThe problems with the dump STORAGE_PARAMETERS_WRONG_SET are mainly related to the general restrictions of the 32bit OS. You can address up to 4GB of virtual memory. Each process inOS is running in its own context and can address max. 4GB. the parameters which are related to ‘heap memory’ ie- abap/heap_area_dia, abap/heap_area_nondia, abap/heap_area_total are should be set to 2 GB. Common approaches which we can take for this dump are:a) Please use in the ‘boot.ini’ file the switch ‘/3GB’ and restart your whole computer as described in the below SAP Notes:SAP Note 552209 – Maximum memory utilization for processes on NT/Win 2000SAP Note 313347 – Windows NT, 2000, 2003: Editions and memory usage.b) Another way to avoid this problem is to try to add more criteria to your report/program/transaction so that there will be fewer entries that need to be retrieved from your database or buffers. This way, the system would not need to use up much resource to complete the transaction. The query may have been quite big already and the load cannot be accommodated. So please do add more criteria or options so that there will less data to fetch.c) To decrease the value of the parameters: rdisp/ROLL_SHM, rdisp/PG_SHMd) Migrate to 64-bit OS (as per SAP Note 931024 and SAP Note996600)2) TSV_TNEW_PAGE_ALLOC_FAILEDThe error TSV_NEW_PAGE_ALLOC_FAILED means that more memory was requested by the system because the program needed to expand an internal table, but not is available. When Extended Memory is completely used up, the process will go

into PRIV mode and it will start using Heap Memory in case of Windows or vice versa in case of UNIX. Once this enters into PRIV mode, no other user will be able to use the corresponding work process. If there is enough memory for itto finish, you will not see the error.Please refer the following SAP notes:SAP Note 649327 – Analysis of memory consumption.SAP Note 20527 - Runtime error TSV_TNEW_PAGE_ALLOC_FAILEDSAP Note 185185 – Application: Analysis of memory bottlenecksSAP Note 369726 - TSV_TNEW_PAGE_ALLOC_FAILED

3) TSV_TNEW_OCCURS_NO_ROLL_MEMORYThe dump TSV_TNEW_BLOCKS_NO_ROLL_MEMORY usually means that the roll buffer has been exhausted. Please check the usage of your roll buffer with ST02->History->Page. Near the bottom of the screen you can see ROLL BUFFER history. If theroll buffer has been exhausted, you can increase the size with parameter rdisp/ROLL_MAXFS, but make sure you have sufficient disk space to handle the additional size of this buffer if it writes to disk.Please refer the following SAP note:SAP Note 185185 - Application: Analysis of memory bottlenecks

4) LOAD_PROGRAM_LOSTThe LOAD_PROGRAM_LOST error can occur when there are two or more versions of a given program loaded into the buffer at any given time. This happens when the program is changed by one user while it is still in use by another user. When a user gets to the program that is having this problem and R/3attempts to load the generated version from the buffer, it sees that the version is not the most current and tries to swap it out for the most current, but the load was lost fromthe PXA buffer, hence it throws the dump of LOAD_PROGRAM_LOST. LOAD_PROGRAM_LOST are the result of the combination of not enough PXA space + changes of programs which are in use currently. A running program can’t run withtwo different versions of one program. Ask the users restart

their transactions (/nST22). By the way, if the PXA would bebig enough then the user who does not leave their transaction for weeks will not see the changes to this application until they restart the transaction.Other way to correct the error is you need to run transaction SAMT & regenerate the program(s) that are listedin the dump. You can then do a $SYNC in the command field inthe affected application server, but make sure that the other application servers are not running at that time. After the $SYNC, the other app servers can be brought up andthe buffers should then be in sync.Please refer the following SAP notes:SAP Note 5451 – LOAD_PROGRAM_LOSTSAP Note 24824 – Inconsistencies in a Program LoadSAP Note 10367 – Termination LOAD_PROGRAM_LOST5) CALL_FUNCTION_SIGNON_INCOMPLThe short dump CALL_FUNCTION_SIGNON_INCOMPL is typical of anRFC-Call with incorrect or missing logon-data. So, we have to find out where the call is coming from.Please refer the following SAP notes:SAP Note 171805 - Determining RFC client when sign-on problems occur.SAP Note 684788 - Possible reason for CALL_FUNCTION_SIGNON_INCOMPL.SAP Note 901256 – Rabax “CALL_FUNCTION_SIGNON_INCOMPL”.

6) RFC_NO_AUTHORITYThis error mostly appears with the user SAPSYS. The user SAPSYS is an internal user, it is not a personally used ID in the R/3 system. However, all system errors and ABAP programs are run via this user id. As per note 93254, since release 4.0 the parameter auth/rfc_authority_check is set on1 per default. This means, as long as you did not set it explicitly to value ‘0′, any incoming RFC call is checked asdescribed in the mentioned note.The common approaches which we can take on this dump are:1. Deactivate RFC authority Check: set auth/rfc_authority_check to value ’0′ (zero) in your profileand restart the server. (This is the least secure option as

any authorization checks are disabled for all RFC requests)..2. Assign full RFC authorities to the users who need to connect to your system via RFC.Please also check the user id provided in RFC connection (check from SM59) which cause the dump RFC_NO_AUTHORITY. Make sure that this user has sufficient authorizations.Please refer the following SAP notes:SAP Note 171805 – Determining RFC client when sign-on problemsSAP Note 93254 - RFC short dump RFC_NO_AUTHORITYSAP Note 91980 – Missing output of RFC short dump after login errors7) SYSTEM_NO_TASK_STORAGEFor this error, please go to service market to download the latest patch for your SAP Application release and apply the patch. The latest patch would be useful for the problem. TheSYSTEM_NO_TASK_STORAGE is a known problem and related to limitation of 32bit OS. Please see notes 110172, 552209, 546361 for details. As long term solution you have to use 64bit Windows (Note 996600).The cause for the dump SYSTEM_NO_TASK_STORAGE could also be an old sap collector. SAP recommends using the updated collector version always.The common approaches which we can take on this dump are:1. Check your settings match the recommendations mentioned in SAP Note 146289.2. Are limits set according to SAP Note 323816? (Referenced in SAP Note 146289)3. If there is no additional instances on same host then it should be possible to increase EM/TOTAL_SIZE_MB from 4096 MBtowards the RAM and even higher so that ztta/roll_extension can be reached. Also the swap space should be set according to SAP Note 153641 for this.Please refer the following SAP notes:SAP note 789477 – Large extended memory on AIX (64-bit) as of KernelSAP note 191801 - AIX 64-bit with a lot of Extended MemorySAP note 445533 - Lots of extended memory on AIX (64-bit)SAP note 581319 - Signal 33 on AIX (64-bit only)

SAP note 153641 – Swap space requirement for R/3 64-bit kernel

8) CALL_FUNCTION_NOT_FOUNDThe error CALL_FUNCTION_NOT_FOUND is due to the fact that the program called the function which doesn’t exist in the library. Means the requested function module is not found intable TFDIR. Also you may get this error if the buffered version of the TFDIR contains errors. The error needs to attention based on the function module. You may take a general approach mentioned in the SAP Note 98458.Please refer the following SAP note:SAP Note 98458 - SAPMSSY1, CALL_FUNCTION_NOT_FOUND9) CALL_FUNCTION_SINGLE_LOGIN_REJThis error usually comes when you don’t have sufficient authorization to login to the trusted system. This dump accompanies with 4 different error codes:0 – Incorrect logon data for valid security ID.1 – Calling system is not a Trusted System or security ID isinvalid.2 – Either user does not have RFC authorization (authorization object S_RFCACL), or a logon was performed using one of the protected users DDIC or SAP*.3 – Time stamp of the logon data is invalid.Please refer the following SAP notes:Note 986707 – No authorization to log on as a trusted system(RC=1)SAP Note 128447 – Trusted/Trusting SystemsSAP Note 204039 – Authorization check in trusted system

10) SYSTEM_CORE_DUMPEDGenerally, SYSTEM_CORE_DUMPED is related to R/3 system kernel. Upgrade the kernel patch to the latest may solve theissue. But without a detail analysis of the core dump at theKernel, we cannot conclude the reason behind the dump. I would recommend contacting SAP for this dump.SAP Note 19466 – Downloading SAP kernel patches

11) PXA_NO_SHARED_MEMORY

In most situations where the ST22 DUMP PXA_NO_SHARED_MEMORY occurs there is not enough contiguous address space to create the buffer of sizexMB Approx (where x is size in mega bytes). The SAP note 129813 may be relevant as some DLLs may be positioned that are stopping the creation of this large buffer on Windows platforms.Also SAP note 307976 gives information about this dump type PXA_NO_SHARED_MEMORY. 12) Message_Type_X/RAISE_EXCEPTION … CNTL_ERRORIs a GUI related error. Go for latest GUI version to avoid this error.How to check patch level of GUI-open GUI-F10-about SAP logonYou will get a File Version similar to:7100.2.9.1039……7100 means SAPGUI 7.10……..2 means Compilation2…….9 means Patch level…….1039 is a build number (it is of no use for us)Message_Type_X Dump also occurs when proper date format is not maintained in SU01 transaction of the user who have faced this dump.

Incase you have received a complaint from customer that he is receiving this dump while running some transactions, please go to SU01 and check the date format in the defaults tab. If there is any date format other than DD.MM.YYYY, please change that to this format to avoid this error13) EXSORT_NOT_ENOUGH MEMORYMemory bottleneck encountered by the program while sorting.14) SYSTEM_ROLL_IN_ERRORNot enough memory for user context.15) SYSTEM_NO_MORE_PAGINGNot enough SAP Paging Memory. Set “rdisp/pg_maxfs” to sufficiently large value ( say 32,000 ).If the problem exists even after assigning this value then there could be afault in the program itself.16) SET_PARAMETER_MEMORY_OVERFLOWNot enough memory for SET/GET Parameter (Otherwise known as SPA/GPA Memory ).Try extending the memory area with SAP profile “ztta/parameter_area”.

17) SAPSQL_ARRAY_INSERT_DUPRECNumber range problem, likely document number exists.18) EXSORT_FWRITE_FAILEDIs related to disk space. There is not enough disk space forthe external sorting process in the sort directory. To avoidthis move either the extract files (DIR_EXTRACT) or the sortfiles (DIR_SORTTMP) to a separate directory with enough space.Posted by Kapil Patil at 08:12

How to Remove locked entries in SAP ( SM12) )

In a system when ever a user performs any update on any table for that period of time a lock on that particular field of that table is created so that no other user can update that table as user one is doing update on that table.And Suppose during the update user session get terminated due to some error then this lock entry remains on that field. SM12 : Remove locked entries [TCODE]I am sure many of you have faced this problem:

This occurs when the report/program is locked by the actionsof certain user. One can surely ask the user to come out from that program or revoke the locked entries created.

To remove the lock entries , one must use Tcode SM12.

Just specify the username if you want to see all locked entries of a particular user and execute. All the lock entries corresponding to the particular user is displayed.

Now you can delete any lock entry created.

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.

How to post system message in SAP ( SM02 )

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.This system message can be posted using SM02 transaction code in SAP.A message like “R3 system won’t be accessible between 4:00amto 5:00am due to planned kernel upgrade activity. Please plan your work accordingly” can be posted to keep the customers informed about the downtime of the system.Go to Transaction SM02 and click on create button as shown below :

This pops up another window as shown below. In this window, you can compose the message that is to be published. In thatwindow, you will have to provide details like client number,server name, logon language, expires on, delete on fields asshown below.

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. Specify expires on field to mention the system when this message should expire so that message won't be visible to users after that.

The delete on field is used to mention the date and time on which the posted message should be deleted from the system.

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.

System prompts to confirm deletion as below. Message gets deleted if confirmed by pressing Yes button in the below screen.

How to Close / Terminate a user session in SAP (SM04)In most implementations a client can close his own sessions.This is especially helpful when dealing with problematic transactions or RFCs that hang and do not release the session.

GO to SM04 then user list will appear, Double-clicking on the User will bring up the sessions he has open. To close a session, select it and then click the "End Session" button.

or

Sometimes there will be a requirement to terminate a user session.

For example: An user has run a report or program with inappropriate selection criteria, which leads work process going to PRIV mode occupying so much memory impacting performance of the system. In those cases, you will have to check with the user and terminate his session or logoff usersystem wide if he is no longer working.

How to send popup / individual message to a specific user inSAP ( SE37 )

There is a very interesting function module, with the help of which you can send the pop up messages to the users/friends who are logged into the SAP system.The interesting function module name is ‘TH_POPUP’.For this you and your friend should be logged on into the SAP system and you must know the SAP user id of your friend to whom you are going to send the message.

STEPS :

1. Go to transaction SE37 and enter the function module nameTH_POPUP.

2. Pass the client, user name and the message which you wantto send and execute the function module.

Output :The pop up will appear to the user/friend’s SAP system

Note - if user has logged on multiple systems then the message will be sent to multiple systems.

SAP Directories (AL11)

Transport Cycle of SAP with Case Study from Development To Quality & from Quality To Production

Case Study•ABC ltd, car manufacturing company recently formed a group of 5 people in finance department, and decided to give them special authority ofAccounts Receivable T- Codes.•Management have asked to SAP team to assign this role to these 5 people in SAP FICOT- Code used for assigning roles is ‘PFCG’Click on Single Role, and create that role. i am skipping role creation from snap shots

after role creation in PFCG; select that role

following window will come with selected role; now click on export (truck )

Tick in check box and then click on execute

warning, press enter

tick in both check boxes and press enter

warning, press enter

In next window create transport request

enter details

after saving above window following window will come with Transport Number; press enter

data entered in request now close this transaction & open SE01 to release request

T- Code used to release the Transport request is ‘SE01’enterour generated transport number & click on display

details of your transport

T-Code used to import the transport request is ‘STMS_IMPORT’

System is asking want to schedule import or import immediately.... i will import immediately

click on log

Transport imported successfully to QA, now QA people will test newly created role.and after testing role will be imported to production system. process to import on production will be same as we have imported to QA

error code 0 & 4 are OK....if code is different than 0 or 4 means import is failed

How to transport request to different client; in the same SAP system ( SCC1 )

Transaction code SCC1 is a supplement to the client copy. Itcan be used to transfer individual transport requests directly out for the source client into the the current client

Transaction code SCC1 is different from transaction code STMS because transaction code SCC1 is used to transport request from different client in the same system. Example, you want to transport request DEV12345 from client 300 into client 200 in DEV system. The transport request does not need to be released status and you must logged to the targetclient to execute this.

Goto SCC1---- here 300 is source client & 200 is target client, you must logged to the target client to execute this, which is 200 here

How to check the size of the client in SAP

1. Execute report RSSPACECHECK in transaction code SE38.

Put the client number and execute.

it can take 2-3 hour to calculate size Result will be,

How to Lock / Unlock Client in SAPProcedure For Client Lock/Unlock in SAPA) Client Lock in SAP1. Login to any client using username and password.2. Run transaction SE37 (See slide -> 1)3. Enter the function module as SCCR_LOCK_CLIENT (See slide -> 2)4. Press F8 or test run (single run).5. Specify the client and execute(F8). (See slide -> 3)6. Check client lock by login. (See slide -> 4)B) Client Unlock in SAPC) Run transaction SE37 (See slide -> 1)D) Enter the function module as SCCR_UNLOCK_CLIENT (See slide -> 5)E) Press F8 or test run (single run).F) Specify the client and execute(F8). (See slide -> 3)G) Check client unlock by login.

Slide-->5

How to configure Frontend printer in SAP ( SPAD )• Go to transaction SPAD• click on Display for Output Device (or choose menu Configuration->Output Devices)

click on the change icon (or type F8)

click on the create icon (or type Shift-F1)

fill-in fields as needed

In First tab "Device Attributes" • o Output Device: any name starts with "Z"o Device Type: SWIN or SAPWIN

In Second tab "Access Method"• o Host Spool Access Method: F: Printing on Front End Computero Host printer: __DEFAULTo Please remember in above step its two times under-scope thenDEFAULTo

In the other tabs, please leave the default settings and press save which creates an output device

How to check the spool requests generated in SAP ( SP01 )

spool request can be viewed in SP01 transaction as below :

enter username or spool request number or you can put * also

Click on execute to view the below list of spool requests

Printer (Spool) Troubleshooting in SAP & Common errors in SAP Spool AdministrationTrouble shooting Printer:

1)Ping the printer2) Fire the test print from SAPLpstart –aEg :-lpstart –a zgam

Lpstart –o zgam (Will get the print jobs are accessing)

Hpnadmin (ip address of printer)

Rsp0041:- To delete the old spool requests

Common errors:If after cleanup and you encounter one of these errors:

A. SPOOL_INTERNAL_ERRORB. spool overflow (assume you have not adjust max spool number before)C. ...no more free spool request numbers...

SAP note 48284 mentioned that change:

1. In Client 000, execute transaction SNRO -Number Range button - Interval. Default numbering range is 100 - 32,000 (which can print up to 31,900 requests)To do this:Transaction SNRO > Table SPO_NUM > Number Ranges (button) > Modify > change the max limit to desired number.

What is spool overflow ( SPAD, RZ20 & SNRO )

2. Define profile parameter rspo/spool_id/max_number up to 2^313. Define rspo/spool_id/loopbreak to same value as above. This is optional.

We don't see a need to have more than 31,900. Well if this happens, do the things above.

Indirectly, database table size going to grow to few GB, andindirectly slowing down all print request, as well as unnecessary database size

How to Import Device Type (Printer Type) for Spool / Printing administration in SAPWhat is Device Type in Spool / Printing administration of SAP

Importing a Device Type with the SPAD Transaction 1.Download the SAP device type and save the .pri file to a directory on your computer. (You can download .pri file from companies website of your printer)2.Logon to SAP and select the SPAD transaction. 3.Select "Utilities" at the top of the screen, select "For device types", and then select "Import"

4. When the report appears, select the Device Type radio button.5. Type in the name of the device type you want to import inthe field to the right of object name

6. Select the execute button in the upper left corner of thescreen (check mark inside the clock). 7. In next message box Select the "Local Object" button.8. In next message box Select device type to import in SAP9. When the import process is complete, a message will appear on screen stating “Object successfully imported.”

How to schedule the background job in SAP (SM36)

You can schedule the background job using SM36. Planned or immediate jobs can be scheduled.Step 1) Execute T-code SM36.

Step 2) Fill the job name, priority(A/B/C) and the target server. Background jobs once scheduled on a target server run on that server. Main purpose of defining target server is the workload balancing.Step 3) Click on “spool list recipient”. You will get outputin your mailbox. You can check email from SBWP.Step 4) Insert your SAP username and click copy button.Step 5) Click Step button to define ABAP program, variant’s details, etc.Step 6) Define program name, variant details.1. Enter your program name,Variant name in the field. If youhave not created variant as per your requirement ,then leaveit blank.2. Press save button.

Step 7) Once you schedule the job you will get the followingscreen.Step 8) Click Start conditions to fill start date, end date,frequency,etc for job. If you do not specify start conditionthen job will always remain in scheduled status. A job in scheduled status will never run.1. Click on Date/Time(For periodic jobs). If you click “Immediate” then job will start running right away. But it will not be set as periodic job. It’s like “press and run”.2. Define job’s start date/time, end date/time. The job willbe released only once it meets its Scheduled start date/time.3. Press periodic values.

Step 9) Click on Hourly/Daily/Weekly period to define the frequency of the job as per your requirement.We will select Other PeriodStep 10) Here you specify the recurring criteria of the job.For example, You can have the Job run after every 5 daysfrom the Start Date. Here we select job to run every 10 minutesStep 11) Click on save button.Step 12) Click on save again.Step 13) Click save again

I will explain each start condition you can use then if you requireStart Conditions.

Immediate: - It will run batch jobs immediatelyDate/Time:-Specify the date/Time to run the Batch JobsAfter Job: - Dependent on other job which should be runAfter Event:-Dependent on other event which should be runAt Operation Mode:- job will run At Operation Mode which we define in RZ04 (Day Or Night)

Step 14) Once Job step and start conditions are defined the following window will appear.Step 15) Press save.Step 16) Goto SM37 to know the status of the job.Step 17) Select your criteria for the job which you want to monitor.1. Put your job name and username who scheduled the job.2. Select the status of the job.3. Specify the date range. In our scenario we just specify the end date while keeping From Date Open.

Step 18) You will get the following screen. Look at the status, it’s a released means start conditions are met, and the job is in the queue is waiting for background work process to be free.

Few Important values to be monitored in ST02 & ST06/ST06N

In ST02,

1) Hit ratio for each buffer should be greater than 95%.2) If hit ratio is less than 95%, no swap should be there.3) Current usage of extended memory should not cross 75%.4) We have to check the swaps for each buffer. For program buffers it should be 10000 hits/ day & for other buffers it should be 1000 hits/ day.

5) We have to check the free space & the free directory for each buffer.

In ST06/ST06N,

1) Ideally CPU should be free for 60% of the time.2) Page out/s should be 0.3) Under LAN, we have to check for collisions & errors. Theyshould be 0.4) We have to check for the SAPOSCOL status.

List of common database errors found in SM21 in SAP

Here is a list of some common database errors found in tcodeSM21 in SAP.These are not very critical errors and can be ignored depending on situation.Table names and error code in my case may differ from yours.

• SQL statement violates database system restriction• Database error 24909 at UPD access to table TST01• Database error 1555 at FET access to table MKPF• Database error: TemSe->XRTAB(2)->128 for table TST03 key• Database error: TemSe->XRTAB(3)->1 for table TST01 key• Database error: TemSe->XRTAB(2)->128 for table TST03 key Challan No1914• Database error 1013 at COM• Database error -2 at FET• Database error 24909 at SEL access to table REPOLOAD• Database error 3114 at FET• For READ TABLE, the database table TDRG_MEMO_DET was not found• Database error 24909 at FET• Database I/O error• For READ TABLE, the database table TKKO was not found• For READ TABLE, the database table TBPA was not found• For READ TABLE, the database table TDRG_MEMO_DET was not found

• Database error: TemSe->XRTAB(3)->1 for table TST01 key• DBIF_RSQL_INVALID_RSQL• Database I/O error• Database selection with invalid cursor 2• Database error 1410 at FET access to table BLPK

What is lock table over flow ? How to resolve lock table overflow issue ?

• What is lock table overflow ?• How to identify lock table over flow issue ?• What is the parameter to be changed to increase lock tablesize in SAP ?• What is the reason for lock table overflow ?• How to resolve lock table overflow ?

--------------------------------------------------------------------------------------------

What is lock table overflow ?

SAP manages locks using lock table. The lock table contains all of the informaton related to locks like who is holding the lock and which locks are currently held etc. The size ofthe lock table can be specified by the SAP parameter enque/table_size. The size of the lock table limits the number of locks, lock owners and lock names. If this size isexceeded, then the lock table overflow occurs.

How to identify lock table overflow issue ?

In SM21 transaction log and ST22 dumps, if you find any error messages like LOCK_TABLE_OVERFLOW, Lock table overflow, Internal lock administration error it means there is a lock table overflow issue.

What is the parameter to be changed to increase lock table size in SAP ?

Parameter enque/table_size to be changed to increase or decrease lock table size using RZ10 transaction. Default value of this parameter is 32768. The min value that can be set is 4096 and max value is 102400. The unit for this parameter is KB.

As this is not dynamic parameter, for the new value to take effect, a system restart is required after modifying the parameter.

What is the reason for lock table overflow ?

A lock table overflow can occur due to

• The lock table is configured too small (i.e value set to enque/table_size parameter is very low)

• Due to improper design of application which sets a large number of locks

• Number of enqueue worprocesses configured in a sap system are less and update is very slow/hanging due to which lots of locks are accumulated in lock table

• Running a custom report with improper selection criteria (like very long time periods data pull) which sets so many locks & eventually lock table overflow occurs

How to resolve lock table overflow ?

• Increase the size of lock table i.e increase the parameterenque/table_size value using RZ10 transaction.To determine the optimal value for this parameter, you can check the maximum locks set so far in the history and the current number of locks set from SM12 -> Extras -> Statistics

• Increase the number of en-queue work-processes

SAP system is full – what to do as Basis consultant

This article answers the following queries:

• If file systems in SAP server is full, what need to be done?• How to avoid file system full in SAP?• How to delete un necessary files in file systems of SAP?• How to delete core files in SAP?• How to delete trace files in SAP?• How to delete stat files manually in SAP?• What is the transaction code used to delete stat files manually in SAP?• What are various reports to be run to cleanup when file system is full?• How to prune the file systems in SAP?• How to delete old archive files in SAP?• What is the location of work and data directories in SAP?• What is the location of global directory in SAP?• Can we delete old page file and role files when the SAP system is online?• What is the sap parameter to set the trace level in SAP?***************************************************************************

Sometimes, a basis consultant will get alerts or informationfrom customers that the file systems are full. To avoid system issues and to increase uptime of the SAP system, In those cases, we have 2 options.i) Delete un-necessary files in the file systemii) In case you found file system is defined as too small then increase the size of them.

In this article, am covering the option 1 mentioned above.

Let us assume that the system id(SID) of the sap system is DP1. Then the

i) work directory in (Unix, WindowsNT operating system) is /usr/sap/DP1/DVEBMGSnn/work (where nn is the instance number)ii) data directory in (Unix, WindowsNT) is/usr/sap/DP1/DVEBMGSnn/data (where nn is the instance number)iii) Global directory (i.e. for all instances) is/sapmnt/DP1/global (for UNIX )\\<sapglobalhost>\sapmnt\DP1\sys\global (for WindowsNT)

Please follow below steps to avoid this issue :

1) Delete core files from work directory

Work directory in Unix often contains old core files which were generated due to previous program terminations. These core files need to be deleted

2) Delete old log files and spool files

Under global directory there will be many log files which can be deleted regularly.

Those files areLog file type Naming Convention

Spool requests nnnSPOOL ( where nnn=client)Job logs nnnJOBLGBatch input logs BI<hostname><instance-number>

Following reports can be run using SE38 or through background job for selective deletion of the files mentionedabove.RSPO0041 - This report is used for deletion of old spool filesRSBTCDEL – Used for deletion of old job logsRSBDCREO - Report can be used for deletion of batch input log files and reorganization.

3) Deletion of old ABAP/4 trace files

Some trace files with the name AT<instance number>nnnn will be in the data directory. Old files of this type can be deleted. The maximum available space for all files is defined by the parameter abap/atrasizequota. Also transaction SE30 can be used to delete the files.

4) Deletion of old archiving files

When old data is archived, some files are written to the global directory. The naming convention of those files is Rxxmmddn (xx= application, mm= month, dd=day, n=number). Forexample, RMM11056

If these files are already saved on tape and these data is no longer required for productive operation, then these files can be deleted from the disk

5) Deletion of old output requests

Output requests are normally stored on the data directory. Naming convention will be like SP*. Under normal scenarios, they are deleted automatically when the output is completed.In case you see they are not getting deleted, you can deletethe same

6) Page file and Roll file

Under the data directory, normally page files and roll filesare stored. Naming convention will be like PAGFILnn and ROLLFLnn. Please note that page file and roll files can onlybe deleted when the corresponding SAP instance is offline.

Deleting these files hardly makes any sense because these files will start growing to the allowed maximum extent during the R/3 system start up. However in some special scenarios (during or after client copy), the required space can be retrieved by deleting these files. As mentioned

earlier, please note that this can be done only when the instance is offline.

The maximum size of the roll file is given by(rdisp/ROLL_MAXFS – rdisp/ROLL_SHM) * 8 Kbytes

A similar formula applies to the paging file also.

In some scenarios, to avoid the file system full issue, we can even move these page and roll files to a different file system by defining alternate values for R/3 parameters DIR_ROLL and DIR_PAGING

7) Deletion of Old sort and Extract files

By the ABAP commands SORT and EXTRACT, temporary files are created. The location of these files are set using profile parameter DIR_SORT or DIR_EXTRACT.

The temporary files for sort are named S+++++++<Extension> (On Windows NT .dat is used as extension and on Unix there is no extension). Similarly for Extract, E+++++++<Extension>will be the file naming convention.

These files will be automatically deleted after the execution of these SORT and EXTRACT commands. However, in some scenarios, an abrupt termination can happen and these files won’t get deleted automatically. Those old files can be deleted by an administrator.

The exact file names for these are stored in the profile parameters FN_SORT or FN_EXTRACT

8) Deletion of trace files

Trace files are created during a new system startup and theycan be deleted. They are contained in the work directory

9) Deletion of stat file or moving to different location

Please check whether the stat file which consists the work load statistics, has not been reorganized for some time and has therefore become too large. In emergency cases, this file can be either deleted manually or can be moved to different location.

To delete the stat file manually, please proceed as follows:Goto ST03 transaction , call the delete function on the relevant instance by choosing :Workload -> Reorganize -> Delete seq.stat.file

To change the location of stat file, change the value of system parameter ‘stat/file’ to a new location.

10) Deletion of job logs at operating system level

In some emergency cases, where you cannot start the R/3 system at all, the measure is to delete the job logs at operating system level and run RSBTCDEL report in forced mode.

Note: How to delete job logs at operating system level will be covered in a separate article later

11) Changing the trace levelIf the trace files (dev_*) in the work directory are very large(normal size 0.1 to 20Kbyte), it is likely that the trace level is set to very high value. In SAP, rdisp/TRACE parameter is used to set the trace level. Normal value for trace is 1.

Please cross check this SAP parameter and reset to 1 if the value is maintained as 2 or higher. If this value is set to high, much more detailed trace will be collected and trace file sizes are likely to increase. Therefore recommending todecrease or set the trace level to 1.

Please refer below link to know, how to set the trace level

in SAP.

Iam sure, if you duly follow the steps mentioned above, filesystem full issues can be addressed. However, if after carrying out all the above steps there is no improvement, then please consider to increase the file system size by requesting space to the relevant team.