Subscribe

RSS Feed (xml)



Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Showing posts with label Tutorials on SAP-ABAP(Reports). Show all posts
Showing posts with label Tutorials on SAP-ABAP(Reports). Show all posts

Friday, June 3, 2011

Scheduling Background jobs

Objective: Scheduling a background job in SAP R/3. These document intents to provide steps which can be done even by an end user to prepare a Job.

Main Steps:

1. Change screen layout of stock report as per the requirement.

2. Create variant to run the stock report (MB52) via Job.

3. Access transaction code SM36 to create the Job.

4. Monitor the Job and check the spool

5. Access SAP Business Work place to check the Spool.

Step1: Create Screen layout

Assumption: Go to transaction MB52 and enter the value of the Plant (let’s say 1000).

Step : Create Variant along with the layout which we have created in previous step.

Press F4 on the layout field in initial screen and then press save.

After selecting the layout here please click on save.

Step: Please mention the variant name as per your choice and also mention the description.

You may also mark the check box protect variant for the field plant and layout though its not mandatory.

Save

Step: Finding the program name for transaction code MB52

Now please notice the Program name RM07MLBS.

Step: Log in transaction code SM36.

Mention the Job name as ZDaliystk_MB52_1000.

Press enter to get the below screen



Click on the ABAP program and mention the program and also select the variant name which was created in initial steps.

Click on check and save

Step : Now click on the start condition button.

In this step we are giving the frequency of running the job. As already mentioned the Job needs to run daily basis.

click on the period values button and also mark the period check box as the job has to run every day.

Click on the spool recipient button

Just press enter and save to get the message that job is in release status

Monitor and check the output of job. Access transaction code SM37.

Also mention the Job name

execute and check the spool.

click on the type

Step: Here we are with the results which is list of stock in our case



Converting an XML file with many hierarchy levels to ABAP format

This example shows how we can convert an XML file with many hierarchy levels to ABAP format.

Copy and paste the following code in notepad and save it as test.xml file.

Save the XML file which in desktop or some other path

            0000000000038491     ZEU_MATMAS           004     000000000000010003          005      E      promo pack normal      EN           

Here we can see that the root node is ZEU_MATMAS03 which is the main structure containing all other structures.

It contains IDOC structure which in turn contains E1MARAM and EDI_DC40 structures within.

EDI_DC40 contains DOCNUM and MESTYP fields.

E1MARAM contains E1MAKTM structure and MSGFN and MATNR fields.

In SAP we have to create corresponding structures to store this data from XML to ABAP.The main structure contains many deep structures.

So in ABAP dictionary we first create the structure ZIDOC_TEST which contains Structures ZEDIDC40 and Z1EMARAM_TEST1.

ZIDOC_TEST structure contains ZE1MARAM_TEST1 and ZEDIDC40 structures within.

ZEDIDC40 contains DOCNUM and MESTYP fields.

ZE1MARAM_TEST1 contains E1MAKTM structure and MSGFN and MATNR fields.

The structures Z1EMARAM_TEST1 and ZEDIDC40 are also created as shown in the below slides.

This is the structure of ZEDIDC40 - Control record with fields DOCNUM and MESTYP..

The structure ZE1MARAM_TEST1 contains the following fields MSGFN and MATNR.Also a deep structure E1MAKTM.

E1MAKTM Structure is a standard dictionary structure we are using directly with the fields MSGFN,SPRAS,MAKTX and SPRAS_ISO.

The following ABAP program converts the given input XML file to ABAP format.

TYPE-POOLS abap.

*Input file contents as string.XML file path where we saved the file. *Here it is saved in desktop.

*Input file with path as constant
CONSTANTS gs_file TYPE string VALUE 'C:\Documents and Settings\Administrator\Desktop\test1.xml'.

*This is the structure type for the data from the XML file
TYPES
: BEGIN OF ts_zeu_matmas03,
idoc
TYPE ZIDOC_TEST, “ZIDOC_TEST structure we created in SE11
END OF ts_zeu_matmas03.

