2009 Jan 08 12:07 PM
Hi Experts,
I am working on ALV Grid , Data is Displayed in Grid well , But Can Any one please tell me how can i capture the event (back,exit and cancel) which is persent on standard toolbar on ALV Gried output .
Rgds,
Premraj
2009 Jan 08 1:03 PM
Hi PremRaj,
To capture the event (back,exit and cancel) which is present on standard toolbar on ALV Grid output, go to the PBO screen of the ALV output and put a PF-STATUS for the output screen and in that pf-status Function Key section declare the BACK, CANCEL and EXIT for the corresponding icon it will capture the event for that particular button.
some code snippet..
*---------------------------------------------------------------------*
* MODULE PBO OUTPUT *
*---------------------------------------------------------------------*
module pbo output.
set pf-status 'MAIN100'.
set titlebar 'MAIN100'.
*
*
<your code portion>
endmodule.Best Regards,
Sayak..
Hi Experts,
I am working on ALV Grid , Data is Displayed in Grid well , But Can Any one please tell me how can i capture the event (back,exit and cancel) which is persent on standard toolbar on ALV Gried output .
Rgds,
Premraj
2009 Jan 08 12:09 PM
Hi,
Use this document,
Hope this will help you a lot with ALV Grid Control.
Or use links:-
Hope this helps you.
Thanks & Regards,
Tarun Gambhir
Edited by: Tarun Gambhir on Jan 8, 2009 5:46 PM
2009 Jan 08 12:20 PM
HI.
Refer this link.
http://sap4.com/wiki/index.php?title=Mantenimiento_de_tablas_con_ALV
http://sap.niraj.tripod.com/id64.html
Regards.
Jay
2009 Jan 08 12:36 PM
Hello PremRaj ,
Please find an dummy program to capture the events below:
TYPE-POOLS slis.
DATA: ITAB_EVENTS TYPE slis_t_event,
WA_EVENTS TYPE SLIS_ALV_EVENT.
DATA: IT_END TYPE SLIS_T_LISTHEADER,
WA_END TYPE SLIS_LISTHEADER.
** This function module will get all the events present in alv into internal table itab_events*
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = ITAB_EVENTS
EXCEPTIONS
LIST_TYPE_WRONG = 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.
** With this read table statement itab_events is read for the desired event*+
READ TABLE itAB_eventS INTO wa_eventS WITH KEY name = 'END_OF_LIST'.
wa_eventS-form = 'END'.
MODIFY itAB_eventS FROM wa_eventS INDEX sy-tabix.
CLEAR wa_eventS.
*Pass the ITAB_EVENTS created in this Function Module
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
IT_EVENTS = ITAB_EVENTS
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_tab
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.
*READ TABLE itAB_eventS INTO wa_eventS WITH KEY name = 'END_OF_LIST'.
wa_eventS-form = 'END'.
MODIFY itAB_eventS FROM wa_eventS INDEX sy-tabix.
CLEAR wa_eventS.
*in these statements ,the second line will automatically try to call subroutine with name end.
FORM END.
WA_END-TYP = 'S'.
WA_END-KEY = TEXT-004.
WA_END-INFO = SY-DATUM.
APPEND WA_end TO IT_END.
CLEAR WA_END.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = IT_END
I_LOGO =
I_END_OF_LIST_GRID =
I_ALV_FORM =
.
ENDFORM.
Hope it helps you.
Thanks Mansi
Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 11:02 AM
Edited by: MANSI ASNANI on Jan 9, 2009 7:31 AM
2009 Jan 08 1:03 PM
Hi PremRaj,
To capture the event (back,exit and cancel) which is present on standard toolbar on ALV Grid output, go to the PBO screen of the ALV output and put a PF-STATUS for the output screen and in that pf-status Function Key section declare the BACK, CANCEL and EXIT for the corresponding icon it will capture the event for that particular button.
some code snippet..
*---------------------------------------------------------------------*
* MODULE PBO OUTPUT *
*---------------------------------------------------------------------*
module pbo output.
set pf-status 'MAIN100'.
set titlebar 'MAIN100'.
*
*
<your code portion>
endmodule.Best Regards,
Sayak..
2009 Jan 08 3:58 PM
Hi Experts,
I am working on ALV Grid , Data is Displayed in Grid well , But Can Any one please tell me how can i capture the event (back,exit and cancel) which is persent on standard toolbar on ALV Gried output .
Rgds,
Premraj
Assuming you are using FM to display grid you can use below parameter to specify that you need to capture specified FCODE
*" REFERENCE(IT_EVENT_EXIT) TYPE SLIS_T_EVENT_EXIT OPTIONAL
Structure of SLIS_T_EVENT is
types: begin of slis_event_exit.
types: ucomm like sy-ucomm,
before(1) type c,
after(1) type c,
end of slis_event_exit.
Insert three row in table IT_EVENT_EXIT and with FCODE in UCOMM
and put X in BEFORE or AFTER. Then your USER_COMMAND form
will be called accordingly.
FCODE you need are
Back - &F03
Exit- &F15
Cancel- &F12
Edited by: Pawan Kesari on Jan 8, 2009 9:29 PM
2009 Jan 09 4:31 AM
2009 Jan 09 5:04 AM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |