Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV

Former Member
0 Likes
536

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
518

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./

5 REPLIES 5
Read only

Former Member
0 Likes
519

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./

Read only

0 Likes
518

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

Read only

0 Likes
518

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.

Read only

peter_ruiz2
Active Contributor
0 Likes
518

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

Read only

Former Member
0 Likes
518

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