ALV Reports Using FM
ALV Reports Using FM
ALV Reports Using FM
Type-Pool Declaration
ALV Layout
Use:
Populate Layout Features for ALV output.
Data Declaration:
For field catalog population, declare a structure of type SLIS_LAYOUT_ALV.
Exporting:
IS_LAYOUT: ALV layout structure.
gs_layout-no_input
='X'.
gs_layout-colwidth_optimize
='X'.
gs_layout-no_totalline
= X.
gs_layout-subtotals_text
='SubTotal'.
gs_layout-zebra
='X'.
ENDFORM.
ALV Sorting
Use:
Data Declaration:
Exporting
IT_SORT: internal table for Sorting.
Fields of the sort structure:
- FIELDNAME : field name on which sort is required.
- SPOS : sort priority, pass incremental numbers example:
1, 2, 3 etc.
- UP : pass X to sort in ascending order.
- DOWN : pass X to sort in descending order.
- SUBTOT : pass X to get the subtotal for every break of the sort.
Exporting
I_CALLBACK_PROGRAM
: report id
IS_LAYOUT
: report layout.
IT_FIELDCAT
names,
IT_SORT
on which
IT_EVENTS
along with
Tables
T_OUTTAB
mandatory.
Sample Code:
text=sy-datum.
CALLMETHODdocument->add_text
EXPORTING
text =text
sap_emphasis =Strong.
CALLMETHODdocument->add_gap
EXPORTING
width =15.
FORMpf_status_setUSINGrt_extabTYPEslis_t_ext
ab.
setpf-status'ZSTANDARD'.
ENDFORM.
Z31_SAMP