02-27-2015 11:16 AM
Hi all,
I have created a hierarchical ALV using class cl_salv_hierseq_table. In 1st level ALV (highlighted yellow in below screenshot) I am not able to populate the field labels because I am not using data elements while declaration.
below is the declaration:
BEGIN OF ty_count,
ustyp TYPE string,
count TYPE i,
END OF ty_count.
Please refer below screenshot.
Thanks,
Sneha.
02-27-2015 12:03 PM
Hi,
use method GET_COLUMNS of your CL_SALV_HIERSEQ_TABLE object. From its returning object (of CL_SALV_COLUMNS_HIERSEQ) call method GET_COLUMN for each column you want to set "text label" (USTYP and COUNT). Then you end up with column object (CL_SALV_COLUMN), where you can use "setter" methods: SET_SHORT_TEXT, SET_MEDIUM_TEXT and SET_LONG_TEXT.
Its almost same like setting up column text in SALV Grid (cl_salv_table).
02-27-2015 12:19 PM
Hi Tomas,
I tired using the solution provided by you. But I am getting the following error.
'Method set_medium_text is unknown or protected or private'.
02-27-2015 12:40 PM
Hi Sneha,
Please find the below code.
data: gr_columns type ref to cl_salv_columns_table.
data: gr_column type ref to cl_salv_column_table.
gr_columns = gr_table->get_columns( ).
gr_column ?= gr_columns->get_column( 'Field_Name' ).
gr_column->set_long_text( 'Long Text' ).
gr_column->set_medium_text( 'Medium Text' ).
Also find the below link
USING HIERARCHICALLY -SEQUENTIAL TABLE Factory method - Community Profiles - SCN Wiki
Regards
Rajkumar Narasimman
Moderator message: Linking farming is not allowed. Points removed
Message was edited by: Suhas Saha
02-27-2015 12:54 PM
Try :
Before coding, try some navigation in the mentionned methods (also correct any typo)
Regards,
Raymond