Tuesday, 31 May 2016

How to Configure and Test RFC.

This tutorial is divided into 4 sections
  1. Setup a RFC connection
  2. Trusted RFC connection
  3. Testing a RFC connection
  4. Error Resolution

Procedure to setup an RFC connection:

Enter Transaction Code SM59

 
In the SM59 screen, you can navigate through already created RFCs connection with the help of option tree, which is a menu based method to organize all the connections on the basis of categories.
 
 
Click the  'CREATE' button. In the next screen , Enter -
  • RFC Destination – Name of Destination (could be Target System ID or anything relevant)
  • Connection Type – here we choose one of the types (as explained previously) of RFC connections as per requirements.
  • Description – This is a short informative description, probably to explain the purpose of connection.
 
After you'SAVE'the connection, the system will take you to 'Technical Settings' tab, where we provide the following information:
  • Target Host– Here we provide the complete hostname or IP address of the target system.
  • System Number – This is the system number of the target SAP system.
  • Click Save
 
In the 'Logon and Security'  Tab, Enter Target System information
  • Language – As per the target system's language
  • Client – In SAP we never logon to a system, there has to be a particular client always, therefore we need to specify client number here for correct execution.
  • User ID and Password – preferably not to be your own login ID, there should be some generic ID so that the connection should not be affected by constantly changing end-user IDs or passwords. Mostly, a user of type 'System' or 'Communication' is used here. Please note that this is the User ID for the target system and not the source system where we are creating this connection.
 
Click Save. RFC connection is ready for use
Note: By default a connection is defined as aRFC. To define a connection as tRFC or qRFC go to Menu Bar -> Destination aRFC options / tRFC options ; provide inputs as per requirements. To define qRFC , use the special options tab.

Trusted RFC connection


There is an option to make the RFC connection as 'Trusted'Once selected, the calling (trusted) system doesn't require a password to connect with target (trusting) system.
Following are the advantages for using trusted channels:
  • Cross-system Single-Sign-On facility
  • Password does not need to be sent across the network
  • Timeout mechanism for the logon data prevents misuse.
  • Prevents the mishandling of logon data because of the time-out mechanism.
  • User-specific logon details of the calling/trusted system is checked.
The RFC users must have the required authorizations in the trusting system (authorization object S_RFCACL).Trusted connections are mostly used to connect SAP Solution Manager Systems with other SAP systems (satellites)

Testing the RFC Connection

After the RFCs are created (or sometimes in case of already existing RFCs) we need to test, whether the connection is established successfully or not.
 
 
As shown above we go to SM59 to choose the RFC connection to be tested and then we expand drop down menu - "Utilities->Test->…". We have three options:

Connection test -> This attempts to make a connection with remote system and hence validates IP address / Hostname and other connection details. If both systems are not able to connect, it throws an error. On success it displays the table with response times. This test is just to check if the calling system is able to reach the remote system.
 
  
Authorization Test -> It is used to validate the User ID and Password (provided under 'logon and security' tab for the target system) and also the authorizations that are provided. If test is successful, then same screen will appear as shown above for the connection test.

Unicode Test -> It is to check if the Target system is a Unicode or not.
 
Remote Logon –>This is also a kind of connection test, in which a new session of the target system is opened, and we need to specify a login ID and Password (if not already mentioned under 'Logon and Security' tab). If the user is of type 'Dialog' then a dialog session is created. To justify the successful connection test, output will be the response times for the communication packets, else error message will appear.
 

 

What went wrong?

If somehow the RFC connection is not established successfully, we can check the logs (to analyze the issue) at OS level in the 'WORK' director. There we can find the log files with the naming convention as "dev_rfc<sequence no.>" and the error description can be read from such files.
 

Monday, 30 May 2016

Introduction to RFC

Types of RFC:


Synchronous


requires both the systems (client and server) to be available at the time of communication or data transfer. It is the most common type and is required when result is required immediately after the execution of sRFC.

sRFC is a means of communication between systems where acknowledgements are required. The resources of the Source System wait at the target system and ensure that they deliver the message/data with ACKD. The Data is consistent and reliable for communication.

