Handling C# events in ABAP
Hi,
I am having a very bad time trying to make a C# custom control and an ABAP class talk to each other...
The control have many properties and methods, all of them perfectly accessible using a proxy class derived from cl_gui_control in ABAP. I can instantiate, show the control in the screen, call its methods, get its properties, but there is nothing in the earth that makes the ABAP understand a single event raised by the component.
In fact, the component runs ok - I tested it outside SAP, using IExplorer, and the event was good. But when I embed it on SAP, nothing happens.
What I did:
1) The component has an event declared this way:
// C# code, simplified
public interface IEventInfterface
[DispID(10)]
event Selected();
[ComSourceInterfaces(typeof(ISapControlEvents))]
public class mycontrol
public delegate void SelectedHND();
public event SelectedHND Selected;
public void OnSelected()
if (Selected != null) // Attention here!
Selected();
This means that my component have a "Selected" event, its DispatchID is "10".
2) In SAP, after making all the necessary implementations to use a class (constructor, dispatch, etc), my ABAP code contains this (consider obj_csharp an already instantiated and functional object):
DATA: evt_table TYPE cntl_simple_events,
evt_line TYPE cntl_simple_event.
evt_line-eventid = 10. " This is my DispID to the Selected event
evt_line-appl_event = 'X'.
APPEND evt_line to evt_table.
call METHOD obj_csharp->set_registered_events
EXPORTING
events = evt_table.
Now, the problem is: everything works perfect, including the registration routine (the event is registrered in the obj_csharp object), but when it need to be fired, <b>VisualStudio says that the object "Selected" is null</b> in that verification (where I wrote "Attention here", remember?) and do not raise the event.
Am I missing anything?
Thanks !!!
Arnaldo.
The ap Object is declared inside my OpenWord - Method.
The class itself is bound to a GUI button as a command.
public class OfficeCommand : ICommand
public void Execute(object parameter)
OpenWord(info, ReadWrite);
private void OpenWord(DocumentInfo info, bool readwrite)
Word.Application ap = new Word.Application();
Microsoft.Office.Interop.Word.Document document
= ap.Documents.Open(path,
ConfirmConversions:false,
ReadOnly:!readwrite,
AddToRecentFiles:false);
WordDocumentEventHandler WordCloseEventHandler = GlobalModel.createNew(info);
ap.DocumentBeforeSave += WordCloseEventHandler.DocumentBeforeSaveEvent;
ap.Visible = true;
ap.Activate();
Similar Messages
-
How to Handle Business Object event in ABAP class
Hello Everybody,
I wanted to know if it was possible to reference BOR objects in ABAP class and handle BOR events in ABAP Objects.
Thanks in advance.Hi,
Catch the et_VALIDATE event, when InnerEvent = False and ItemChanged = True.
If pVal.EventType = BoEventTypes.et_VALIDATE Then
If pVal.InnerEvent = False And pVal.ItemChanged Then
'TODO Your code here...
End If
End If
Regards,
Vítor Vieira -
Event handling in global class (abap object)
Hello friends
I have 1 problem regarding events in abap object... how to handel an event in global class in se24 .
Regards
Reema jain.
Message was edited by:
Reema JainHello Reema
The following sample report shows how to handle event in principle (see the § marks)..
The following sample report show customer data ("Header"; KNB1) in the first ALV list and sales areas ("Detail"; KNVV) for the selected customer (event double-click) in the second ALV list.
*& Report ZUS_SDN_TWO_ALV_GRIDS
REPORT zus_sdn_two_alv_grids.
DATA:
gd_okcode TYPE ui_func,
go_docking TYPE REF TO cl_gui_docking_container,
go_splitter TYPE REF TO cl_gui_splitter_container,
go_cell_top TYPE REF TO cl_gui_container,
go_cell_bottom TYPE REF TO cl_gui_container,
go_grid1 TYPE REF TO cl_gui_alv_grid,
go_grid2 TYPE REF TO cl_gui_alv_grid,
gs_layout TYPE lvc_s_layo.
DATA:
gt_knb1 TYPE STANDARD TABLE OF knb1,
gt_knvv TYPE STANDARD TABLE OF knvv.
"§1. Define and implement event handler method
" (Here: implemented as static methods of a local class)
* CLASS lcl_eventhandler DEFINITION
CLASS lcl_eventhandler DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
handle_double_click FOR EVENT double_click OF cl_gui_alv_grid
IMPORTING
e_row
e_column
es_row_no
sender.
ENDCLASS. "lcl_eventhandler DEFINITION
* CLASS lcl_eventhandler IMPLEMENTATION
CLASS lcl_eventhandler IMPLEMENTATION.
METHOD handle_double_click.
* define local data
DATA:
ls_knb1 TYPE knb1.
CHECK ( sender = go_grid1 ).
READ TABLE gt_knb1 INTO ls_knb1 INDEX e_row-index.
CHECK ( ls_knb1-kunnr IS NOT INITIAL ).
CALL METHOD go_grid1->set_current_cell_via_id
EXPORTING
* IS_ROW_ID =
* IS_COLUMN_ID =
is_row_no = es_row_no.
* Triggers PAI of the dynpro with the specified ok-code
CALL METHOD cl_gui_cfw=>set_new_ok_code( 'DETAIL' ).
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_eventhandler IMPLEMENTATION
START-OF-SELECTION.
SELECT * FROM knb1 INTO TABLE gt_knb1
WHERE bukrs = '1000'.
* Create docking container
CREATE OBJECT go_docking
EXPORTING
parent = cl_gui_container=>screen0
ratio = 90
EXCEPTIONS
OTHERS = 6.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Create splitter container
CREATE OBJECT go_splitter
EXPORTING
parent = go_docking
rows = 2
columns = 1
* NO_AUTODEF_PROGID_DYNNR =
* NAME =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Get cell container
CALL METHOD go_splitter->get_container
EXPORTING
row = 1
column = 1
RECEIVING
container = go_cell_top.
CALL METHOD go_splitter->get_container
EXPORTING
row = 2
column = 1
RECEIVING
container = go_cell_bottom.
* Create ALV grids
CREATE OBJECT go_grid1
EXPORTING
i_parent = go_cell_top
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
"§2. Set event handler (after creating the ALV instance)
SET HANDLER: lcl_eventhandler=>handle_double_click FOR go_grid1. " Or:
" SET HANDLER: lcl_eventhandler=>handle_double_click FOR all instances.
CREATE OBJECT go_grid2
EXPORTING
i_parent = go_cell_bottom
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
* Display data
gs_layout-grid_title = 'Customers'.
CALL METHOD go_grid1->set_table_for_first_display
EXPORTING
i_structure_name = 'KNB1'
is_layout = gs_layout
CHANGING
it_outtab = gt_knb1
EXCEPTIONS
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.
ENDIF.
gs_layout-grid_title = 'Customers Details (Sales Areas)'.
CALL METHOD go_grid2->set_table_for_first_display
EXPORTING
i_structure_name = 'KNVV'
is_layout = gs_layout
CHANGING
it_outtab = gt_knvv " empty !!!
EXCEPTIONS
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.
ENDIF.
* Link the docking container to the target dynpro
CALL METHOD go_docking->link
EXPORTING
repid = syst-repid
dynnr = '0100'
* CONTAINER =
EXCEPTIONS
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.
ENDIF.
* NOTE: dynpro does not contain any elements
CALL SCREEN '0100'.
* Flow logic of dynpro (does not contain any dynpro elements):
*PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.
*PROCESS AFTER INPUT.
* MODULE USER_COMMAND_0100.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
* text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_0100'. " contains push button "DETAIL"
* SET TITLEBAR 'xxx'.
* Refresh display of detail ALV list
CALL METHOD go_grid2->refresh_table_display
* EXPORTING
* IS_STABLE =
* I_SOFT_REFRESH =
EXCEPTIONS
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
* text
MODULE user_command_0100 INPUT.
CASE gd_okcode.
WHEN 'BACK' OR
'END' OR
'CANC'.
SET SCREEN 0. LEAVE SCREEN.
* User has pushed button "Display Details"
WHEN 'DETAIL'.
PERFORM entry_show_details.
WHEN OTHERS.
ENDCASE.
CLEAR: gd_okcode.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form ENTRY_SHOW_DETAILS
* text
* --> p1 text
* <-- p2 text
FORM entry_show_details .
* define local data
DATA:
ld_row TYPE i,
ls_knb1 TYPE knb1.
CALL METHOD go_grid1->get_current_cell
IMPORTING
e_row = ld_row.
READ TABLE gt_knb1 INTO ls_knb1 INDEX ld_row.
CHECK ( syst-subrc = 0 ).
SELECT * FROM knvv INTO TABLE gt_knvv
WHERE kunnr = ls_knb1-kunnr.
ENDFORM. " ENTRY_SHOW_DETAILS
Regards
Uwe -
INTERFACE AND EVENTS IN ABAP OO
Can some one explain me the real time need with example for use of interfaces and events in abap objects
(asking interface and events along doesnt mean that i am relating them).
<removed_by_moderator>
Pankaj Giri
Edited by: Julius Bussche on Jul 14, 2008 1:36 PMEvents :
Technically speaking :
" Events are notifications an object receives from, or transmits to, other objects or applications. Events allow objects to perform actions whenever a specific occurrence takes place. Microsoft Windows is an event-driven operating system, events can come from other objects, applications, or user input such as mouse clicks or key presses. "
Lets say you have an ALV - An editable one ...
Lats say - Once you press some button you want some kind of validation to be done.
How to do this ?
Raise an Event - Which is handled by a method and write the validation code.
Now you might argue, that I can do it in this way : Capture the function code - and call the validate method.
Yes, in this case it can be done.. But lets say .. you change a field in the ALV and you want the validation to be done as soon as he is done with typing.
Where is the function code here ? No function code... But there is an event here - The data changed event.
So you can raise a data changed event that can be handled and will do the validation.
It is not user friendly that you ask the user to press a button (to get the function code) for validation each time he enters a data.
The events can be raised by a system, or by a program also. So in this case the data changed event is raised by a system that you can handle.
Also, Lets say on a particular action you want some code to trigger. (You can take the same example of validation code). In this case the code to trigger is in a separate class. The object of which is not available here at this moment. (This case happens very frequently).
Advantage with events : Event handlers can be in a separate class also.
e.g : In the middle of some business logic .. you encounter a error. You want to send this information to the UI (to user - in form of a pop up) and then continue with some processing.
In many cases - A direct method call to trigger the pop up is not done. Because (in ideal cases) the engine must not interact with UI directly - Because the UI could be some other application - like a windows UI but the error comes from some SAP program.
So - A event is raised from the engine that is handled in the UI and a pop up is triggered.
Here -- I would have different classes (lets say for different Operating Systems). And all these classes must register to the event ERROR raised in application.
And these different classes for different Operation systems will have different code to raise a pop-up.
Now you can imagine : If you coded a pop-up for Windows (in your application logic) .. it will not work for Mac or Linux. But of you raise a event.. that is handled separately by a different UI classes for Win, Linux or Mac they will catch this event and process accordingly.
May be I complicated this explanation .... but I couldn't think of a simpler and concrete example.
Cheers.
Varun. -
Why and how to use events in abap objects
Dear all,
Please explain me why and how to use events in abap objects with real time example
regards
pankaj giriHi Pankaj,
I will try to explain why to use events... How to use is a different topic.. which others have already answered...
This is same from your prev. post...
Events :
Technically speaking :
" Events are notifications an object receives from, or transmits to, other objects or applications. Events allow objects to perform actions whenever a specific occurrence takes place. Microsoft Windows is an event-driven operating system, events can come from other objects, applications, or user input such as mouse clicks or key presses. "
Lets say you have an ALV - An editable one ...
Lats say - Once you press some button you want some kind of validation to be done.
How to do this ?
Raise an Event - Which is handled by a method and write the validation code.
Now you might argue, that I can do it in this way : Capture the function code - and call the validate method.
Yes, in this case it can be done.. But lets say .. you change a field in the ALV and you want the validation to be done as soon as he is done with typing.
Where is the function code here ? No function code... But there is an event here - The data changed event.
So you can raise a data changed event that can be handled and will do the validation.
It is not user friendly that you ask the user to press a button (to get the function code) for validation each time he enters a data.
The events can be raised by a system, or by a program also. So in this case the data changed event is raised by a system that you can handle.
Also, Lets say on a particular action you want some code to trigger. (You can take the same example of validation code). In this case the code to trigger is in a separate class. The object of which is not available here at this moment. (This case happens very frequently).
Advantage with events : Event handlers can be in a separate class also.
e.g : In the middle of some business logic .. you encounter a error. You want to send this information to the UI (to user - in form of a pop up) and then continue with some processing.
In many cases - A direct method call to trigger the pop up is not done. Because (in ideal cases) the engine must not interact with UI directly - Because the UI could be some other application - like a windows UI but the error comes from some SAP program.
So - A event is raised from the engine that is handled in the UI and a pop up is triggered.
Here -- I would have different classes (lets say for different Operating Systems). And all these classes must register to the event ERROR raised in application.
And these different classes for different Operation systems will have different code to raise a pop-up.
Now you can imagine : If you coded a pop-up for Windows (in your application logic) .. it will not work for Mac or Linux. But of you raise a event.. that is handled separately by a different UI classes for Win, Linux or Mac they will catch this event and process accordingly.
May be I complicated this explanation .... but I couldn't think of a simpler and concrete example.
Cheers.
Varun. -
How to handle selection event in alv component
Hi all,
i am new to webdynpro abap. and i want to know how to handle selection event(such as select all / unselect ) in my simple alv application.
Thanks very muchHi,
By default when you use the selection mode for the ALV as Multi/Mutli No Lead then this option is enabled.
Try to implement the event ONLEADSELECT and check wether this event is triggered or not.
DATA: lo_value type ref to cl_salv_wd_config_table.
CALL METHOD lo_value->if_salv_wd_table_settings~set_selection_mode
EXPORTING
value = cl_wd_table=>e_selection_mode-multi_no_lead.
Try to implement these event for ALV and put a break-point and test which event is getting triggered.
ON_CLICK
ON_DATA_CHECK
ON_FUNCTION
ON_LEAD_SELECT
ON_STD_FUNCTION_AFTE
ON_STD_FUNCTION_BEFO
Please provide more inputs.
Regards,
Lekha. -
Hello ,
is there anyway can we handle SAP events from CPS , our scenario is if we schedule a job in SAP from CPS , the job in SAP is firing an SAP event based job , how can we get the status of event based job from SAP to CPS.
Regards
RaghuHi Raghu,
There are a few options here.
You could monitor the SAP event based job in CPS, to see the status.
You could also create the SAP event based job from CPS, then it is automatically monitored.
The best would be to verify if you can simply put the two jobs in a CPS job chain. If the second job only waits for the event and does not do anything with the message of the event, this should be very easy. If the ABAP programs involved are custom developments, you could remove the event dependency and replace it with a CPS job chain too.
Regards,
Anton. -
Dear All,
Would you mind tell me the concept of the event in the ABAP objects.
Regards,
LukehI
Triggering and Handling Events
In ABAP Objects, triggering and handling an event means that certain methods act as triggers and trigger events, to which other methods - the handlers - react. This means that the handler methods are executed when the event occurs.
This section contains explains how to work with events in ABAP Objects. For precise details of the relevant ABAP statements, refer to the corresponding keyword documentation in the ABAP Editor.
Triggering Events
To trigger an event, a class must
· Declare the event in its declaration part
· Trigger the event in one of its methods
Declaring Events
You declare events in the declaration part of a class or in an interface. To declare instance events, use the following statement:
EVENTS ) TYPE type ..
To declare static events, use the following statement:
CLASS-EVENTS ... ...
It links a list of handler methods with corresponding trigger methods. There are four different types of event.
It can be
· An instance event declared in a class
· An instance event declared in an interface
· A static event declared in a class
· A static event declared in an interface
The syntax and effect of the SET HANDLER depends on which of the four cases listed above applies.
For an instance event, you must use the FOR addition to specify the instance for which you want to register the handler. You can either specify a single instance as the trigger, using a reference variable ...
The registration applies automatically to the whole class, or to all of the classes that implement the interface containing the static event. In the case of interfaces, the registration also applies to classes that are not loaded until after the handler has been registered.
Timing of Event Handling
After the RAISE EVENT statement, all registered handler methods are executed before the next statement is processed (synchronous event handling). If a handler method itself triggers events, its handler methods are executed before the original handler method continues. To avoid the possibility of endless recursion, events may currently only be nested 64 deep.
Handler methods are executed in the order in which they were registered. Since event handlers are registered dynamically, you should not assume that they will be processed in a particular order. Instead, you should program as though all event handlers will be executed simultaneously.
http://help.sap.com/saphelp_erp2004/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
http://help.sap.com/saphelp_erp2004/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
http://help.sap.com/saphelp_erp2004/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
http://help.sap.com/saphelp_erp2004/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm -
What are events. how to create and handle this events.
HI,
By triggering an event, an object or a class announces a change of state, or that a certain state has been achieved.Events link objects or classes more loosely than direct method calls do. Method calls establish precisely when and in which statement sequence the method is called. However, with events, the reaction of the object to the event is determined by the triggering of the event itself.
Events are most often used in GUI implementations.Other external object models, such as COM, ActiveX Controls etc, also provide events.
At the moment of implementation, a class defines its instance events (using the statement EVENTS) and static events (using the statement CLASS-EVENTS)
Classes or their instances that receive a message when an event is triggered at runtime and want to react to this event define event handler methods.
Statement : (CLASS-)METHODS | FOR ALL INSTANCES.
Every object that has defined events has an internal table: the handler table. All objects that have registered for events are entered in this table together with their event handler methods.Objects that have registered themselves for an event that is still live also remain live. The methods of these objects are called when the event is triggered, even if they can no longer be reached using main memory references.
If several objects have registered themselves for an event, then the sequence in which the event handler methods are called is not defined, that is, there is no guaranteed algorithm for the sequence in which the event handler methods are called.
If a new event handler is registered in an event handler method for an event that has just been triggered, then this event handler is added to the end of the sequence and is then also executed when its turn comes.
If an existing event handler is deregistered in an event handler method, then this handler is deleted from the event handler method sequence.
Events are also subject to the visibility concept and can therefore be either public, protected or private. Visibility establishes authorization for event handling :
all users
only users within that class or its subclasses
only users in that class.
Event handler methods also have visibility characteristics. Event handler methods, however, can only have the same visibility or more restricted visibility than the events they refer to.
The visibility of event handler methods establishes authorization for SET-HANDLER statements: SET HANDLER statements can be made
anywhere
in that class and its subclasses
only in that class
Regards,
Balaji Reddy G
**Rewards if answers are useful -
Calling Portal event from ABAP class
Hi Experts,
I need a following clarificatrion, Please help,
1. Is it possible to call a webdynpro method from a normal ABAP class?
2. If no, we need a functionality of a class 'CL_WDR_HTTP_EXT_MIME_HANDLER' having method 'DO_DOMAIN_RELAX_HTML'.
Is there any alternative method which can be used in ABAP having the same functionality.
3. Is there any ways with which we can call portal event from ABAP class?
Thanks,
Shabir>1. Is it possible to call a webdynpro method from a normal ABAP class?
I wouldn't necessarily recommend this approach. You shouldn't try to trigger events or any of the standard WDDO* methods from outside the WD Component itself. That said, you can pass the object reference (like the WD_COMP_CONTROLLER object reference or the View Object Reference) into methods of normal classes. Be careful if you are finding yourself calling a lot of your added methods from outside WD. This is probably a sign that these methods should be in the Assistance Class or some other Class functioning as a Model Object.
>2. If no, we need a functionality of a class 'CL_WDR_HTTP_EXT_MIME_HANDLER' having method 'DO_DOMAIN_RELAX_HTML'.
Is there any alternative method which can be used in ABAP having the same functionality.
What exactly do you want to do here? Do you just want to get the relaxation script? For what purpose? You should never need to inject the relaxation script into WDA.
>3. Is there any ways with which we can call portal event from ABAP class?
To what purpose. Do you just want to delegate the triggering of the event that is inside WD Component to be called from a class? If so you can pass the portal API object reference into a class from the WD Component. However this only works while running within WD.
How is this class used? Are you running in WD? Are you trying to generate some HTML code that runs in the portal independent of WD? -
Hi,
this is kiran,can any one send the order for events in abap.
regards,
kiranHi Kiran,
Below is the list of events:
Initialization : triggered when the report is loaded in memory.
At selection-screen output : triggered when the selection screen is loaded in memory before being displayed.
At selection-screen / <field> : before leaving the selection screen.
start-of-selection : the first event for displaying the report.
end-of-selection : after the start-of-selection is completed.
classiscal report events.
top-of-page : every time a new page is started in the list.
end-of-page : every time the list data reaches the footer region of the page.
interactive report events.
top of page during line selection : top of page event for secondary list.
at line-selection : evey time user dbl-clicks(F2) on the list data.
at pF<key> : function key from F5 to F12 to perform interactive action on the list.
Hope this serves your need.
Regards:
Sapna -
Events in ABAP runtime.
Can Any one explain me the events in ABAP runtime with proper example please.
Hi Srnivas,
Here are the events in order
Classical Report Events:
Initialization
At selection-screen
at selection-screen output
start-of-selection
end-of-selection
top-of-page
end-of-page
Interactive Report Events:
Above events and also,
at line-selection,
at user-command,
at pfn
The following events occur at runtime of a typical report program which uses logical databases:
Event keyword Event
INITIALIZATION Point before the selection screen
is displayed
When you start a program in which a selection screen is defined (either in the program itself or in the linked logical database program), the system normally processes this selection screen first. If you want to execute a processing block before the selection screen is processed, you can assign it to the event keyword INITIALIZATION.
AT SELECTION-SCREEN Point after processing user
input on the selection screen while the selection screen is still active
The event keyword AT SELECTION-SCREEN provides you with several possibilities to carry out processing blocks while the system is processing the selection screen.
START-OF-SELECTION Point after processing the selection screen
The event START-OF-SELECTION gives you the possibility of creating a processing block after processing the selection screen and before accessing database tables using a logical database. You can use this processing block, for example, to set the values of internal fields or to write informational statements onto the output screen.
At the START-OF-SELECTION event, also all statements are processed that are not attached to an event keyword except those that are written behind a FORM-ENDFORM block
GET <table> Point at which the logical database
offers a line of the database table <table>.
The most important event for report programs with an attached logical database is the moment at which the logical database program has read a line from a database table (see Accessing Data Using Logical Databases ). To start a processing block at this event, use the GET statement as follows:
Syntax
GET <table> FIELDS <list>.
After this statement, you can work with the current line of the database table <table>. The data is provided in the table work area <table>.
GET <table> LATE Point after processing all tables which
are hierarchically subordinate to the database table <table> in the structure of the logical database.
To start a processing block at the moment after the system has processed all database tables of a logical database that are hierarchically inferior to a specific database table, use the event keyword GET as follows:
Syntax
GET <table> LATE FIELDS <list>.
In analogy to report programs that use only SELECT statements (see table in Comparison of Access Methods ), the processing block of a GET <table> LATE statement would appear directly before the ENDSELECT statement in the SELECT loop for the database table <table>.
END-OF-SELECTION Point after processing all lines offered
by the logical database.
To define a processing block after the system has read and processed all database tables of a logical database, use the keyword END-OF-SELECTION.
The following events occur during the processing of the output list of a report program:
Event keyword Event
TOP-OF-PAGE Point during list processing when
a new page is started
END-OF-PAGE Point during list processing when a page
is ended
The following events occur during the display of the output list of a report program:
Event keyword Event
AT LINE-SELECTION Point at which the user selects a line
AT USER-COMMAND Point at which the user presses a function key or enters a command in the command field.
AT PF<nn> Point at which the user presses the
function key with the function code PF<n>
With the selection screen, ABAP/4 offers an interactive element also for report programs. You can define a selection screen without having to bother about all the details required in dialog programming.
The selection screen is always processed directly after a report program is started. The user can enter field values and selection criteria on this screen.
Reward points if useful.
Cheers,
Swamy Kunche -
What is the equivalent for 'On Change of' Event in ABAP OBJECTS?
What is the equivalent for 'On Change of' Event in ABAP OBJECTS? and how to use it in LOOP control?
hi,
There is no such Equivalent in OO ABAP.
You have to Raise your own Event within tha class checking the value of the field whose value is changing.
Regards
Sumit Agarwal -
Event handler : handleEvent(Event event)
Good day,
The deprecated event handler "handleEvent(Event event)" has been replaced by "processEvent(AWTEvent event)" as per the docs.
With some research, I came up with this little conversion chart :
item handleEvent processEvent
====== ============ ============
x event.x event.getX()
y event.y event.getY()
id event.id event.getID()
target event.target ???
====== ============ =============
I'm just trying to compile a list of conversion for deprecated APIs with some extra information to "ease" the transition process.
Is the above information right or am I still missing the boat ?
Please apply necessary corrections wherever applicable.
Best regards.Good day,
The deprecated event handler "handleEvent(Event event)" has been replaced by "processEvent(AWTEvent event)" as per the docs.
With some research, I came up with this little conversion chart :
item handleEvent processEvent
====== ============ ============
x event.x event.getX()
y event.y event.getY()
id event.id event.getID()
target event.target ???
====== ============ =============
I'm just trying to compile a list of conversion for deprecated APIs with some extra information to "ease" the transition process.
Is the above information right or am I still missing the boat ?
Please apply necessary corrections wherever applicable.
Best regards. -
Is it possible to handle multiple events using Jscript for a button in Apex
Hi,
I've application wherein in one of the pages for a button, I need to trigger 2 events as: 1. redirect to a new page upon 'click' of the button
2. display a set of values on 'mouse over' that button.
I'm able to handle both separately, but not in one button. I would like to know if there is any limitation in Apex that we cant handle multiple events? Currently I've put a text item near the button, and called the Jscript for mouse over event in that as a temporary workaround. Can someone let me know if this is feasible? If not any other alternative to handle this?
Thanks in advance,
gsachidhHi Gsachidh,
well interesting problem you're facinng. Indeed, it can't be specified using the 'Button Attributes' So we have to come up with an workaround.
A quick en dirty solution would be to specify it with the 'Optional URL Redirect options'. In a normal button, with processing on same page, this would be 'no target'. but in case of additional things to be done this can be used, using an target URL. I used this many times, in example with popUp windows for refreshing the caller object when changes are made. In your case we have to add next to the href an onmouseover event. this can be done with;
Target set to => URL
URL - target => javascript:doSubmit('<button_name>');" onMouseOver="javascript:showTooltip('tooltip');"
Here the " is the key, letting ApEx know the target (href) is doSubmit('<button_name>'), just like when no target would be specified and adding a new javascript event; onMouseOver.
Although this is a dirty solution in my opinion, it is the best i could come up with. I have another idea in how to do this, that is by adding this event dynamically with javascript with an addEvent. But i don't have an example at the moment for this scenario.
Simon
Message was edited by:
S1M0N
Maybe you are looking for
-
My MacBook died. Again. Am I the only one SERIOUSLY regretting my purchase?
Okay. Almost two weeks ago, I turned my MacBook off only to discover that, an hour later, it would not turn on any more. At all. I took it in. The man was suprised by my issue, saying that it was one he had not yet encountered. They kept my MacBook (
-
How do I install another phone without sharing the content of the first phone?
My neighbor doesn't have a computer and just got an iPhone 4. She wants to get on iTunes but we don't know how to do this without her phone downloading all of my music, contacts, videos, etc. Can anyone help?
-
SCCM 2012 SP1 - Evil Folders in Reporting Services - What Are They and How to Remove Them
Hello All, There are a lot of sub-folders in the http://CentralSiteSCCM/ReportServer. They are like: <dir> Config_Mgr_CEN <dir> Config_Mgr_CEN.OLD.0 <dir> Config_Mgr_CEN.OLD.1 <dir> Config_Mgr_CEN.OLD.10 <dir> Config_Mgr_CEN.OLD.100 <dir> Config_Mgr_
-
Payload is not visible in sxmb_moni
Hi friends, when i send payload from RWB, i am getting success in RWB but when i see that payload in sxmb_moni, i could not see my payload in main document ..only in attachment i could see that paylad. could you give some idea what could be cause for
-
How to move rejected clips ONLY to trash in the new iMovie?
In the old iMovie, there was a 'Move rejected clips' function that I cannot find in the new iMovie. When I select it to where it only shows rejected clips before selecting 'Move to trash', ALL the clips, including the ones marked as 'favorites' end u