04-26-2006 5:36 AM
Hi,
I want a ALV Grid report with Details pages & at last(next page) Summary report can any one suggest how to perform this
regards
Bobby
04-26-2006 5:41 AM
Hi,
I don't think it will be possible in the screen display. However, you probably can do that in the print option where you can enable the END-OF-LIST / END-OF-PAGE events. You can print the summary over there.
On the second the thought on the screen you probably can write the summary using the REUSE_ALV_COMMENTARY_WRITE, but this will write the summary on the top.
However, if you can develope the report using the OO ALV Controls, then you can have the summary at the bottom.
<b> I just looked at the function REUSE_ALV_COMMENTARY_WRITE more closely and there is a parameter I_END_OF_LIST_GRID and if you set this to X, your summary that you are passing to the function will be printed at the bottom.</b>
Regards,
Ravi
Note : Please mark all the helpful answers and close the thread if this resolves your issue
Message was edited by: Ravikumar Allampallam
04-26-2006 6:19 AM
Hai Bobby
the following code will help your requirement
REPORT ZALV_SAMP .
TABLES: MARA.
TYPE-POOLS : SLIS.
*----
Data declaration
*----
DATA: BEGIN OF I_MARA OCCURS 0.
INCLUDE STRUCTURE MARA.
DATA: END OF I_MARA.
DATA: V_REPID LIKE SY-REPID.
*----
selection-screen
*----
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
SELECT-OPTIONS : S_MATNR FOR MARA-MATNR.
PARAMETERS: P_MTART LIKE MARA-MTART DEFAULT 'ROH'.
SELECTION-SCREEN END OF BLOCK B1.
*----
initialisation
*----
INITIALIZATION.
S_MATNR-LOW = '1400'.
S_MATNR-HIGH = '1500'.
APPEND S_MATNR.
V_REPID = SY-REPID.
*----
start-of-selection
*----
START-OF-SELECTION.
SELECT * FROM MARA
INTO TABLE I_MARA
WHERE MATNR IN S_MATNR AND
MTART = P_MTART.
CHECK SY-SUBRC = 0.
*----
end of selection
*----
END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ' '
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME = 'MARA'
IS_LAYOUT =
IT_FIELDCAT =
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = I_MARA
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop at i_mara.
write:/ i_mara.
endloop.
Thanks & regards
Sreenivasulu P