Thursday 2 January 2014

SAP NetWeaver Layers


  SAP Net weaver is SAP's integrated technology computing platform and is the technical foundation for many SAP applications.
   Set of cooperative technologies that provide internal connectivity (integration) between SAP modules and external connectivity with other systems.
   SAP Net weaver is marketed as a service-oriented application and integration platform.
   SAP Net weaver composition environment (CE) is a platform that enables building and running applications based on service-oriented architecture (SOA) principles.
   SAP Net weaver is built using primarily the ABAP programming language, but also uses c (programming language), c++, and java ee.
   Net weaver is essentially the integrated stack of SAP technology products.
   Eases integration between systems. 
      SAP NetWeaver Application Server is the further development of the SAP Web Application Server.
   Provides framework for development.

Layers of SAP Net Weaver



   The core capabilities of SAP Net weaver are the integration of people, information, and process.
       People Integration :  It simply means that it enables you to bring people together and help them to work more efficiently.

       Information Integration: Information integration provides your company with both structured and unstructured information that is consistent and accessible. Users have constant access to consistent information, no matter where it is stored.


       Process Integration: means coordinating the flow of work across departments, divisions, and between companies.
 It is used to facilitate the exchange of information among a company's internal software and systems and those of external parties.






















Monday 30 December 2013

Background Job/Background Workprocess


Background Work process:

Background jobs run in a special type of work process—the background work process—that is different from dialog work processes in two ways:
...
       1.      A dialog work process has a run-time limit that prevents users from interactively running especially long reports. By default, the system terminates any dialog work process in a transaction that exceeds 600 seconds. Although the value of the limit can be changed (in the system profile parameter rdisp/max_wprun_time), that limit is always in effect for dialog work processes. No such limit applies to background work processes.
       2.      Background work processes allocate memory differently than dialog work processes so that background work processes can become as large as they need to in allocated memory to allow for processing large volumes of data.

Having special work processes for background processing provides an additional dimension for separating background processing and interactive work. Typically, background processing and interactive work on the system is separated by time of day. For example, interactive users have the system during the day, large background jobs have the system by night. But the background work process also lets you separate interactive from background use by server, since background jobs can only run on those servers that offer background work processes.
Using background work processes also lets you optimize either background or dialog processing. In “night” mode, more servers can offer more work processes to accommodate background processing jobs that are scheduled to run when there are lower numbers of interactive users. In “day” mode, you could limit background processing to fewer servers and/or fewer background work processes.
When a time-driven scheduler is activated, it starts the jobs for which it has free work processes. If there is another background processing server, then the scheduler on that server starts the remaining jobs for which it has capacity, and so on.
Although a job can specify to use a particular background server (an application server that has at least one background work process), it is best to allow the background processing system to use load balancing to distribute the workload among the available servers.
Parallel processing, or asynchronous RFC (remote function call), is the only exception to the rule that job processing only occurs in background jobs.

The background processing system runs the external program by starting the sap server program SAPXPG on the target host and then uses on the target host system and then uses RFC to communicate with SAPXPG.

The three phases of the background processing are
1)    Job scheduling
2)    Job processing
3)    Job overview
  
Background processing enables you to plan the start of ABAP/4 programs then at the given time; they are started by special work processes called background work processes. 

In the background we can run ABAP programs, external commands and external programs.

ABAP Programs:
To run an ABAP program in the background, you must provide a variant for reports with selection screens or the ABAP program must supply its own runtime parameters. You can specify the SAP user under whose authorizations the program should run, as well as how the spool system should handle output from the program.

Output generated by an ABAP program is held in the SAP spool system as a spool request. The job step printing and archiving specifications specify how to handle this output. Spool requests can also be automatically mailed via SAPoffice to any user designated in the job definition, but because output can be rather large, this option should be used with care.


External commands are pre-defined commands for end users and can run on any operating system. They are protected by system administrator-defined authorizations, so end users are restricted to scheduling only the commands they've been authorized to run.
External programs are unrestricted commands that can be entered into a job step by any user with administrator authorizations. Administrator authorization allows a user to run any program.

SAP runs background jobs by using background work process but SAP schedules the background job by using dialogue work process. From SM36 we can schedule a background job.








