Application Development and Automation 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: 
Read only

alv classes

Former Member
0 Likes
459

Hi to all

can any one tell what is the difference between

cl_salv_columns_table and cl_salv_column_table

thanks

3 REPLIES 3
Read only

Former Member
0 Likes
429

cl_salv_columns_table -> refers to the whole column set.

cl_salv_column_table -> refers to a single column and its attributes.

See the below code to understand.

DATA: lr_columns

TYPE REF TO cl_salv_columns_table,

lr_column TYPE REF TO cl_salv_column_table.

DATA: l_shorttext TYPE scrtext_s,

l_mediumtext TYPE scrtext_m,

l_longtext TYPE scrtext_l.

  • l_ddic_reference type salv_s_ddic_reference.

  • get columns' object

lr_columns = r_grid->get_columns( ).

************************************************************************

  • settings valid for all columns *

************************************************************************

  • optimize columns' width

  • lr_columns->set_optimize( ).

TRY.

  • column messageid

lr_column ?= lr_columns->get_column( columnname = 'MESSAGEID' ).

CATCH cx_salv_not_found.

exc_handler=>process_alv_error_msg( gd_salv_msg ).

ENDTRY.

l_mediumtext = 'Error message ID'(015).

l_shorttext = ' '.

l_longtext = ' '.

lr_column->set_medium_text( value = l_mediumtext ).

lr_column->set_short_text( value = l_shorttext ).

lr_column->set_long_text( value = l_longtext ).

Read only

Former Member
0 Likes
429

cl_salv_column_table: related to methods/attributes applicable for specific column only(one at a time).

cl_salv_columns_table:related to methods/attributes applicable for more than 1 column.

Thanks

Vishal Kapoor

Read only

Former Member
0 Likes
429

HI,

CL CL_SALV_COLUMN_TABLE

Column Description of Simple, Two-Dimensional Tables

Functionality

The CL_SALV_COLUMN_TABLE class contains all the information required to display a specific column in a list-like table. In particular, this includes:

Information about the column title, such as texts and F1 help

Variations in visibility, assignment, and display of data in the column

Column relevance, such as its role as a decimal, rounding, or unit of measure column

Technical information such as data element, output length, and domain

CL CL_SALV_COLUMNS_TABLE

Short Text

Columns in Simple, Two-Dimensional Tables

Functionality

With the class CL_SALV_COLUMNS_TABLE, you manage the column properties.