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

REUSE_ALV_GRID_DISPLAY drill down problem

Former Member
0 Likes
686

Hi all,

I've searched through the forums and can't find out why my code doesn't work when I try to double-click to drill-down on my report. I've tried a number of variations including the usage of "status" and "events" but none have worked. I'd like the simplest solution. Can anyone provide any suggestions please?

In my code, the break-point is never reached.


form display_alv_report.
  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_callback_program       = wa_repid
      it_fieldcat              = it_fcat[]
      it_sort                  = it_sort[]
      i_save                   = 'A'
      i_callback_user_command  = 'USER_COMMAND'
    tables
      t_outtab                 = it_data
    exceptions
      program_error            = 1
      others                   = 2.
  if sy-subrc <> 0.
    write:
      / 'Returncode',
        sy-subrc,
        'from function REUSE_ALV_LIST_DISPLAY'.
  endif.
endform.                                             "display_alv_report

form user_command using r_ucomm like sy-ucomm
                        rs_selfield  type slis_selfield.
  break-point.
  case r_ucomm.
    when '&IC1'.
      read table it_data into wa_data index rs_selfield-tabindex.
      set parameter id 'BUK' field wa_data-bukrs.
      set parameter id 'AN1' field wa_data-anln0.
      call transaction 'AW01N'.
  endcase.
endform.                                           "user_command

Thanks in advance! Points will be awarded for helpful answers.

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
609

John, your code looks pretty good to me. Once thing though, make sure that you are filling the wa_repid variable before the function call.

wa_repid = sy-repid.

Regards,

Rich Heilman

Hi all,

I've searched through the forums and can't find out why my code doesn't work when I try to double-click to drill-down on my report. I've tried a number of variations including the usage of "status" and "events" but none have worked. I'd like the simplest solution. Can anyone provide any suggestions please?

In my code, the break-point is never reached.


form display_alv_report.
  call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
      i_callback_program       = wa_repid
      it_fieldcat              = it_fcat[]
      it_sort                  = it_sort[]
      i_save                   = 'A'
      i_callback_user_command  = 'USER_COMMAND'
    tables
      t_outtab                 = it_data
    exceptions
      program_error            = 1
      others                   = 2.
  if sy-subrc <> 0.
    write:
      / 'Returncode',
        sy-subrc,
        'from function REUSE_ALV_LIST_DISPLAY'.
  endif.
endform.                                             "display_alv_report

form user_command using r_ucomm like sy-ucomm
                        rs_selfield  type slis_selfield.
  break-point.
  case r_ucomm.
    when '&IC1'.
      read table it_data into wa_data index rs_selfield-tabindex.
      set parameter id 'BUK' field wa_data-bukrs.
      set parameter id 'AN1' field wa_data-anln0.
      call transaction 'AW01N'.
  endcase.
endform.                                           "user_command

Thanks in advance! Points will be awarded for helpful answers.

3 REPLIES 3
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
610

John, your code looks pretty good to me. Once thing though, make sure that you are filling the wa_repid variable before the function call.

wa_repid = sy-repid.

Regards,

Rich Heilman

Read only

0 Likes
609

Thanks, Rich! I totally overlooked this value. It works now! You're awesome!

Read only

0 Likes
609

Woooohoooo! Someone actually did the same thing the other day, which is why it was my first thought. Glad that it worked out for ya.

Regards,

Rich Heilman