How can I register an EVENT for ALV-GRID?????
Hi,
i have create Events for my ALV-Grid Table (cl_gui_alv_grid).
But there is one Problem!!!!
Which Event must i create, if users write something in the ALV row and press to key "enter" ???
With kind regards
Ersin
Did you set the handler for one of forementioned events? If no, please suplement your code with the following
"create handler class
CLASS lcl_gui_alv_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
" Controlling data changes when ALV Grid is editable
handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING er_data_changed e_onf4 e_onf4_before e_onf4_after,
" To be triggered after data changing is finished
handle_data_changed_finished FOR EVENT data_changed_finished OF cl_gui_alv_grid
IMPORTING e_modified ,
ENDCLASS.
"implement you handler methods
CLASS lcl_gui_alv_event_receiver IMPLEMENTATION.
METHOD handle_data_changed .
MESSAGE 'Data changed' TYPE 'I'.
ENDMETHOD.
METHOD handle_data_changed_finished .
MESSAGE 'Data changed finished' TYPE 'I'.
ENDMETHOD .
ENDCLASS.
data: g_alv_event_ref TYPE REF TO lcl_gui_alv_event_receiver.
CREATE OBJECT g_alv_event_ref.
"set handlers for these events
SET HANDLER:
g_alv_event_ref->handle_data_changed FOR g_alv_grid_ref,
g_alv_event_ref->handle_data_changed_finished FOR g_alv_grid_ref,
"register the events after pressing enter
CALL METHOD g_alv_grid_ref->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
Regards
Marcin
Similar Messages
-
How can I register a Event for TAB???
Hi,
my problem is, that i search for an solution to register an Event for Tabulator (Tab Key).
If i klick to tab, than it must be trigger the event!!
I have found in forum following:
http://webcache.googleusercontent.com/search?q=cache:fk2pfn0bhiwj:www.sdn.sap.com/irj/scn/thread%3fmessageid%3d1078796eventtabulatoralvgrid&cd=50&hl=de&ct=clnk&gl=de
How must I register my TAB Event ????
Please give an example!
Thanks in forwards.
ErsinThanks for Help:-)
-
How can I trigger a USER_COMMAND for alv grid "toolbar" ???
Hi,
i have the standard ALV Grid "toolbar" and if i click to the Button "&LOCAL©_ROW" than i want try to make a Refresh to my ALV Table in the Event "afteruser_command"_!!!!
Here is the implementation of my Event *"afteruser_command":*_
METHOD on_after_user_command.
........DATA: ls_stable TYPE lvc_s_stbl.
.....CASE e_ucomm.
.....WHEN '&LOCAL©_ROW'.
........MESSAGE 'LOCAL_COPY_ROW' TYPE 'S' DISPLAY LIKE 'E'.
........ls_stable-row = 'X'.
........ls_stable-col = 'X'.
........CALL METHOD gr_grid_d0100->refresh_table_display
..............EXPORTING
.......................is_stable = ls_stable
..............EXCEPTIONS
.......................finished = 1
.......................OTHERS = 2.
......ENDCASE.
ENDMETHOD.
But it doesnt work.
Is there another function code for the Copy Button????
Thanks
ErsinHello Ersin,
the events "after_user_command", "before_user_command" and "user_command" will not be fired when selecting this command!
In my opinion, there is no solution, to fire these events, using this alv-function!
But there is a trick:
1. Register on the event "toolbar" with an own method:
toolbar_own for event toolbar of cl_gui_alv_grid
importing e_object
e_interactive,
In this method change the function code of "&LOCAL©_ROW", but don´t change the row of the entry, because the button should appear on the same place in the toolbar:
field-symbols: <ls_toolbar> type stb_button.
read table e_object->mt_toolbar with key function = '&LOCAL©_ROW'
assigning <ls_toolbar>.
if sy-subrc = 0.
<ls_toolbar>-function = 'COPYROW_OWN'.
endif.
2. Register on the event "user_command" ( I think, that´s clear ):
user_cmd_own for event user_command
of cl_gui_alv_grid
importing e_ucomm,
( don´t forget the set handler-commands for both events:
set handler po_alv_own->user_cmd_own for po_alv_own.
set handler po_alv_own->toolbar_own for po_alv_own. )
3. Now you can react in the method "user_command" on your own function code:
case e_ucomm.
when 'COPYROW_OWN'.
perform copy_row using me
changing gt_bis_cf_out.
Sample code for copying the current line:
FORM COPY_ROW using po_alv_own type ref to gcl_alv_own
changing pt_table_alv type gt_table_alv_t.
data: l_index type i,
ls_table_alv type gs_table_alvt_t.
call method po_alv_own->get_current_cell
importing
e_row = l_index.
* e_value =
* e_col =
* es_row_id =
* es_col_id =
* es_row_no =
"read the current line:
read table pt_table_alv index l_index
into ls_table_alv_out.
"some changes for the new row:
clear: ls_table_alv-style,
ls_table_alv-tabix.
"insert the new line:
add 1 to l_index.
insert ls_table_alv into pt_table_alv index l_index.
po_alv_own->refresh( ).
ENDFORM. " COPY_ROW
In this manner the events "after_user_command", "before_user_command" are fired, too!
For information: My problem was, that the ALV-function copied the style-information too, so in the new line, some fields are not editable. At least his field must be cleared!
Best regard
Thomas Scheuermann -
How can i shoulD use 'select' for ALV
Hello guys,Please Help
how can i summation as date with alv.
how can i use 'group by' in select statement.
Normally my alv table like this.
I want to this.MY STANDART ALV QUERY IS THIS.
select * appending corresponding fields of table itabon
from ( lips
inner join likp
on LIKP~VBELN = LIPS~VBELN )
where
likp~WADAT_IST between s_WADAT-low and s_WADAT-high AND
likp~VKORG eq 'O001' AND LIPS~LFIMG ne 0
I WANT TO QUERY FOR MY SECOND PICTURE.
Thank you -
How can I register Apple care for my iPad if my ipad's warranty is not expire yet?
Apple care for my iPad will be expire in November 14, 2013. I want to extend my iPad's warranty. I already bought Apple Care warranty but when I register online it said I already had a warranty for my iPad. The question is, how can I extend my iPad's warranty?
You can only buy apple care once to extend your original warranty from one year to two. You can't keep reupping it every year if I'm understanding that's what you're trying to do.
After your device is two years old it's out of warranty and not eligible for any warranty from Apple (some retailers sell you up to 3 years of coverage, but you had to get that with the device) -
How can i save the data from ALV grid to my database tables?
Hi all,
Suppose in a grid i want to edit some fields and after editing the data i want to store the refresh data to my database tables. How can i do that? what is procedure? Please tell me in details.
Thanks in Advance,
Abhijit.Hi,
If you are doing it with oops concept then here are the steps for that.
1) Declare DATA : er_data_changed TYPE REF TO cl_alv_changed_data_protocol,
data_changed TYPE REF TO cl_alv_changed_data_protocol.
--For getting the row no of of the row which is edited by user
DATA : ls_mod_cell TYPE table of lvc_s_modi with header line,
lv_value TYPE lvc_value .
in your program
2) Define a class
CLASS notification DEFINITION.
PUBLIC SECTION.
CLASS-METHODS : handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid IMPORTING er_data_changed.
ENDCLASS. "NOTIFICATION DEFINITION
3) For that class write the implementation
CLASS notification IMPLEMENTATION.
METHOD handle_data_changed.
PERFORM handle_data_changed USING er_data_changed.
ENDMETHOD. "handle_data_changed
ENDCLASS. "NOTIFICATION IMPLEMENTATION
4) In the PERFORM handle_data_changed you code like this
FORM handle_data_changed USING er_data_changed type ref TO
cl_alv_changed_data_protocol.
SORT er_data_changed->mt_mod_cells BY row_id .
LOOP AT er_data_changed->mt_mod_cells
INTO ls_mod_cell .
append ls_mod_cell.
ENDLOOP.
*LS_MOD_CELL will have all the rows which were edited
and all the updated data corresponding to those rows*
You can now use the the data which is in LS_MOD_CELL
to update into your DB Table.
LOOP at ls_mod_cell.
READ TABLE itab3 INTO t_output INDEX ls_mod_cell-row_id.
ENDLOOP.
ENDFORM. " handle_data_changed
Regards,
Syed -
Please very urgent How can i call focus event for dynamic created txtbox
Hi,
I create a one texbox using javascript .now i want to call onFocus event that textbox.How is itHi,
I create a one texbox using javascript .now i want to
call onFocus event that textbox.How is itJust for you, slowly, so you can understand:
Javascript was invented by Netscape and is a scri�ting language for browsers.
Java is a programming language invented by Sun.
Compare:
Netscape. Sun.
Notice a difference? -
How can I enter an event for the first Monday of every month?
I used to have a Custom choice that allowed me to select day or date for repeat. Where is it?
I don't believe there is such a custom repeat option with the iPhone's Calendar app, but if you are syncing calendar events with a supported calendar app on your computer or syncing calendar events over the air with an email account that supports it with an option to create such a custom repeating event with the online calendar, set up the custom repeating event there.
-
Help - I have an apple id account, where is my iPod and iPad registered, but also the iPod of my daughter. How can I make an account for my daughter and keep all the apps she has on her iPod and in her own iTunes?
Sorry, content bought with one Apple ID cannot be merged or transferred to another Apple ID.
-
How can I remove default alarm for events in iCal on devices ios?
Whenever I add an event to my iCal calendar in Mounain Lion it will automatically add one default alert only on my iphone and ipad. These default alarms are not displayed on my macbook or icloud.com
Default alarms are disabled in macbook, icloud.com, and my ios devices.
How can I remove default alarm for events in iCal on devices ios?
Thanks and sorry for my english.
MacBook Pro, Mac OS X 10.8OK, so I have had this issue for the past several months. I think it all started when I upgraded to ML from SL and migrated my calendars and contacts to iCloud. That was a couple months ago. But now I am running 10.8.2, and about two weeks ago I upgraded my iOS devices to 6.0.1.
I don't seem to be having any issues with events that I create now, but all those old events that were migrated to iCloud a couple months ago, many of those sound alerts on the iOS devices even though there was no alert defined when the event was originally created. I have always had alerts off by default both in iCal and on the iOS devices.
So here's the question: is there a way to go through and disable all these spurious event alerts? I've been disabling them as the event reminders come up, but it's irritating. It would be nice if there was a way to turn them off all in one shot somehow. -
How can I register a number with iMessage for my iPad2?
I've got a 3G card with a mobile phone number. How can I register this number with iMessage?
Good afternoon;
So to confirm your posting,
lllaass wrote:
If it is a number/email address yu are calling:
- Is it entered in a contact in your Contact app.
- Does the person have the number/email address registered as their messaging number/emai addrrss.
the other person needs to register thier information? -
How to trigger left_click_run event on ALV GRID
Hiiiiiiii........
Can any of u please tell me how to trigger left_click_run event on ALV GRID.
There is an event LEFT_CLICK_RUN and its a public accessed event. But the problem is , the corresponding attribute of this event "EVENT_LEFT_CLICK_RUN" which is needed to registered that event (We need to register our events through a method set_register_events using table of type cntl_simple_events...) is protect accessed. So I am unable to use that attribute...Could u please tell me is there any alternative way to register that event.......ANY POSSIBLE WAY?
Thanks in advance,
RamsI think you should use event selection_changed. Note that you shouldn't allow multiple selection for the tree at the same time, i.e. use: create object g_tree exporting \[...\] node_selection_mode = cl_gui_column_tree=>node_sel_mode_single.
For more information, see this thread: Urgently required : cl_gui_alv_tree single_click event... -
How can I get the events from a java program?
I want to make a monitor to watch a java program.How can I get the events from the GUI of this program some as mouse cliking, keyinput. So I can watch these in my monitor.
ThanksHi,
To put a monitor to the events occuring in the GHUI u need to register required components with the appropriate EventListeners.
Liek if u want to get notified when a mouse is clicked, then u need to add The MouseListener to the component which u want to be monitored.
Say
myFrame which is the JFrame object which shuld be monitored for the events.
Then in ur program u have to add following code
myFrame.addMouseListener( someObectReference );
Here the someObjectReference should be an instance to a concrete class ..i.e. U write a class like the following
public class MyMouseListener implements MouseListener {
// override the followig methods
public void mouseClicked(MouseEvent me){ sop("MOUSE CLICKED ON THE FRAME");}
public void mousePressed(MouseEvent me){}
public void mouseReleased(MouseEvent me){}
If u dont want to use another class for listening to the events. Then u can make teh current class monitor the events. To do so ur class should implement the appropriate listener and should override the required methods.
and u should say myFrame.addMouseListenet( this );
thats it -
Hello Expert,
We have a lot of process chain which was trigger by one event with different variant. However, since the last two days, the process chain did not run. it seems the event was not triggered.
How can we trace the event? I mean, if it is triggered or not within one day.
As I checked the process chain, some of the process chain was successfully triggered by the same event. it is really weird...
Thanks
XY
Edited by: xy chen on Nov 6, 2008 3:24 AM
Edited by: xy chen on Nov 6, 2008 3:30 AMHi......
Copy the event...........then go to SE16 >> RSEVENTHEAD............there in the event field give the event name.........then execute............from there you will get the event collector name................
If you don't get it here then search in table RSEVENTCHAIN.........
Copy the event and go to RSA1OLD(if you are in 7.0)............otherwise go to RSA1...............from there go to the Event collector........give the event collector name and check whether it registered or not............if registered when last it was registered.............if you are unable to find this event in these two chains............then go SM37................from there choose the event..........and in the Job field write BI_PROCESS_TRIGGER..............from there check when this job last triggered for this event.............
Hope this helps.........
Regards,
Debjani........
Edited by: Debjani Mukherjee on Nov 6, 2008 4:44 AM -
How can I register the iTunes without a credit card? No "None" can be selected but only different kinds of credit cards. Thanks!
Get an iTunes gift card & redeem that in iTunes using your existing Apple ID.
Then the option for none, regarding a credit card should appear.
Maybe you are looking for
-
Is use of flat file in SRM-MDM catalog search UI possible ?
Hello, When user looks for materials inside SRM-MDM catalog (using search user interface), search is done manually with free form or drill down search. Then, among the search result, user has to select items he wants to add to his shopping cart and f
-
What is CalDAV and what does it do in iCal?
I know this is probably a dumb question but I just have no idea what CalDAV is or what it does, can someone enlighten me please?
-
Dear sirs, please comment on the idea: I have heard that the costs of the transfer of the email footers (like green wannabe stuff like "please consider the enivronment before printing this em-ail" etc.) are pretty high and in most of the cases not in
-
Redirect to their corresponding index.jsp files from multiple sub folders
Hi, I have a doc root in the location /opt/htdocs/defaultapp, where defaultapp is the application with war file(with jsps and java code) in weblogic. There are multiple sub folders in docroot like /opt/htdocs/defaultapp/ra, /opt/htdocs/defaultapp/inf
-
Airport in Windows via Bootcamp
I cannot seem to get a wireless connection to form when I am on the Windows XP pro service pack 2 side of my MacBook. I am not sure why it won't work, and I have tried reinstalling and repairing the bootcamp drivers but nothing seems to work. Anyone