Wednesday, December 22, 2010
We set DO_SUM = 'X' in the fieldcatalog for the Quantity field in the internal table.
REPORT ZTEST. DATA: BEGIN OF IT_MARD OCCURS 0, MATNR TYPE MARD-MATNR, WERKS TYPE MARD-WERKS, LGORT TYPE MARD-LGORT, LABST TYPE MARD-LABST, END OF IT_MARD. TYPE-POOLS:SLIS. DATA:IT_FIELD TYPE SLIS_T_FIELDCAT_ALV. DATA:WA_FIELD LIKE LINE OF IT_FIELD. DEFINE FIELDCAT. WA_FIELD-FIELDNAME = &1 . WA_FIELD-TABNAME = &2 . WA_FIELD-SELTEXT_M = &3 . WA_FIELD-DO_SUM = &4 . APPEND WA_FIELD TO IT_FIELD. CLEAR WA_FIELD. END-OF-DEFINITION. START-OF-SELECTION. SELECT *
FROM MARD
INTO CORRESPONDING FIELDS OF TABLE IT_MARD
UP TO 100 ROWS. "DO_SUM FIELDCAT: 'MATNR' 'IT_MARD' 'MARD-MATNR' '', 'WERKS' 'IT_MARD' 'MARD-WERKS' '', 'LGORT' 'IT_MARD' 'MARD-LGORT' '', 'LABST' 'IT_MARD' 'MARD-LABST' 'X'. CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY' EXPORTING I_CALLBACK_PROGRAM = SY-REPID IT_FIELDCAT = IT_FIELD TABLES T_OUTTAB = IT_MARD.
Followers
Popular Posts
- ABAP - ALV Report example with steps
- ABAP - Step by step tutorial on Smart Forms - Template Node
- ABAP - Sending email with pdf attachment
- SAP Adobe Form - Steps to create simple ADOBE Form and calling it from ABAP Program
- SAP ABAP - CL_ABAP_CHAR_UTILITIES class usage
- ABAP - Multiple value selection from F4 help for SELECT-OPTIONS
- Execute ABAP Report using SUBMIT statement
- ABAP - Select all or Deselect all in ALV or Check box handling in ALV
- Web Dynpro ABAP ALV - ON_CLICK event
- ABAP - Dynamic WHERE clause
0 comments:
Post a Comment
Your useful comments, suggestions are appreciated.Your comments are moderated.