Subscribe

RSS Feed (xml)



Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Tuesday, June 29, 2010

LESSON 49 COMPLEX LUW PROCESSING

COMPLEX LUW PROCESSING:

In an ABAP program, there are two ways of executing another program synchronously:
Terminate the current program and start the other program (SUBMIT , LEAVE
TO TRANSACTION )

Call the other program without terminating the other program. The calling program is
Interrupted, and the system returns to it when the program that it has called is finished (CALL TRANSACTION, SUBMIT AND RETURN, CALL FUNCTION).

You can only use SUBMIT and SUBMIT AND RETURN to start executable programs (program type 'Executable program', formerly program type '1').

You use LEAVE TO TRANSACTION and CALL TRANSACTION to start programs that have a transaction code.

You use CALL FUNCTION to execute a function module.

The executed commands differ with regard to the visibility of program data in the calling program and the called program, and in their behavior with regard to LUW processing.

With the SUBMIT statement, you start programs that are directly executable programs.

The addition VIA SELECTION-SCREEN is used to send the selection screen of the program (if the program has a standard selection screen).

To return to the calling program after the program has finished, use the addition AND RETURN.

Calling an executable program allows you to use a logical database to read data.

For further information, see the keyword documentation in the ABAP Editor for SUBMIT.

You can execute ABAP programs with a transaction code using the statement CALL TRANSACTION . When the program that you called has terminated, the system continues processing the calling program.

If the transaction that you call in the CALL TRANSACTION statement uses update techniques; you can determine which technique it should use (synchronous or asynchronous) using the FUNCTION parameter in the call.

To exit an ABAP program, use the LEAVE PROGRAM statement. If you use this statement in a program that you have called using CALL TRANSACTION or SUBMIT AND RETURN, the system returns to the calling program. Otherwise, the system returns to the application menu from which you started the program.

To initiate a transaction with the transaction code , use the LEAVE TO TRANSACTION statement. This does not allow you to return to where the transaction was called from.
This statement has the same effect as entering /n in the command field.

For further information, see the keyword documentation in the ABAP Editor for CALL and LEAVE.

You can encapsulate dialogs in reusable function modules.

If you call up a screen within a function module, this screen belongs to the program of function group SAPL of the function module.

ABAP memory

A logical memory model illustrates how the main memory is distributed from the view of executable programs. A distinction is made here between external sessions and internal sessions .

An external session is usually linked to an R/3 window. You can create an external session by choosing System/Create session, or by entering /o in the command field. An external session is broken down further into internal sessions. Program data is only visible within an internal session. Each external session can include up to 20 internal sessions (stacks).

Every program you start runs in an internal session.

All "squares" with rounded "corners" displayed in the status diagram represent a set of data objects in the main memory.

The data in the main memory is only visible to the program concerned.

CALL TRANSACTION and SUBMIT AND RETURN open a new internal session that forms a new program context. The internal sessions in an external session form a memory stack. The new session is added to the top of the stack.

When a program has finished running, the top internal session in the stack is removed, and the calling program resumes processing.

The same occurs when the system processes a LEAVE PROGRAM statement.

LEAVE TO TRANSACTION removes all internal sessions from the stack and opens a new one containing the program context of the calling program.

The ABAP memory is initialized after the program is called. In other words, you cannot transfer any data to a program called with LEAVE TO TRANSACTION via the ABAP memory.

SUBMIT replaces the internal session of the program performing the call with the internal session of the program that has been called. The new internal session contains the program context of the called program with which it is performed.

When a function module is called, the following steps are executed:

A check is made to establish whether your program has called a function module of the same function group previously.

If this is not the case, the system loads the associated function group to the internal session of the calling program as an additional program group. This initializes its global data.

If your program used a function module of the same function group before the current call, the function module that you have called up at present can access the global data of the function group. The function group is not reloaded.

Within the internal session, all of the function modules that you call from the group access the global data of that group.

If, in a new internal session, you call a function module from the same function group as in internal session 1, a new set of global data is initialized for the second internal session. This means that the data accessed by function modules called in session 2 may be different from that accessed by the function modules in session 1.

You can call function modules asynchronously as well as synchronously. To do so, you must extend the function module call using the addition STARTING NEW TASK ''. Here, '' is a symbolic name in the calling program that identifies the external session, in which the called program is executed.

Function modules that you call using the addition STARTING NEW TASK '' are executed independently of the calling program. The calling program is not interrupted.

To make function modules available for local asynchronous calls, you must identify them as executable remotely (processing type: Remote-enabled module).

For further information, see the keyword documentation in the ABAP Editor for CALL FUNCTION.