* Table for storing the XML content from file
DATA: gt_itab TYPE STANDARD TABLE OF char2048.

* Table and work areas for the data from the XML file
DATA: gt_zeu_matmas03 TYPE STANDARD TABLE OF ts_zeu_matmas03,
gs_zeu_matmas03
TYPE ts_zeu_matmas03.

* Result table that contains references
* of the internal tables to be filled
DATA: gt_result_xml TYPE abap_trans_resbind_tab,
gs_result_xml
TYPE abap_trans_resbind.

* For error handling
DATA: gs_rif_ex TYPE REF TO cx_root,
gs_var_text
TYPE string.

* Get the XML file from your client
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = gs_file
CHANGING
data_tab = gt_itab
EXCEPTIONS
file_open_error =
1
file_read_error =
2
no_batch =
3
gui_refuse_filetransfer =
4
invalid_type =
5
no_authority =
6
unknown_error =
7
bad_data_format =
8
header_not_allowed =
9
separator_not_allowed =
10
header_too_long =
11
unknown_dp_error =
12
access_denied =
13
dp_out_of_memory =
14
disk_full =
15
dp_timeout =
16
not_supported_by_gui =
17
error_no_gui =
18
OTHERS = 19.

IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

* Fill the result table with a reference to the data table.
* Within the XSLT style sheet, the data table can be accessed with
* "IDOC_GET".

GET REFERENCE OF gt_zeu_matmas03 INTO gs_result_xml-value.
gs_result_xml-name =
'IDOC_GET'.
APPEND gs_result_xml TO gt_result_xml.

* Perform the XSLT stylesheet

TRY.

CALL TRANSFORMATION z_xml_idoc
SOURCE XML gt_itab
RESULT (gt_result_xml).

In this part of the code

Z_XML_IDOC should be created in XSLT Editor and write code for that as follows:-

We can go there by double clicking on Z_XML_IDOC.Create it and after copying this code activate it.

XSLT is a language is used to convert XML from one format to another format.

Copy paste the following code in XSLT editor :-

Some rules which were applied for conversion to XSLT are:-

IDOC_GET is used to get the data from IDOC.In the XML file the main node is IDOC which has E1MARAM and EDIDC_40 which in turn contains MSGFN,MATNR and E1MAKTM and EDIDC_40 contains MSGFN and DOCNUM respectively.

The same type of structure which is used in our program needs to be filled.In our program EDIDC_40 is used as ZEDIDC40 and E1MARAM is used as ZE1MARAM_TEST1.

The basic template is already filled when we enter the XSLT editor.

We use IDOC_GET to use the IDOC data.We should use the tags to be filled in the hierarchy structure as we declared it in the program.To use the values we need to use the structures in the XML file.Use the corresponding path to access the values.

After transformation the gt_zeu_matmas03 is filled which can be used for displaying.

      
                                                          
                                                                                                                                                                               
    

*Come back to ABAP editor and copy this code for error handling.

CATCH cx_root INTO gs_rif_ex.

gs_var_text = gs_rif_ex->get_text( ).
MESSAGE gs_var_text TYPE 'E'.

ENDTRY.

*Display the file contents on screen.
IF
sy-subrc = 0.
LOOP at gt_zeu_matmas03 INTO gs_zeu_matmas03.
WRITE: gs_zeu_matmas03-idoc-zedidc40-docnum, “document no
/ gs_zeu_matmas03-idoc-zedidc40-mestyp, “message type
/ gs_zeu_matmas03-idoc-ze1maram_test1-msgfn,”message function
/ gs_zeu_matmas03-idoc-ze1maram_test1-matnr,”material no

*all fields of E1MAKTM segment
/ gs_zeu_matmas03-idoc-ze1maram_test1-e1maktm-msgfn,
/ gs_zeu_matmas03-idoc-ze1maram_test1-e1maktm-spras,
/ gs_zeu_matmas03-idoc-ze1maram_test1-e1maktm-maktx,
/ gs_zeu_matmas03-idoc-ze1maram_test1-e1maktm-spras_iso.
ENDLOOP.
ENDIF.

