on 09-14-2009 9:30 AM
Hi all,
When I am displaying the data in the ALV it is populating the whole table. I have few fields which i have selected in the context node. but it is displaying all the fields, Please let me know how I can write the code when i want to display only the selected fields.
" DATA LO_ND_NODE_VBAK TYPE REF TO IF_WD_CONTEXT_NODE.
DATA LO_EL_NODE_VBAK TYPE REF TO IF_WD_CONTEXT_ELEMENT.
DATA LS_NODE_VBAK TYPE WD_THIS->ELEMENT_NODE_VBAK.
DATA IT_VBAK TYPE TABLE OF VBAK.
LO_ND_NODE_VBAK = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_NODE_VBAK ).
LO_EL_NODE_VBAK = LO_ND_NODE_VBAK->GET_ELEMENT( ).
SELECT * FROM VBAK INTO TABLE IT_VBAK.
DATA LO_ND_NODE_ALV TYPE REF TO IF_WD_CONTEXT_NODE.
DATA LS_NODE_ALV TYPE WD_THIS->ELEMENT_NODE_ALV.
NAVIGATE FROM <CONTEXT> TO <NODE_ALV> VIA LEAD SELECTION
LO_ND_NODE_ALV = WD_CONTEXT->GET_CHILD_NODE( NAME = 'NODE_ALV' ).
CALL METHOD LO_ND_NODE_ALV->BIND_TABLE
EXPORTING
NEW_ITEMS = IT_VBAK[]
SET_INITIAL_ELEMENTS = ABAP_TRUE
INDEX =
.
"
Hi,
This is a common problem that you would with face with both a normal Table UI element or an ALV. When you create your context node you would have typed it by specifying the table name in the nodes "Dictionary structure" property. So in your case you would have typed VBAK in here and then you would have pressed upon the pushbutton ("From components of Structure") to select the field names from VABK which you would want to be created as attributes under your context node. Once you finish with this step just clear off the table name (VBAK) from the nodes "Dictionary structure" property. This should resolve your problem.
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why not just hide the fields from display in the ALV:
data: l_ref_cmp_usage type ref to if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv( ).
if l_ref_cmp_usage->has_active_component( ) is initial.
l_ref_cmp_usage->create_component( ).
endif.
data l_salv_wd_table type ref to iwci_salv_wd_table.
l_salv_wd_table = wd_this->wd_cpifc_alv( ).
data l_table type ref to cl_salv_wd_config_table.
l_table = l_salv_wd_table->get_model( ).
data l_column type ref to cl_salv_wd_column.
l_column = l_table->if_salv_wd_column_settings~get_column( 'CLIENT' ).
l_column->set_visible( cl_wd_uielement=>e_visible-none ).
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.