2006 Jan 25 5:40 AM
Hi,
How do i find the subtotal of a field in ALV.
Thanks in advance,
Prakash
2006 Jan 25 5:43 AM
u have to fill sort info and pass that to i_sort.
in slis_alv_sort or lvc_s_sort u can find
2006 Jan 25 5:43 AM
u have to fill sort info and pass that to i_sort.
in slis_alv_sort or lvc_s_sort u can find
2006 Jan 25 5:54 AM
Try something like this
data:begin of itab occurs 0.
fld1 like ztab-fld1,
...
..
amount like ztab-amount,
end of itab.
*if u want the subtotals at every change of field1
loop at itab.
at end of fld1.
sum.
itab-amount = itab-amount.
append itab.
clear itab.
endat.
endloop.
2006 Jan 25 5:55 AM
Hi,
You can use SLIS_SORTINFO_ALV
For Ex.
DATA: L_SORT TYPE SLIS_SORTINFO_ALV.
L_SORT-TABNAME = 'T_ALV'.
L_SORT-FIELDNAME = 'PSPID'.
L_SORT-UP = 'X'.
L_SORT-SUBTOT = 'X'.
APPEND L_SORT TO T_SORT.
CLEAR L_SORT.
Regards,
Sumanth.
2006 Jan 30 11:21 AM
Hi,
How do i find the subtotal of a field in Hierarchical ALV Report.
Thanks in advance,
Prakash
2006 Jan 30 11:30 AM
Hi,
There is no difference. you just need to pass the Sort table info.
for examples just check the below code...
REPORT ZTEST_HIER NO STANDARD PAGE HEADING
LINE-SIZE 132
LINE-COUNT 64
MESSAGE-ID Z00.
*..Type Definitions for ALV Report
TYPE-POOLS SLIS.
*----------------------------------------------------------------------*
* Table/Structure declarations. *
*----------------------------------------------------------------------*
TABLES : VBRK, " Billing: Header Data
VBRP, " Billing: Item Data
T001, " Comapny Codes
TVKOT, " Sales Organizations: Texts
MAKT. " Material Descriiptions
*----------------------------------------------------------------------*
*.. Internal Tables declaration *
*----------------------------------------------------------------------*
*----- Internal table to store billing docs which are not cancelled
DATA : BEGIN OF IT_VBRK OCCURS 0,
VBELN LIKE VBRK-VBELN, " Billing document
WAERK LIKE VBRK-WAERK, " SD document currency
VKORG LIKE VBRK-VKORG, " Sales organization
VTEXT LIKE TVKOT-VTEXT, " Sales organization text
FKDAT LIKE VBRK-FKDAT, " Billing date
BUKRS LIKE VBRK-BUKRS, " Company Code
BUTXT LIKE T001-BUTXT, " Company Code text
NETWR LIKE VBRK-NETWR, " Net value in document currency
END OF IT_VBRK.
*-----Internal table to stroe ITEM DETAILS
DATA: BEGIN OF IT_VBRP OCCURS 0,
VBELN2 LIKE VBRP-VBELN, " Billing document
POSNR LIKE VBRP-POSNR, " Billing item
FKIMG LIKE VBRP-FKIMG, " Actual billed quantity
VRKME LIKE VBRP-VRKME, " Sales unit
NETWR LIKE VBRP-NETWR, " Net value of the billing item
MATNR LIKE VBRP-MATNR, " Material number
ARKTX LIKE VBRP-ARKTX, " Short text for sales order item
END OF IT_VBRP.
*----------------------------------------------------------------------*
* Variable / Flag Declerations *
*----------------------------------------------------------------------*
DATA : FG_COLOR VALUE ' ', " FLAG TO CHANGE THE COLOR OF THE RECORD
FG_NO_DATA VALUE ' '. " FLAG TO CHECK THE DATA
DATA : V_REPID TYPE SYREPID.
*----------------------------------------------------------------------*
* ALV Type declaration *
*----------------------------------------------------------------------*
DATA : IT_FIELDCAT TYPE STANDARD TABLE OF
SLIS_FIELDCAT_ALV WITH HEADER LINE.
DATA : IT_SORT TYPE SLIS_T_SORTINFO_ALV,
WA_SORT TYPE SLIS_SORTINFO_ALV.
DATA : IT_EVENT TYPE SLIS_T_EVENT,
WA_EVENT LIKE LINE OF IT_EVENT.
DATA : IT_HEADINGS TYPE STANDARD TABLE OF
SLIS_LISTHEADER WITH HEADER LINE.
DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV.
DATA : WA_KEYINFO TYPE SLIS_KEYINFO_ALV.
*----------------------------------------------------------------------*
* Selection Screen. *
*----------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_VBELN FOR VBRK-VBELN, " Billing doc no
S_FKDAT FOR VBRK-FKDAT OBLIGATORY, " Billing date
S_MATNR FOR VBRP-MATNR. " Material no
SELECTION-SCREEN END OF BLOCK B1.
*----------------------------------------------------------------------*
* Event:Initialization *
*----------------------------------------------------------------------*
INITIALIZATION.
V_REPID = SY-REPID.
S_FKDAT-LOW = SY-DATUM - 200.
S_FKDAT-HIGH = SY-DATUM.
APPEND S_FKDAT.
*----------------------------------------------------------------------*
* AT Selection Screen. *
*----------------------------------------------------------------------*
AT SELECTION-SCREEN.
PERFORM VALIDATE_VBELN.
PERFORM VALIDATE_MATNR.
*----------------------------------------------------------------------*
* Event: Start-of-Selection *
*----------------------------------------------------------------------*
START-OF-SELECTION.
PERFORM GET_VBRK_DATA.
PERFORM GET_VBRP_DATA.
*----------------------------------------------------------------------*
* Event: End-of-Selection *
*----------------------------------------------------------------------*
END-OF-SELECTION.
PERFORM GET_EVENTS.
PERFORM SORT_TAB.
PERFORM FIELDCATALOG.
PERFORM LIST_DISPLAY.
*//////////////////////////////////////////////////////////////////////*
*
* FORM DEFINITIONS *
*
*//////////////////////////////////////////////////////////////////////
*&---------------------------------------------------------------------*
*& Form list_display
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM LIST_DISPLAY.
WA_LAYOUT-INFO_FIELDNAME = 'COLOR'.
WA_LAYOUT-TOTALS_TEXT = 'GRAND TOTAL'.
WA_LAYOUT-ZEBRA = 'X'.
WA_LAYOUT-KEY_HOTSPOT = 'X'.
WA_KEYINFO-HEADER01 = 'VBELN'.
WA_KEYINFO-ITEM01 = 'VBELN2'.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
I_CALLBACK_PROGRAM = V_REPID
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
IT_SORT = IT_SORT
* IT_FILTER =
* IS_SEL_HIDE =
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
I_TABNAME_HEADER = 'IT_VBRK'
I_TABNAME_ITEM = 'IT_VBRP'
* I_STRUCTURE_NAME_HEADER =
* I_STRUCTURE_NAME_ITEM =
IS_KEYINFO = WA_KEYINFO
* IS_PRINT =
* IS_REPREP_ID =
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB_HEADER = IT_VBRK
T_OUTTAB_ITEM = IT_VBRP
* 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.
ENDFORM. " list_display
*&---------------------------------------------------------------------*
*& Form fieldcatalog
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FIELDCATALOG.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'IT_VBRK'
* I_STRUCTURE_NAME =
* I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = V_REPID
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = IT_FIELDCAT[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*..Changing the fieldcatlog as required
LOOP AT IT_FIELDCAT.
CASE IT_FIELDCAT-FIELDNAME.
WHEN 'VBELN'.
IT_FIELDCAT-SELTEXT_L = 'Billing doc no'.
IT_FIELDCAT-SELTEXT_M = 'Bill No'.
IT_FIELDCAT-SELTEXT_S = 'Bill'.
IT_FIELDCAT-OUTPUTLEN = '15'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
OUTPUTLEN
WHERE FIELDNAME = 'VBELN'.
WHEN 'WAERK'.
IT_FIELDCAT-SELTEXT_L = 'SD document Currency'.
IT_FIELDCAT-SELTEXT_M = 'Document Currency'.
IT_FIELDCAT-SELTEXT_S = 'Currency'.
IT_FIELDCAT-OUTPUTLEN = '15'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'WAERK'.
WHEN 'VKORG'.
IT_FIELDCAT-SELTEXT_L = 'Sales Organisation'.
IT_FIELDCAT-SELTEXT_M = 'Sales Org'.
IT_FIELDCAT-SELTEXT_S = 'S,Org'.
IT_FIELDCAT-OUTPUTLEN = '15'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'VKORG'.
WHEN 'VTEXT'.
IT_FIELDCAT-SELTEXT_L = 'Sales Organisation Name'.
IT_FIELDCAT-SELTEXT_M = 'Sales Org Text'.
IT_FIELDCAT-SELTEXT_S = 'S,Org'.
IT_FIELDCAT-OUTPUTLEN = '30'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'VTEXT'.
WHEN 'FKDAT'.
IT_FIELDCAT-SELTEXT_L = 'Billing Date'.
IT_FIELDCAT-SELTEXT_M = 'Bill.Date'.
IT_FIELDCAT-SELTEXT_S = 'BDate'.
IT_FIELDCAT-OUTPUTLEN = '15'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'FKDAT'.
WHEN 'BUKRS'.
IT_FIELDCAT-SELTEXT_L = 'Company Code'.
IT_FIELDCAT-SELTEXT_M = 'Company'.
IT_FIELDCAT-SELTEXT_S = 'Comp'.
IT_FIELDCAT-OUTPUTLEN = '15'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'BUKRS'.
WHEN 'BUTXT'.
IT_FIELDCAT-SELTEXT_L = 'Company Name'.
IT_FIELDCAT-SELTEXT_M = 'Comp Text'.
IT_FIELDCAT-SELTEXT_S = 'Comp'.
IT_FIELDCAT-OUTPUTLEN = '25'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'BUTXT'.
WHEN 'NETWR'.
IT_FIELDCAT-SELTEXT_L = 'Net value in docu currency'.
IT_FIELDCAT-SELTEXT_M = 'Net value in currency'.
IT_FIELDCAT-SELTEXT_S = 'Net Value'.
IT_FIELDCAT-OUTPUTLEN = '20'.
IT_FIELDCAT-DO_SUM = 'X'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
DO_SUM
WHERE FIELDNAME = 'NETWR'.
ENDCASE.
ENDLOOP.
PERFORM FIELDCAT_SECLIST.
ENDFORM. " fieldcatalog
*&---------------------------------------------------------------------*
*& Form sort_tab
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM SORT_TAB.
CLEAR WA_SORT.
WA_SORT-FIELDNAME = 'VBELN'.
WA_SORT-SPOS = '1'.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO IT_SORT.
ENDFORM. " sort_tab
*&---------------------------------------------------------------------*
*& Form get_events
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM GET_EVENTS.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 1
IMPORTING
ET_EVENTS = IT_EVENT
EXCEPTIONS
LIST_TYPE_WRONG = 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.
READ TABLE IT_EVENT INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
WA_EVENT-FORM = 'DISPLAY_HEADER'.
MODIFY IT_EVENT FROM WA_EVENT INDEX SY-TABIX.
ENDFORM. " get_events
*&---------------------------------------------------------------------*
*& Form DISPLAY_HEADER
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM DISPLAY_HEADER.
WRITE : /3 'Date : ',
10 SY-DATUM USING EDIT MASK '__/__/____',
35 'xxxx xxxx Pvt. Ltd',
80 'Time : ',
90 SY-UZEIT,
/3 'User : ',
10 SY-UNAME,
30 SY-TITLE,
80 'Page : ',
90 SY-PAGNO.
ENDFORM. " DISPLAY_HEADER
*&---------------------------------------------------------------------*
*& Form VALIDATE_VBELN
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM VALIDATE_VBELN.
* Validating Billing doc no
SELECT VBELN
INTO VBRK-VBELN
UP TO 1 ROWS
FROM VBRK
WHERE VBELN IN S_VBELN.
ENDSELECT.
IF SY-SUBRC NE 0.
MESSAGE E010. " Invalid billing doc no
ENDIF.
ENDFORM. " VALIDATE_VBELN
*&---------------------------------------------------------------------*
*& Form VALIDATE_MATNR
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM VALIDATE_MATNR.
* Validating material no
SELECT MATNR
INTO VBRP-MATNR
UP TO 1 ROWS
FROM VBRP
WHERE MATNR IN S_MATNR.
ENDSELECT.
IF SY-SUBRC NE 0.
MESSAGE E018. " Invalid material number
ENDIF.
ENDFORM. " VALIDATE_MATNR
*&---------------------------------------------------------------------*
*& Form GET_VBRK_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM GET_VBRK_DATA.
* To get Billing doc detials based on selections
SELECT V~VBELN
V~WAERK
V~VKORG
V~FKDAT
V~BUKRS
V~NETWR
T~VTEXT
C~BUTXT
INTO CORRESPONDING FIELDS OF TABLE IT_VBRK
FROM VBRK AS V
INNER JOIN VBRP AS P
ON V~VBELN = P~VBELN
INNER JOIN TVKOT AS T
ON V~VKORG = T~VKORG
INNER JOIN T001 AS C
ON V~BUKRS = C~BUKRS
WHERE V~VBELN IN S_VBELN
AND V~FKDAT IN S_FKDAT
AND P~MATNR IN S_MATNR.
SORT IT_VBRK.
DELETE ADJACENT DUPLICATES FROM IT_VBRK COMPARING VBELN.
IF SY-SUBRC NE 0.
FG_NO_DATA = 'X'.
ENDIF.
ENDFORM. " GET_VBRK_DATA
*&---------------------------------------------------------------------*
*& Form GENERATE_SECLIST
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM GENERATE_SECLIST USING R_UCOMM LIKE SY-UCOMM
RS_SELFIELD TYPE SLIS_SELFIELD.
CASE R_UCOMM.
WHEN '&IC1'. "DOUBLE CLICK
READ TABLE IT_VBRK INDEX RS_SELFIELD-TABINDEX.
ENDCASE.
ENDFORM. " GENERATE_SECLIST
*&---------------------------------------------------------------------*
*& Form FIELDCAT_SECLIST
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM FIELDCAT_SECLIST.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = V_REPID
I_INTERNAL_TABNAME = 'IT_VBRP'
* I_STRUCTURE_NAME =
* I_CLIENT_NEVER_DISPLAY = 'X'
I_INCLNAME = V_REPID
* I_BYPASSING_BUFFER =
* I_BUFFER_ACTIVE =
CHANGING
CT_FIELDCAT = IT_FIELDCAT[]
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*..Changing the fieldcatlog as required
LOOP AT IT_FIELDCAT.
CASE IT_FIELDCAT-FIELDNAME.
WHEN 'VBELN2'.
IT_FIELDCAT-NO_OUT = 'X'.
IT_FIELDCAT-KEY = SPACE.
MODIFY IT_FIELDCAT TRANSPORTING NO_OUT
KEY
WHERE FIELDNAME = 'VBELN2'.
WHEN 'POSNR'.
IT_FIELDCAT-SELTEXT_L = 'Billing Iem no'.
IT_FIELDCAT-SELTEXT_M = 'Bill Item No'.
IT_FIELDCAT-SELTEXT_S = 'Item No'.
IT_FIELDCAT-OUTPUTLEN = '15'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
OUTPUTLEN
WHERE FIELDNAME = 'POSNR'.
WHEN 'FKIMG'.
IT_FIELDCAT-SELTEXT_L = 'Actual billed quantity'.
IT_FIELDCAT-SELTEXT_M = 'Billed Quantity'.
IT_FIELDCAT-SELTEXT_S = 'Bill.Qty'.
IT_FIELDCAT-OUTPUTLEN = '15'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'FKIMG'.
WHEN 'VRKME'.
IT_FIELDCAT-SELTEXT_L = 'Sales Unit'.
IT_FIELDCAT-SELTEXT_M = 'Sale unit'.
IT_FIELDCAT-SELTEXT_S = 'S.Unit'.
IT_FIELDCAT-OUTPUTLEN = '15'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'VRKME'.
WHEN 'NETWR'.
IT_FIELDCAT-SELTEXT_L = 'Net value in docu currency'.
IT_FIELDCAT-SELTEXT_M = 'Net value in currency'.
IT_FIELDCAT-SELTEXT_S = 'Net Value'.
IT_FIELDCAT-OUTPUTLEN = '20'.
IT_FIELDCAT-DO_SUM = 'X'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
DO_SUM
WHERE FIELDNAME = 'NETWR'.
WHEN 'MATNR'.
IT_FIELDCAT-SELTEXT_L = 'Material Number'.
IT_FIELDCAT-SELTEXT_M = 'Mat. Number'.
IT_FIELDCAT-SELTEXT_S = 'Mat. No'.
IT_FIELDCAT-OUTPUTLEN = '30'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'MATNR'.
WHEN 'ARKTX'.
IT_FIELDCAT-SELTEXT_L = 'Text for sales order item'.
IT_FIELDCAT-SELTEXT_M = 'Sale Order Text'.
IT_FIELDCAT-SELTEXT_S = 'SO Item text'.
IT_FIELDCAT-OUTPUTLEN = '30'.
MODIFY IT_FIELDCAT TRANSPORTING SELTEXT_L
SELTEXT_M
SELTEXT_S
WHERE FIELDNAME = 'ARKTX'.
ENDCASE.
ENDLOOP.
ENDFORM. " FIELDCAT_SECLIST
*&---------------------------------------------------------------------*
*& Form GET_VBRP_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM GET_VBRP_DATA.
SELECT VBELN
POSNR
FKIMG
VRKME
NETWR
MATNR
ARKTX
INTO TABLE IT_VBRP
FROM VBRP
FOR ALL ENTRIES IN IT_VBRK
WHERE VBELN EQ IT_VBRK-VBELN.
ENDFORM. " GET_VBRP_DATA
2006 Jan 30 12:26 PM
Hi Prakash,
Declare sort table and work area as follows
DATA : I_SORT TYPE SLIS_T_SORTINFO_ALV,
WA_SORT TYPE SLIS_SORTINFO_ALV.
In the subroutine for sorting if you want to subtotal on the materials.Use the logic given here. Pass this table to display list function module.
CLEAR WA_SORT.
WA_SORT-FIELDNAME = 'MATNR'.
WA_SORT-SPOS = '1'.
WA_SORT-UP = 'X'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO I_SORT.
Hope this helps.
Regards,
Sudheer