We can see the values filled in the heirarchy structure of IDOC as follows:-

Execute the ABAP program and we get the file contents displayed as below.So we have converted the given XML File to a structure and display the contents.

Final output of the program is:-



FTP file transfer in Background

1) Creating RFC Destination for FTP.

Run program: RSFTP005.

The RFC destinations SAPFTP and SAPFTPA will be created automatically.

a) SAPFTP (for local system)

b) SAPFTPA (for running in Application server)(This is used for file transfer in background.

2) Code sample for developing FTP programs can be got from report program

a) RSFTP002

b) RSFTP007

c) RSFTP008

3) Sample code for getting customer details as tab delimited .TXT file in background.

*&---------------------------------------------------------------------* *& Report ZCUSTOMER *& *&---------------------------------------------------------------------* *&-Customer -All new/changed customer records created during the period. *&---------------------------------------------------------------------* *LedgerKey-------------Char(50) *AccountName-----------Char(80) *AccountReference -----Char(50) *Address1 -------------Char(80) *Address2 -------------Char(80) *Town -----------------Char(50) *County / State -------Char(50) *Post Code / ZIP ------Char(20) *Country---------------Char(2) *AccountCurrencyCode --Char(3) *ContactTelephone -----Char(20)
REPORT  zcustomer.
TABLES: kna1,knb1. 
TYPES: BEGIN OF st_customer,        ledgerkey TYPE char50,        name1 TYPE kna1-name1,        kunnr TYPE kna1-kunnr,        name2 TYPE kna1-name2,        stras TYPE kna1-stras,        ort01 TYPE kna1-ort01,        regio TYPE kna1-regio,        pstlz TYPE kna1-pstlz,        land1 TYPE kna1-land1,        waers TYPE knvv-waers,        telf1 TYPE kna1-telf1,        END OF st_customer. 
TYPES : BEGIN OF st_cus,               ledgerkey(50)  TYPE c, "LedgerKey               wrk_delim1      TYPE x ,               name1(80)   TYPE c,  "AccountName               wrk_delim2      TYPE x ,               kunnr(50)   TYPE c,  "AccountReference               wrk_delim3      TYPE x ,               name2(80)   TYPE c,      "Address1               wrk_delim4      TYPE x ,               stras(80)   TYPE c,    " Address2               wrk_delim5      TYPE x ,               ort01(50)   TYPE c,   " Town               wrk_delim6      TYPE x ,               regio(50)   TYPE c,   " County / State               wrk_delim7      TYPE x ,               pstlz(10)   TYPE c,   "Post Code / ZIP               wrk_delim8      TYPE x ,               land1(2)    TYPE c,    "Country               wrk_delim9      TYPE x ,               waers(3)    TYPE c,    "AccountCurrencyCode               wrk_delim10     TYPE x ,               telf1(20)   TYPE c,    "ContactTelephone          END OF st_cus .
DATA: wrk_file TYPE char200. DATA: it_customer TYPE STANDARD TABLE OF st_customer,       wa_customer LIKE LINE OF it_customer.
DATA: it_dat TYPE STANDARD TABLE OF st_cus,       wa_dat LIKE LINE OF it_dat.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
SELECT-OPTIONS:cust_no FOR  kna1-kunnr,"customer no                com_code FOR knb1-bukrs,"company code                country FOR kna1-land1, "country                creat_on FOR kna1-erdat default sy-datum. "created or changed on SELECTION-SCREEN END OF BLOCK b2.
START-OF-SELECTION.
  IF creat_on-high IS INITIAL.     creat_on-high = creat_on-low.   ENDIF.
  CONCATENATE sy-mandt '_1_'  creat_on-low '_' creat_on-high '_Cust.txt' INTO                       wrk_file.
  PERFORM customer_data_select.    "Customer Data File   PERFORM build_template_data.   PERFORM ftp_file_customer.
