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

regarding interactive ALV report

Former Member
0 Likes
979

Dear All,

i have a problem with create interactive ALV report, i want to display 2 different ALV in same report, my requirement is i have a 2 internal table, and 1st ITAB i shown in a output data, once i click into a docno of the alv output then display 2nd ITAB data in a sub screen on ALV grid in the same program because of i calculate some amount in 2nd ITAB.

please help me how to do it.

Regards,

Abhilash

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
944

Refer to below pseudo code

FORM z_display_grid_alv .

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
      i_callback_program                = sy-repid
      i_callback_user_command           = 'Z_USER_COMMAND'
      i_callback_top_of_page            = 'Z_TOP_OF_PAGE'
      it_fieldcat                       = t_fieldcat
    TABLES
      t_outtab                          = t_outtab
   EXCEPTIONS
     program_error                     = 1
     OTHERS                            = 2
            .
  IF sy-subrc <> 0.
  ENDIF.

ENDFORM.                    " Z_DISPLAY_ALV
*&---------------------------------------------------------------------*
*&      Form  Z_USER_COMMAND
*&---------------------------------------------------------------------*
*       User command ALV GRID
*----------------------------------------------------------------------*
*      -->R_UCOMM      text
*      -->RS_SELFIELD  text
*----------------------------------------------------------------------*
FORM z_user_command USING r_ucomm     LIKE sy-ucomm
                          rs_selfield TYPE slis_selfield.
  CASE r_ucomm.
    WHEN '&IC1'.
      READ TABLE t_outtab INTO wa_outtab INDEX rs_selfield-tabindex.
      IF sy-subrc = 0.
        PERFORM z_prepare_list_field_catalog.  " Field catalog for drill down.
        PERFORM z_populate_details_value.      " Populating data in table to display.
        PERFORM z_event_call.                  " Event for list display
        PERFORM z_populate_event.              " Populating envent table
        PERFORM z_display_list_alv.            " Display details of line selected
      ENDIF.
  ENDCASE.
ENDFORM.                    "Z_USER_COMMAND

9 REPLIES 9
Read only

Former Member
0 Likes
944

once u click on the docnum in 1st alv, u need to write to display second alv in the USER COMMAND

*User actions on ALV

FORM user_command USING r_ucomm TYPE sy-ucomm

rs_selfield TYPE slis_selfield.

CASE r_ucomm.

WHEN '&IC1'. " ON DOUBLE CLICK

  • HERE u select ur data accoring to the docnum slected and store it in a second internal table

  • and display it.

END CASE.

U have lot of posts in SCN. please chk it.

Read only

0 Likes
944

hi Kalyan,

Thanks for u r reply,

i have done this work, but how to display it, i am getting following error in display 2nd alv.

"The current application triggered a termination with a short dump"

how to display it.

abhilash

Read only

0 Likes
944

HI,

debud your program. Try to get the point which is raising this error.

Read only

matt
Active Contributor
0 Likes
944

Please use a meaningful subject in future.

matt

Read only

former_member224008
Active Participant
0 Likes
944

This message was moderated.

Read only

0 Likes
944

hi Arun,

there is no any link please repost.

abhilash

Read only

Former Member
0 Likes
944

Hi,

Use the following code for your requirement.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = sy-repid

i_callback_user_command = 'USER_COMMAND'

i_callback_pf_status_set = 'PFSTATUS'

it_fieldcat = it_fieldcat

is_layout = it_layout

it_event_exit = it_eventexit

i_screen_start_column = 10

i_screen_start_line = 20

i_screen_end_column = 70

i_screen_end_line = 45

TABLES

t_outtab = itab.

FORM user_command USING r_ucomm TYPE sy-ucomm

rs_selfield TYPE slis_selfield.

CASE r_ucomm.

WHEN '&IC1'.

READ TABLE itab INDEX rs_selfield-tabindex INTO wa.

(logic for second internal table)

ENDCASE.

ENDFORM.

More detailed information you can get from internet search.

Hope it will solve your problem.

Read only

Former Member
0 Likes
945

Refer to below pseudo code

FORM z_display_grid_alv .

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
      i_callback_program                = sy-repid
      i_callback_user_command           = 'Z_USER_COMMAND'
      i_callback_top_of_page            = 'Z_TOP_OF_PAGE'
      it_fieldcat                       = t_fieldcat
    TABLES
      t_outtab                          = t_outtab
   EXCEPTIONS
     program_error                     = 1
     OTHERS                            = 2
            .
  IF sy-subrc <> 0.
  ENDIF.

ENDFORM.                    " Z_DISPLAY_ALV
*&---------------------------------------------------------------------*
*&      Form  Z_USER_COMMAND
*&---------------------------------------------------------------------*
*       User command ALV GRID
*----------------------------------------------------------------------*
*      -->R_UCOMM      text
*      -->RS_SELFIELD  text
*----------------------------------------------------------------------*
FORM z_user_command USING r_ucomm     LIKE sy-ucomm
                          rs_selfield TYPE slis_selfield.
  CASE r_ucomm.
    WHEN '&IC1'.
      READ TABLE t_outtab INTO wa_outtab INDEX rs_selfield-tabindex.
      IF sy-subrc = 0.
        PERFORM z_prepare_list_field_catalog.  " Field catalog for drill down.
        PERFORM z_populate_details_value.      " Populating data in table to display.
        PERFORM z_event_call.                  " Event for list display
        PERFORM z_populate_event.              " Populating envent table
        PERFORM z_display_list_alv.            " Display details of line selected
      ENDIF.
  ENDCASE.
ENDFORM.                    "Z_USER_COMMAND

Read only

Former Member
0 Likes
944

thanks to all solved it.