‎2006 Feb 02 9:20 AM
hi guys,
can anyone plz lemme know how to use tcode samt???
plz reply me soon.
thanks n regards,
Bhargava.
‎2006 Feb 02 9:39 AM
ABAP Program Mass Processing
Transaction SAMT allows you to perform tests on sets of associated
programs.
To do this, you specify a subroutine which you call with an external
PERFORM for each individual program.
A program name and the associated TRDIR entry is then passed to a test
subroutine.
If the test detects any problem, it analyzes the information, error or
warning and outputs a note on the program location (external PERFORM
SAMT_HINT(SAPRSAMT)).
One note can have several messages consisting of any amount of text
(external PERFORM SAMT_MESSAGE(SAPRSAMT)).
For documentation about writing these subroutines, refer to the program
documentation for RSAMTFEX.
Special functions
Transporting tests
This function allows you to transport a test to another
system, but the system transports only a table entry, not the
associated test program.
Transported tests are usually displayed in green.
These transports are only deleted irrevocably if the deletion
was also transported.
Creating program sets
With this function, you create a program set belonging to a
particular test. You can describe the set on the next
selection screen.
If you want to enable certain program sets with a complicated
selection to be created several times, you can define a
variant of the program RSAMTSEL (in the usual way).
If you want to determine the program set according to
different criteria, you can use your own subroutine. This must
be part of the main program for the test, have the name
DETERMINE_PROGRAMSET and the following interface:
FORM DETERMINE_PROGRAMSET.
TABLES P_PROGRAMS TYPE PROGRAMS
USING P_FORM TYPE FORM
CHANGING P_SHORTTEXT TYPE SHORTTEXT.
Executing a test
The subroutine belonging to the test is called for each
program in a program set (in alphabetical order).
Since locks are set, several different sessions can perform
tests on the same program set at the same time. This means you
can reduce considerably the total amount of time needed to
process a program set.
There is also a function to execute tests in the background.
The function for performing a test on all machines initiates
the scheduling of a background job that executes a test on all
"suitable" machines (with RFC). Since this function increases
the load on the entire system considerably, this type of
background job should only be run at night.
Copying a program set
This function creates a new version of an existing program
set. You can execute the test for all the programs concerned.
In this way, you can detect any change in the results.
Extracting a program set
With this function, you create a new program set from an
existing program set.
For example, you can extract just the programs that cause
errors.
Copying a program set to another test
This function copies a program set from one test to another
test.
User statistics
If you want to determine the persons responsible for all the
program classes and development classes of the selected
programs, you can generate a list of all the relevant user
names.
This is accompanied by statistics giving the number of
programs, informations, warnings and errors.
Code statistics
You can also generate a statistic containing all the notes
codes that have occurred.
The text for a code is any first line of a note belonging to
the code.
You can branch to the relevant results display from either the
user statistic or the code statistic.
Displaying the results
There are two types of results display - standard display and
private display using your own program.
You can reduce the standard display by specifying certain
criteria.
If you want to perform non-standard results analyses, you can
handle the display and processing of test results yourself. To
do this, you call the program containing the test subroutine
directly (with SUBMIT ... VIA SELECTION-SCREEN). The test,
program set and version IDs are then passed via memory.
Since this involves a lot of programming and assumes some
knowledge of the structure of results tables, you are advised
against such results analysis.
Instead, you should make a development request for this
transaction in order to get any defective function included in
the standard.
Editing
By double-clicking on a message for a note in the standard
display, you can go into the ABAP/4 editor and jump to the
relevant place in the program.
Refreshing
You can refresh display lists at any time. This makes changes
made by other modi visible.
Return ->
SAMT
Regards,
Ankur Bhandari.
p.s Reward points if it helps.
‎2006 Feb 02 9:42 AM
Hi Ankur,
Thanks alot for the info, however can u plz lemme know where will u will call the external subroutine that u have mentioned...
can u plz be abit clear on that...
regards,
Bhargava.
‎2006 Feb 02 9:46 AM
Bhargava,
Please find below the answer. Reward points if it helps.
-
Mass Test for ABAP/4 Programs: Subroutines for Reporting Results
riting a (Sub)routine for ABAP Program Set Processing
Each main program belonging to a test should contain the include
RSAMTINC (or at least the include RSAMTTP0), since this defines the
constants for the allowed values of P_CATEGORY.
The subroutine interface should be similar to the following:
FORM <FORM name> USING P_PROGRAM TYPE PROGRAM
P_TRDIR LIKE TRDIR.
This passes the program name and the associated TRDIR entry.
Messages are output by calling the subroutine SAMT_MESSAGE, but you must
first assign them to a note by calling SAMT_HINT, SAMT_CODED_HINT or
SAMT_GENERAL_HINT. You can also give notes a code which facilitates
selection later. You call the subroutines SAMT_HINT and SAMT_MESSAGE of
the main program with an external PERFORM.
One program can have several notes but each note always refers to one
program location. One note can have several messages (texts).
The include RSAMTFEX of the main program SAPRSAMT contains some other
useful subroutines which you can call from the actual test subroutine
with an external PERFORM. These subroutines include:
SAMT_SEARCH_ABAP_PATTERN: This searches for ABAP statements
which match the specified pattern.
It also scans includes.
In general, you use this program for
searching, and not SAMT_SEARCH_STRING
SAMT_SEARCH_STRING: This searches for a character string in a
program, including comments,
but does not scan includes.
SAMT_SYNTAX_CHECK: This checks the syntax of a specified program
and, if necessary, outputs error messages.
SAMT_READ_REPORT: This reads the specifed program; the subroutine
takes over error handling.
splaying results with auxiliary programs
If you want a larger number of users to be able to view the results
without being "obliged" to use the transaction, use the programs
RSAMTUSS and RSAMTUSR can be used.
RSAMTUSS allows you to jump directly to the standard display. When doing
this, you must specify the IDs of the test, program set and version. You
can determine these by using an appropriate function in the program set
list. Sometimes, it is useful to create variants.
RSAMTUSR calls RSAMTUSS by using a variant (of RSAMTUSS) specified on
the selection screen and a user name (default: SY-UNAME).
Regards,
Ankur Bhandari
‎2006 Feb 02 10:16 AM
Hi Ankur,
Iam able to create a task and then a program set and its in processing... but how to see the errors and what is the basic use of samt tcode....
after i create program sets what should i do in order to see the errors what should i do...
can u pzl gimme hat information..
regrads,
Bhargava.
‎2006 Feb 02 10:36 AM
Bhargava,
Reward points if you feel it was helpful.For previous posts as well. Here is the part which you want.
_________________________________________________________
ABAP Development Under Unicode
A Unicode-enabled ABAP program (UP) is a program in which all Unicode checks are effective. Such a program returns the same results in a non-Unicode system (NUS) as in a Unicode system (US). In order to perform the relevant syntax checks, you must activate the Unicode flag in the screens of the program and class attributes.
In a US, you can only execute programs for which the Unicode flag is set. In future, the Unicode flag must be set for all SAP programs to enable them to run on a US. If the Unicode flag is set for a program, the syntax is checked and the program executed according to the rules described in this document, regardless of whether the system is a US or an NUS. From now on, the Unicode flag must be set for all new programs and classes that are created.
If the Unicode flag is not set, a program can only be executed in an NUS. The syntactical and semantic changes described below do not apply to such programs. However, you can use all language extensions that have been introduced in the process of the conversion to Unicode.
As a result of the modifications and restrictions associated with the Unicode flag, programs are executed in both Unicode and non-Unicode systems with the same semantics to a large degree. In rare cases, however, differences may occur. Programs that are designed to run on both systems therefore need to be tested on both platforms.
You are recommended to follow the procedure below to make your programs US-compliant:
The UNICODE task in transaction SAMT performs first an NUS and then a US syntax check for a selected program set. For an overview of the syntax errors by systems, programs and authors, consult the following document in SAPNet: Alternatively, you can start the ABAP program RSUNISCAN_FINAL to determine the Unicode-relevant syntax errors for a single program.
Before you can set the Unicode flag in the NUS in the attributes of the program concerned, all syntax errors must be removed.
Having enabled the Unicode flag in the NUS, you can run the syntax check for this program. To display a maximum of 50 syntax errors simultaneously, choose Utilities -> Settings -> Editor in the ABAP Editor and select the corresponding checkbox.
Once all syntactical requirements are met in the NUS, you must test the program both in the NUS and US. The purpose of this test is to recognize any runtime errors and make sure that the results are correct in both systems. To rule out runtime errors in advance, you should always type field symbols and parameters so that any potential problems can be detected during the syntax check.
‎2006 Feb 02 10:40 AM
Hi Ankur,
In order to run this SAMT tcode and get the error results displayed, do we need to write any executable program of our own.... if u have written any program like that can u plz send me the code...
its very urgent, can u help me out.
awaiting ur reply
Thanks and regards,
Bhargava.K.K.