There are various ways of transferring data between programs that are running in different program contexts (internal sessions).
You can use:

(1) The interface of the called program (standard selection screen, or interface of a
subroutine, function module, or dialog module)
(2) ABAP memory
(3) SAP memory
(4) Database tables
(5) Local files on your presentation server.

For further information about transferring data using database tables and the shared buffer, refer to the keyword documentation in the ABAP Editor for the terms EXPORT and IMPORT.

For further information about transferring data between an ABAP program and your presentation server, refer to the documentation for the function modules WS_UPLOAD and WS_DOWNLOAD.

Function modules have an interface, which you can use to pass data between the calling program and the function module itself (there is also a comparable mechanism for ABAP subroutines). If a function module supports RFC, certain restrictions apply to its interface.

If you are calling an ABAP program that has a standard selection screen, you can pass values to the input fields. There are two options here:
By using a variant of the standard selection screen in the program call
By passing actual values for the input fields in the program call

If you want to call a report program without displaying its selection screen (default setting), but still want to pass values to its input fields, there is a variety of techniques that you can use.

The WITH addition allows you to assign values to the parameters and select-options fields on the standard selection screen.

If the selection screen is to be displayed when the program is called, use the addition: VIA SELECTION-SCREEN.

Use the pattern button in the ABAP Editor to insert a program call via SUBMIT. The structure shows you the names of data objects that you can complete with the standard selection screen.

For further information on working with variants and further syntax variants for the WITH addition, see the key word documentation in the ABAP Editor for SUBMIT.

You can use SAP memory and ABAP memory to pass data between different programs.

The SAP memory is a user-specific memory area for storing field values. It is available in all of the open sessions in a user's terminal session, and is reset when the terminal session ends. You can use its contents as default values for screen fields. All external sessions can access SAP memory. This means that it is only of limited use for passing data between internal sessions.

The ABAP memory is also user-specific, and is local to each external session. You can use it to pass any ABAP variables (fields, structures, internal tables, complex objects) between the internal sessions of a single external session.

Each external session has its own ABAP memory. When you end an external session (/i in the command field), the corresponding ABAP memory is released automatically.

To copy a set of ABAP variables and their current values (data cluster) to the ABAP memory, use the EXPORT TO MEMORY ID statement. The (up to 32 characters) is used to identify the different data clusters.

If you repeat an EXPORT TO MEMORY ID statement to an existing data cluster, the new data overwrites the old.

To copy data from ABAP memory to the corresponding fields of an ABAP program, use the IMPORT FROM MEMORY ID statement.

The fields, structures, internal tables, and complex objects in a data cluster in ABAP memory must be declared identically in both the program from which you exported the data and the program into which you import it.

To release a data cluster, use the FREE MEMORY ID statement.

You can import just parts of a data cluster with IMPORT, since the objects are named in the cluster.

In the SAP memory, you can define memory areas (SET/GET parameters, or parameter IDs), which you can then address by a name of up to 20 characters.

You can fill these memory areas either using the contents of input/output fields on screens, or using the ABAP statement:
SET PARAMETER ID '' FIELD .
The memory area with the name now has the value .

You can use the contents of a memory area to display a default value in an input field on a screen.

You can also read the memory areas from the SAP memory using the ABAP statement GET PARAMETER ID FIELD . The field then contains the value from parameter .

The link between an input/output field and a memory area in SAP memory is inherited from the data element on which the field is based. You can enable the set parameter or get parameter attributes in the input/output field attributes.

Once you have set the Set parameter attribute for an input/output field, you can fill it with default values from SAP memory. This is particularly useful for transactions that you call from another program without displaying the initial screen. For this purpose, you must activate the Set parameter functionality for the input fields of the first screen of the transaction.

You can:

(1) Copy the data that is to be used for the first screen of the transaction to be called to the parameter ID in the SAP memory. To do so, use the statement SET PARAMETER immediately before calling the transaction.
(2) Start the transaction using CALL TRANSACTION or LEAVE TO
TRANSACTION . If you do not want to display the initial screen, use the AND
SKIP FIRST SCREEN addition.
(3) The system program that starts the transaction fills the input fields that do not already have default values and for which the Get parameter attribute has been set with values from SAP memory.

The Technical information for the input fields in the transaction you want to call contains the names of the parameter IDs that you need to use.

Parameter IDs should be entered in table TPARA. This happens automatically if you create them via the Object navigator.

Programs that you call using the statements SUBMIT , LEAVE TO TRANSACTION , SUBMIT AND RETURN, or CALL TRANSACTION run in their own SAP LUW, and update requests receive their own update key.

