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

About FM ALV user_command Event

Former Member
0 Likes
2,715

Hi All !

In FM ALV user_command event .

Why can't Process sy-ucomm with 'BACK'.

" code

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

CASE r_ucomm.

WHEN 'BACK'.

" don't process this event

WHEN 'CANC' .

" do process this event

ENDCASE.

Regards.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,571

u can try this...


DATA: it_event_exit TYPE slis_t_event_exit,
      is_event_exit TYPE slis_event_exit.


is_event_exit-ucomm = '&F03'.      "back
is_event_exit-before = 'X'.
APPEND is_event_exit TO it_event_exit.

is_event_exit-ucomm = '&F12'.      "Cancel
is_event_exit-before = 'X'.
APPEND is_event_exit TO it_event_exit.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
 EXPORTING
   i_callback_user_command           = 'USER_COMMAND'
   it_event_exit                     = it_event_exit
.......

*&---------------------------------------------------------------------*
*&      Form  USER_COMMAND
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM user_command USING rucomm rs_selfield TYPE slis_selfield.
  break-point.
ENDFORM.                    "USER_COMMAND

Edited by: Sukriti Saha on Oct 23, 2008 12:01 PM

Hi All !

In FM ALV user_command event .

Why can't Process sy-ucomm with 'BACK'.

" code

FORM user_command USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

CASE r_ucomm.

WHEN 'BACK'.

" don't process this event

WHEN 'CANC' .

" do process this event

ENDCASE.

Regards.

6 REPLIES 6
Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,571

Hello ,

Are you using reuse_alv_lsit_display?

Rgds,

Sandeep

Read only

0 Likes
1,570

Hi .

so. i used 'REUSE_ALV_GRID_DISPLAY'.

Regards.

Read only

Former Member
0 Likes
1,570

Hi,

Try

Using '&F03' in place of back and '&F12 in place of cancel.

Read only

Former Member
0 Likes
1,570

try like this..

are you using your own status, or standard one. if so change the code like this..

FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.

CASE r_ucomm.
WHEN '&F03'.           "if you don't set any status and using the standard one
" don't process this event
WHEN '&F12' .                     "if you don;t set any status
" do process this event
ENDCASE.

Read only

former_member342104
Participant
0 Likes
1,570

CHECH YOUR CREATED BUTTONS

Read only

Former Member
0 Likes
1,572

u can try this...


DATA: it_event_exit TYPE slis_t_event_exit,
      is_event_exit TYPE slis_event_exit.


is_event_exit-ucomm = '&F03'.      "back
is_event_exit-before = 'X'.
APPEND is_event_exit TO it_event_exit.

is_event_exit-ucomm = '&F12'.      "Cancel
is_event_exit-before = 'X'.
APPEND is_event_exit TO it_event_exit.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
 EXPORTING
   i_callback_user_command           = 'USER_COMMAND'
   it_event_exit                     = it_event_exit
.......

*&---------------------------------------------------------------------*
*&      Form  USER_COMMAND
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM user_command USING rucomm rs_selfield TYPE slis_selfield.
  break-point.
ENDFORM.                    "USER_COMMAND

Edited by: Sukriti Saha on Oct 23, 2008 12:01 PM