Here is the step by step procedure for screen enhancement definitions using BADI .
1. Create the following methods.
The methods PUT_DATA_TO_SCREEN and GET_DATA_FROM_SCREEN are required for data transport. These methods are called from within the program of the application at PBO or PAI .
Here is the screen shot for defining the methods mentioned above and you can click it for enlarging.
2. Create an instance attribute in the interface. This attribute is used for passing data.
3. Write the code for the call of the screen enhancement in the program of the application:
Top Include:
DATA: program Type program,
dynpro Type dynnr.
exit type ref to if_ex_badi_screen
The variable for the object reference is created using data and typed to the interface.
PBO:
MODULE initialize OUTPUT.
CLEAR: sflight, ok_code.
IF exit IS INITIAL.
CALL METHOD cl_exithandler=>get_instance
CHANGING
instance = exit.
ENDIF.
CALL METHOD cl_exithandler=>set_instance_for_subscreen
EXPORTING
instance = exit.
ENDMODULE.
The factory method is used to create an instance of the adapter class. You then declare the instance using the public static method SET_INSTANCE_FOR_SUBSCREEN to allow the data for display on the screen to be used in the function group of the user or in the module pool.
MODULE data_for_subscreen OUTPUT.
program = sy-repid.
dynpro = sy-dynnr.
CALL METHOD cl_exithandler=>get_prog_and_dynp_for_subscr
EXPORTING
exit_name = 'BADI_SCREEN'
calling_program = program
calling_dynpro = dynpro
subscreen_area = 'SUB'
IMPORTING
called_program = program
called_dynpro = dynpro.
CALL METHOD exit->put_data_to_screen
EXPORTING
flight = sflight
EXCEPTIONS
reserved = 01.
ENDMODULE.
PAI:
MODULE user_command_0200 INPUT.
CASE save_ok.
WHEN 'BACK'.
SET SCREEN 100.
WHEN 'SAVE'.
PERFORM save_flights.
WHEN '+EXT'.
CALL METHOD exit->get_data_from_screen
IMPORTING
flight = sflight
EXCEPTIONS
reserved = 01.
ENDCASE.
ENDMODULE.
The method GET_PROG_AND_DYNP_FOR_SUBSCR and the input/output parameters specified above are used to determine the name of the customer program and the name of the subscreen. The method PUT_DATA_TO_SCREEN which is called at PBO as well as the method GET_DATA_FROM_SCREEN which is called at PAI are used to transport the data to be displayed.
These methods are implemented by the user:
When you define a screen enhancement, you are strongly recommended to provide sample code for the methods PUT_DATA_TO_SCREEN and GET_DATA_FROM_SCREEN. This code is automatically copied when you create an implementation and can be added to if required. The user of the BAdI definition should not be responsible for the data transport.
Tuesday, November 4, 2008
Subscribe to:
Post Comments (Atom)
Archives
-
▼
2008
(167)
-
▼
November
(22)
- BUSINESS TRANSACTION EVENTS
- BUSINESS ADD INS
- BADI I
- BADI II
- BADI III
- BADI Introduction
- BADI Defination and Implementaion
- Calling a BADI and uses
- SAP ABAP BADI INTRODUCTION
- SAP ABAP BADI Importance
- SAP ABAP Comparison of Enhancement Techniques
- SAP ABAP BADI DEFINATION
- ABAP BADI IMPLEMENTATION
- ABAP BADI IMPLEMENTATION part two
- SAP ABAP Business Add-Ins Filter Dependent
- SAP ABAP Business Add-Ins Filter Dependent part two
- SAP ABAP Business Add-Ins implementation
- SAP ABAP BADI MENU ENHANCEMENTS
- ABAP BADI SCREEN ENHACEMENTS
- ABAP BADI SCREEN ENHANCEMENTS DEFINATION
- SAP badi screen enhancements implementation
- SAP IMPORT BADI - Procedure
-
▼
November
(22)
1 comment:
Excellent Online Resource for SAP EP and SAP Web Dynpro ABAP. Visit Learn SAP Online for Free
SAP EP - Standard Portal Services
Portal Eventing and Navigation
Portal Look and Feel - Branding the Portal
How to Develop Portal Applications
SAP EP-Developing portal content and assigning permissions
SAP EP-Role maintenance
SAP EP-How to make Enterprise Portal highly available
SAP Material Management Introduction
SAP EP-J2EE architechture
And Many More...
Basics of Web Dynpro ABAP
ABAP Data Types and Objects
ABAP Statements
WD4A - Topics to be covered in the upcoming posts
WD4A - Introduction
WDA - SAP Logon Procedures
WD4A-Format the Values appearing on value Axis of Business Graphic
WD4A-Navigate from one view to another and back to previous view
WD4A - How to Calculate next 12 months from current month in web dynpro ABAP
WD4A - Validate Inputs in a web dynpro ABAP Application
And Many More...
Post a Comment