Single click event in alv grid.
Hi Experts,
i have done will my code..everything is working perfectly, but having an issue..pls help me...
in my output screen i have 2 check-boxes,when i select both of them i shuld get a message saying select only one..this is done when am using double click. Is single click possible in alv-grid...
please help me.
thanks.
anusha
Hi Anusha,
Did you Try by using get_selected_rows(Method)?
If the selected rows are 2 display a message such that 'Select only One record'.
data t_roid type lvc_t_roid.
CALL METHOD r_grid->get_selected_rows
IMPORTING
et_row_no = t_roid.
READ TABLE t_roid INDEX 1 TRANSPORTING NO FIELDS."to know how many No.Of records selected
if sy-tfill > 1.
Message 'Please Select only one record' type 'I'.
Exit.
endif.
Similar Messages
-
Handling Right & Left Click Events in ALV Grid
Hi Friends,
Please give me the idea how to handle Right & Left mouse Click Events in ALV Grid.
My requirement is that when i click on the grid i need to pop up a message.
Eagerly waiting for your replies
Thanks
Satishyou have to Define a class and implement event handler methods for this purpose.
and the following events can help.
LEFT_CLICK_DESIGN
LEFT_CLICK_RUN
Regards
Raja -
Handle single click event in ALV OOPS
Hi,
I have to display 2 ALV grid...one above the other.
Top ALV will contain Header info and bottom ALV witll display line item.
I am use ALV OOPS.
Now when user will click on the top ALV ...bottom ALV should show corresponding data.
I don't have to use HOTSPOT or Double click event.
How can I handle single click event.
Please guide me..thanks in advance
Regards,
Prasoonhi,
for this in ALV OOPS take <b>2 custom containers( cl_gui_custom_container)</b>in the same screen and on the 1st container display the header data<b>(use set_tale_for_first_display method of class cl_gui_alv_grid)</b>.
On the 2nd screen item data for this use<b> EVENT</b> handling(you want <b>single click</b>). use<b> hotspot_click</b> or <b>button_click </b>events.
for this you have to register the events. the code for that.
<b>CLASS lcl_event_handler DEFINITION .</b>
PUBLIC SECTION .
METHODS:
*--Hotspot click control
handle_hotspot_click
FOR EVENT hotspot_click OF cl_gui_alv_grid
IMPORTING e_row_id e_column_id es_row_no ,
*--To control button clicks
handle_button_click
FOR EVENT button_click OF cl_gui_alv_grid
IMPORTING e_oject e_ucomm .
PRIVATE SECTION.
ENDCLASS.
<b>CLASS lcl_event_handlerIMPLEMENTATION .</b>
*--Handle Hotspot Click
METHOD handle_hotspot_click .
PERFORM handle_hotspot_click USING e_row_id e_column_id es_row_no .
ENDMETHOD .
METHOD handle_button_click .
PERFORM handle_button_click USING e_object e_ucomm .
ENDMETHOD .
ENDCLASS .
DATA gr_event_handler TYPE REF TO lcl_event_handler .
<b>*--Creating an instance for the event handler</b>
CREATE OBJECT gr_event_handler.
<b>*--Registering handler methods to handle ALV Grid events</b>
SET HANDLER gr_event_handler->handle_hotspot_click FOR gr_alvgrid .
SET HANDLER gr_event_handler->handle_button_click FOR gr_alvgrid .
do n't forget to use<b> refresh_table_display
</b> other wise only the record which you first you clicked will display in the 2nd container.
<b>Reward points for useful Answers</b> -
How to trigger single click event in ALV
Hi Experts,
I am trying to raise an event in a module pool program whereby an event will be triggered on a single click of a particular row in the ALV.
My requirement is that in the table display , which is being handled OO method, once the user clicks on a particular row - the details of the row should be displayed in another part of the screen.
I have used hotspots and done this - but I do not want all my entries underlined.Hi Atish,
Is there any other way to trigger the single click event in the ALV grid display for a particular row ? I have come across an event CLICK_ROW_COL, which I think may solve the problem, however this is a protected event and whenever I try to access it , I get the error that a protected event cannot be accessed.
Edited by: Aditya Niyogi on May 14, 2008 6:33 AM -
Hi all ,
In the code below ,
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
DATA: L_TA TYPE SY-TCODE VALUE 'SLIS_DUMMY'.
CASE R_UCOMM.
WHEN 'WAHL'. "menubutton
READ TABLE GT_OUTTAB INDEX RS_SELFIELD-TABINDEX. "cursorposit.
IF SY-SUBRC = 0.
SUBMIT SLIS_DUMMY WITH P_CARRID EQ GT_OUTTAB-CARRID
WITH P_CONNID EQ GT_OUTTAB-CONNID.
ENDIF.
CLEAR R_UCOMM.
WHEN '&IC1'. "doubleclick
READ TABLE GT_OUTTAB INTO GT_OUTTAB INDEX RS_SELFIELD-TABINDEX.
IF SY-SUBRC = 0.
SUBMIT SLIS_DUMMY WITH P_CARRID EQ GT_OUTTAB-CARRID
WITH P_CONNID EQ GT_OUTTAB-CONNID.
ENDIF.
CLEAR R_UCOMM.
ENDCASE.
ENDFORM.
this ( WHEN 'WAHL'.) is for "menubutton click.
& this ('&IC1'.) is for "doubleclick.
Anyone have any idea what should be the return command for single click in grid ?Hi Manish,
here a short examle:
REPORT ZGRO_TEST MESSAGE-ID ZZ NO STANDARD PAGE HEADING.
TABLES: VBAK.
TYPE-POOLS: SLIS.
INCLUDE <ICON>.
DATA: PROGNAME LIKE SY-REPID,
FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
EVENT_EXIT TYPE SLIS_T_EVENT_EXIT,
EVENTS TYPE SLIS_T_EVENT.
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
KUNNR LIKE VBAK-KUNNR,
ICON LIKE ICONS-L4 VALUE ICON_OKAY,
END OF ITAB.
START-OF-SELECTION.
SELECT * FROM VBAK UP TO 100 ROWS.
ITAB-VBELN = VBAK-VBELN.
ITAB-KUNNR = VBAK-KUNNR.
APPEND ITAB.
ENDSELECT.
PERFORM AUSGABE_ALV_GRID.
END-OF-SELECTION.
FORM AUSGABE_ALV_GRID.
PROGNAME = SY-REPID.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = PROGNAME
I_INTERNAL_TABNAME = 'ITAB'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = PROGNAME
CHANGING
CT_FIELDCAT = FIELDCAT.
PERFORM SPALTENEIGENSCHAFTEN USING FIELDCAT.
DATA: WA_EVENT_EXIT TYPE SLIS_EVENT_EXIT.
MOVE: '&IC1' TO WA_EVENT_EXIT-UCOMM,
'X' TO WA_EVENT_EXIT-BEFORE.
APPEND WA_EVENT_EXIT TO EVENT_EXIT.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = PROGNAME
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IT_FIELDCAT = FIELDCAT
IT_EVENT_EXIT = EVENT_EXIT
TABLES
T_OUTTAB = ITAB
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
ENDFORM.
FORM SPALTENEIGENSCHAFTEN USING P_FIELDCAT
TYPE SLIS_T_FIELDCAT_ALV.
DATA: WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
LOOP AT P_FIELDCAT INTO WA_FIELDCAT.
CASE WA_FIELDCAT-FIELDNAME.
WHEN 'ICON'.
MOVE 'X' TO WA_FIELDCAT-HOTSPOT.
MOVE 'X' TO WA_FIELDCAT-ICON.
ENDCASE.
MODIFY P_FIELDCAT INDEX SY-TABIX FROM WA_FIELDCAT .
ENDLOOP.
ENDFORM.
FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
READ TABLE ITAB INDEX RS_SELFIELD-TABINDEX.
IF R_UCOMM EQ '&IC1'.
SET PARAMETER ID 'AUN' FIELD itab-VBELN.
CALL TRANSACTION 'VA03' AND SKIP FIRST SCREEN.
ENDIF.
ENDFORM.
Have a nice weekend,
Regards, Dieter -
LEFT_CLICK_RUN event of ALV Grid Control
Hello,
What is the use of LEFT_CLICK_RUN event of the CL_GUI_ALV_GRID control. I thought it gets triggered when we click on the ALV Grid. But nothing as such is happening.
I had defined the event and then implemented it. I had even registered the event to the Grid Control. But when I am clicking on the Grid control, this event is not gettin triggered.
My requirement is I need to get a popup when I click on a particular field of a ALV Grid Control.
PriyaHi Priya,
Please check demo program BCALV_GRID_06, it shows how to create a context menu when you right-click on the list.
Hope this may help you.
Regards,
Lanka -
Click Event on ALV using cl_gui_alv_grid (DYNPRO)
How can I implement a listener for a click on ALV.
If I click on my ALV grid, for example PBA should be triggered. Is that possible?
Now it seems that nothing happens when I click on ALV.
Can anyone help?Hi Ezachiael,
you dont have to trigger event DOUBLE_CLICK, it will be triggered, in case of double click :-).
You have to implent event handling class and event handler method - It is quite simple.
Check out this [Reference on SDN|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907].
Regards
REA -
About double click event in ALV report
Hi all,
I want to program a double-click event in ALV reprot.
I am not suppose to use module pool approach for the same.
If a user double clicks on the any of the row of ALV report, the transaction should get called.
Again, I am using function 'REUSE_ALV_GRID_DISPLAY' for displaying ALV.
Can you please help me to solve this?
Thanks,
-SiddhiHi Sidhi,
You can do it easily by using Reuse_ALV_GRID_DISPALY.
The User Command subroutine which you pass to this function module in that you can check which field is selected and what is the value of that and also you can get the table index.
I am giving you a code example where interactivity of ALV report is done .
*& Report ZRAIL_LOT_REPORT
REPORT zrail_lot_report.
TABLES :qals,aufk.
TYPE-POOLS:slis.
TYPES:BEGIN OF x_lot,
sel(1) TYPE c, "SELECTION
prueflos TYPE qals-prueflos, "INSPECTION LOT NUMBER
werk TYPE qals-werk, "PLANT
losmenge TYPE qals-losmenge, "LOT QUANTITY
mengeneinh TYPE qals-mengeneinh, "BASE UNIT OF MEASURE FOR THE INSPECTION LOT QUANTITY
matnr TYPE qals-matnr, " MATERIAL NO. ATTACHED TO ORDER
zzequnr TYPE qals-zzequnr, "EQUIPMENT NO.
zzassembly TYPE qals-zzassembly, "ASSEMBLY
herkunft TYPE qals-herkunft, "INSPECTION LOT ORIGIN
aufnr TYPE qals-aufnr, "ORDER NO.
sttxt TYPE qals_d02-sttxt, "LOT STATUS
objnr TYPE qals-objnr, "OBJECT NUMBER
enstehdat TYPE qals-enstehdat, "lot creation date
pruefer TYPE qamr-pruefer, "Name of the Inspector
END OF x_lot.
TYPES:BEGIN OF x_ordmat,
aufnr TYPE aufk-aufnr, "Order No.
equnr TYPE afih-equnr, "Equipment No. attached to Order
zmatnr TYPE aufk-zmatnr, "Material No. attached to Order
bautl TYPE afih-bautl, "Assembly attached to Order
END OF x_ordmat.
TYPES:BEGIN OF x_status,
objnr TYPE jest-objnr,
stat TYPE jest-stat,
txt04 TYPE tj02t-txt04,
END OF x_status.
DATA:it_qals TYPE STANDARD TABLE OF x_lot,
wa_qals TYPE x_lot.
DATA:it_ordmat TYPE TABLE OF x_ordmat,
wa_ordmat TYPE x_ordmat.
DATA:it_status TYPE STANDARD TABLE OF x_status,
wa_status TYPE x_status.
DATA:mytabix TYPE sy-tabix.
DATA: wa_layout TYPE slis_layout_alv,
wa_fieldcat TYPE slis_fieldcat_alv,
it_fieldcat TYPE TABLE OF slis_fieldcat_alv,
it_fcat TYPE TABLE OF slis_fieldcat_alv.
DATA:mytabix1 TYPE sy-tabix.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS: s_werks FOR qals-werk,
s_zmatnr FOR aufk-zmatnr,
s_assbly FOR qals-zzassembly,
s_equnr FOR qals-zzequnr,
s_lotor FOR qals-herkunft,
s_lotdat FOR qals-enstehdat.
SELECTION-SCREEN END OF BLOCK b1.
INITIALIZATION.
s_lotdat-low = sy-datum - 7.
s_lotdat-high = sy-datum.
APPEND s_lotdat.
START-OF-SELECTION.
PERFORM get_data_qals.
PERFORM build_fieldcat.
PERFORM display_data.
EXIT.
END-OF-SELECTION.
*& Form get_data_qals
text
--> p1 text
<-- p2 text
FORM get_data_qals .
IF it_qals[] IS INITIAL.
SELECT a~prueflos
a~werk
a~losmenge
a~mengeneinh
a~zzequnr
a~zzassembly
a~herkunft
a~aufnr
a~objnr
a~matnr
a~enstehdat
b~pruefer
FROM qals AS a INNER JOIN qamr AS b
ON aprueflos = bprueflos
INTO CORRESPONDING FIELDS OF TABLE it_qals
WHERE werk IN s_werks
AND zzassembly IN s_assbly
AND zzequnr IN s_equnr
AND herkunft IN s_lotor
AND enstehdat IN s_lotdat.
ENDIF.
IF it_ordmat[] IS INITIAL.
SELECT a~aufnr
a~zmatnr
b~bautl
b~equnr
FROM aufk AS a INNER JOIN afih AS b
ON aaufnr = baufnr
INTO CORRESPONDING FIELDS OF TABLE it_ordmat FOR ALL ENTRIES IN it_qals
WHERE a~aufnr = it_qals-aufnr
AND zmatnr IN s_zmatnr.
ENDIF.
IF it_status[] IS INITIAL.
SELECT a~objnr
a~stat
b~txt04
FROM tj02t AS b
INNER JOIN jest AS a ON bistat = astat
INTO CORRESPONDING FIELDS OF TABLE it_status FOR ALL ENTRIES IN it_qals
WHERE a~objnr = it_qals-objnr
AND b~spras = sy-langu
AND a~inact = space.
ENDIF.
LOOP AT it_qals INTO wa_qals.
mytabix = sy-tabix.
READ TABLE it_ordmat INTO wa_ordmat WITH KEY aufnr = wa_qals-aufnr.
IF sy-subrc = 0.
IF wa_qals-herkunft = '14'.
wa_qals-matnr = wa_ordmat-zmatnr.
wa_qals-zzequnr = wa_ordmat-equnr.
wa_qals-zzassembly = wa_ordmat-bautl.
MODIFY it_qals FROM wa_qals INDEX mytabix TRANSPORTING matnr zzassembly zzequnr.
ENDIF.
ENDIF.
LOOP AT it_status INTO wa_status WHERE objnr = wa_qals-objnr.
CONCATENATE wa_qals-sttxt wa_status-txt04 INTO wa_qals-sttxt SEPARATED BY space.
CLEAR :wa_status.
ENDLOOP.
MODIFY it_qals FROM wa_qals INDEX mytabix TRANSPORTING sttxt.
CLEAR :wa_qals,wa_ordmat,mytabix.
ENDLOOP.
IF s_zmatnr[] IS NOT INITIAL.
DELETE it_qals WHERE matnr IS INITIAL.
ENDIF.
ENDFORM. " get_data_qals
*& Form build_fieldcat
text
--> p1 text
<-- p2 text
FORM build_fieldcat .
wa_layout-zebra = 'X'.
wa_layout-colwidth_optimize = 'X'.
wa_layout-box_fieldname = 'SEL'.
wa_layout-box_tabname = 'IT_QALS'.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME =
i_internal_tabname = 'IT_QALS'
i_structure_name = 'QALS_D02'
I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME =
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
CHANGING
ct_fieldcat = it_fieldcat
IF sy-subrc = 0.
LOOP AT it_fieldcat INTO wa_fieldcat.
CASE wa_fieldcat-fieldname .
WHEN 'PRUEFLOS'.
wa_fieldcat-col_pos = 1.
wa_fieldcat-hotspot = 'X'.
APPEND wa_fieldcat TO it_fcat.
WHEN 'WERK'.
wa_fieldcat-col_pos = 3.
APPEND wa_fieldcat TO it_fcat.
WHEN 'LOSMENGE'.
wa_fieldcat-col_pos = 4.
wa_fieldcat-no_out = ''.
APPEND wa_fieldcat TO it_fcat.
WHEN 'MENGENEINH'.
wa_fieldcat-col_pos = 5.
wa_fieldcat-no_out = ''.
APPEND wa_fieldcat TO it_fcat.
WHEN 'ZZEQUNR'.
wa_fieldcat-col_pos = 6.
wa_fieldcat-no_out = ''.
wa_fieldcat-hotspot = 'X'.
APPEND wa_fieldcat TO it_fcat.
WHEN 'ZZASSEMBLY'.
wa_fieldcat-col_pos = 7.
wa_fieldcat-no_out = ''.
wa_fieldcat-hotspot = 'X'.
APPEND wa_fieldcat TO it_fcat.
WHEN 'HERKUNFT'.
wa_fieldcat-col_pos = 8.
APPEND wa_fieldcat TO it_fcat.
WHEN 'AUFNR'.
wa_fieldcat-col_pos = 9.
wa_fieldcat-hotspot = 'X'.
APPEND wa_fieldcat TO it_fcat.
WHEN 'ENSTEHDAT'."enstehdat
wa_fieldcat-col_pos = 10.
APPEND wa_fieldcat TO it_fcat.
WHEN 'STTXT'.
wa_fieldcat-col_pos = 12.
wa_fieldcat-hotspot = 'X'.
APPEND wa_fieldcat TO it_fcat.
WHEN OTHERS.
ENDCASE.
CLEAR wa_fieldcat.
ENDLOOP.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-tabname = 'IT_QALS'.
wa_fieldcat-col_pos = 2.
wa_fieldcat-ref_tabname = 'AUFK'.
wa_fieldcat-hotspot = 'X'.
wa_fieldcat-seltext_l = 'Material No.'.
APPEND wa_fieldcat TO it_fcat.
wa_fieldcat-fieldname = 'PRUEFER'.
wa_fieldcat-tabname = 'IT_QALS'.
wa_fieldcat-col_pos = 11.
wa_fieldcat-ref_tabname = 'QAMR'.
wa_fieldcat-seltext_l = 'Name of the Inspector'.
APPEND wa_fieldcat TO it_fcat.
ENDIF.
ENDFORM. " build_fieldcat
*& Form display_data
text
--> p1 text
<-- p2 text
FORM display_data .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZRAIL_LOT_REPORT'
I_CALLBACK_PF_STATUS_SET = ' '
i_callback_user_command = 'USER_COMMAND'
is_layout = wa_layout
it_fieldcat = it_fcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
TABLES
t_outtab = it_qals
EXCEPTIONS
PROGRAM_ERROR = 1
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.
ENDFORM. " display_data
*& Form USER_COMMAND
text
-->R_UCOMM text
-->RS_SELFIELD text
FORM user_command USING r_ucomm TYPE sy-ucomm rs_selfield TYPE slis_selfield.
CASE rs_selfield-fieldname .
WHEN 'PRUEFLOS'.
SET PARAMETER ID 'QLS' FIELD rs_selfield-value.
CALL TRANSACTION 'QA03' AND SKIP FIRST SCREEN.
WHEN 'ZZEQUNR'.
SET PARAMETER ID 'EQN' FIELD rs_selfield-value.
CALL TRANSACTION 'IE03' AND SKIP FIRST SCREEN.
WHEN 'ZMATNR'.
SET PARAMETER ID 'MAT' FIELD rs_selfield-value.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
WHEN 'ZZASSEMBLY'.
SET PARAMETER ID 'MAT' FIELD rs_selfield-value.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
WHEN 'AUFNR'.
SET PARAMETER ID 'ANR' FIELD rs_selfield-value.
CALL TRANSACTION 'IW33' AND SKIP FIRST SCREEN.
WHEN 'STTXT'.
MOVE rs_selfield-tabindex TO mytabix1.
PERFORM show_status.
ENDCASE.
ENDFORM. "USER_COMMAND
*& Form show_status
text
--> p1 text
<-- p2 text
FORM show_status .
DATA:it_systat TYPE TABLE OF bapi2045ss,
wa_sysstat TYPE bapi2045ss,
it_bapi2045us TYPE TABLE OF bapi2045us.
DATA:it_fsys TYPE TABLE OF slis_fieldcat_alv.
DATA:insplot TYPE bapi2045d_il0-insplot.
DATA:language TYPE bapi2045la.
CLEAR wa_qals.
READ TABLE it_qals INTO wa_qals INDEX mytabix1.
insplot = wa_qals-prueflos.
language-langu = sy-langu.
CALL FUNCTION 'BAPI_INSPLOT_GETSTATUS'
EXPORTING
number = insplot
language = language
TABLES
system_status = it_systat
user_status = it_bapi2045us.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZRAIL_LOT_REPORT'
i_internal_tabname = 'IT_SYSTAT'
i_structure_name = 'BAPI2045SS'
CHANGING
ct_fieldcat = it_fsys.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZRAIL_LOT_REPORT'
it_fieldcat = it_fsys
TABLES
t_outtab = it_systat.
ENDFORM. " show_status
IIn the subrouitne the User command the Parameter rs_selfield will give you the selected or clicked field and its value its record no .
I hope this will help you. -
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... -
Print all slides in single click event
I have 10 quiz slides in captivate 5.5. Now my client wnats to print all the slides at the single click event. I have already used the Captivate inbuild Print widget, but its print the current slide only. Please help me on this.....
Thanks
KarthikThere is no current way to do this with standard Captivate functionality.
If this is really important to your client, you'll need to create a PDF document with screenshots of the 10 quiz slides, and link this document to a button within the course module. Participants can then click the button to open and print the document.
If anyone has a better idea, I'm open to it. -
SharePoint JS grid paging, capturing values using single click event
Hi
I need some help with getting the following work using the SharePoint JS grid, the reference articles available are not sufficient to continue work.
1) Setting up Paging
2) Capturing individual field values on single click or any other relevant event.
Sample code or references would be of great help.
References
http://msdn.microsoft.com/en-us/library/office/ee535898(v=office.14).aspx
http://answers.flyppdevportal.com/categories/sharepoint2010/sharepoint2010programming.aspx?ID=d6e32632-d0e4-4337-95c3-c2d06fc3ef86
http://answers.flyppdevportal.com/categories/sharepoint2010/sharepoint2010programming.aspx?ID=5c952c6d-b2be-4563-b805-b00e7c8136ff
http://msdn.microsoft.com/en-us/library/ff681039.aspx
http://social.msdn.microsoft.com/Forums/en-US/a439fcc2-42de-45ca-9f74-935498e0d246/js-grid-oncelleditcompleted-event-infinitely-fired?forum=project2010custprog
Thanks,
Sharat
Sharat Menon (Sharepoint Developer)Hi,
Please try to use PagingFilter class to achieve paging in JS Grid.
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.jsgrid.pagingfilter.aspx
Here is a similar thread for you to take a look at:
https://go4answers.webhost4life.com/Example/sharepoint-jsgrid-2692.aspx
If you want to implement more complex functionalities for a list, I suggest you use SPGridView to achieve it.
Best regards
Dennis Guo
TechNet Community Support -
hi,
Hi,
I am displaying some fields from VBAP in ALV gid and have give drop down check box to storage location making it editable so if the user changes Storage location of
some entries and clicks SAVE button, when we click save button i need to capture all the rows that were been changed and update VA02 using these records through bapi.
but iam not able to capture this SAVE event but iam able to capture Enter and cursor event.
i have written following code for this
LOCAL CLASSES: Definition
class lcl_event_receiver: local class to handle event CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_data_changed
FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING er_data_changed.
PRIVATE SECTION.
ENDCLASS. "lcl_event_receiver DEFINITION
LOCAL CLASSES: Implementation
class lcl_event_receiver (Implementation)
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_data_changed.
DATA: l_error_in_data TYPE c.
PERFORM handle_data_changed USING er_data_changed l_error_in_data.
*§7.Display application log if an error has occured.
IF l_error_in_data EQ 'X'.
CALL METHOD er_data_changed->display_protocol.
ENDIF.
ENDMETHOD. "handle_data_changed
ENDCLASS. "lcl_event_receiver IMPLEMENTATION
*& Form handle_data_changed
Identify columns which were changed and check input
-->P_ER_DATA_CHANGED text
FORM handle_data_changed USING p_er_data_changed
TYPE REF TO cl_alv_changed_data_protocol
p_error_in_data TYPE c.
DATA : lw_mod_cell TYPE lvc_s_modi ,
l_value TYPE lvc_value ,
l_lgort TYPE lgort_d.
SORT p_er_data_changed->mt_mod_cells BY row_id .
LOOP AT p_er_data_changed->mt_mod_cells INTO lw_mod_cell
WHERE fieldname = 'LGORT'.
CALL METHOD p_er_data_changed->get_cell_value
EXPORTING
i_row_id = lw_mod_cell-row_id
i_fieldname = 'LGORT'
IMPORTING
e_value = l_value.
SELECT SINGLE lgort FROM t001l INTO l_lgort WHERE werks = p_werks
AND lgort = l_value.
IF sy-subrc NE 0.
In case of error, create a protocol entry in the *application log.
CALL METHOD p_er_data_changed->add_protocol_entry
EXPORTING
i_msgid = '0K'
i_msgno = '000'
i_msgty = 'E'
i_msgv1 = text-003
i_msgv2 = l_value
i_msgv3 = text-004
i_fieldname = lw_mod_cell-fieldname
i_row_id = lw_mod_cell-row_id.
p_error_in_data = 'X'.
EXIT.
ELSE.
*§5b.If the value is valid change values of
cells.
CALL METHOD p_er_data_changed->modify_cell
EXPORTING
i_row_id = lw_mod_cell-row_id
i_fieldname = lw_mod_cell-fieldname
i_value = l_value.
READ TABLE t_list1 INTO w_list1 INDEX lw_mod_cell-row_id.
IF sy-subrc EQ 0.
*comparing old value with the changed value
IF w_list1-lgort <> l_value.
MOVE: w_list1-werks TO w_list3-werks,
w_list1-matnr TO w_list3-matnr,
w_list1-arktx TO w_list3-arktx,
w_list1-vbeln TO w_list3-vbeln,
w_list1-posnr TO w_list3-posnr,
w_list1-pstyv TO w_list3-pstyv,
w_list1-vstel TO w_list3-vstel,
w_list1-auart TO w_list3-auart,
w_list1-kwmeng TO w_list3-kwmeng,
w_list1-vrkme TO w_list3-vrkme,
w_list1-mbdat TO w_list3-mbdat,
l_value TO w_list3-lgort.
APPEND w_list3 TO t_list3.
*t_list3 will contain all the records that are changed
CLEAR w_list3.
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
*& Module STATUS_0100 OUTPUT
text
MODULE status_0100 OUTPUT.
SET PF-STATUS 'MAIN100'.
SET TITLEBAR 'MAIN100'.
IF go_custom_container IS INITIAL.
create a custom container control for our ALV Control
CREATE OBJECT go_custom_container
EXPORTING
container_name = g_cont_on_main
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
IF sy-subrc NE 0.
Display error message.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = sy-repid
txt2 = sy-subrc
txt1 = 'The control could not be created'.
ENDIF.
create an instance of alv control
CREATE OBJECT go_grid
EXPORTING
i_parent = go_custom_container.
*If display or change radio button is cheked
IF ( p_chng = 'X' OR p_disp = 'X' ) .
Set a titlebar for the grid control
g_layout-grid_title = 'Sales Orders'.
g_layout-excp_fname = 'TRAFFIC_LIGHT'.
Define a drop down table.
PERFORM set_drdn_table.
CALL METHOD go_grid->set_table_for_first_display
EXPORTING
is_layout = g_layout
CHANGING
it_outtab = t_list1
it_fieldcatalog = t_fieldcat1
EXCEPTIONS
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
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.
ENDIF.
register ENTER and CURSOR to raise event DATA_CHANGED.
(Per default the user may check data by using the check icon).
CALL METHOD go_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
CALL METHOD go_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
CREATE OBJECT g_event_receiver.
SET HANDLER g_event_receiver->handle_double_click FOR go_grid.
SET HANDLER g_event_receiver->handle_hotspot_click FOR go_grid .
SET HANDLER g_event_receiver->handle_data_changed FOR go_grid .
ENDIF.
CALL METHOD cl_gui_control=>set_focus
EXPORTING
control = go_grid.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module USER_COMMAND_0100 INPUT
text
MODULE user_command_0100 INPUT.
ok_code = sy-ucomm.
CASE ok_code.
WHEN 'EXIT'.
PERFORM exit_program.
WHEN 'SAVE'.
PERFORM update_sales_order using t_list3[].
endcase.
Thanks in Advance,
SiriHi Sirisha,
You can get the event code for Enter because you have regitered in the event reciever .
But for the SAVE you will have to set in the PF-status of the screen and not the ALV-grid save .
Please award if helpful. -
Enabling screen for single click in OOABAP alvs
Hello All,
I have a requirement where I am displaying ALV grid in screen 100. In this grid I have defined double click event in which I call 101 screen (with coordinates i.e. starting at 10 10) which displays another grid. The problem here is that in screen 101 the buttons and screen fields are not responding to single click. I mean that for every action (change the cell value in 101 screen ot selecting a row or clicking on pushbutton in this 101 screen) I have to click twice. But I want all this actions to be performed with single click. If anyone knows the solution to know please let me know.
Note: <b>Helpful answers will be duly rewarded.</b>Please do not make duplicate postings.
Rob -
hi all,
Is there any way to handle the single click/tick on checkbox. Is there user command on that? For now, if we will click on the checkbox, the changes made on it does not reflect. I checked on the debugging mode, checkbox is not populated/ marked even if it was ticked by the user.
thanks in advance.Hi Akira,
For Controling Check Box , you have to use grid display using customised Container screen.
From there you can control check Box .
CREATE OBJECT custom_container
EXPORTING container_name = o_container.
CREATE OBJECT o_grid
EXPORTING i_parent = custom_container.
Form for building the fieldcatalog
PERFORM build_fieldcat CHANGING it_fieldcat.
Form for excluding the unwanted functionalities from the toolbar.
PERFORM exclude_tb_functions CHANGING it_exclude.
Method for displaying the ALV grid.
CALL METHOD o_grid->set_table_for_first_display
EXPORTING
is_layout = it_layout
it_toolbar_excluding = it_exclude
CHANGING
it_fieldcatalog = it_fieldcat
it_outtab = it_final.
CREATE OBJECT o_event_receiver.
Setting the event handlers for events toolbar, usercommand and datachange.
SET HANDLER o_event_receiver->catch_toolbar FOR o_grid.
SET HANDLER o_event_receiver->catch_user_command FOR o_grid.
SET HANDLER o_event_receiver->catch_datachange FOR o_grid.
Set editable cells to ready for input.
CALL METHOD o_grid->set_ready_for_input
EXPORTING
i_ready_for_input = 1. -
How can I use hotspot click in an ALV grid?
Hello,
I have a table that is displayed in an ALV grid and I would like to have one of the columns as clickable icons.
For example:
Print | Doc. Type | Name
(icon) | .docx | first
(icon) | .pdf | second ... and so on.
I would like to click in the icon (Print column) and execute an action, but no matter what I do I can't set the action.
I know that is not just setting "fieldcatalog-hotspot='X'", but I don't know how to use a hotspot handler.
Here's some of the code I have:
TYPES: BEGIN OF ty_docs,
print LIKE ICON-ID,
doc_type LIKE table_doc-TYPE,
name LIKE table_doc-NAME,
END OF ty_docs.
DATA: oref_dock TYPE REF TO cl_gui_docking_container,
oref_alv TYPE REF TO cl_gui_alv_grid,
i_fieldcat TYPE lvc_t_fcat,
aux_fieldcat TYPE lvc_s_fcat,
aux_lay TYPE lvc_s_layo,
i_exclude TYPE TABLE OF syucomm,
i_docs TYPE ty_docs,
t_docs LIKE TABLE OF i_docs.
AT SELECTION-SCREEN OUTPUT.
APPEND 'ONLI' TO i_exclude.
APPEND 'SJOB' TO i_exclude.
APPEND 'PRIN' TO i_exclude.
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = sy-pfkey
p_program = sy-repid
TABLES
p_exclude = i_exclude.
AT SELECTION-SCREEN.
CHECK sy-ucomm = space.
SELECT
icon~ID AS print
doc~TYPE AS doc_type
doc~NAME as name
INTO CORRESPONDING FIELDS OF TABLE t_docs
FROM table_doc AS doc
INNER JOIN ICON AS icon
ON icon~NAME EQ 'ICON_PRINT'
GROUP BY icon~ID doc~TYPE doc~NAME.
IF sy-subrc = 0.
IF oref_dock IS NOT BOUND.
CREATE OBJECT oref_dock
EXPORTING
repid = sy-repid
dynnr = sy-dynnr
side = cl_gui_docking_container=>dock_at_bottom
ratio = 90
EXCEPTIONS
OTHERS = 1.
ENDIF.
IF oref_alv IS NOT BOUND.
CHECK oref_dock IS BOUND.
CREATE OBJECT oref_alv
EXPORTING
i_parent = oref_dock
EXCEPTIONS
OTHERS = 1.
CHECK oref_alv IS BOUND.
aux_fieldcat-fieldname = 'PRINT'.
aux_fieldcat-coltext = 'Print'.
aux_fieldcat-ref_table = 't_docs'.
aux_fieldcat-ref_field = 't_docs-print'.
aux_fieldcat-edit = ''.
aux_fieldcat-just = 'C'.
aux_fieldcat-hotspot = 'X'.
aux_fieldcat-outputlen = 10.
aux_fieldcat-col_pos = 0.
APPEND aux_fieldcat TO i_fieldcat.
CLEAR aux_fieldcat.
aux_fieldcat-fieldname = 'TYPE'.
aux_fieldcat-coltext = 'Doc. Type'.
aux_fieldcat-ref_table = 't_docs'.
aux_fieldcat-ref_field = 't_docs-doc_type'.
aux_fieldcat-edit = ''.
aux_fieldcat-outputlen = 15.
aux_fieldcat-col_pos = 1.
APPEND aux_fieldcat TO i_fieldcat.
CLEAR aux_fieldcat.
aux_fieldcat-fieldname = 'NAME'.
aux_fieldcat-coltext = 'Name'.
aux_fieldcat-ref_table = 't_docs'.
aux_fieldcat-ref_field = 't_docs-name'.
aux_fieldcat-edit = ''.
aux_fieldcat-outputlen = 12.
aux_fieldcat-col_pos = 2.
APPEND aux_fieldcat TO i_fieldcat.
CLEAR aux_fieldcat.
aux_lay-grid_title = 'Docs'.
aux_lay-edit = ''.
CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = 'ty_docs'
i_internal_tabname = 't_docs'
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
OTHERS = 3.
CALL METHOD oref_alv->set_table_for_first_display
EXPORTING
i_structure_name = 'ty_docs'
is_layout = aux_lay
CHANGING
it_fieldcatalog = i_fieldcat
it_outtab = t_docs
EXCEPTIONS
OTHERS = 1.
ELSE.
CALL METHOD oref_alv->refresh_table_display
EXCEPTIONS
OTHERS = 1.
ENDIF.
ENDIF.
Thank you so much in advance!Hi,
After creating grid set the even handler for hot spot.
SET HANDLER lcl_event_receiver=>handle_hotspot_click FOR alv_grid.
Try this code:
TABLES: mara,t001l.
DATA: BEGIN OF i_alv OCCURS 0,
matnr TYPE mara-matnr,
mtart TYPE mara-mtart,
matkl TYPE mara-matkl,
groes TYPE mara-groes,
maktx TYPE makt-maktx,
END OF i_alv.
DATA: wa_alv LIKE LINE OF i_alv.
DATA: alv_container TYPE REF TO cl_gui_docking_container.
DATA: alv_grid TYPE REF TO cl_gui_alv_grid.
DATA: layout TYPE lvc_s_layo.
DATA: fieldcat TYPE lvc_t_fcat.
DATA: gt_t001l TYPE STANDARD TABLE OF t001l.
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
*-->Method for User command
CLASS-METHODS :
handle_hotspot_click FOR EVENT hotspot_click OF
cl_gui_alv_grid
IMPORTING E_ROW_ID e_column_id.
ENDCLASS. "lcl_event_receiver DEFINITION
* CLASS lcl_event_receiver IMPLEMENTATION
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_hotspot_click.
READ TABLE i_alv INTO wa_alv
INDEX e_row_id-index
TRANSPORTING matnr.
SET PARAMETER ID 'MAT' FIELD wa_alv-matnr.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
ENDMETHOD. "handle_double_click
ENDCLASS. "lcl_event_receiver IMPLEMENTATION
PARAMETERS: p_check TYPE matnr.
INITIALIZATION.
PERFORM get_data.
AT SELECTION-SCREEN OUTPUT.
* START-OF-SELECTION.
DATA: variant TYPE disvariant.
DATA: repid TYPE sy-repid.
repid = sy-repid.
variant-report = sy-repid.
variant-username = sy-uname.
layout-zebra = 'X'.
layout-edit_mode = 'X'.
CHECK alv_container IS INITIAL.
CREATE OBJECT alv_container
EXPORTING repid = repid
dynnr = sy-dynnr
side = alv_container->dock_at_right
extension = 350.
CREATE OBJECT alv_grid
EXPORTING
i_parent = alv_container.
* Set event handler
SET HANDLER lcl_event_receiver=>handle_hotspot_click FOR alv_grid.
* ALV Specific. Data selection.
* Populate Field Catalog
PERFORM get_fieldcatalog.
CALL METHOD alv_grid->set_table_for_first_display
EXPORTING
is_layout = layout
is_variant = variant
i_save = 'U'
i_structure_name = 'I_ALV'
CHANGING
it_outtab = i_alv[]
it_fieldcatalog = fieldcat[].
START-OF-SELECTION.
* FORM GET_DATA
FORM get_data.
SELECT * INTO CORRESPONDING FIELDS OF TABLE i_alv
FROM mara
INNER JOIN makt
ON mara~matnr = makt~matnr
UP TO 100 ROWS
WHERE makt~spras = sy-langu.
SORT i_alv ASCENDING BY matnr.
ENDFORM. "get_data
* Form Get_Fieldcatalog - Set Up Columns/Headers
FORM get_fieldcatalog.
DATA: ls_fcat TYPE lvc_s_fcat.
REFRESH: fieldcat.
CLEAR: ls_fcat.
ls_fcat-reptext = 'Material Number'.
ls_fcat-fieldname = 'MATNR'.
ls_fcat-ref_table = 'I_ALV'.
ls_fcat-outputlen = '18'.
ls_fcat-fix_column = 'X'.
ls_fcat-key = 'X'.
ls_fcat-hotspot = 'X'.
ls_fcat-col_pos = '1'.
APPEND ls_fcat TO fieldcat.
CLEAR: ls_fcat.
ls_fcat-reptext = 'Material Type'.
ls_fcat-fieldname = 'MTART'.
ls_fcat-ref_table = 'I_ALV'.
ls_fcat-outputlen = '10'.
ls_fcat-fix_column = 'X'.
ls_fcat-key = 'X'.
ls_fcat-col_pos = '2'.
APPEND ls_fcat TO fieldcat.
CLEAR: ls_fcat.
ls_fcat-reptext = 'Material Group'.
ls_fcat-fieldname = 'MATKL'.
ls_fcat-ref_table = 'I_ALV'.
ls_fcat-outputlen = '12'.
ls_fcat-col_pos = '3'.
APPEND ls_fcat TO fieldcat.
CLEAR: ls_fcat.
ls_fcat-reptext = 'Size'.
ls_fcat-fieldname = 'GROES'.
ls_fcat-ref_table = 'I_ALV'.
ls_fcat-outputlen = '30'.
ls_fcat-col_pos = '4'.
APPEND ls_fcat TO fieldcat.
CLEAR: ls_fcat.
ls_fcat-reptext = 'Material Description'.
ls_fcat-fieldname = 'MAKTX'.
ls_fcat-ref_table = 'I_ALV'.
ls_fcat-outputlen = '40'.
ls_fcat-col_pos = '5'.
APPEND ls_fcat TO fieldcat.
ENDFORM. "get_fieldcatalog
Hope this solves your problem....
Maybe you are looking for
-
Contact groups not complete in Communication Centr...
I'm using Communication Centre 7.1.40.1 on Windows XP with SP3 in order to edit contacts on a Nokia 6300i via bluetooth. Contact groups created on the 6300i are not displayed correctly in the Communication Centre, eg. a group with 17 contacts appears
-
FAQ: Installing Elements 10, or What do all these disks do?
When you purchase Photoshop and/or Premiere Elements 10 as a boxed product, you get a fair number of disks. The main reason for this is that a boxed product purchase of Elements is dual platform, that is, it's for both Windows and Macintosh. When dea
-
Ultiboard 12 - bug exporting gerber X
Hi, I believe there is a bug in Ultiboard 12, gerber X handling. If you export a layer in gerber X format, the files are generated and correctly interpreted by ultiboard 12. The bug becomes apparent when one opens the created gerber files on third pa
-
HP 4200 series Printer Drivers
I am having a problem getting a new HP Deskjet F4280 to print. When I send a document to print, all the normal functions happen from selecting the number of copies , etc, and the print progress bar shows up and fills in but it never prints. The jobs
-
How to download existing apps from old to new phone?
how does one download existing apps to new phone from old? please help.