The issue is if the target system is not available, the source system resources wait until target system is available. This may lead to the Processes of source system to go into Sleep/RFC/CPIC Mode at target systems and hence blocks these resources.

Used for
  • For communication between systems
  • For communication between SAP Web Application Server to SAP GUI

Asynchronous

It is communication between systems where acknowledgements are not required (it is similar to post card delivery).It doesn't require both the systems to be available at the time of execution and the result is not immediately required to be sent back to calling system.
The Source System resource does not wait for the target system as they deliver the message/data without waiting for any acknowledgement. It is not reliable for communication since data may be lost if the target system is not available. 
Used for -
  • For communication between systems
  • For parallel processing

Transactional

 It is a special form of aRFC. Transactional RFC ensures transaction-like handling of processing steps that were originally autonomous.
Transactional RFC is an asynchronous communication method that executes the called function module in the RFC server only once, even if the data is sent multiple times due to some network issue. The remote system need not be available at the time when the RFC client program is executing a tRFC. The tRFC component stores the called RFC function, together with the corresponding data, in the SAP database under a unique transaction ID (TID). tRFC is similar to aRFC as it does not wait at the target system (Similar to a registered post). If the system is not available, it will write the Data into aRFC Tables with a transaction ID (SM58) which is picked by the scheduler RSARFCSE (which runs for every 60 seconds). Used For-
  • Extension of Asynchronous RFC
  • For secure communication between systems

Queued

 
Queued RFC is an extension of tRFC. It also ensures that individual steps are processed in sequence.
To guarantee that multiple LUWs (Logical Unit of Work/ Transaction) are processed in the order specified by the application. tRFC can be serialized using queues (inbound and outbound queues). Hence the name queued RFC (qRFC). Used For-
  • Extension of the Transactional RFC
  • For a defined processing sequence
  • Implementation of qRFC is recommended if you want to guarantee that several transactions are processed in a predefined order.

Types of RFC Connections – SM59


 
Type 3 - entries specify connection between ABAP systems. Here, we must specify the host name / IP address. You can, however, specify logon information if desired. This is applicable for both type of RFCs, between ABAP systems and external calls to ABAP systems
Type I - entries specify ABAP systems connected to the same data base as the current system. These entries are pre-defined and cannot be modified. Example entry name: ws0015_K18_24
  • ws0015=host name
  • K18=system name (data base name)
  • 24=TCP-service name
  Type T - destinations are connections to external programs that use the RFC API to receive RFCs. The activation type can be either Start or Registration. If it is Start, you must specify the host name and the pathname of the program to be started.

Sunday, 29 May 2016

Introduction to RFC (Remote Function Call)

What is RFC?


For business applications, it is necessary to communicate and exchange information (in pre-defined formats) with other systems.Hence, there are well defined mechanisms to enable this communication. SAP has also provided us with such mechanism called RFC, which stands for 'Remote Function Call'.
 
 
RFC is a SAP protocol to handle communications between systems to simplify the related programming. It is the process of calling a function module which is residing in a different machine from the caller program. RFCs can be used to call a different program in the same machine as well, but usually it is used when 'calling' and 'called' function modules/ programs are running on separate machines.
 
 
In SAP, RFC Interface system is used for setting-up RFC connections between different SAP systems, and also between an SAP and an external (non-SAP) system.
 

Must Know Details About RFC

  • SAP Uses CPIC (Common Programming Interface for Communication) Protocol to transfer data between Systems. It is SAP Specific protocol. Remote Function Call (RFC) is a communications interface based on CPI-C, but with more functions and easier for application programmers to use
  • The RFC library functions support the C programming language and Visual Basic (on Windows platforms)
  • RFC connections can always be used across the entire system.This means that an RFC connection you have defined in client 000 can also be used from client 100 (without any difference).
  • RFC is the protocol for calling special subroutines (function modules) over the network. Function modules are comparable with C functions or PASCAL procedures. They have a defined interface through which data, tables and return codes can be exchanged. Function modules are managed in the R/3 System in their own function library, called the Function Builder.
  • The Function Builder (transaction SM37) provides application programmers with a useful environment for programming, documenting and testing function modules that can be called locally as well as remotely. The R/3 System automatically generates the additional code (RFC stub) needed for remote calls.
  • You maintain the parameters for RFC connections using transaction SM59. The R/3 System is also delivered with an RFC-SDK (Software Development Kit) that uses extensive C libraries to allow external programs to be connected to the R/3 System.
  • The only difference between a remote call of a function module to another server and a local call is a special parameter (destination) that specifies the target server on which the program is to be executed.

The RFC Advantages:


RFC helps to reduce the efforts of programmers, by letting them avoid the re-development of modules and methods at remote systems. It is capable enough to:
  • Convert the data into the format understandable by the remote (target) system.
  • Convert the data into the format understandable by the remote (target) system.
  • Call up certain routines which are necessary to start communication with remote system.
  • Handle errors that might occur in the process of communication.

Saturday, 28 May 2016

SAP OSS Note: Trace it in your landscape

SAP frequently releases "Online SAP Support" (OSS) Notes which may contain bug fixes , new program developments or enhancements or other miscellaneous updates.

At times before you begin work , it will be required to check whether a particular note is present in your SAP system

To ensure that a particular OSS note is present in your SAP system ,execute the following steps:

a)In SAP command prompt , Enter TCode # SNOTE
 
sap-oss-note 
b) In the next screen, Click  SAP Note Browser
 
sap-oss-note 
c) Type in your SAP Note Number in the corresponding text field and click execute
sap-oss-note 
d) Next Screen shows status of the SAP note
 
sap-oss-note 
For a background, a SAP note could have any of the following seven status -

  • Can be implemented
  • Cannot be implemented
  • Completely implemented
  • Incompletely implemented
  • Obsolete
  • Obsolete version implemented
  • Undefined Implementation State

Thursday, 26 May 2016

Performance Checks

Tune Summary (ST02)

Step 1: Go to ST02 to check the Tune summary.

Step 2: If you see any red values, in SWAPS, double –click the same.
 

Step 3: In the below screen click on the tab 'Current Parameters'
 

Step 4: Note down the value and the Profile parameters
 

Step 5: Go to RZ10 (to change the Profile parameter values)

Step 6: Save the changes.

Step 7: Restart the server to take the new changes effect.
 

CPU Utilization (ST06)



Idle CPU utilization rate must be 60-65%,if it exceeds the value then we must start checking at least below things:
  • Run OS level commands – top and check which processes are taking most resources.
  • Go to SM50 or SM66 .Check for any long running jobs or any long update queries being run.
  • Go to SM12 and check lock entries
  • Go to SM13 and check Update active status.
  • Check for the errors in SM21.

ABAP Dumps (ST22)

Here we check for previous day's dumps

Spool Request Monitoring (SP01)

For spool request monitoring, execute SP01 and select as below:
  • Put '*' in the field Created By
  • Click on  execute button.


Here we record only those requests which are terminated with problems.
 

Monitoring Batch Jobs (SM37)


For Monitoring background jobs, execute SM37 and select as below:
  • Put '*' in the field User Name and Job name
  • In Job status, select: Scheduled, Cancelled, Released and Finished requests.

Transactional RFC Administration (SM58)


Transactional RFC (tRFC, also originally known as asynchronous RFC) is an asynchronous communication method which executes the called function module in the RFC server only once.
 

We need to select the display period for which we want to view the tRFCs and then select '*' in the username field to view all the calls which have not be executed correctly or waiting in queue.
 

QRFC Administration (Outbound Queue-SMQ1)

We should specify the client name over here and see if there any outgoing qRFCs in waiting or error state.

QRFC Administration (Inbound Queue-SMQ2)

We should specify the client name over here and see if there any incoming qRFCs in waiting or error state.

Database Administration (DB02)


After you select Current Sizes on the first screen we come to the below screen which shows us the current status of all the tablespaces in the system.

If any of the tablespace is more than 95% and the autoextent is off then we need to add a new datafile so that the database is not full.
We can also determine the history of tablespaces.

