on 01-15-2009 7:33 AM
I want to make my ALV like this [https://weblogs.sdn.sap.com/weblogs/images/1918/wda_alv17.jpg|https://weblogs.sdn.sap.com/weblogs/images/1918/wda_alv17.jpg] by coding. I've found a pdf about how to do it, but it doesn't work.
Here is my code:
DATA:
l_ref_cmp_usage TYPE REF TO if_wd_component_usage,
l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table.
l_ref_cmp_usage = wd_this->wd_cpuse_salv( ).
IF l_ref_cmp_usage->has_active_component( ) is INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
l_ref_interfacecontroller = wd_this->wd_cpifc_salv( ).
wd_this->r_table = l_ref_interfacecontroller->get_model( ).
cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs~set_all(
r_model = wd_this->r_table ).
wd_this->r_table->if_salv_wd_table_settings~set_display_type(
if_salv_wd_c_table_settings=>display_type_hierarchy ).
DATA: lr_column TYPE REF TO cl_salv_wd_column.
lr_column = wd_this->r_table->if_salv_wd_column_settings~get_column( 'CNOID' ).
lr_column->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).
lr_column = wd_this->r_table->if_salv_wd_column_settings~get_column( 'STOID' ).
lr_column->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).
wd_this->r_table->if_salv_wd_table_hierarchy~set_last_hier_column_as_leaf( abap_true ).
how can i make these code work?
thx
by jkchen
Hi Jiakai,
Refer to this [article|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c060fcb4-2c62-2b10-d2b2-f32407a5cc6f]. It explain the same thing.
I hope it helps.
Regards
Arjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
In the article there is line:
data: l_value type ref to cl_salv_wd_config_table.
But in your code you are using
cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs~set_all(
r_model = wd_this->r_table ).
.
I have worked with the 1st statement, I am not sure if the second one has the same functionality. Just see to it. I think if you use the first statement, your problem will be solved.
Regards
Arjun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi arjun,
it still doesn't work. when i debug it, the system sets the column hierarchy "false"...
the code is like this now:
DATA:
l_ref_cmp_usage TYPE REF TO if_wd_component_usage,
l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table,
l_value TYPE REF TO cl_salv_wd_config_table.
l_ref_cmp_usage = wd_this->wd_cpuse_salv( ).
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
l_ref_interfacecontroller = wd_this->wd_cpifc_salv( ).
l_value = l_ref_interfacecontroller->get_model( ).
* cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs~set_all(
* r_model = l_value ).
l_value->if_salv_wd_std_functions~set_hierarchy_allowed( abap_true ).
l_value->if_salv_wd_table_settings~set_display_type(
if_salv_wd_c_table_settings=>display_type_hierarchy ).
DATA: lr_column TYPE REF TO cl_salv_wd_column.
lr_column = l_value->if_salv_wd_column_settings~get_column( 'CNOID' ).
lr_column->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).
lr_column = l_value->if_salv_wd_column_settings~get_column( 'STOID' ).
lr_column->if_salv_wd_column_hierarchy~set_hierarchy_column( abap_true ).
l_value->if_salv_wd_table_hierarchy~set_last_hier_column_as_leaf( abap_true ).
Hi Jiakai,
Check out this link...
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/7b/fb57412df8091de10000000a155106/frameset.htm
regards
Pranav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.