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

Issue when calling ALV from module pool

Former Member
0 Likes
680

Hi Gurus,

Issue:I am calling an alv report from a module pool i.e from PAI Event.

Below is the code

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = i_events.

READ TABLE i_events INTO wa_events WITH KEY name = 'USER_COMMAND'.

IF sy-subrc EQ 0.

wa_events-form = 'USER_COMMAND'.

MODIFY i_events FROM wa_events TRANSPORTING form WHERE name =

wa_events-name.

ENDIF.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = repid

i_callback_user_command = 'USER_COMMAND'

it_fieldcat = i_ztal_prof1_cat[]

i_save = 'A'

it_events = i_events

TABLES

t_outtab = i_ztal_prof1.

But above fuction module is not triggering ' i_callback_user_command = 'USER_COMMAND' ' when i am selecting a line in the alv.

Any help in this reg will be appreciated.

'

6 REPLIES 6
Read only

Former Member
0 Likes
641

Hi Vamshi

you must create a form like follow for catch the event.


form user_command using r_ucomm     like sy-ucomm
                               rs_selfield type slis_selfield.
 
  case r_ucomm.
    when '&IC1'. "for double click
      if rs_selfield-fieldname = '...'.
              ......
      endif.
  endcase.
endform.                    "USER_COMMAND

Best regards

Marco

Read only

0 Likes
641

yes i did that,but still the form is not getting called from PBO/PAI event.

Read only

0 Likes
641

Hi

try with this code

remove


READ TABLE i_events INTO wa_events WITH KEY name = 'USER_COMMAND'.
IF sy-subrc EQ 0.
wa_events-form = 'USER_COMMAND'.
MODIFY i_events FROM wa_events TRANSPORTING form WHERE name =
wa_events-name.
ENDIF.

and change alv


CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_user_command = 'USER_COMMAND'
it_fieldcat = i_ztal_prof1_cat[]
i_save = 'A'
TABLES
t_outtab = i_ztal_prof1.

Marco

Read only

0 Likes
641

Hey Menegazzo Marco .

It worked,sorry for the before message.

Thanks a lot for the solution.

Have a nice day.

Edited by: vamshi sreerangam on May 6, 2010 1:09 PM

Read only

0 Likes
641

Have you given a transaction to your ALV report?

If yes,

Why dont you write

CALL TRANSACTION 'ZXYZ'

IN Pai SUBROUTINE FOR THAT PUSHBUTTON?

Regards,

Sumit

Read only

0 Likes
641

Hi....

well have a nice day you to,

Marco