We can select Months, Weeks or Days over here to see the changes which takes place in a tablespace.
We can determine the growth of tablespace by analyzing these values.
 


Database Backup logs (DB12)

From this transaction we could determine when the last successful backup of the system was. We can review the previous day's backups and see if everything was fine or not.

We can also review the redo log files and see whether redo log backup was successful or not.
 

Tuesday, 24 May 2016

System Monitoring


What is System Monitoring?


System monitoring is a daily routine activity and this document provides a systematic step by step procedure for Server Monitoring. It gives an overview of technical aspects and concepts for proactive system monitoring. Few of them are:
  • Checking Application Servers.
  • Monitoring System wide Work Processes.
  • Monitoring Work Processes for Individual Instances.
  • Monitoring Lock Entries.
  • CPU Utilization
  • Available Space in Database.
  • Monitoring Update Processes.
  • Monitoring System Log.
  • Buffer Statistics
Some others are:
  • Monitoring Batch Jobs
  • Spool Request Monitoring.
  • Number of Print Requests
  • ABAP Dump Analysis.
  • Database Performance Monitor.
  • Database Check.
  • Monitoring Application Users.

How do we do monitor a SAP System ?


Checking Application Servers (SM51)


This transaction is used to check all active application servers.

Here you can see which services or work processes are configured in each instance.

Monitoring Work Processes for Individual Instances SM50:


Displays all running, waiting, stopped and PRIV processes related to a particular instance. Under this step we check all the processes; the process status should always be waiting or running. If any process is having status other than waiting or running we need to check that particular process and report accordingly.

This transaction displays lot of information like:
  1. Status of Workprocess (whether its occupied or not)
  2. If the workprocess is running, you may be able to see the action taken by it in Action column.
  3. You can which table is being worked upon
Some of typical problems:
  • User take long time to log on/not able to logon/online transaction very slow. This could be the result of the DIA work processes are fully utilized. There could be also the result of long running jobs (red indicator under the Time column). If necessary you can cancel the session by selecting the jobs then go to Process>Cancel Without core. This will cancel the job and release the work process for other user/process
  • Some users may have PRIV status under Reason column. This could be that the user transaction is so big that it requires more memory. When this happen the DIA work process will be 'owned' by the user and will not let other users to use. If this happens, check with the user and if possible run the job as a background job.
  • If there is a long print job on SPO work process, investigate the problem. It could be a problem related to the print server or printer.

Monitoring System wide Work Processes (SM66)


By checking the work process load using the global work process overview, we can quickly investigate the potential cause of a system performance problem.

Monitor the work process load on all active instances across the system

Using the Global Work Process Overview screen, we can see at a glance:
  • The status of each application server
  • The reason why it is not running
  • Whether it has been restarted
  • The CPU and request run time
  • The user who has logged on and the client that they logged on to
  • The report that is running

Monitor Application User (AL08 and SM04)

This transaction displays all the users of active instances.

Monitoring Update Processes (SM13)


Execute Transaction SM13 and put '*' in the field USER and click on  button.
 

If there are no long pending updates records or no updates are going on then this queue will be empty as shown in the below screen shot.
 

But, if the Update is not active then find the below information:
  • Is the update active, if not, was it deactivated by system or by user?
    • Click on  button and get the information.
    • Click on  button and get the below information:
  • Is any update cancelled?
  • Is there a long queue of pending updates older than 10 minutes?

Monitoring Lock Entries (SM12)

Execute Transaction SM12 and put '*' in the field User Name

SAP provides a locking mechanism to prevent other users from changing the record that you are working on. In some situations, locks are not released. This could happen if the users are cut off i.e. due to network problem before they are able to release the lock.

These old locks need to be cleared or it could prevent access or changes to the records.

We can use lock statistics to monitor the locks that are set in the system. We record only those lock entries which are having date time stamp of previous day.
 

Monitoring System Log (SM21)

We can use the log to pinpoint and rectify errors occurring in the system and its environment.
We check log for the previous day with the following selection/option: