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

using fm REUSE?

former_member194669
Active Contributor
0 Likes
788

Hi,

I need to use REUSE_GRID_DISPLAY function module to display like the following


--------------------------------------------------------------------------------------------------------------------------
List of material numbers that don't have plant associated with that, please change the material using 
transaction MM02

10001      TEST
10002      TEST2
10003      TEST3
10004      TEST4

Please add correct values to the fields shown above and save the Material
-----------------------------------------------------------------------------------------------------------------------

Please give your suggestions on this.

Thanks

aRs

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
674

Hi,

Try this sample code..


TYPE-POOLS: slis.

DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
DATA: BEGIN OF wa_ekko,
ebeln like ekko-ebeln,
ekorg like ekko-ekorg,
ekgrp like ekko-ekgrp,
END OF wa_ekko.

DATA: v_repid TYPE syrepid.
v_repid = sy-repid.

DATA it_ekko LIKE STANDARD TABLE OF wa_ekko WITH HEADER LINE.

SELECT * UP TO 100 ROWS
FROM ekko
INTO CORRESPONDING FIELDS OF TABLE it_ekko.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
     EXPORTING
          i_program_name     = v_repid
          i_internal_tabname = 'WA_EKKO'
          i_inclname         = v_repid
     CHANGING
          ct_fieldcat        = gt_fieldcat.


* Events
  DATA: t_events TYPE  slis_t_event,
        s_events LIKE LINE OF t_events.

  s_events-name = 'TOP_OF_PAGE'.
  s_events-form = 'TOP_OF_PAGE'.
  APPEND s_events TO t_events.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
     EXPORTING
          i_callback_program      = v_repid
          it_fieldcat             = gt_fieldcat
          it_events               = t_events[]
     TABLES
          t_outtab                = it_ekko.

*---------------------------------------------------------------------*
*       FORM TOP_OF_PAGE                                              *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
FORM top_of_page.
  WRITE: / 'My alv report'.
  WRITE: / SY-ULINE.
ENDFORM.

Thanks,

Naren

4 REPLIES 4
Read only

amit_khare
Active Contributor
0 Likes
674

You cannot have the top and below lines as the part of the ALV.

But they can be displayed as HEADER and FOOTER of the ALV.

But again for Header, it can only be displayed on the left side of the screen with the maximum of 60 characters in a line.

Regards,

Amit

Reward all helpful replies.

Read only

Former Member
0 Likes
674

Hi,

I believe you can do this in the fm REUSE_ALV_LIST_DISPLAY..

Using WRITE: / SY-ULINE..in the top_of_page event..

Thanks,

Naren

Read only

former_member194669
Active Contributor
0 Likes
674

Naren,

Thanks for your reply,

Is there any example program already available in ?

aRs

Read only

Former Member
0 Likes
675

Hi,

Try this sample code..


TYPE-POOLS: slis.

DATA: gt_fieldcat TYPE slis_t_fieldcat_alv.
DATA: BEGIN OF wa_ekko,
ebeln like ekko-ebeln,
ekorg like ekko-ekorg,
ekgrp like ekko-ekgrp,
END OF wa_ekko.

DATA: v_repid TYPE syrepid.
v_repid = sy-repid.

DATA it_ekko LIKE STANDARD TABLE OF wa_ekko WITH HEADER LINE.

SELECT * UP TO 100 ROWS
FROM ekko
INTO CORRESPONDING FIELDS OF TABLE it_ekko.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
     EXPORTING
          i_program_name     = v_repid
          i_internal_tabname = 'WA_EKKO'
          i_inclname         = v_repid
     CHANGING
          ct_fieldcat        = gt_fieldcat.


* Events
  DATA: t_events TYPE  slis_t_event,
        s_events LIKE LINE OF t_events.

  s_events-name = 'TOP_OF_PAGE'.
  s_events-form = 'TOP_OF_PAGE'.
  APPEND s_events TO t_events.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
     EXPORTING
          i_callback_program      = v_repid
          it_fieldcat             = gt_fieldcat
          it_events               = t_events[]
     TABLES
          t_outtab                = it_ekko.

*---------------------------------------------------------------------*
*       FORM TOP_OF_PAGE                                              *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
FORM top_of_page.
  WRITE: / 'My alv report'.
  WRITE: / SY-ULINE.
ENDFORM.

Thanks,

Naren