When you use SUBMIT and LEAVE TO TRANSACTION , the SAP LUW of the calling program ends. If no COMMIT WORK statement occurred before the program call, the update requests in the log table remain incomplete and cannot be processed. They can no longer be executed. The same applies to inline changes that you make using PERFORM … ON COMMIT.

Data that you have written to the database using inline changes is committed the next time a new screen is displayed.

If you use SUBMIT AND RETURN or CALL TRANSACTION to insert a program and then return to the calling program, the SAP LUW of the calling program is resumed when the called program ends. The LUW processing of calling and called programs is independent.

In other words, inline changes are committed the next time a new screen is displayed. Update requests and calls using PERFORM ... ON COMMIT require an independent COMMIT WORK statement in the SAP LUW in which they are running.

Function modules run in the same SAP LUW as the program that calls them.

If you call transactions with nested calls, each transaction needs its own COMMIT WORK, since each transaction maps its own SAP LUW.

The same applies to calling executable programs, which are called using SUBMIT AND RETURN.

The statement CALL TRANSACTION allows you to

Shorten the user dialog when calling using CALL TRANSACTION USING .

Determine the type of update (asynchronous, local, or synchronous) for the transaction called. For this purpose, use the addition CALL TRANSACTION USING UPDATE 'update_mode', where update_mode can have the values a (asynchronous), L (local), or S (synchronous).

Combining the two options enables you to call several transactions in sequence (logical chain), to reduce their screen sequence, and to postpone processing of the SAP LUW 2 until processing of the SAP LUW 1 has been completed.

When you call a function module asynchronously using the CALL FUNCTION STARTING NEW TASK ' ' statement, it runs in its own SAP LUW.

Programs that are executed with a SUBMIT AND RETURN or CALL
TRANSACTION statement starts their own LUW processing. You can use these to perform nested (complex) LUW processing.

You can use function modules as modularization units within an SAP LUW.

Function modules that are called asynchronously are suitable for programs that allow parallel processing of some of their components.

All techniques are suitable for including programs with purely display functions.

Note that a function module called with CALL FUNCTION STARTING NEW TASK is executed as a new logon. It, therefore, sees a separate SAP memory area. You can use the interface of the function module for data transfers.
Example: In your program, you want to call a display transaction that is displayed in a separate window (amodal). To do so, you encapsulate the transaction call in a function module, which you set as to Remote-enabled module. You use the function module interface to accept values that you write to the SAP memory. You then call up the transaction in the function module using CALL TRANSACTION AND SKIP FIRST SCREEN. You call the function module itself asynchronously.

Type ‘E' locks for nested program calls may be requested more than once from the same object. This behavior can be described as follows:
Lock entries from function modules called synchronously increment the cumulative counter, And are therefore successful.
Lock entries from programs called with CALL TRANSACTION or SUBMIT

AND
RETURN is refused. The object to be locked by the called program is displayed as already Locked by another user.

Programs that you call using SUBMIT or LEAVE TO TRANSACTION cannot come into conflict with lock entries from the calling program, since the old program ends when the call is made. When a program ends, the system deletes all of the lock entries that it had set.

Lock requests belonging to the same user from different R/3 windows or logons are treated as lock requests from other users.



LESSON 50 AUTHORISATION CHECKS

AUTHORISATION CHECKS


The authorization concept uses authorization objects and authorizations.

Authorization objects are repository objects and are maintained in the ABAP Dictionary. They consist of a name and up to ten logically-related fields that are used in the authorization check. Authorization objects define a logical grouping of fields whose values will be used in the authorization check. The above example uses the authorization object S_CARRID, which combines airline (CARRID) and activity (ACTVT, with the four possible values create, change, display, and delete).

An authorization for an authorization object is a concrete set of values for the fields of an Authorization object.

Authorizations are grouped by profiles (business activities), which are assigned to users in their user master records.

For further information, see the ABAP Editor Keyword documentation for the term Authorization concept.

In an authorization check, you specify the object and values that the user needs in an authorization in his or her user master record.

In our example, we want to check whether the user has authorization for the object S_CARRID in which the field CARRID (airline) has the value 'LH' and the field ACTVT (activity) has the value '03' for 'display'. The activity codes are listed in tables TACT and TACTZ and are also documented in the relevant authorization objects.

In the AUTHORITY CHECK, you must specify all fields of the object, otherwise, the return code will be unequal to zero. If you do not want to perform a check for one field, enter DUMMY in the field.

The most important return codes for the AUTHORITY-CHECK statement are:
0: The user has an authorization with the correct values.
4: The user does not have the required authorization.
8: You did not list all of the fields in the authorization object, so the check was unsuccessful.