*&---------------------------------------------------------------------* *&      Form  CUSTOMER_DATA_SELECT *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* *  -->  p1        text *  <--  p2        text *----------------------------------------------------------------------* FORM customer_data_select .
  SELECT a~name1 a~name2 a~kunnr a~stras a~ort01 a~regio a~pstlz a~land1 a~telf1    
"Details of the Customer based on KNA1.        FROM kna1 AS a        INNER JOIN knb1 AS b ON a~kunnr = b~kunnr              INTO CORRESPONDING FIELDS OF TABLE it_customer              WHERE a~kunnr IN cust_no              AND ( ( a~erdat IN creat_on OR a~updat IN creat_on ) OR              ( b~erdat IN creat_on OR b~updat IN creat_on ) )              AND a~land1 IN country               AND b~bukrs IN com_code.
  IF sy-subrc = 0.     LOOP AT it_customer INTO wa_customer.
      SELECT SINGLE waers FROM knvv INTO wa_customer-waers                                            WHERE kunnr = wa_customer-kunnr.. 
      wa_customer-ledgerkey = '12345'.
      MODIFY it_customer FROM wa_customer.
    ENDLOOP.
  ENDIF.
ENDFORM.                    " CUSTOMER_DATA_SELECT *&---------------------------------------------------------------------* *&      Form  BUILD_TEMPLATE_DATA *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* *  -->  p1        text *  <--  p2        text *----------------------------------------------------------------------* FORM build_template_data .
  LOOP AT it_customer INTO wa_customer.     MOVE-CORRESPONDING wa_customer TO wa_dat.
    wa_dat-wrk_delim1  = '09'.  "for adding tab after each field     wa_dat-wrk_delim2  = '09'.     wa_dat-wrk_delim3  = '09'.     wa_dat-wrk_delim4  = '09'.     wa_dat-wrk_delim5  = '09'.     wa_dat-wrk_delim6  = '09'.     wa_dat-wrk_delim7  = '09'.     wa_dat-wrk_delim8  = '09'.     wa_dat-wrk_delim9  = '09'.     wa_dat-wrk_delim10 = '09'.     APPEND wa_dat TO it_dat.   ENDLOOP.
ENDFORM.                    " BUILD_TEMPLATE_DATA *&---------------------------------------------------------------------* *&      Form  FTP_FILE_CUSTOMER *&---------------------------------------------------------------------* *       text *----------------------------------------------------------------------* *  -->  p1        text *  <--  p2        text *----------------------------------------------------------------------* FORM ftp_file_customer .
  DATA:  l_user(30) TYPE c VALUE 'ZTEST', "user name of ftp server          l_pwd(30) TYPE c VALUE '1234', "password of ftp server          l_host(64) TYPE c VALUE '111.2.1.198', "ip address of FTP server          l_dest LIKE rfcdes-rfcdest VALUE 'SAPFTPA'."Background RFC destination
  DATA: w_hdl TYPE i,         c_key TYPE i VALUE 26101957,         l_slen TYPE i.
*HTTP_SCRAMBLE: used to scramble the password provided in a format recognized by SAP.   SET EXTENDED CHECK OFF.   l_slen = STRLEN( l_pwd ).
  CALL FUNCTION 'HTTP_SCRAMBLE'     EXPORTING       SOURCE      = l_pwd       sourcelen   = l_slen       key         = c_key     IMPORTING       destination = l_pwd.
* To Connect to the Server using FTP   CALL FUNCTION 'FTP_CONNECT'     EXPORTING       user            = l_user       password        = l_pwd       host            = l_host       rfc_destination = l_dest     IMPORTING       handle          = w_hdl     EXCEPTIONS       OTHERS          = 1.  . *FTP_R3_TO_SERVER:used to transfer the internal table data as a file to other system in the character mode.
  CALL FUNCTION 'FTP_R3_TO_SERVER'     EXPORTING       handle         = w_hdl       fname          = wrk_file          "file path of destination system       character_mode = 'X'     TABLES       text           = it_dat     EXCEPTIONS       tcpip_error    = 1       command_error  = 2       data_error     = 3       OTHERS         = 4.
  IF sy-subrc <> 0.     MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4     RAISING invalid_output_file.   ENDIF.
