Skip to Content
0
Former Member
Feb 12, 2007 at 10:04 AM

ALV using objects

480 Views

hi,

Im using the class which is mentioned below,

1)i need to display the top_of_page and end_of_page how can i do that?,

2)how could i give user defiined column headings.

for eg:for the first column ,the coumn heading is sales document number.

REPORT ZALV_SAMPLE.

types:begin of ty_final,

vbeln type vbeln_va,

matnr type matnr,

end of ty_final.

DATA:IT_FINAL TYPE TABLE OF TY_FINAL.

select vbeln matnr

FROM VBAP

INTO TABLE IT_FINAL.

********************this is the code for alv (OO concept)

DATA : R_TABLE TYPE REF TO CL_SALV_TABLE,

R_COLUMNS TYPE REF TO CL_SALV_COLUMNS,

R_COLUMN TYPE REF TO CL_SALV_COLUMN.

TRY.

CALL METHOD cl_salv_table=>factory

IMPORTING

R_SALV_TABLE = R_TABLE

CHANGING

t_table = IT_final.

.

CATCH CX_SALV_MSG .

ENDTRY.

R_COLUMNS = R_TABLE->GET_COLUMNS( ).

R_TABLE->DISPLAY( ).