|
START-OF-SELECTION.
* fill internal table
SELECT * FROM spfli INTO TABLE gdt_spfli.
CALL SCREEN 100.
Flow logic for screen 100:
PROCESS BEFORE OUTPUT.
MODULE status_0100. MODULE clear_ok_code.
MODULE create_control.
*
PROCESS AFTER INPUT.
MODULE user_command_0100.
Source code excerpt: Module CREATE_CONTROL
MODULE create_control OUTPUT.
IF container_r IS INITIAL.
CREATE OBJECT container_r
EXPORTING container_name = ’CONTAINER_1’. CREATE OBJECT grid_r
EXPORTING i_parent = container_r.
CALL METHOD grid_r->set_table_for_first_display
EXPORTING i_structure_name = ’SPFLI’ CHANGING it_outtab = gdt_spfli.
ENDIF.
ENDMODULE. " CREATE_CONTROL OUTPUT
LessonSummary
You should now be able to:
• Execute the basic steps in object-oriented ABAP programming (instantiation and method calls) to use the classes and methods shipped in the SAP standard system.
• Use the SAP Grid Control (ALV List Viewer) to display an internal table on a screen
Lesson:
349
Working with BAPIs
Lesson Duration: 30 Minutes
Lesson Overview
This lesson deals with the importance as well as the search for and use of BAPIs.
After completing this lesson, you will be able to:
• Search for suitable BAPIs
• Call BAPIs in your program
The short introduction to object-orientation in the lesson “Working with Methods”
will help the participants understand the object model in the BOR.
For obvious reasons, we shall only deal with the use of BAPIs within the same SAP system. Appropriate systems integration courses provide detailed information on calling up BAPIs remotely.
Business Example
You want to use standard functions in your program that are encapsulated in
BAPIs.
Working with BAPIs
Figure 217: Business Objects and BAPIs
The Business Object Repository (BOR) of the SAP system contains business objects. Formally, a business object is a class and corresponds to a SAP table or a table hierarchy. A Business Object has BAPIs (Business Application Programming Interfaces) as methods. You can call these BAPIs to access the corresponding table(s). Hence, a BAPI is a means of accessing the data of the SAP system.
BAPIs usually exist for basic functions of a business object, such as:
• Creating an object
• Retrieving the attributes of an object
• Changing the attributes of an object
• Listing the objects
The functions of a BAPI are encapsulated in a function module that can be called up remotely. Therefore, BAPIS can be called by ABAP programs of the same SAP system as well as by external programs.
The graphic above illustrates how BAPIs can be used.
There are standard methods in the form of BAPIs with standardized names. Some of the most important standard BAPIs are listed here.
Standard BAPIs
Returns a list of available objects that meet the specified selection criteria.
GetDetail
Returns detailed information (attributes) for an object (the complete key must be specified).
Create, Change, Delete, Cancel
Allows you to create, change, and delete objects
AddItem, RemoveItem
Adds and removes subobjects (for example, item for an order)
You can use the BAPI Explorer to list business objects as well as the corresponding BAPIs with reference to the application. To call up the BAPI Explorer use the following path in the SAP Easy Access menu: Tools → Business Framework → BAPI Explorer or transaction BAPI.
Once you have found the required business object or BAPI, you can display its details on the right part of the screen by selecting the BAPI. You can navigate into its display by using the Function Builder by double-clicking on the displayed function module.
Function modules for BAPIs must fulfill the following technical requirements:
• Naming convention BAPI_<business_object_name>_<method_name>
• Remote enabled
• Contain neither user dialogs nor messages
• Interface parameters are typed with components of structures from the ABAP Dictionary that were created for this BAPI. (Name prefix for such structures: BAPI_)
• may not contain any changing parameters until release 4.6.
• Do not trigger any exceptions: Errors are reported to the user through the special export parameter RETURN.
If you would like to use a BAPI in the same SAP system, you can call the function module containing it. Note the restrictions already mentioned.
Hint: BAPI interfaces are created according to the requirements for the “external” call - that is, from an external, non-SAP System. Therefore, amounts are expected in an external format with 4 or 9 decimal places. During the call, the amounts must be transferred to the interface in an appropriately converted format, even if the corresponding currency has no decimal places.
For this conversion or re-conversion you can use function modules from the BACV function group (package SBF_BAPI).
You now have the opportunity to discuss any questions.
Discussion Questions
Use the following questions to engage the participants in the discussion. Feel free to use your own additional questions.
See list of course objectives.
LessonSummary
You should now be able to:
• Search for suitable BAPIs
• Call BAPIs in your program
UnitSummary
You should now be able to:
• Search for function modules
• Acquire information on the functionality and use of function modules
• Call a function module in your program
• Execute the basic steps in object-oriented ABAP programming (instantiation and method calls) to use the classes and methods shipped in the SAP standard system.
• Use the SAP Grid Control (ALV List Viewer) to display an internal table on a screen
• Search for suitable BAPIs
• Call BAPIs in your program
Related Information
... Refer to the online documentation for each tool.
Unit 11
357 Adjusting the SAP Standard Software
(Overview)
See the introductory instructors’ notes in the lessons
Unit Overview
Refer to the lesson objectives for an overview of this unit.
UnitObjectives
After completing this unit, you will be able to:
• Explain the terms original, copy, correction, repair, customizing, modification, and enhancement
• Describe which options are available for adjusting the SAP standard software to your company's requirements
• List the disadvantages of modifications and the advantages of SAP
enhancements
• List and explain the different enhancement types
Unit Contents
Lesson: Adjusting the SAP Standard Software (Overview)...............390
Lesson:
358
Adjusting the SAP Standard Software (Overview)
Lesson Duration: 30 Minutes
Lesson Overview
This lesson provides an overview of the options for adjusting the SAP standard software to your company's requirements.
After completing this lesson, you will be able to:
• Explain the terms original, copy, correction, repair, customizing, modification, and enhancement
• Describe which options are available for adjusting the SAP standard software to your company's requirements
• List the disadvantages of modifications and the advantages of SAP
enhancements
• List and explain the different enhancement types
Business Example
You want to make adjustments to the SAP standard but, in doing so, you want to avoid modifications because of their disadvantages.
Basic Terms and Options of SAP Software Adjustment
Figure 222: Originals and Copies
In the system in which it was developed, a Repository object is called original. In another system, in which the object arrives by means of transport, it only exists as a copy. The original system (the “birth place”) of a Repository object is noted
in the attributes of the object.
Usually, changes are only to be made to the original. These changes are then transported to subsequent systems to change the corresponding copies. This ensures that Repository objects are consistent in all systems. It is possible to change copies, but you should avoid that in order to avoid the systems becoming inconsistent if the changes are not made to the respective original.
Originals can never be overwritten in transports.
Changing an original is called a correction. Corrections are made in
development/correction type tasks.
In contrast, changes to a copy are called repair. Repairs are made in repair type tasks.
After a customer object has been repaired (for example, as a consequence of an emergency in the production system), the change should always be reproduced in the original to ensure the systems remain consistent.
Repairing an SAP object in a customer system is also called modification.
During an upgrade, the modified SAP objects in your system might be overwritten by new versions of the objects that are supplied by SAP. You need to make a modification adjustment to get your modification back into the system. When you do this, you must compare your old, modified version with the newly supplied version and copy earlier changes to the SAP standard into the new version.
Such a comparison can be very time-consuming. Hence, you should use an SAP enhancement instead of a modification. Enhancements also provide the option of adjusting the SAP functionality. However, they do not depend on the release and are thus “low maintenance”. You will be provided with an overview of existing enhancement types later on in this lesson.
We recommend only making the modification adjustment in the development system and then transporting the adjusted objects to subsequent systems
(by releasing the request you used). This ensures consistency between the development system and the subsequent systems.
The illustration above shows the four options for adjusting the SAP software to customer requirements:
• Customer development:
You can develop your own Repository objects under consideration of the customer name space. This may be necessary when there is not a similar functionality to the functionality you require available in the SAP standard.
• Customizing:
You can set certain system properties and functionalities by means of appropriate maintenance transactions. SAP has planned for and organized such adjustments. Customizing is a mandatory part of setting up an SAP system.
• Enhancements:
SAP Repository objects can be adjusted without modifications by means of enhancements. Enhancements are release-independent and do not require any adjustments. However, not all customer requirements are covered by enhancement options.
• Modifications:
Modifications should only be made when there is no appropriate enhancement option in the system as they might cause a significantly increased workload due the adjustments that might be required. To support an organized modification and to facilitate the subsequent adjustment, the Modification Assistant has been integrated in the system since SAP R/3 4.6b. For detailed information on the Modification Assistant, refer to the online documentation for the ABAP Workbench (changes to the SAP standard).
The following section explains the different types of enhancements.
Enhancement Types
Figure 226: The Concept of a Program Exit
SAP has implemented program exits in some SAP programs, to which you as the customer can attach the appropriate source code. This is also processed at the runtime of the SAP program. This way, you have the option of realizing additional or alternative functions without changing the SAP program. Program exits are the most important type of enhancement.
SAP uses different techniques for implementing program exits: User Exits, Customer Exits, Business Transaction Events (BTEs), and Business Add Ins (BAdIs). There is a special search function for each enhancement technique, which you can use to find the program exits prepared by SAP. You can find out more about this in course BC425.
In addition to program exits, the following enhancement types exist:
Menu exit
Some SAP menus contain entries prepared by SAP, which you can link to your own functionality (customer source code) and activate.
Screen exit
Some screens contain SAP subscreens areas in which you can integrate your own screens.
Field exit
Customized input checks on SAP screen fields can always be implemented without modifications by means of field exits. This does not require any preparation by SAP.
Furthermore you can overwrite the field documentation and field labels of an SAP
data element in the ABAP Dictionary:
Overwriting the field documentation
You can replace the SAP field documentation that is displayed when the user presses F1 with your own texts.
Overwriting the field labels
You can overwrite the different field labels of an SAP data element with your own texts.
Apart from the enhancement type already mentioned, there are also others, such as:
You can attach an append structure with the required additional fields to most transparent table. With that you can implement additional columns in the database table of SAP applications without modifications.
Source texts areas commented out by SAP
Some SAP programs contain source code areas that have been commented out. If recommended by SAP, you can remove the comments to obtain additional functionality. Technically, however, this is a modification.
Course BC425 provides detailed information on all enhancement types.
Figure 228: SAP Software Change Registrations
As soon as a developer creates or changes a Repository object for the first time, the system will prompt him for his developer key. He can obtain this key by means of a corresponding one-time SSCR developer registration. The developer key is linked to the developer's user ID and the license number of the SAP system.
You need an object-related access key (object key) for every SAP Repository object that is to be modified. You can get this by means of SSCR object registration. When you register, you must specify the Repository object name, the object type, and the SAP system license number and its release.
You now have the opportunity to discuss any questions.
Discussion Questions
Use the following questions to engage the participants in the discussion. Feel free to use your own additional questions.
See list of course objectives.
LessonSummary
You should now be able to:
• Explain the terms original, copy, correction, repair, customizing, modification, and enhancement
• Describe which options are available for adjusting the SAP standard software to your company's requirements
• List the disadvantages of modifications and the advantages of SAP
enhancements
• List and explain the different enhancement types
UnitSummary
You should now be able to:
• Explain the terms original, copy, correction, repair, customizing, modification, and enhancement
• Describe which options are available for adjusting the SAP standard software to your company's requirements
• List the disadvantages of modifications and the advantages of SAP
enhancements
• List and explain the different enhancement types
Related Information
... Refer to the articles “Transport Organizer ” and “Changing the SAP Standard”
in the online documentation.
CourseSummary
You should now be able to:
• Create an ABAP program containing user dialogs and database accesses
• Describe the different types of development objects and their typical intended purposes
• Use appropriate tools to create simple examples of the development objects presented
Related Information
... Refer to the online documentation for all the concepts, keywords and tools addressed.
Дата добавления: 2015-11-16; просмотров: 87 | Нарушение авторских прав
<== предыдущая страница | | | следующая страница ==> |
REFRESH_TABLE_DISPLAY | | | DATA it_spfli TYPE sbc400_t_spfli. DATA wa_spfli LIKE LINE OF it_spfli. |