*FTP_DISCONNECT: This is used to disconnect the connection between SAP and other system.
* To disconnect the FTP   CALL FUNCTION 'FTP_DISCONNECT'     EXPORTING       handle = w_hdl.
*RFC_CONNECTION_CLOSE:This is used to disconnect the RFC connection between SAP and other system.
  CALL FUNCTION 'RFC_CONNECTION_CLOSE'     EXPORTING       destination = l_dest     EXCEPTIONS       OTHERS      = 1.
ENDFORM.                    " FTP_FILE_CUSTOMER
On running this report in background a file will be created in ftp server location.

Understanding "Coverage Analyzer"

Coverage Analyzer is a very powerful runtime analysis tool provided by SAP that enables an ABAP developer to monitor processing blocks such as reports, subroutines, function-modules and methods.

Powerful filtering system in Coverage Analyzer facilitates developer to enter the number of calls separately according to periods, users and functional areas.

In a nut-shell; Coverage Analyzer is a function for monitoring the system-wide execution of ABAP programs;

It enables the success of test activities to be assessed for quality checks.

It also provides an overview of the use of programs for development purposes.

Developer can use this tool to trace programs for development purpose and Quality Manager can use this tool to check system performance for quality assurance.

It helps carry out a range of Administration Settings and the Monitoring Activity. Moreover it helps get summarized information of number of program executions, number of runtime errors, number of program resets. Fascinatingly, the results can be formatted separately according to user-group; each user-group can contain any number of users under one test key.

Broadly, functions of Coverage Analyzer are classified into two;

1. Administration Settings

  • On/Off.

  • Test Groups.

  • Registrations.

  • Reset.

  • Settings.

  • Monitor.

  • Consistency Checks.

2. Display

  • Global.

  • Detail.

A simple exercise will help us easily understand Coverage Analyzer, rather simply going through documentation.

In order to make use of Coverage Analyzer, user has to have an appropriate role. To check user authorization;

Call up transaction SUIM (User Information System).

Expand Authorizations node.

Choose By Object and execute it (press F8).

[SCM]actwin,-12,-37,1020,709;User Information System  saplogon.exe 8/18/2009 , 3:48:39 PM

Check the presence of authorization object S_COV_ADM in the system.

[SCM]actwin,-17,-81,1015,665;Authorizations by Complex Selection Criteria saplogon.exe 8/18/2009 , 4:05:30 PM Confirm the where-used list for profiles using [SCM]actwin,2147483599,2147483534,0,0;Authorizations by Complex Selection Criteria    saplogon.exe 8/18/2009 , 4:05:30 PM icon or Ctrl+Shift+F11.

Once user authorization is checked to have absolute access to SCOV (Coverage Analyzer) transaction; user can proceed further. If a role is not assigned to a user, Basis consultant has to be consulted in this regards.

In fact, a tip to be remembered is that Coverage Analyzer tool should be used on weekends or in the evening, when all users and packages are on loose ends. Since backup server collects data from all the servers including local and remote; system needs all packages and users to be in the passive mode.

Let’s start up with a simple example to understand Coverage Analyzer in a better way:

STEP 1: Call up the transaction SCOV or navigate through SAP Easy Access->SAP Menu->Tools->ABAP Workbench->Test->SCOV (Coverage Analyzer).

[SCM]actwin,-18,-81,1014,665;SAP Easy Access  saplogon.exe 8/21/2009 , 11:08:06 AM

General Status of the system is shown on the right hand pane of the window;

Coverage Analyzer administration includes all of the functions required for carrying out settings and checks.

[SCM]actwin,-18,-147,1014,599;Coverage Analyzer: Main Menu saplogon.exe 8/19/2009 , 10:57:19 AM

Administration and Display nodes are shown on the left pane of the window.

STEP 2: Before the Coverage Analyzer being switched on, settings have to be maintained for backup server and filters are to be set. Having not made settings for backup server, if Coverage Analyzer is started, it simply throws out an information message to maintain background server for data collection.