For a full list of all return codes, see the keyword documentation in the ABAP Editor for AUTHORITY-CHECK.

You can only enter single fields after the FIELD addition, not selection tables. However, there are function modules that can perform an AUTHORITY-CHECK for all values in a selection table.

Use the model for the AUTHORITY-CHECK in the ABAP Editor. This model inserts all names of the authorization object fields.

The R/3 System contains tools that help you to administer authorizations and assign them to user master records.

Authorizations are always assigned to a user using authorization profiles.

Authorization profiles consist of a set of authorizations and are used to administer authorizations that are required for a particular activity (work center description).

When you call a transaction using its transaction code, a system program starts to perform automatic authorization checks.

Firstly, a system program checks whether the transaction is listed in the table TSTC and whether it is locked. Using the entries in the TSTC table, the system program determines the name of the ABAP program and the number of the first screen.

Next, the system program uses the authorization object S_TCODE to see whether the user is authorized to use the transaction.

After that, it checks whether a particular field of an authorization object is assigned to the Transaction. The user calling the transaction must have an authorization for the authorization object listed in table TSTCA in his or her user master record that also contains the values Specified in table TSTCA.

If the user has this authorization, the system starts the transaction. If not, the transaction is not started, and the system displays an error message.

After this, the authorization checks in the ABAP program (AUTHORITY-CHECK) are processed.



LESSON 51CHANGING THE SAP STANDARD

You can adjust the R/3 System to meet your needs in the following ways:
Customizing: This means setting up specific business processes and functions for your system according to an implementation guide. The need for these changes has already been foreseen by SAP and an implementation procedure has been developed.
Personalization: This means making changes to certain fields' global display

attributes

(Setting default values or fading fields out altogether), as well as creating
user-specific menu sequences.


Modifications: These are changes to SAP Repository objects made at the customer site. If SAP delivers a changed version of the object, the customer's system must be adjusted to reflect these changes. Prior to Release 4.0B these adjustments had to be made manually using upgrade utilities. From Release 4.5A, this procedure has been automated with the Modification Assistant.


Enhancements: This means creating Repository objects for individual customers that refer to Objects that already exist in the SAP Repository.

Customer Developments: This means creating Repository objects unique to individual
Customers in a specific namespace reserved for new customer objects.

Customizing and most personalization are done using tools found in Accelerated SAP; customer developments, enhancements, and modifications are all made using the tools available in the ABAP Workbench.

If your requirements cannot be met by Customizing or personalization, you may either start a development project or try using a CSP solution (= Complementary Software Product).

A development project falls into the customer development category if the SAP standard does not already contain functions similar to the one you are trying to develop. If, however, a similar SAP function exists, try to assimilate it into your development project by either enhancing or modifying it, by using a user exit, or simply by making a copy the appropriate SAP program.

Modifications can create problems, as new versions of SAP objects must be adjusted after an upgrade to coincide with modified versions of SAP objects you have created. Prior to Release 4.0B these adjustments had to be made manually using upgrade utilities. From Release 4.5A, this procedure has been automated with the Modification Assistant.

Thus, you should only make modifications if:
Customizing or personalizing cannot satisfy your requirements
Enhancements or user exits are not planned
It would not make sense to copy the SAP object to the customer namespace.


The Business Engineer is made up of all SAP implementation tools. These include:
The R/3 Reference Model contains all of the models used to describe R/3 (the process model, the data model, the organization model) The Implementation Guide (IMG)
A complete list of all Customizing changes
Personalization accelerates and simplifies how business cases are processed by the R/3 System. During personalization, individual application transactions are adjusted to meet the business needs of your company as a whole or even to the needs of specific user groups within your company. All unnecessary information and functions found in the transaction are switched off.

Global display attributes allow you to define default values for specific screen fields. You can also suppress individual fields or table control columns in a particular transaction, or even a whole screen.

Role-based menus, favorites, and shortcuts allow you to adjust menu sequences to reflect the needs of different user groups within your company.

Modifications are changes to SAP objects in customer systems. They are:
Executed with the help of user exits (these are subroutines reserved for customers that have been inserted in objects in the SAP namespace)
'hard-coded' at various points within SAP Repository objects.

Customer developments are programs developed by customers that can call SAP Repository objects.

Example: A customer creates a program that calls an SAP function module.

The enhancement concepts embody the reverse of this principle: SAP programs call Repository objects that you, as a customer, created or changed. Example: You use a function module exit called by an SAP program. You can enhance your system at the following levels:

in ABAP programs (function module exit)
on GUI interfaces (menu exit)

on screens by inserting a sub screen in an area specified by SAP (screen exit)

on screens by processing customer code that refers to a specific field on the screen (field exit)

in ABAP Dictionary tables or structures (table enhancement)

SAP provides two ways to enhance tables and structures with fields.

Structures

Customizing includes ("CI includes")

Both techniques allow you to attach fields to a table without actually having to modify the table itself.

Append structures may only be assigned to a single table. A table may, however, have several append structures attached to it. During activation, the system searches for all active append structures for that table and attach them to the table.

Append structures differ from include structures in how they refer to their tables. In order to include fields from an include structure in a table; you must add an '.INCLUDE...' line to the table. In this case, the table refers to the substructure. Append structures, on the other hand, refer to their tables. In this case, the tables themselves are not altered in any way by the reference.

Append structures allow you to attach fields to a table without actually having to modify the table itself. Table enhancements using append structures therefore do not have to be planned by SAP developers. An append structure can only belong to exactly one table.

In contrast, CI_includes allows you to use the same structure in multiple tables. The include statement must already exist in the SAP table or structure. Table enhancements using CI_includes do, however, have to be planned by SAP developers.

Field exits need not be prepared by the SAP application developer. You can create a field exit for any screen input field that has a Dictionary reference. The reference object is the data element.

The unit "Enhancements to Dictionary Elements" discusses how the field exits work.

The purpose of a program enhancement is always to call an object in the customer namespace. You can use the following techniques here:

A special exit function module is called by the SAP application program. The function module is part of a function group that is handled in a special manner by the system.

Business transaction events

The SAP application program dynamically calls a function module in the customer namespace.

Business add-ins
The application program calls a method of a class or instance of a class. This class lies in the customer namespace.

Program enhancements permit you to execute additional program logic in SAP application programs. SAP currently provides the techniques outlined above.

The advantages and restrictions of the particular enhancement techniques will be discussed in detail in later units.

Menu enhancements permit you to add additional menu entries to an SAP standard menu. The system provides two options here:

Customer exits

Business add-ins

The additional menu entries are merged into the GUI interface.

When the function code is implemented; you can change the text of the menu entry, and provided the SAP developer specified this option - change the icons.

Screen exits belong to the customer exits. They allow you to display additional objects in an SAP application program screen. The SAP developer must:

Define the sub screen areas

Specify the corresponding calls in the flow logic

Provide the framework for the data transport

Include the screen exit in an enhancement

Maintain the documentation

You can implement screen exits by creating sub screens, possibly with flow logic. You also have to implement the data transport.

How you implement screen exits will be discussed in the "Enhancements using Customer Exits" unit.

Any change that you make your system to an object that has been delivered by SAP is known as a modification.

Modifications can lead to complications at upgrade. When SAP delivers a new version of the object, you must decide whether the new object should be used, or whether you want to continue using your old object.

Prior to Release 4.0B, modifications were only recorded at Repository object level (for example, an include program).

Since Release 4.5A, the granularity for recording modifications has been finer. This has been made possible by the Modification Assistant, as we will see in the "Modifications" unit.

The modification adjustment process has also been overhauled. How modifications are adjusted is also part of the "Modifications” unit.

The SAP System adjusts itself to the user's style of working: When the system is started, the users are only offered functions that are typical in their daily work. There is no unnecessary navigating through functions that are not used. In the past, user menus could be called in the Session Manager or in the dynamic menu in R/3. With Release 4.6A, the role -based menu is output in the form of a tree for each user.

When you select a function, it is started in the same session. This function replaces the role –based menu. The role -based menu appears again automatically when you leave a transaction or when you start a new session.

In the maintenance screen for activity groups (Transaction PFCG), the administrator can combine the menu structure for an activity group consisting of transactions, reports, and Internet/Intranet links to a user menu. You can choose any structure and description for the functions contained.

The enterprise menu is no longer available with Release 4.6A.

Typical questions at a work center are:

What function should be performed at this work center?
Which menus are needed?
What authorizations do the users need?
Which users are involved here?

The goal of personalization is to answer these questions in the R/3 System.

The tools provided by R/3 for this purpose are area menus and activity groups.

We will now see how these tools can be used to adapt the work center to the user's needs as effectively as possible.

Area menus were also included prior to this release. They can contain:
Transactions
References to other area menus
Executable programs (new)
Lists created by programs (new)

From this release onwards, you can include programs in area menus that create lists directly.

You can assign users an area menu as their start menu. These users no longer see the complete SAP menu when they log onto R/3, but only the menu items that they require. By integrating the report trees, users obtain a complete view of their work environment.

Area menus can also be linked to activity groups.

