Capturing the event of ALV
Does anyone know how to create an ALV that captures the <b>event of checking/unchecking a checkbox</b>.
After which the selected rows will be used for custom processing.
Thank you.!
Hi,
http://www.sapfans.com/forums/viewtopic.php?t=88376
http://www.sapfans.com/forums/viewtopic.php?t=40968
http://www.sapfans.com/forums/viewtopic.php?t=6919
Reward if useful!
Similar Messages
-
How to capture the event in ALV grid display?
Hi experts,
How to capture the event in an ALV grid display which is editable. I have to capture the TAB key or ENTER key.
regards,
Arul Jothi.Hi Arul,
Take a look at sample program BCALV_EDIT_03. (Find string "register ENTER" in the program to see how to register)
Basically you have to Register edit events using method call REGISTER_EDIT_EVENT and then write a handler method for event DATA_CHANGED..
If you are using a REUSE..GRID fm then first get the grid reference using function module GET_GLOBALS_FROM_SLVC_FULLSCR and then repeat the above procedure..
Hope this helps..
Sri
Message was edited by: Srikanth Pinnamaneni -
Class or method needed to capture the event triggered
Hi All,
Help needed in finding the event triggered in ALV container.
As per my requirement , I am registering the event mc_evt_modify for getting the search help(MEKK) in a ALV container . However it is triggered when ever I am inserting a row in ALV container and also the method data_changed is also triggered with that. But I don't want the method data_changed to be triggered.
Is there any method or class which captures the event triggered so that I can put a condition on mc_evt_modify event.
Please help me to resolve this issue.
Regards,
SrinivasHi,
You can check event ONF4
"1 . -------------------- first register it
DATA: it_f4 TYPE lvc_t_f4,
wa_f4 TYPE lvc_s_f4.
wa_f4-fieldname = 'CONNID'.
wa_f4-register = 'X'.
wa_f4-CHNGEAFTER = 'X'.
APPEND wa_f4 TO it_f4.
CALL METHOD g_alv_grid_ref->register_f4_for_fields
EXPORTING
it_f4 = it_f4.
"2. --------------------------- now handle it
handle_on_f4 FOR EVENT onf4 OF cl_gui_alv_grid
IMPORTING e_fieldname e_fieldvalue er_event_data,
METHOD handle_on_f4.
DATA: repid LIKE sy-repid,
dynnr LIKE sy-dynnr,
field TYPE help_info-dynprofld.
repid = sy-repid.
dynnr = sy-dynnr.
field = e_fieldname.
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = 'SFLIGHT'
fieldname = 'CONNID'
searchhelp = "give search help here
dynpprog = repid
dynpnr = dynnr
dynprofield = field. "return picked value to the one you are in
"prevent furhter standard processing
er_event_data->m_event_handled = 'X'.
ENDMETHOD.
Regards
Marcin -
How to capture the event in driver JSplitPane
Hi all, i have some problem with the JSplitPane.
What i want to do is that:
i need to capture the event throw when the user press the button in the driver of the JSplitPane, this is because i want to know wich side of the splitpane is complet visible.
Thanks for your time!
LucaI thought I would do up an example just for fun. As you drag the splitter bar the size of the two components and the splitter component is reported to the console along with the divider location. Interestinly, on my system (Windows XP, Java 1.41_02) when you move the bar downwards the divider location is consistantly two pixels past the height of the top component but when you drag the bar upwards the divider location and the height of the top component are the same.
Does anyone have any ideas why that would be?
Here is the test app:package splitPaneMonitor;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.JFrame;
import javax.swing.JSplitPane;
import javax.swing.JTextArea;
public class SplitPaneFrame extends JFrame implements PropertyChangeListener {
public SplitPaneFrame() {
super ("Split pane test");
// Create the components to show in the split pane
myTopComponent = new JTextArea ("This is the top component", 10, 40);
myBottomComponent = new JTextArea ("This is the bottom component", 15, 40);
// Create the split pane
mySplitter = new JSplitPane (JSplitPane.VERTICAL_SPLIT , true, myTopComponent, myBottomComponent);
mySplitter.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, this);
getContentPane ().setLayout(new BorderLayout ());
getContentPane ().add (mySplitter, BorderLayout.CENTER);
public void propertyChange (PropertyChangeEvent evt) {
if (evt.getPropertyName () == JSplitPane.DIVIDER_LOCATION_PROPERTY) {
System.out.println ("Split pane divider moved");
Dimension size = myTopComponent.getSize ();
System.out.println (" The top component's size is: " + size.height +" h, "+ size.width + " w");
myBottomComponent.getSize (size);
System.out.println (" The bottom component's size is: " + size.height +" h, "+ size.width + " w");
mySplitter.getSize (size);
System.out.println (" The splitter's size is: " + size.height +" h, "+ size.width + " w");
System.out.println (" The splitter divider location is: " + mySplitter.getDividerLocation ());
private JTextArea myTopComponent;
private JTextArea myBottomComponent;
private JSplitPane mySplitter;
public static void main(String[] args) {
SplitPaneFrame appFrame = new SplitPaneFrame ();
appFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
appFrame.pack();
appFrame.setVisible (true);
} -
Capturing the event on clicking the af:train stop icon
We are using an af:train as follows
<fnd:applicationsPanel>
<f:facet name="appsPanelTrain">
<af:panelGroupLayout layout="horizontal" halign="center"
id="panelGroupLayout2">
<af:train value="#{controllerContext.currentViewPort.taskFlowContext.trainModel}"
id="train1"/>
</af:panelGroupLayout>
</f:facet>
</fnd:applicationsPanel>
I see the train stops on top of my page as expected. I can skip the train stops by directly clicking on the stops on top of the page.
Is there a way to capture the event of this click?This should help
http://www.oracle.com/technetwork/developer-tools/adf/learnmore/97-deferred-trainstop-navigation-1528557.pdf -
Capturing the events and performing a predefined action
I want a mechanism to capture the events:
eg: If a new document is opened , I want a text frame to be created on that document as soon as it gets opened.
what interfaces, classes can help me here? andy sample code avilable which shows how to capture events?Operating System
System Model
Windows 7 Ultimate (build 7100)
Gigabyte Technology Co., Ltd. M61PME-S2P
Enclosure Type: Desktop
Processor
Main Circuit Board
2.80 gigahertz AMD Athlon X2 240
256 kilobyte primary memory cache
1024 kilobyte secondary memory cache
64-bit ready
Multi-core (2 total)
Not hyper-threaded
Board: Gigabyte Technology Co., Ltd. M61PME-S2P
Bus Clock: 200 megahertz
BIOS: Award Software International, Inc. F2 12/30/2008
Drives
Memory Modules
320.07 Gigabytes Usable Hard Drive Capacity
125.82 Gigabytes Hard Drive Free Space
TSSTcorp CDDVDW SE-S084C USB Device [Optical drive]
SAMSUNG HD321HJ SCSI Disk Device (320.07 GB) -- drive 0, s/n S13RJ90SB04688, SMART Status: Healthy
1984 Megabytes Usable Installed Memory
Slot 'A0' has 2048 MB
Slot 'A1' is Empty
Local Drive Volumes
c: (NTFS on drive 0) *
319.97 GB
125.76 GB free
d: (NTFS on drive 0)
105 MB
65 MB free
* Operating System is installed on c:
The media files are avi and are in my videos folder (videos-windows 7) -
Capturing the event!!!urgent
Hi all,
i have a checkBox on a page.My requirement is to capture the event of the CheckBox being clicked,like writing some javascript Functions like onClick.
kan anyone provide me some clarity like, is this possible.
I am being to fetch the user checked value once i caputre the event.
For time being i have created a Apply button to capture the user selection of checkBox.
The code is here
if(pageContext.getParameter("Apply")!=null)
String checkboxn = pageContext.getParameter("NoFlag");
if ("on".equals(checkboxn))
updatedCheckValue="Y";
But my client does not want any additional Buttons on the page.
So i need to captire the vent through some javascript.You don't need a javascript to do this. As Tapash mentions, you can define a fireAction on the messageCheckBox Bean and handle this event in your controller code.
Thanks, Srinath. -
How can I capture the event of selecting a listbar page item?
Is there any way that I can capture the event of clicking/selecting a listbar page item (not just selecting the listbar page) from the listbar activeX control in TestStand 3.0?
I was able to populate the list bar page with items, now how do I know if a user selects any one of those items?
Thanks for your time and assistance,
MarkUse the CursorMoved event.
-
Hi friends ,
I want capture "enter " event whenever user presses enter at ALV fields .
Well i have used an event "handle data changed" but then it wont get triggered
Unless data in ALV field is changed .
Please suggest me how to capture event without data getting changed ,
As i want validate data , when user presses enter on alv fields .
Thanx in advance .If you want to trigger PAI for Enter key even when no data is changed, then you need to set I_APPL_EVENTS flag when creating the alv grid.
create object alv_grid
exporting
i_parent = cust_ctrl
i_appl_events = 'X'.
But this may bring in more problems because you have to now call check_changed_Data in PAI which will trigger data_Changed, but there are workarounds.
Regards,
Rao A -
Query about the events in ALV List
Hi,
When does the events being triggered in the ALV?
Whta is its behavior? Thanks a lot!Hi,
Following this report is the sample report ALV. Kindly go through that one.
REPORT YMS_ALVDEMO .
TYPE-POOLS : SLIS.
TABLES : QALS.
DATA : BEGIN OF T_OUT OCCURS 0,
MATNR LIKE QALS-MATNR, "MATERIAL
WERK LIKE QALS-WERK, "PLANT
ART LIKE QALS-ART, "Inspaction Lot Type
OBJNR LIKE QALS-OBJNR, "Object Number
END OF T_OUT.
DATA : I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
I_LAYOUT TYPE SLIS_LAYOUT_ALV,
GS_LAYOUT TYPE LVC_S_LAYO,
G_REPID TYPE SY-REPID,
LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
SELECT-OPTIONS:S_PRFLOS FOR QALS-PRUEFLOS.
INITIALIZATION.
G_REPID = SY-REPID.
I_LAYOUT-ZEBRA = 'X'.
I_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
START-OF-SELECTION.
PERFORM FETCH_DATA.
END-OF-SELECTION.
PERFORM FILL_FIELDCAT.
PERFORM DISPLAY_ALV.
*& Form FETCH_DATA
* text
* --> p1 text
* <-- p2 text
FORM FETCH_DATA .
SELECT MATNR WERK ART OBJNR
FROM QALS
INTO TABLE T_OUT
WHERE PRUEFLOS IN S_PRFLOS.
ENDFORM. " FETCH_DATA
*& Form FILL_FIELDCAT
* text
FORM FILL_FIELDCAT .
REFRESH I_FIELDCAT[].
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = G_REPID
I_INTERNAL_TABNAME = 'T_OUT'
I_INCLNAME = G_REPID
CHANGING
CT_FIELDCAT = I_FIELDCAT[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
ENDFORM. " FILL_FIELDCAT
*& Form display_alv
* text
FORM DISPLAY_ALV .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_REPID
IS_LAYOUT = I_LAYOUT
IT_FIELDCAT = I_FIELDCAT[]
TABLES
T_OUTTAB = T_OUT
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDFORM. " display_alv
Thanks,
Sankar M -
what r the events contain in alv's
plz give in an order
clearly with decsription(Build up events table)
build an event table, which are used for firing both user commands and the system dependent events i.e. top of page, end of page etc.
A list of possible events is populated into an event table (I_EVENTS) when this table is passed from the function module REUSE_ALV_EVENT_NAMES_GET. The return table from this function module contains all the possible events.
The function module contains following import and export parameters.
IMPORTING PARAMETERS: I_LIST_TYPE
This parameter has possible values from 0-4.
The parameter I_LIST_TYPE is of TYPE SLIS_LIST_TYPE and is DEFAULT 0 .
EXPORTING PARAMETERS: I_EVENTS table.
This table is of TYPE SLIS_T_EVENT and returns to the program the name of all the possible events.
The table structure contains the fields:
I_EVENTS-NAME: Name of the Callback event.
I_EVENTS-FORM: Name of the form routine that should be called in the calling program at the event.
Only events with a form routine name are processed.
The I_EVENTS table returns with the following possible constants:
1. Slis_ev_item_data_expand TYPE slis_formname VALUE 'ITEM_DATA_EXPAND'.
Only relevant for hierarchical-sequential lists using the layout parameter IS_LAYOUT-EXPAND_FIELDNAME of the structure IS_LAYOUT. Exit for passing item entries (ITEM table) for a header record that was expanded interactively by the user.
2. Slis_ev_reprep_sel_modify TYPE slis_formname VALUE 'REPREP_SEL_MODIFY'.
RS_SELFIELD-TABINDEX contains the header table index for which the item entries are to be put in the global item output table (T_OUTTAB_SLAVE). The Callback is only called if ALV has no items for a header that is to be expanded.
RFLG_ALL is passed with 'X' if the user shows all items. The application must ensure that entries are not repeated in the item table.
RS_SELFIELD is initial in this case.
3. Slis_ev_caller_exit_at_start TYPE slis_formname VALUE 'CALLER_EXIT'.
Is called at the beginning of the function module to make special settings. It is not usually used.
4. Slis_ev_user_command TYPE slis_formname VALUE 'USER_COMMAND'.
As this is a frequently-used Callback event, the form routine can also be passed directly in the interface by passing the user command in the IMPORTING parameter I_CALLBACK_USER_COMMAND.
5. Slis_ev_top_of_page TYPE slis_formname VALUE 'TOP_OF_PAGE'.
Equivalent to the list processing TOP-OF-PAGE event.
6. Slis_ev_top_of_coverpage TYPE slis_formname VALUE 'TOP_OF_COVERPAGE'.
The selection information and list status are output together (if they exist) on a separate page by default
7. Slis_ev_end_of_coverpage TYPE slis_formname VALUE 'END_OF_COVERPAGE'.
Analogously to TOP_OF_COVERPAGE the user can add other information
to the information output by ALV (selection information, list status) at this event.
8. Slis_ev_foreign_top_of_page TYPE slis_formname VALUE FOREIGN_TOP_OF_PAGE'.
The Top-of-page event is always processed in ALV and is only passed to the caller via the Callback mechanism. This is still the case if the caller, e.g. by a user action, processes a branch list which was not formatted by ALV (e.g. a popup with additional information about the list record selected and displayed by ALV).
In this case, top-of-page cannot be formatted by ALV analogously to the basic list, it must be handled completely by the caller. The event top-of-page still occurs in ALV. When ALV notices a top-of-page which was not caused by an ALV output, the form routine in FOREIGN_TOP_OF_PAGE is called.
9. Slis_ev_foreign_end_of_page TYPE slis_formname VALUE 'FOREIGN_END_OF_PAGE'.
The event end-of-page is always processed in ALV and only passed to the caller via callback. This is still the case, e.g. when the caller processes a details list which was not formatted by ALV (e.g. a popup with further information about selected list records which were displayed by ALV).
In this case, end-of-page cannot be formatted by ALV analogously to the basic list, it must be handled completely by the caller. The event end-of-page still occurs in ALV. When ALV notices an end-of-page that was not caused by an ALV output, the form routine in FOREIGN_END_OF_PAGE is called.
10. Slis_ev_pf_status_set TYPE slis_formname VALUE 'PF_STATUS_SET'.
If a user list status is to be set, it must be done in the form routine assigned to this event. The ALV function codes, which must not be active, are in the Parameter RT_EXTAB. This table must be passed with the SET PF-STATUS command (with inactive user function codes as well, if necessary).
The STANDARD status of the function group SALV should be used as a template for a user-specific status. As this is a frequently used Callback event, its form routine can also be passed directly in the interface in the IMPORTING parameter I_CALLBACK_PF_STATUS_SET.
11. Slis_ev_list_modify TYPE slis_formname VALUE 'LIST_MODIFY'.
LIST_MODIFY USING R_TABNAME TYPE SLIS_TABNAME
R_INDEX LIKE SY-TABIX
R_INDEX_ITEM LIKE SY-TABIX
R_INDEX_SUM LIKE SY-TABIX.
12. Slis_ev_top_of_list TYPE slis_formname VALUE 'TOP_OF_LIST'.
Information output at the start of the list
13. Slis_ev_end_of_page TYPE slis_formname VALUE 'END_OF_PAGE'.
Information output at the end of a page. This is only called for printing.
14. Slis_ev_end_of_list TYPE slis_formname VALUE 'END_OF_LIST'.
Information output at the end of the list
15. Slis_ev_after_line_output TYPE slis_formname VALUE 'AFTER_LINE_OUTPUT'.
Output information after each output line. Should only be used in justified cases because it costs a lot of performance.
16. Slis_ev_before_line_output TYPE slis_formname VALUE 'BEFORE_LINE_OUTPUT'.
Output information before each output line. Should only be used in justified cases because it costs a lot of performance.
17. Slis_ev_subtotal_text TYPE slis_formname VALUE 'SUBTOTAL_TEXT'.
This event table (I_EVENTS) is now checked with the desired constants. If the desired constant is found, then the corresponding field for the FORM NAME is populated with the name of the routine containing the corresponding event.
Sample code :
FORMNAME_TOP_OF_PAGE TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
FORMNAME_END_OF_PAGE TYPE SLIS_FORMNAME VALUE 'END_OF_PAGE', FORMNAME_USER_COMMAND TYPE SLIS_FORMNAME VALUE 'USER_COMMAND'.
DATA: L_I_EVENT TYPE SLIS_ALV_EVENT.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = I_EVENTS.
READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
INTO L_I_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_TOP_OF_PAGE TO L_I_EVENT-FORM.
APPEND L_I_EVENT TO I_EVENTS.
ENDIF.
READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_END_OF_PAGE
INTO L_I_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_END_OF_PAGE TO L_I_EVENT-FORM.
APPEND L_I_EVENT TO I_EVENTS.
ENDIF.
CLEAR L_I_EVENT.
READ TABLE I_EVENTS WITH KEY NAME = SLIS_EV_USER_COMMAND
INTO L_I_EVENT.
IF SY-SUBRC = 0.
MOVE FORMNAME_USER_COMMAND TO L_I_EVENT-FORM.
APPEND L_I_EVENT TO I_EVENTS.
ENDIF.
This will prepare the events table for the report.
The report will contain three forms for the above events:
1. FORM TOP_OF_PAGE: This form will contain the top of page event for the report i.e. header etc
Using the function module REUSE_ALV_COMMENTARY_WRITE, the internal table containing the headings for top of page event can be passed to the list output. Also, any logo specific to the report can be passed to the function module.
2. FORM END_OF_PAGE: This form will contain the end of page event for the report i.e. footer etc
3. FORM USER_COMMAND: This form will contain the desired user command i.e. pick/line selection
hope this helps
Regards
Abdullah -
What is the Event in ALV to handle a mark/demark?
Hi togehter,
I´m looking for the event to react on a mark or demark in ALV OO.
Thanks in advance,
SebastianHi,
Check with the [Select or Deselect the row of ALV|Row Select in ALV]
Hope it helps you.
Regareds! -
Capture the event in java : JVMMI_EVENT_OUT_OF_MEMORY
Hi,
Is it possible for a java class to be notified by the JVMMI_EVENT_OUT_OF_MEMORY ( JVMMI interface event)?
I can create a JNI shared library to capture this event, then notify the java class.
Is there a way to do it without any JNI shared lib?
Thanks a lot.
JimmyI also face that problem.Returning from Manager is Vector and vector size is over 80000 so the JSP and Excel can't load that amount of data.
How can I fix that problem -
How to capture the event on changing focus from a JTextField?
Hi All,
I have got a problem...
I want to do something (say some sort of validations/calculations) when I change the focus by pressing tab from a JTextField. But I am not able to do that.
I tried with DocumentListener (jtf01.getDocument().addDocumentListener(this);). But in that case, it's calling the event everytime I ke-in something in the text field. But that's not what I want. I want to call that event only once, after the value is changed (user can paste a value, or even can key-in).
Is there any way for this? Is there any method (like onChange() in javascript) that can do this.
Please Help me...
Regards,
UjjalHi Michael,
I am attaching my code. Actual code is very large containing 'n' number of components and ActionListeners. I am attaching only the relevant part.
//more codes
public class PaintSplitDisplay extends JApplet implements ActionListener
JFrame jf01;
JPanel jp01;
JTextField jtf01, jtf02;
//more codes
public void start()
//more codes
jtf01 = new JTextField();
jtf01.setPreferredSize(longField);
jtf01.setFont(new Font("Courier new",0,12));
jtf01.setInputVerifier(new InputVerifier(){public boolean verify(JComponent input)
//more codes
System.out.print("updating");
jtf02.setText("updated value");
System.out.print("updated");
return true;
//more codes
jtf02 = new JTextField();
jtf02.setPreferredSize(mediumField);
jtf02.setEditable(false);
jp01.add(jtf02, gbc);
//more codes
jf01.add(jp01);
jf01.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jf01.setVisible(true);
//more codes
public static void main(String args[])
PaintSplitDisplay psp = new PaintSplitDisplay();
psp.start();
public void actionPerformed(ActionEvent ae)
//more codes
}As you can see I want to update the second JTextField based on some calculations. That should happen when I change the focus from my frist JTextField. I have called jtf02.setText() method inside InputVerifier. But it's giving error...
Please suggest...
Ujjal -
Capture the text in ALV grid output
Hi Friends,
I have created a alv grid report, in that i have to edit one field by using EDIT, i am editign that field.
Since i am working on interactive alv ( if user keeps the cursor on that row and he presses the push button) i want to capture that entered text in interactive alv.
Can any one help me
Regards,
DVNSHi,
Please refer to SAP standard demo program BCALV_TEST_GRID_EDITABLE.
Thanks,
Sriram Ponna.
Maybe you are looking for
-
Lumia 1520 Battery Discharge Issue After Updating ...
After updating to Denim, my Nokia Lumia 1520 started to experience the following symptoms: Phone charges to 100%, I disconnect and use an app like Instagram BETA, Internet Explorer, Lumia Camera, or any game--after no more than 5 minutes of use, the
-
hi, I have to create a info package whicah can load data from last saturday of april 07 to last friday of the may07. if i m sheduling the info pack on 1 june it must load data from 28th april to 25th may. please help i m not good in coding. any help
-
JAR suddenly not working on double click...
I have a program that I have been working on for the past few months. I want to run it from the desktop in the form of a .jar file. I use netbeans to create the jar file. In previous versions, this has worked very well. With the most recent build, I
-
Hi As we all know Java treat character literals as Unicode characters. I have been studying Unicode and the way they treat characters and I have a doubt which is not specific to Java code but specific to Unicode. Unicode states that each character is
-
Can i Include a Google Doc Form in the animation?
That