[SCM]actwin,0,0,432,158;Information    saplogon.exe 8/19/2009 , 11:05:39 AM

So, Administration settings are to be done before starting up the Coverage Analyzer.

Expand Administration node, select Settings;

Settings function is used to set the parameters for the Global and Detail views, and to filter the programs to be checked via the package.

In order to make settings, switch settings to Change Mode (Cntrl+F1).

Tip to remember: A program is regarded as tested if the following conditions are fulfilled;

Count1 Absolute Value > 0.

Count2 Absolute Value > 0.

RABAX2 Absolute Value = 0.

Unicode Check = 1.



Count1 and RABAX1 indicate the number of programs executed and runtime errors since the Coverage Analyzer was started.

Count2 and RABAX2 indicate the number of programs executed and runtime errors since the last reset.

Further, assign package to be used during analysis. When a package is pre-selected, the evaluation for the Global view is only performed for this package. If this restriction is not applied, all of the programs are included together with those from local packages ($*) and programs generated locally without packages ( ).

[SCM]actwin,-240,-319,792,427;Coverage Analyzer: Settings saplogon.exe 8/19/2009 , 11:30:57 AM

If ABAP programs with a set Unicode flag are only to be traced by the Coverage Analyzer, then select Unicode checkbox. Checking Unicode is to mark it as ‘X’, else leave it unattended.

[SCM]actwin,-238,-402,794,344;Coverage Analyzer: Settings   saplogon.exe 8/19/2009 , 11:33:20 AM [SCM]actwin,-238,-401,794,345;Coverage Analyzer: Settings   saplogon.exe 8/19/2009 , 11:35:26 AM

It’s optional to set the lights; lights provide a visual means of representing the status of the results for the degree of coverage in the Global and Detail views.

Lights are set by default, which can be set according to developer’s way of analysis.

RED 0 LT 33 %

YELLOW 33 LT 66 %

GREEN 66 LE 100%

[SCM]actwin,-237,-405,795,341;Coverage Analyzer: Settings  saplogon.exe 8/19/2009 , 11:42:54 AM

Further, Monitor Settings have to be done, which includes setting Trace Level and Maximum Entries Log and Maximum Entries Data Monitor.

There are 4 different trace levels (1-4), the higher the trace level, the more information is drawn for debugging.

[SCM]actwin,-239,-488,793,258;Coverage Analyzer: Settings  saplogon.exe 8/19/2009 , 11:56:15 AM

Tip: The values for Maximum Entries Log and Maximum Entries Data Monitor limit the lines displayed for the General Log and Monitor Data Volumes in the monitor function.

The defaulted lines for log file are 100 and for data volume are 200.

Background server has to be specified, where precisely data is to be collected. Moreover, the period for which background job has to be repeated is also to be specified.

The defaulted value for Data Collection: Period (Min) is 30 mins, which can be modified based on developer’s way of analysis. In this case, current server is specified as Background server.

[SCM]actwin,-238,-544,794,202;Coverage Analyzer: Settings saplogon.exe 8/19/2009 , 3:58:26 PM

Further, Summarization function facilitates checking the same processing blocks in several systems simultaneously.

Tip to remember: The results from the individual systems are local and those from the remote systems are summarized.

Local Degree of coverage LE 100%.

Summarized degree of coverage LE 100%.

Local Degree of coverage GE Summarized degree of coverage.

To determine RFC connection with current server, call up transaction SM59->RFC Destinations->R/3 Connections->E6SCLNT900.

Desired RFC connections in Summarize coverage results can be specified; moreover period and start time for summarize data can also be specified.

[SCM]actwin,-241,-575,791,171;Coverage Analyzer: Settings saplogon.exe 8/19/2009 , 3:56:49 PM

Finally, save the Settings.

STEP 3: Choose On/Off, Status in the Administration node and start up the Coverage Analyzer.

Switch Coverage Analyzer On/Off: This displays the number of programs that have been initialized.

Switch Automatic Recordings On/Off: This displays the automatic recording period and the version number for the Global view.