Scheduling a standard housekeeping jobs:
There are several background jobs that should run periodically in a production SAP System. These jobs perform housekeeping chores such as deleting outdated spool requests of background jobs. You should schedule each of these jobs for periodic execution

Some of the predefined background jobs are:

Job name
ABAP Program
Required Variant
Often
SAP_REORG_JOBS
(Delete old background jobs)
RSBTCDEL

You must create a variant
Daily
SAP_REORG_SPOOL
(deletes old spool request)
RSPO0041
You must create a variant
Daily
SAP_REORG_BATCHINPUT
(Deletes old batch input files. This job may not run at the same time as normal batch input activity. Schedule this job for periods during which no batch input sessions are run.)

RSBDCREO
You must create a variant
Daily
SAP_REORG_ABAPDUMPS
(Deletes old dumps produced by ABAP abnormal terminations)
RSSNAPDL
You must create a variant
Daily
SAP_REORG_UPDATERECORDS
(Delete old update records)
RSM13002
You must create a variant
Daily
SAP_COLLECTOR_FOR_PERFMONITOR
(Collects system performance statistics)
RSCOLL00
None
Hourly
SAP_COLLECTOR_FOR_JOBSTATISTIC
(Generates run time statistics for background jobs)
RSBPCOLL
None
Hourly
SLCA_LCK_SYNCHOWNERS
(Synchronizing enque server)
SLCA_LCK_SYNCHOWNERS

None
Hourly

Defining a house keeping job:
1)    Go to SM36 and define a job name:


2)    From the above screen we will define background jobs.


3)    While scheduling a background job we have different kind of priorities based on the priority background jobs will be executed.
Class A: high priority jobs
Class B: Medium priority
Class C: Low Priority
Class A job will be taken care by the class A work process present in the background work process.

4)    If you want to run your background job in other server than select respective server in the execution server. The spool list recipient will be used to send mails about the background job status.

5)    Select Job step in the above screen, another window will popup select the program that you want to run. Here we are selecting ABAP program.


6)    As I am running a standard housekeeping job here I am running rspo0041 (deletion of old spool requests) and I am selecting a standard variant.


7)    Click on check and save overview window will appear. 




8)    For scheduling the job go back and save it.



9)    Now we need to run the background for that go to start condition.






10)  Here we are running the job immediately with periodically so select periodic check box as well.


11)  Check and save and select periodic values option.


12)  Here we can define the periodic values. I would like to run this job for every three minutes so I am selecting other period option and I will specify as 3minutes.


13)  Check and save in all the windows and save it in sm36 main screen the job will be in the released stage. 

14)  Sm37 is the transaction code to check the status of the background jobs.


15)  Execute the above screen to know the status of the jobs that you released.



16)  The job we released has finished successfully. To check the job log double click on the that job.




Sunday 29 December 2013

Update Work Process




1)    The update work process handles database update operations
2)    SAP transactions usually consists of several dialogue steps i.e., it creates a log record for dialogue step in SAP transaction in the VBLOG table for database update.
3)    Update work process later process the log record at the end of the SAP transaction.
4)    Update Service
        i)        Create update request
        ii)       Send update message
        iii)      Read update request
        iv)      Implement update request
5)    While doing the updating object has to be locked for not execute other requests at the same time.  Otherwise it might leads to database inconsistency.
6)    The locking mechanism will be taken care by enqueue work process.
7)    Dialogue work process updates the data to the temporary tables. From temporary tables update work process update the data directly to the database.
8)    The list of temporary tables are
       i)        VBHDR : Contains header information
       ii)       VBMOD: contains modification of updated data
       iii)      VBDATA: contains actual updated data
       iv)      VBERROR: Error information will be stored
       v)       VBWORK: work list for mass processing
9)    Update process are of three types
i)             Local Update: in this dialogue work process will update the data directly to database. This case occurs when dialogue work process dealing a small transaction.
ii)            Asynchronous Update: This case occurs when dialogue work process is writing the data to the temporary tables.
iii)           Synchronous Update: This case occurs when update work process will write the temporary table data to the database.
10)  In each and every system there are two update work processes. Those are UPD and UPD2.
11)  UPD will take care of all critical updates and UPD2 will take care of all non critical updates.
12) The configuration of update work process depends on dialogue work process in general we need one update work process for each and every 5 dialogue work processes.
13) From SM13 T-code we will check the all update processes.
14) Update process status are
1)    Cancelled
2)    To be updated
3)    V1 executed
4)    V2 executed