In contrast to previous releases, area menus are displayed in tree form starting with Release 4.6. This gives the user a clearer overview of the available options.

The objects that can be included in the area menu are listed in the right part of the graphic.

Use Transaction SE43 to create an area menu. You can call this transaction with the given path.

Assign a name in the corresponding customer namespace and create the area menu.

You can include the area menus in your list of favorites in the GUI for faster editing at a later time.

You build area menus by creating entries in the tree structure. Position the cursor and choose the corresponding icon for insertion at the same level or one level down. In the popup window that now appears, choose a description and the corresponding transaction code.

You can also insert reports (objects that create lists, such as ABAP programs, querie s, and so on)

You can no longer store lists in report trees as of Release 4.6A. Report trees have been integrated in the new area menus.

With List--> Save --> Report tree you can store lists for the program. Since the lists are stored program-specifically, you can display them in the corresponding area menus.


During an upgrade, existing area menus are automatically migrated to the new structure. You can make further entries in these new area menus.


With Release 4.6, SAP has implemented user-oriented R/3 operations. When the R/3 application is started, a tree structure appears in the initial screen containing the entries the user needs for his daily work.

These role -based menus go beyond the scope of the area menus. Only the menu structure can be defined for area menus. You can define them as you like for role -based menus. They also use the functions of the Profile Generator.

By using specific role -based menus you can set the following individually:

Menu structure
Profiles
User assignments

The term "activity group" is synonymous in R/3 with "role -based menu." You can edit activity groups using the Profile Generator.

Before you create your own activity groups, you should evaluate the predefined workplace examples that SAP delivers in Release 4.6A. You can use these workplace examples just as they are delivered in the SAP System.

Delivered activity groups should not be changed. You can combine several activity groups to form a composite activity group. Which may also include activity groups delivered by SAP?

To create an activity group; choose the appropriate button on the initial R/3 screen.
Assign a name for the activity group in the customer namespace and press Create. The system displays the maintenance screen for activity groups.

The activity group naming conventions are defined as follows:

SAP* delivered by SAP
Rest customer namespace

To create an activity group; choose the appropriate button on the initial R/3 screen.

Assign a name for the activity group in the customer namespace and press Create. The system displays the maintenance screen for activity groups.

The activity group naming conventions are defined as follows:

SAP* delivered by SAP
Rest customer namespace

There are several ways to build the menu for your activity group. You can copy sub-trees and menu entries from
the SAP menu
another activity group
an area menu
You can also maintain single entries. These can be

a transaction code
a report in which a transaction code is automatically generated
a hyperlink (e.g. web address or a path on the local machine)
You cannot maintain single entries if it is a composite activity group.

The system determines the authorization objects used in the given transactions. The assignment of single authorization objects for a transaction using Transaction SU22 provides the basis for this determination.

Transaction SU22 also specifies for the particular authorizations whether or not:
there must be a check
there are default values
Using these default values makes maintaining authorizations much simpler. You only have to maintain authorizations marked with the yellow icon. If you do not do so, full authorization is automatically given.

In the last step, a profile is generated from your entries. The system proposes a name T-, which you can change here, but not later on. Enter a meaningful name.
Next assign the relevant users to the activity group.

Once you have assigned the users, you must adjust the user master profiles accordingly. The profile that was created is automatically assigned to the given users.

A user can be assigned to more than one activity group. Each time you change an activity group, you must also adjust the user masters again.

SAP delivers more than one hundred preconfigured activity groups. Choose the one most suitable for the particular work center and assign the users. Adjust the user master records.

You can change activity groups delivered by SAP. However, these changes are lost during an upgrade. We therefore recommend that you copy the delivered activity groups and adjust the copy.

In the last section we introduced the user-specific appearance of the interface, which is implemented using activity groups. In addition, there are ways to set single transactions to the needs of your enterprise or of individual user groups. In this section we will see how a transaction can be simplified without being modified.
In this example you see two screens of an SAP transaction that should be redesigned using a transaction variant.

Screen 100 is changed as follows: Fields are hidden; field attributes are changed; buttons are hidden.
Screen 200 shows the following changes: buttons moved and screen inserted (with GuiXT). We will be discussing the use of GuiXT in more detail later.
A transaction variant is a reference to a set of screen variants.
You can create any number of screen variants for a screen. The transaction variant consists of these screen variants.

You can create different kinds of transaction variants for an SAP transaction:
a standard variant
any number of "normal" transaction variants

The standard variant is executed at runtime instead of the SAP delivered transaction. No new transaction code is required.

A normal transaction variant will be called with its own transaction code of type "variant transaction".

