‎2007 May 23 3:58 PM
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
‎2007 May 23 4:19 PM
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
‎2007 May 23 4:04 PM
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.
‎2007 May 23 4:09 PM
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
‎2007 May 23 4:12 PM
Naren,
Thanks for your reply,
Is there any example program already available in ?
aRs
‎2007 May 23 4:19 PM
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