‎2008 Aug 30 8:12 AM
Hi,
My requirement is, in ALV grip display,
for example : if i enter material number and press enter, material description, material group, material type, industry type unit of measure etc, should be fetch and get displayed
i know the function code to save, back, etc, but I didn't fine function code for enter button even after debugging.
Please tel me the options
Thank you
‎2008 Aug 30 8:15 AM
By Default There is No Function Code for Enter key. You need to set the Function code For Enter. using PF_STATUS_SET event.
I hope you know how to set the PF-STATUS in case of ALV./
‎2008 Aug 30 8:15 AM
By Default There is No Function Code for Enter key. You need to set the Function code For Enter. using PF_STATUS_SET event.
I hope you know how to set the PF-STATUS in case of ALV./
‎2008 Aug 30 1:10 PM
hi,
Vijay, i already used pf status set but by using this if the cursor is on command field then only the function code is working but when the cursor is on table and pressing enter, it is not taking the function code
i want to execute a block a code when ever user press enter as in module pool when we press enter the whole program get executed, but i want jst a block of code to be executed
im not using OOPs concept.
Thank you
Edited by: Naseer uddin on Aug 30, 2008 2:11 PM
‎2008 Aug 30 5:12 PM
Yes you need to manually Click the Green Tick Button, if you don't want that Then in that case you need to use hotspot option.
Using the Hotspot option it triggeres automatically. here you don't need to enter also.
‎2008 Aug 30 8:20 AM
Hi Naseer,
you would have to override the DATA_CHANGED event of ALV Grid
if you are using OOP, you can create a new class like this.
CLASS lcl_event_receiver DEFINITION.
PUBLIC SECTION.
METHODS:
handle_data_changed
FOR EVENT data_changed OF cl_gui_alv_grid
IMPORTING er_data_changed.
ENDCLASS.
CLASS lcl_event_receiver IMPLEMENTATION.
METHOD handle_data_changed.
PERFORM fl_datachange USING er_data_changed.
ENDMETHOD.
ENDCLASS.
and set the event handler to this class.
DATA lo_event TYPE REF TO lcl_event_receiver.
CREATE OBJECT lo_event.
SET HANDLER lo_event->handle_data_changed FOR lo_alvg2.
then create a new sub-routine like this.
FORM fl_datachange USING pi_datac TYPE REF TO cl_alv_changed_data_protocol.
<do your processing here>.
ENDFORM.
regards,
Peter
‎2008 Aug 31 5:01 AM
The most simple way for you to do it is to use the user_command module.
in the module implementation use the following.
case sy-ucomm.
when 'SAVE'.
....................
when 'EXIT'.
leave program.
endcase.
Regards,
Rebeka