To create transaction variants, choose the component Personalization from the entry Accelerated SAP in the SAP menu and then Transaction variant. You go to the transaction for maintaining transaction variants.

Enter the name of the transaction from which you want to create a variant. The name of the variant must be unique in the system and be in the customer namespace.

With the menu option Goto, choose whether you want to create a client-specific or a cross-client transaction variant.

To create the variant; choose the appropriate button in the application toolbar.

Pressing "Screen entries" starts the transaction in CALL mode.
Triggering a dialog also triggers PAI of the current screen. The system sends another screen in which you can evaluate the fields of the screen.
Also read the online documentation about transaction variants.
The screen that was evaluated is stored as a screen variant when you continue. This will be discussed next.

A screen variant is an independent Repository object, which has a unique name in the system. The name is constructed as follows:

Variant name
Client (only for client-specific transaction variants)
Screen number

Here you specify whether or not field contents should be copied to the screen variant. You can set various attributes for the individual fields: You can undo or hide the input status of a field. You can find a detailed list of options in the online documentation about transaction variants.

The GuiXT tool permits you to design the individual screens in a more flexible manner. GuiXT uses a script language to
Position objects on the screen,
Set attributes,
Include new objects.

If you press "GuiXT", an editor window appears where you can enter the script. You can also choose GuiXT files stored on your local machine.

You can also import scripts created on the local machine and export them there.
You can change the layout of a screen with the script language used by GuiXT. You can

Move objects
Insert screens
Insert pushbuttons
Insert value helps
Change the input attributes of fields
Delete screen elements

You are provided with a complete documentation of GuiXT with the installation.

You have the following options for starting a transaction variant:

Test environment
Transaction code of type "variant transaction"
User menu

You can test the transaction flow in the test environment of the transaction variant maintenance routine. This is intended primarily for developers creating transaction variants.

To insert a variant transaction in a user menu or activity group, you must create a transaction code of type "variant transaction".

To start a transaction variant from a menu, you must create a transaction code of type "variant transaction". You can navigate there directly from the maintenance screen for the transaction variants. Alternatively you can start the corresponding transaction from the ABAP Workbench.

You can insert the transaction in a menu by choosing one of the following two options: maintenance of

Activity group or
Area menu.

The user can immediately see the changes made in this way.


LESSON 52 ENHANCEMENTS TO DICTIONERY ELEMENTS

ENHANCEMENTS TO DICTIONERY ELEMENTS

Tables and structures can be expanded in one of two different ways:

Append structures allow you to enhance tables by adding fields to them that are not part of the standard. With append structures; customers can add their own fields to any table or structure they want.

Append structures are created for use with a specific table. However, a table can have multiple append structures assigned to it.

If it is known in advance that one of the tables or structures delivered by SAP needs to have customer-specific fields added to it, the SAP application developer includes these fields in the table using a Customizing include statement.

The same Customizing include can be used in multiple tables or structures. This ensures consistency in these tables and structures whenever the include is extended.

Nonexistent Customizing includes do not lead to errors.

Append structures allow you to attach fields to a table without actually having to modify the table itself.

Append structures may only be assigned to a single table. A table may, however, have several append structures attached to it. Whenever a table is activated, the system searches for all active append structures for that table and attach them to the table. If an append structure is created or changed and then activated, the table it is assigned to is also activated, and all of the changes made to the append structure take effect in the table as well.

You can use the fields in append structures in ABAP programs just as you would any other field in the table.

Note: If you copy a table that has an append structure attached to it, the fields in the append structure become normal fields in the target table.

You create append structures in the customer namespace. This protects them from being overwritten at upgrade or during release upgrade. New versions of standard tables are loaded during upgrades.

The fields contained in active append structures are then appended to the new standard tables when these new standard tables are activated for the first time.

From Release 3.0, the field sequence in the ABAP Dictionary can differ from the field sequence in the database. Therefore, no conversion of the database table is necessary when adding an append structure or inserting fields into an existing one. All necessary structure adjustment is taken care of automatically when you adjust the database catalog (ALTER TABLE). The table's definition is changed when it is activated in the ABAP Dictionary and the new field is appended to the database table.

Pay attention to the following points when using append structures:
You cannot create append structures for pool and cluster tables.
If a table contains a long field (either of data type LCHR or LRAW), then it is not possible to expand the table with an append structure. This is because long fields of this kind must always be the last field in their respective tables. No fields from an append structure may be added after them.

If you use an append structure to expand an SAP table, the field names in your append structure must be in the customer namespace, that is, they must begin with either YY or ZZ. This prevents naming conflicts from occurring with any new fields that SAP may insert in the future.