Switch Data Aggregations from Different Remote Systems: This displays background server and all of the other systems whose results are used for Data-aggregation.

If the server is in switched-off mode exception shows RED signal, GREEN signifies server to be in switched-on mode and YELLOW represents either RFC problem or database and shared memory inconsistency.

In this case, we’ll proceed without switching on Switch Automatic Recording On/Off.

[SCM]actwin,-236,-145,796,601;Coverage Analyzer: On/Off Status saplogon.exe 8/19/2009 , 4:02:15 PM

The servers which are actually running are shown as flagged up.

STEP 4: Create Test-Groups; Test-Groups are made to summarize and display the results of the Coverage Analyzer for a particular set of users under one generic key/heading.

Tip to remember: Test-groups should not be created more than 10. Moreover, only users assigned a role with the authorization object S_COV_ADM are allowed to define group.

Two pre-defined Test-groups are always available;

ALL Coverage results summarized for all test groups on the local system.

COND – Coverage results on the local system as well as remote system.

In this case, we create a test-group.

To create a test-group; switch on the Change Mode, click Append Row icon provided in the application tool-bar.

[SCM]actwin,2147483175,2147483501,0,0;Coverage Analyzer: Define Test Groups   saplogon.exe 8/19/2009 , 2:21:50 PM

Define a Test-group following Y/Z naming convention; then save it.

[SCM]actwin,-238,-148,794,598;Coverage Analyzer: Define Test Groups saplogon.exe 8/19/2009 , 2:29:26 PM

STEP 5: Next step is to assign users to the just-made test-group.

To assign Users to a test-group; switch on the Change Mode, click Append Row icon provided in the application tool-bar.

[SCM]actwin,2147483175,2147483501,0,0;Coverage Analyzer: Define Test Groups   saplogon.exe 8/19/2009 , 2:21:50 PM

Select desired test-group for which users have to be assigned; in this case we assign SAPDEV02 as user to test-group ZTST.

[SCM]actwin,-237,-146,795,600;Coverage Analyzer: Registration saplogon.exe 8/19/2009 , 2:32:23 PM

Tip: A test-group can contain any number of users, for example, all HR developers in one group. That makes filtering pretty easy. Moreover, comparison of performance of test-groups can be done in Global view.

STEP 6: An optional function to be done is Reset; explicitly this function is intended for situations in which the results of the previous analyses are no longer required. It resets all the counters of the Coverage Analyzer to 0 for all the programs of a selected group.

Further more, implicit reset is carried out automatically as soon as the flow or the data of a program changes.

After successful reset, an information message is popped-up;

[SCM]actwin,0,0,1020,38;Coverage Analyzer: Reset   saplogon.exe 8/19/2009 , 2:46:25 PM

STEP 7: Consistency check has to be done for all the servers including remote ones, before proceeding to actual analysis; [SCM]actwin,-237,-148,795,598;Coverage Analyzer: Consistency Checks   saplogon.exe 8/19/2009 , 2:52:20 PM

Check Status of All Servers checks whether the status in the shared memory matches the status in the database.

Check Status of Background Jobs checks whether all the batch jobs of the Coverage Analyzer are activated. If this is not the case, the batch jobs are all rescheduled by means of the Repair function.

Check Table Consistency (Long Runtime) may become inconsistent if the Coverage Analyzer fails on an application server due to system error.

Repair function also bridges the gap between activating and generating a program.

So, in order to check inconsistencies, check the types of inconsistencies accordingly and Execute Checks, and then choose monitor to check for the inconsistency messages,

GREEN indicates Information message, YELLOW indicates Warning message and RED indicates Error message.

[SCM]actwin,-245,-221,787,525;Coverage Analyzer: Monitor saplogon.exe 8/19/2009 , 4:07:19 PM

In the present case; no inconsistencies have been found while starting All Servers. In case, there arise any warning or error messages, those problems are to be fixed and then select particular row of the warning/error message and click Completed.

General Log gives general information, while Monitor Volume gives detailed information of started server.

[SCM]actwin,-247,-222,785,524;Coverage Analyzer: Monitor saplogon.exe 8/19/2009 , 4:09:17 PM

