Posted: Sat Feb 16, 2008 9:45 pm Post subject: Группировка полей в ALV LIST по аналогии с ALV GRID
Code:
REPORT Z_ALV_LIST_SUBTOTAL_DEMO.
TYPE-POOLS slis.
DATA:
gt_bseg TYPE TABLE OF bseg with header line,
gt_fieldcatalog TYPE slis_t_fieldcat_alv,
gs_fieldcatalog TYPE LINE OF slis_t_fieldcat_alv,
gt_sort TYPE slis_t_sortinfo_alv,
gs_sort TYPE LINE OF slis_t_sortinfo_alv,
gt_events type slis_t_event.
DATA: g_bukrs LIKE bseg-bukrs,
g_belnr LIKE bseg-belnr,
g_gjahr LIKE bseg-gjahr.
SELECT * FROM bseg INTO TABLE gt_bseg
UP TO 100 ROWS.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
else.
read table gt_events INTO ls_event
with key name = 'BEFORE_LINE_OUTPUT'.
if sy-subrc eq 0.
concatenate 'ALV_EVENT_'
ls_event-name
into ls_event-form.
MODIFY gt_events FROM ls_event INDEX sy-tabix.
else.
ls_event-name = 'BEFORE_LINE_OUTPUT'.
concatenate 'ALV_EVENT_'
'BEFORE_LINE_OUTPUT'
into ls_event-form.
append ls_event to gt_events.
endif.
endif.
*---------------------------------------------------------------------*
* FORM ALV_EVENT_BEFORE_LINE_OUTPUT
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
form ALV_EVENT_BEFORE_LINE_OUTPUT
using rs_lineinfo type slis_lineinfo. "#EC *
DATA: ls_bseg LIKE LINE OF gt_bseg.
IF rs_lineinfo-tabindex NE 0.
IF g_bukrs NE gt_bseg-bukrs.
g_bukrs = gt_bseg-bukrs.
ELSE.
CLEAR gt_bseg-bukrs.
ENDIF.
IF g_belnr NE gt_bseg-belnr.
g_belnr = gt_bseg-belnr.
ELSE.
CLEAR gt_bseg-belnr.
ENDIF.
IF g_gjahr NE gt_bseg-gjahr.
g_gjahr = gt_bseg-gjahr.
ELSE.
CLEAR gt_bseg-gjahr.
ENDIF.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG. SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG. Every effort is made to ensure content integrity. Use information on this site at your own risk.