Some of the tables and structures delivered with the R/3 standard contain special include statements:

Customizing includes. These are often inserted in those standard tables that need to have customer specific fields added to them.

In contrast to append structures, Customizing includes can be inserted into more than one table. This provides for data consistency throughout the tables and structures affected whenever the include is altered.

Customizing include programs is part of the customer namespace: all of their names begin with 'CI_'. This naming convention guarantees that nonexistent Customizing includes do not lead to errors. No code for Customizing includes is delivered with the R/3 standard.

You create Customizing includes using special Customizing transactions. Some are already part of SAP enhancements and can be created by using project management (see the unit on 'Enhancements using Customer Exits').

The Customizing include field names must lie in the customer namespace just like field names in append structures. These names must all begin with either 'YY' or 'ZZ'.

When adding the fields of a Customizing include to your database, adhere to same rules you would with append structures.

Every time they define a data element, the SAP application programmers define keywords in different lengths and a short description for each data element.

You create field exits in Project management. Field exits are processed when the user leaves a screen that contains a field which refers to a data element containing a field exit.

SAP lets you create a field exit for every input-ready screen field that has been created with reference to the ABAP Dictionary. The additional program logic is stored in a function module and is executed at a specific point in the PAI logic.

The slide shows the order in which processing takes place. Before the PAI logic of the screen is executed, the system performs the following checks: First the system checks if all the required fields have been filled in. If a required field is empty, the screen is shown again.

The system then checks that data has been entered in the correct format.

Any defined field exits are executed next. For example, by sending an error message you can have the screen sent again.

Once all the field exits have been checked, the screen is processed as normal.

Field transport
Foreign key check
Processing the PAI module

Field exits take you from a screen field with a data element reference to a function module. Field exits can be either global or local:

Global field exits are not limited to a particular screen: If a global exit's data element is used on several screens, the system goes to the function module for all these screens after activating the field exit. Here you can, for example, edit the contents, force a new entry to be made by outputting an error message, or prohibit certain users from proceeding further.

Local field exits are valid for one screen only. If you assign a screen from a specific program to a field exit, then the system will go to the appropriate function module from this screen once the exit has been activated.

You can either create a global field exit or up to 36 local field exits for a data element, but not both.

Each exit number refers to a different function module. Field exit function modules adhere to the following naming convention:

Prefix: FIELD_EXIT_
Name:
Suffix (for local field exit): _0 to _9, _A to _Z
To create field exits; choose Utilities in the ABAP Workbench. Choose Enhancements and then Project management to edit field exits and to implement customer exits. Do not create field exits directly from the Function Builder.

Choose Goto -> Global enhancements -> Field exits to start the transaction for maintaining field exits. To create a new enhancement, use the menu path Text Enhancements -> Create.

Enter the name of the data element to which your screen field refers in the modal dialog box. The Function Builder is started with a special naming convention and interface options. The system specifies the name of the field exit. Do not change this name. Create the function module in a customer function group.

The function module must be assigned to an existing customer function group.

The function module interface is fixed and cannot be changed. The function module has an import parameter INPUT and export parameter OUTPUT. The contents of the screen field are stored in parameter INPUT. The contents of OUTPUT are returned in the screen field when you leave the function module.

Field exits are not transported automatically. Therefore, you must assign the value of INPUT to OUTPUT in your source code. Otherwise the screen field would be blank after executing the field exit.
The following ABAP statements are not allowed in field exit function modules:
CALL SCREEN, CALL DIALOG, CALL TRANSACTION, SUBMIT
COMMIT WORK, ROLLBACK WORK
COMMUNICATION RECEIVE
EXIT FROM STEP-LOOP
MESSAGE I, MESSAGE W
STOP, REJECT

When you debug a screen that is referenced by a field exit, the field exit code is ignored by the debugger. As with any normal function module, you can, however, debug the field exit code in the Function Builder's test environment.

You can create local field exits that relate to a specific screen. A global field exit must already exist.
Edit the local field exit based on the global field exit.

You can create up to 36 local field exits, each of which carries a unique suffix. The system proposes a name for the function module; you should use this name.

Defining local field exits means that the function module of the global field exits initially created is no longer used. However, you must not delete it, for technical reasons. The field exits in the system would be deleted if you deleted the global function module of the field exit from the list.

You must activate the field exit as well as the function module. Also note that field exits are only taken into account during screen execution if the R/3 profile parameter abap/field exit = YES has been set for all application servers. (This profile parameter is set to 'NO' by default).

If you declare field exits for multiple screen fields, you have no control over the order in which they are processed. In particular, you cannot access the contents of other screen fields in a field exit.