15)  While running update processes there are four update stages
1)    I (INIT): It will initialize the update records
2)    N (RUN): Update is started in main memory
3)  O(AUTO): When we got any update errors after solving those errors the update process starts automatically.
4)    F (Error): Error in the process
16)  From SM14 we can activate or deactivate the update process.

17)  The update errors will occur when
i)             DB Errors
ii)            Program Errors
iii)           Table overflow
iv)           Network issues
v)            When less number of work processes are configured



Update Work Process Profile Parameters:
1)    rdisp/wp_no_vb: number of update work processes
Default value: 0
Recommended: 2

2)    rdisp/vbmail: Send mail in case of an update error
If update errors occur, the user is informed by the sending of an Express mail. You can deactivate this mail:
   Parameter value = 1: A mail is sent
   Parameter value = 0: No mail is sent

3)    rdisp/vbname: Name of the update server

4)    rdisp/vbreorg: deletion of old update requests
This parameter specifies whether incomplete update requests should be deleted as an update server is started. This type of request can occur if a transaction has already saved function modules in the update tables and executed an implicit COMMIT WORK at a screen change, after which a rollback occurred. As these incomplete update requests can never be executed and only occupy space in the database, you should delete them from time to time.

Alternatively to deleting incomplete update requests at the start of an update server, you can use background job rsm13002 to delete them. In this case, you can set the parameter to 0. This means that no reorganization is performed when the update server is started.
Default value: 1 (a reorganization is executed when the update server is started).

5)    rdisp/auto_vb_stop: DB errors will stop update task automatically
Update automatically stops when database errors occur.
The possible values are:
     0 No automatic stop
     1 Automatic stop
Default: 1

6)    rdisp/vb_lock_mode: handling of sap enqueues after update error
This parameter defines the handling of the SAP locks inherited by the update process after update terminations. There are three variants: - the locks are released. This should mean that important system   resources do not remain locked after update termination. The parameter value for this variant is RELEASE.
·         The locks remain in place. The parameter value for this variant is   HOLD.
·         The locks only remain in place if the update was externally   and was previously in the status PREPARE. The parameter value   for this variant is HOLD_AFTER_PREPARE.
Default value: RELEASE

7)    rdisp/vbdelete: Delete old update requests
The parameter specifies the duration in days, after which an update request is deleted. At the end of this period, the update requests are deleted irrespective of their status. If the parameter has the value 0, the update requests are not deleted.
Default value: 50 days

8)    rdisp/vb_stop_active:
You can deactivate the SAP update as follows: - By manual deactivation (SM14 or SM13 Update records -> Update -> Deactivate)
- When severe database problems occur, the system deactivates the update process.
This parameter is used to switch off the ability to deactivate the update process. If the value is set to 1, updating can no longer be deactivated.
Default value: 1

9)    rdisp/vb_mail_user_list: List of users to receive mails in case of update                    errors
This parameter controls which users receive an express mail "Update terminated" when an update terminates. Usually only the affected user receives the mail. Other or additional users can be specified. This can be used, for example, to ensure the administrator receives all mails.

The parameter must be entered in the profile using the syntax:
      rdisp/vb_mail_user_list = <usr1> [, <usr2> ] ...

If the affected user is to receive the mail, use the name $ACTUSER.

Examples:
·         rdisp/vb_mail_user_list = $ACTUSER, ADMIN1, ADMIN2   The mail is sent to the affected user and to the users   ADMIN1 and ADMIN2.
·         rdisp/vb_mail_user_list = ADMIN. The mail is sent to the user ADMIN.


10)  rdisp/vbstart: Perform update startup actions
This parameter controls the start-up behavior of an update server. During startup, the update server checks in its request to see if it contains any update requests that have not yet been executed (status init). If this is the case, these requests are flagged and then executed. You can use this parameter to deactivate this automatic starting:
   Parameter value 1: The automatic starting is active
   Parameter value 0: The automatic starting is not active
Default value: 1