2005 Nov 29 11:14 AM
Hi all,
My requirement is at end of each material i have to display summarised open quantity in ALV.
I know how to do it with normal write statement using control breaks.
I want to display this requirement in ALV.
If possible please provide some code.
Thanks and Regards
Chandu.
2005 Nov 29 11:36 AM
You Need to Specify in fieldcat of Field for which you are going to sum <b>DO_SUM = 'X'.</b>
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = V_PF_STAT_FORMNAME
I_CALLBACK_USER_COMMAND = V_USER_FORMNAME
IS_LAYOUT = X_LAYOUT_DATA
IT_FIELDCAT = IT_FIELDCAT_DATA[]
<b> IT_SORT = IT_SORT_DATA[]</b>
IT_EVENTS = IT_EVENTS_DATA[]
TABLES
T_OUTTAB = IT_DISPLAY
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.
reagards
vijay
2005 Nov 29 11:18 AM
2005 Nov 29 11:20 AM
Sai,
Pass those break level statements to ....events_get
or else after display u can set this using Layout setting where u will get subtotal as per the Materials.
Regards,
Amey
2005 Nov 29 11:26 AM
It's is standard in the alv, you can sum, and sub-sum any field that you want, just make sure that this field is numeric.
Alexandre Nogueira.
2005 Nov 29 11:31 AM
Hi In alv Create a sort table based on your material.
in your sort table .
IT_SORT_DATA-SPOS = L_SPOS.
IT_SORT_DATA-FIELDNAME = 'MATNR'.
IT_SORT_DATA-TABNAME = 'IT_DISPLAY'.
IT_SORT_DATA-DOWN = 'X'.
IT_SORT_DATA-GROUP = 'X'. "Separations like breaks
IT_SORT_DATA-SUBTOT = 'X'.
APPEND IT_SORT_DATA.
CLEAR IT_SORT_DATA.
and in your field catlaog
specify DO_SUM = 'X'.
that will solve your Problem.
regards
vijay
2005 Nov 29 11:36 AM
You Need to Specify in fieldcat of Field for which you are going to sum <b>DO_SUM = 'X'.</b>
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = V_REPID
I_CALLBACK_PF_STATUS_SET = V_PF_STAT_FORMNAME
I_CALLBACK_USER_COMMAND = V_USER_FORMNAME
IS_LAYOUT = X_LAYOUT_DATA
IT_FIELDCAT = IT_FIELDCAT_DATA[]
<b> IT_SORT = IT_SORT_DATA[]</b>
IT_EVENTS = IT_EVENTS_DATA[]
TABLES
T_OUTTAB = IT_DISPLAY
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.
reagards
vijay
2005 Nov 29 1:28 PM
Hi all,
Thanks alot for your replies.
My requirement is like this: at end of every material i have to select the summarized data some thing like this
AT END OF matnr.
SELECT SUM( vmeng ) SUM( off_wert )
INTO (gt_data-rueck, gt_data-rueckw)
FROM yvbbe WHERE matnr =
gt_data-matnr and mbdat < p_datum.
ENDAT.
Then I have to display that rueck and rueckw for each material in ALV.
I hope it will clear.
Please help.
Thanks & Regards
chandu.
2005 Nov 29 1:32 PM
Hi why can't you maintain the data in the same table and
proceed in the same way as i told.
regards
vijay
2005 Nov 29 1:53 PM
HI Vijay,
Thanks alot for your valuable replies.
regards
chandu.