on 01-02-2010 8:50 AM
Hi,
I am trying to bind dynamic attributes to a dynamically created Node.
The code is as follows
build a structure description from the list of single fields
comp-name = 'CARRID'.
comp-type ?= cl_abap_datadescr=>describe_by_name( 'S_CARR_ID' ).
APPEND comp TO comp_tab.
comp-name = 'CONNID'.
comp-type ?= cl_abap_datadescr=>describe_by_name( 'S_CONN_ID' ).
APPEND comp TO comp_tab.
* not this structure contains the fields "CONNID" and "CARRID"
struct_type = cl_abap_structdescr=>create( comp_tab ).
* now the nodeinfo is created
node_info = wd_context->get_node_info( ).
node_info = node_info->add_new_child_node(
name = 'MY_NODE'
IS_MANDATORY = ABAP_true
IS_MULTIPLE = ABAP_true
STATIC_ELEMENT_RTTI = struct_type
IS_STATIC = ABAP_false
).
But in the output I want my custom List Headings for each of the column.
How to achieve the same.
Edited by: SAP LEARNER on Jan 4, 2010 8:11 AM
Hi
Try with this code:
l_column = l_table->if_salv_wd_column_settings~get_column( 'CARRID' ).
data l_header type ref to cl_salv_wd_column_header.
l_header = l_column->get_header( ).
l_header->set_prop_ddic_binding_field(
property = if_salv_wd_c_ddic_binding=>bind_prop_text
value = if_salv_wd_c_ddic_binding=>ddic_bind_none ).
l_header->set_text( `CARRIER ID` ).
Thanks & Regards
Arun.P
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can set the column titles when you initialize your ALV as follows,
* Data declarations for instantiation
DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table ,
l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
* Instantiate the ALV
l_ref_cmp_usage = wd_this->wd_cpuse_usg_alv_feclm( ) ." alv_feclm is your usage name
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL .
l_ref_cmp_usage->create_component( ) .
ENDIF .
* Get model
l_ref_interfacecontroller = wd_this->wd_cpifc_usg_alv_feclm( ).
l_value = l_ref_interfacecontroller->get_model( ) .
wd_this->l_value_feclm = l_value .
*to make ALV table editable
lr_table_settings ?= l_value .
lr_table_settings->set_read_only( abap_false ).
* Column Settings
lr_column_settings ?= l_value .
lt_columns = lr_column_settings->get_columns( ).
LOOP AT lt_columns INTO ls_column.
CASE ls_column-id.
WHEN 'CA_TEXT'.
lr_column_header = ls_column-r_column->get_header( ) .
lr_column_header->set_ddic_binding_field(
if_salv_wd_c_column_settings=>ddic_bind_none ) .
lr_column_header->set_text( 'Column Header' ) . " this is your coulmn header
WHEN OTHERS.
ENDCASE.
ENDLOOP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.