Once the warning is attended, select the row and hit Completed, which will going to turn yellow signal to green signal.

[SCM]actwin,-244,-327,788,419;Coverage Analyzer: Monitor saplogon.exe 8/19/2009 , 4:09:35 PM

Tip: Every time inconsistencies are checked; General Log should be refreshed.

To select more than 1 message, keep Cntrl key pressed.

STEP 8: Display; gives coverage results at author or package level according to criteria you select under Settings. Display gives high-level view.

Views can be based on Author or Package. ALL signifies all the authors on local system based on view given and the COND (y/z test groups) signifies all the authors on both local and remote systems based on view given. If ‘Other view’ is selected as Package, then selection is done accordingly.

[SCM]actwin,0,0,313,200;Coverage Analyzer: Change View    saplogon.exe 8/19/2009 , 4:27:00 PM

Note: Since Automatic Recordings were not switched on; percentage-based progress display over time cannot be seen for selected SAPDEV02 author.

Normally, Display view gives Quality Managers to view the system, the following way;

Unicode:

This value indicates how many percent of the processing blocks have the Unicode flag set (the flag itself is set per program)

Capacity Utilization:

This value is computed as the ratio of used processing blocks to loaded processing blocks to loaded processing blocks.

Accumulated Executions (Percent)

This value indicates in percent how many processing blocks have been executed since the start of the Coverage Analyzer.

Tested processing blocks (Percent)

This value indicates in percent how many processing blocks have been executed in the actual version without runtime errors.

In the example above you can see that currently 98% of the processing blocks in the system belong to a program that has the Unicode flag set, 26% have been executed since start of the coverage analyzer, 9% have been executed in the active version without errors and the capacity utilization is 29%.

STEP 9: Exact Value Table can be viewed for author SAPDEV02; which displays number processing blocks for author SAPDEV02 on timely manner.

Graphical view of the selected row can be seen using [SCM]actwin,-428,-30,438,695;Value Table    saplogon.exe 8/19/2009 , 4:36:33 PM icon; that displays graphical view of the individual date and all dates when no row is selected.

All rows selected for graphical analysis;

[SCM]actwin,156,9,1022,734;Value Table    saplogon.exe 8/19/2009 , 4:45:08 PM

Individual selection for graphical analysis;

Tip: Moreover, previous saved history can also be viewed for the specific user.

STEP 10: Details view; gives summarized and detailed results. Details give low-level view.

Strong filtering options allow user to select on what conditions results are to be displayed.

[SCM]actwin,-238,-147,794,599;Coverage Analyzer: Detail saplogon.exe 8/19/2009 , 4:52:17 PM

Conditions can be set for range of test-groups, packages and authors pertaining to those test-groups.

In the present example; test-group ZTST and Author SAPDEV02 is taken as single-value selection, which gives results pertaining to specified criteria. Moreover, other filters can also be set and settings should be done defining access via Package Object, Package and Author. Defaulted access-via is Program Object.

[SCM]actwin,-240,-181,792,565;Coverage Analyzer: Detail saplogon.exe 8/19/2009 , 4:55:34 PM

Hitting Standard Settings is going to reset all the values.

Once settings are done; hit execute button, that is going to get detailed information, including number of calls made to that particular object, number of processing blocks, load size in Kilo byte. Besides all the information given; double-clicking the object name will navigate to the particular program or executing block where exactly error has been found.

[SCM]actwin,-240,-151,792,595;Coverage Analyzer: Program Objects saplogon.exe 8/19/2009 , 5:04:54 PM

[SCM]actwin,-242,-209,790,537;Coverage Analyzer: Processing Blocks saplogon.exe 8/19/2009 , 5:07:59 PM

Note: Current Executions = Program units currently used / Total no. of Program units.

Capacity Utilization = No. of Program units currently used / Loaded Program units.

Conclusion: Likewise, many such program executions, runtime errors and program resets can be easily traced using this powerful ABAP runtime analysis tool - Coverage Analyzer.