07-20-2009 8:38 AM
when use FM REUSE_ALV_GRID_DISPLAY to show ALV data, i often use slis_t_fieldcat_alv to set the text of a field. But when using OO way to show it,
cl_salv_table=>factory(
IMPORTING
r_salv_table = lr_alv
CHANGING
t_table = <fs_tab> ).
who can tell me how to set field text.
07-20-2009 9:50 AM
hi
Call the function LVC_FIELDCATALOG_MERGE to get the fieldcatalog and pass the structure name.
for any other problems in alv grid use the below link
https://wiki.sdn.sap.com/wiki/display/ABAP/7stepstocreateOOPS+ALV
Regards
Nishant Malhotra
07-20-2009 11:05 AM
I am sorry, but it difficult to understand. Can you just give me a simple exam, plz.
In the past, I do it not use oops, and oops is a litter difficult to me.
07-20-2009 2:39 PM
Hi ross.wang,
for modifying column properties you should use classes CL_SALV_COLUMNS and CL_SALV_COLUMN.
1. Retrieve Columns-Object (CL_SALV_COLUMNS) via "get_columns()" Method of CL_SALV_TABLE
2. Retrieve Column-Object(CL_SALV_COLUMN) via "get_column()" Method of CL_SALV_COLUMNS
3. Use Method set_short_text of CL_SALV_COLUMN to edit short description of the specified column
Try the following example, in order to set the column short text of Field CARRID to 'XXX':
DATA: it_sflight TYPE TABLE OF sflight.
DATA: lr_salv TYPE REF TO cl_salv_table.
DATA: lr_columns TYPE REF TO cl_salv_columns.
DATA: lr_column TYPE REF TO cl_salv_column.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = lr_salv
CHANGING
t_table = it_sflight.
lr_columns = lr_salv->get_columns( ).
lr_column = lr_columns->get_column( 'CARRID' ).
lr_column->set_short_text( 'XXX' ).
lr_salv->display( ).
Regards
REA
07-20-2009 9:53 AM
Hi Ross,
Use this link.
https://wiki.sdn.sap.com/wiki/display/ABAP/7stepstocreateOOPS+ALV
Regards,
Vijay
12-06-2010 2:59 PM
i have mainly using oo alv nowadays, the code blow can tell you how to use it.