on 03-25-2011 7:16 AM
HI everyone,
I have one scenario in which i hav a display in WDA table UI element.
in this table i hav multiple rows and each row belongs to a unique group (this in my term is a bundle)...
say bundle1 has 10 rows
bundle2 has 8 rows
bundle3 has 15 rows.
now each row has a weight field.....and i want output as
bundle1 - 1st row
bundle1 - 2nd row
.
.
bundle1 - 10th row
total wieght 1 - "say 100kgs
similarly
bundle2 - 1st row
bundle2 - 2nd row
.
.
bundle2 - 8th row
total wieght 2 - "say 95kgs
and so on....
i want some aggr function which automatically provides me with the ouptut of total weight of each bundle or say group
i found this particular code
DATA:
node_table_out TYPE REF TO if_wd_context_node,
sum TYPE i ,
wa_table_out TYPE if_v_sv_ovstest=>element_table_out .
it_table_out TYPE if_v_sv_ovstest=>elements_table_out .
node_table_out = wd_context->get_child_node( name = if_v_sv_ovstest=>wdctx_table_out ).
"To read node
node_table_out->get_static_attribute_table( it_table_out ).
"_________ to sum the particullar column
LOOP AT it_table_out INTO wa_table_out.
sum = sum + wa_table_out-mark .
ENDLOOP.
wa_table_out-mark = sum.
APPEND wa_table_out to it_table_out.
" __________ to append in last line
node_table_out->bind_table( it_table_out ).
if ur using the ALV
there is default method.
l_table->if_salv_wd_std_functions~set_aggregation_allowed( abap_true ).
this is complete for a table bt not group wise......
is there any standard functon for Table UI Element already available....
i want this table to be dynamic as well as user can change weight so total weight should also change..
i have also gone through WDR_TEST_TABLE....i didnt find anythin in tht also...
can anyone plz help
Hi,
In there is property GroupingValue in TableColumn of a Table Ui element. Select perticular column and bind the value to the GroupingValue.
For example if u want to group a column for carrid, u can bind that carrid context attribute of the table to GroupingValue.
I hope this will help you..
Regards,
Shaira
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please follow the following steps.
1. First, all data sets to be displayed have to be stored in an internal table. This
table should contain an additional column of type string. This column will
be filled with the name of the cell variant used to display the corresponding
table line.
2. The internal table has to be sorted according to the data set groups, subtotals
should be displayed for.
3. After each data set group an additional line has to be inserted into the
internal table. This table line has to contain the sums of the numeric columns
for this group. The cells forming the grouping criterion should contain the
corresponding values. The extra table column should be filled with the name
of the cell variant used to display this table line. All other nun-numeric
cells should be initial.
4. The context of the controller has to be defined. The data node should contain
all attributes to be displayed by the table. In addition, an attribute related
to the extra table column has to be defined. At runtime, this attribute will
contain the name of the cell variant used to render the related table line.
5. The content of the internal table has to be copied to the context.
6. Next, the view's layout has to be defined. Using the wizard, a simple table
displaying the content of the context node can be defined. However, the
extra table column (containing the cell variant name) may not be displayed.
7. For each TableColumn the property selectedCellVariant has to be bound to
the context attribute containing the cell variant name.
8. For each TableColumn, a cell variant of type TableSummaryCell has to be
defined as a direct sub element. The property variantKey has to be evaluated
with the variant name for the subtotal lines (defined in step 3).
9. Finally, a table cell editor (typically a TextView UI element) has to be defined
for each cell variant defined in the previous step. The primary property has
to be bound to the context attribute related to this column.
HI,
Please have a look at Intermediate Results section in the below PDF file:
[SAP List Viewer in Web Dynpro|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0b6a153-a132-2d10-bcb3-ac585332542a?quicklink=index&overridelayout=true]
Regards,
MAdhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.