Professional Documents
Culture Documents
ALV Part2
ALV Part2
1. List Display:
In list display, the data is presented in a simple list format, typically with
rows and columns.
List display is suitable for displaying basic tabular data without much
formatting or customization.
2. Grid Display:
Choosing between list display and grid display depends on the specific
requirements of the application and the preferences of the end-users. If users
need more flexibility and interactivity, grid display is usually preferred. However, if
simplicity and readability are more important, list display may be sufficient.
Code :-
*************************************************
*Start of Program
*Type Strcuture fo Both header and Item table
TYPES : BEGIN OF ty_vbak,
vbeln TYPE vbeln_va,
erdat TYPE erdat,
erzet TYPE erzet,
ernam TYPE ernam,
vbtyp TYPE vbtypl,
********************************************
*Type structure for final table.
TYPES : BEGIN OF ty_final,
vbeln TYPE vbeln_va,
erdat TYPE erdat,
erzet TYPE erzet,
ernam TYPE ernam,
vbtyp TYPE vbtypl,
posnr TYPE posnr_va,
matnr TYPE matnr,
END OF ty_final.
*************************************************
*Declaring the internal table and work area
DATA : lt_vbak type table of ty_vbak,
ls_vbak type ty_vbak,
lt_vbap type table of ty_vbap,
ls_vbap type ty_vbap,
lt_final type table of ty_final,
ls_final type ty_final,
lv_vbeln type vbeln_va.
***************
*Declaring a select option.
SELECT-OPTIONS : s_vbeln for lv_vbeln.
***************************************
*Call REUSE ALV fieldcatalog merge
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = 'ZAR_ORDER_DETAILS'
CHANGING
ct_fieldcat = lt_fieldcat
endif.
*****************
Code :-
********************************************
*Type structure for final table.
TYPES : BEGIN OF ty_final,
vbeln TYPE vbeln_va,
erdat TYPE erdat,
erzet TYPE erzet,
ernam TYPE ernam,
vbtyp TYPE vbtypl,
posnr TYPE posnr_va,
matnr TYPE matnr,
END OF ty_final.
*************************************************
*Declaring the internal table and work area
DATA : lt_vbak type table of ty_vbak,
ls_vbak type ty_vbak,
lt_vbap type table of ty_vbap,
ls_vbap type ty_vbap,
lt_final type table of ty_final,
****************************************
*Internal table and work area for fielcatalog.
DATA : lt_fieldcat type table of slis_fieldcat_alv,
ls_fieldcat type slis_fieldcat_alv.
***************
*Declaring a select option.
SELECT-OPTIONS : s_vbeln for lv_vbeln.
START-OF-SELECTION.
SELECT vbeln erdat erzet ernam vbtyp
from vbak into table lt_vbak
where vbeln in s_vbeln.
***************************************
*Manually writing the fieldcatalog
ls_fieldcat-seltext_l = 'Sales Document Number'.
ls_fieldcat-fieldname = 'VBELN'.
append ls_fieldcat to lt_fieldcat.
clear ls_fieldcat.
endif.