Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV Field text set

Former Member
0 Kudos

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.

5 REPLIES 5

Former Member
0 Kudos

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

0 Kudos

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.

0 Kudos

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

Former Member
0 Kudos

Hi Ross,

Use this link.

https://wiki.sdn.sap.com/wiki/display/ABAP/7stepstocreateOOPS+ALV

Regards,

Vijay

Former Member
0 Kudos

i have mainly using oo alv nowadays, the code blow can tell you how to use it.

http://scnblogs.techweb.com.cn/firefilter/archives/2.html