ABAP WebDynpro ALV Filter Dropdown
Hi guys,
Is it possbile to do the dropdown list of alv filter?
If so , how to do that?
Thanks in advance.
Best regards,
Vincent
Hello Lakshmi,
I did as follows.
1. Go to WDComponent.
2. Add SALV_WD_TABLE as Component use at Used Components tab.
3. Go to ViewController.
4. Add SALV_WD_TABLE as used Component and used Interface at Properties tab.
5. Map FILTER_VALUES node from used Component of ALV to Context of ViewController at Context tab.
6. Code as follows.
DATA lo_nd_filter_values TYPE REF TO if_wd_context_node.
DATA ls_filter_values TYPE REF TO if_wd_context_element.
DATA l_wdy_key_value_table TYPE TABLE OF wdy_key_value.
DATA l_wdy_key_value TYPE wdy_key_value.
lo_nd_filter_values = wd_context->get_child_node( name = wd_this->wdctx_filter_values ).
ls_filter_values = lo_nd_filter_values->create_element( ).
ls_filter_values->set_attribute(
name = `FIELDNAME`
value = `ATTR1` "Attribute name that you want to set filter.
*Followings are filter values.
l_wdy_key_value-key = `0`.
l_wdy_key_value-value = ``.
APPEND l_wdy_key_value TO l_wdy_key_value_table.
l_wdy_key_value-key = `1`.
l_wdy_key_value-value = `AAAA`.
APPEND l_wdy_key_value TO l_wdy_key_value_table.
l_wdy_key_value-key = `2`.
l_wdy_key_value-value = `BBBB`.
APPEND l_wdy_key_value TO l_wdy_key_value_table.
l_wdy_key_value-key = `3`.
l_wdy_key_value-value = `CCCC`.
APPEND l_wdy_key_value TO l_wdy_key_value_table.
ls_filter_values->set_attribute(
name = `T_DROPDOWN_VALUES`
value = l_wdy_key_value_table
lo_nd_filter_values->bind_element( new_item = ls_filter_values set_initial_elements = abap_false ).
Regards,
Masaaki YANOKUCHI
Edited by: Masaaki Yanokuchi on Jan 26, 2010 10:35 AM
Similar Messages
-
Web Dynpro ABAP ALV Filter Dropdown
Hi,
I have a question regarding the filter in the ALV.
I would like to implement a filter with a dropdown box showing all possible values of a DDIC domain. The results should look like on the following screenshot (Taken from a POWL list)
[Screenshot|http://dl.dropbox.com/u/958234/ALV_Filter_Dropdown.png]
How is this possible with a normal SAP List Viewer?
Thanks a lot
Kind regards,
SwenYes,
You can do it.
lr_filter_element = i_filter_node->create_element( ).
lr_filter_element->set_attribute(
name = 'FIELDNAME'
value = <lfs_field>-fieldname
lr_filter_element->set_attribute(
name = 'T_DROPDOWN_VALUES'
value = lt_key_values
i_filter_node->bind_element(
new_item = lr_filter_element
set_initial_elements = abap_false
Best regards,
Rohit -
Unable to selelct a Row in ABAP Webdynpro ALV table
Hi,
I have a ALV Table in webdynpro and I need to choose a Row in that table. But the table is not allowing me to choose the row.
Row_selectable is at 'X'.
Row selection type is at 8.
Still.. the grid looks like it is in display mode..
pls helpHi
You explicitly need to make the table editable.
DATA lo_table_setings TYPE REF TO if_salv_wd_table_settings.
lo_table = lo_interfacecontroller->get_model( ).
lo_field_settings ?= lo_table.
lo_table_setings->set_cell_action_event_enabled( value = abap_true ).
lo_table_setings->set_read_only( value = abap_false ).
lo_table_setings->set_enabled( value = abap_true ).
have u written thse lines in ur code??
Regards,
Arvind -
How to provide F4 for inputfield in ABAP Webdynpro ALV
Hi Friends,
I am displaying records in Editable ALV Gridd in webdynpro.
I need to provide search help(F4) for few fields which are editable.
Please help me, how I can achieve this functionality in ALV .
Regards,
Xavier.phi Xavier.
to display the data in alv you must have binded it to some context node / attribute rite?.......now to get an input help to the fields you can first make the search help using transaction se11...after making the search help return to the web dynpro component go to the conttext tab.... click on the particular attribut where you want to have the search help....check in the property below...you will find that the " INPUT SEARCH help" is set to automatic ....set it to " dictionary search help".....and below it mention the name of search help you created....save it and activate the component again...the search help will be reflected automatically in the output.
in case of any further query regarding this kindly reply.
thanks,
sahai.s -
Webdynpro + alv + dynamic dropdown
Hi,
I;m struggling with creating drop-down in alv grid and unfortunately I couldn't find any reasonable solution. One of the column in grid should be dropdown type, data in dropdown should come from internal table.
I would apreciate your help,
AdamI think the easiest way is to post my complete method. Sorry, its long, because of 5 dropdown and some input fields:
METHOD wddoinit .
DATA:lt_valueset TYPE wdr_context_attr_value_list,
ls_valueset TYPE wdr_context_attr_value,
lr_node TYPE REF TO if_wd_context_node,
stru_total_list TYPE if_mainview=>element_node_dispo_tab,
itab_total_list TYPE if_mainview=>elements_node_dispo_tab.
*Input for the Prio Dropdown
lr_node = wd_context->get_child_node( name = 'NODE_DISPO_TAB' ).
CLEAR: ls_valueset.
ls_valueset-value = 'I'.
ls_valueset-text = 'I'.
INSERT ls_valueset INTO TABLE lt_valueset.
CLEAR: ls_valueset.
ls_valueset-value = 'II'.
ls_valueset-text = 'II'.
INSERT ls_valueset INTO TABLE lt_valueset.
CLEAR: ls_valueset.
ls_valueset-value = 'III'.
ls_valueset-text = 'III'.
INSERT ls_valueset INTO TABLE lt_valueset.
CLEAR: stru_total_list.
stru_total_list-prio_list = lt_valueset.
Input for the Status Dropdown
CLEAR: ls_valueset, lt_valueset.
ls_valueset-value = 'Offen'.
ls_valueset-text = 'Offen'.
INSERT ls_valueset INTO TABLE lt_valueset.
CLEAR: ls_valueset.
ls_valueset-value = 'Angebot'.
ls_valueset-text = 'Angebot'.
INSERT ls_valueset INTO TABLE lt_valueset.
stru_total_list-status_list = lt_valueset.
*Input for the Remote Dropdown
CLEAR: ls_valueset, lt_valueset.
ls_valueset-value = 'Ja'.
ls_valueset-text = 'Ja'.
INSERT ls_valueset INTO TABLE lt_valueset.
CLEAR: ls_valueset.
ls_valueset-value = 'Nein'.
ls_valueset-text = 'Nein'.
INSERT ls_valueset INTO TABLE lt_valueset.
stru_total_list-remote_list = lt_valueset.
Input for the Skill Dropdown
CLEAR: ls_valueset, lt_valueset.
ls_valueset-value = 'SAPScript'.
ls_valueset-text = 'SAPScript'.
INSERT ls_valueset INTO TABLE lt_valueset.
CLEAR: ls_valueset.
ls_valueset-value = 'Smartforms'.
ls_valueset-text = 'Smartforms'.
INSERT ls_valueset INTO TABLE lt_valueset.
stru_total_list-skill_list = lt_valueset.
*Input for the Modul Dropdown
CLEAR: ls_valueset, lt_valueset.
ls_valueset-value = 'CO'.
ls_valueset-text = 'CO'.
INSERT ls_valueset INTO TABLE lt_valueset.
CLEAR: ls_valueset.
ls_valueset-value = 'CRMO'.
ls_valueset-text = 'CRMO'.
INSERT ls_valueset INTO TABLE lt_valueset.
*Input of dropdowns to internal table
stru_total_list-modul_list = lt_valueset.
INSERT stru_total_list INTO TABLE itab_total_list.
DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table,
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.
l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).
*ref to if_wd_context_node
l_ref_interfacecontroller->set_data( r_node_data = lr_node ).
DATA: l_value TYPE REF TO cl_salv_wd_config_table,
lr_column TYPE REF TO cl_salv_wd_column,
lr_column_settings TYPE REF TO if_salv_wd_column_settings,
lr_dropdown1 TYPE REF TO cl_salv_wd_uie_dropdown_by_idx,
lr_dropdown2 TYPE REF TO cl_salv_wd_uie_dropdown_by_idx,
lr_dropdown3 TYPE REF TO cl_salv_wd_uie_dropdown_by_idx,
lr_dropdown4 TYPE REF TO cl_salv_wd_uie_dropdown_by_idx,
lr_dropdown5 TYPE REF TO cl_salv_wd_uie_dropdown_by_idx,
lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.
l_value = l_ref_interfacecontroller->get_model( ).
DATA: lr_table_settings TYPE REF TO if_salv_wd_table_settings,
lr_std TYPE REF TO if_salv_wd_std_functions.
*make alv editable
lr_table_settings ?= l_value.
lr_table_settings->set_read_only( abap_false ).
*Activating the functional sections of ALV-Output
lr_table_settings->set_enabled( abap_true ).
*rows should not be selectable
lr_table_settings->set_row_selectable( abap_false ).
hide buttons "check", "delete row" and "insert row"
lr_std ?= l_value.
lr_std->set_edit_check_available( abap_false ).
lr_std->set_edit_check_available( abap_false ).
lr_std->set_edit_delete_row_allowed( abap_false ).
lr_std->set_edit_insert_row_allowed( abap_false ).
create dropdown
lr_column_settings ?= l_value.
lr_column = lr_column_settings->get_column( 'PRIO' ).
CREATE OBJECT lr_dropdown1
EXPORTING
selected_key_fieldname = 'PRIO'.
lr_dropdown1->set_valueset_fieldname( value = 'PRIO_LIST' ).
lr_dropdown1->set_read_only( value = abap_false ).
lr_dropdown1->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
lr_column->set_cell_editor( lr_dropdown1 ).
create dropdown
lr_column_settings ?= l_value.
lr_column = lr_column_settings->get_column( 'STATUS' ).
CREATE OBJECT lr_dropdown2
EXPORTING
selected_key_fieldname = 'STATUS'.
lr_dropdown2->set_valueset_fieldname( value = 'STATUS_LIST' ).
lr_dropdown2->set_read_only( value = abap_false ).
lr_dropdown2->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
lr_column->set_cell_editor( lr_dropdown2 ).
create dropdown
lr_column_settings ?= l_value.
lr_column = lr_column_settings->get_column( 'THEMA' ).
CREATE OBJECT lr_input_field
EXPORTING
value_fieldname = 'THEMA'.
lr_column->set_cell_editor( lr_input_field ).
set cell editor for input field
lr_column_settings ?= l_value.
lr_column = lr_column_settings->get_column( 'KD_NR' ).
CREATE OBJECT lr_input_field
EXPORTING
value_fieldname = 'KD_NR'.
lr_column->set_cell_editor( lr_input_field ).
set cell editor for input field
lr_column_settings ?= l_value.
lr_column = lr_column_settings->get_column( 'KD_NAME' ).
CREATE OBJECT lr_input_field
EXPORTING
value_fieldname = 'KD_NAME'.
lr_column->set_cell_editor( lr_input_field ).
set cell editor for input field
lr_column_settings ?= l_value.
lr_column = lr_column_settings->get_column( 'KD_ORT' ).
CREATE OBJECT lr_input_field
EXPORTING
value_fieldname = 'KD_ORT'.
lr_column->set_cell_editor( lr_input_field ).
set cell editor for input field
lr_column_settings ?= l_value.
lr_column = lr_column_settings->get_column( 'KD_ANSPR' ).
CREATE OBJECT lr_input_field
EXPORTING
value_fieldname = 'KD_ANSPR'.
lr_column->set_cell_editor( lr_input_field ).
create dropdown
lr_column_settings ?= l_value.
lr_column = lr_column_settings->get_column( 'REMOTE' ).
CREATE OBJECT lr_dropdown3
EXPORTING
selected_key_fieldname = 'REMOTE'.
lr_dropdown3->set_valueset_fieldname( value = 'REMOTE_LIST' ).
lr_dropdown3->set_read_only( value = abap_false ).
lr_dropdown3->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
lr_column->set_cell_editor( lr_dropdown3 ).
create dropdown
lr_column_settings ?= l_value.
lr_column = lr_column_settings->get_column( 'SKILL' ).
CREATE OBJECT lr_dropdown4
EXPORTING
selected_key_fieldname = 'SKILL'.
lr_dropdown4->set_valueset_fieldname( value = 'SKILL_LIST' ).
lr_dropdown4->set_read_only( value = abap_false ).
lr_dropdown4->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
lr_column->set_cell_editor( lr_dropdown4 ).
create dropdown
lr_column_settings ?= l_value.
lr_column = lr_column_settings->get_column( 'MODUL' ).
CREATE OBJECT lr_dropdown5
EXPORTING
selected_key_fieldname = 'MODUL'.
lr_dropdown5->set_valueset_fieldname( value = 'MODUL_LIST' ).
lr_dropdown5->set_read_only( value = abap_false ).
lr_dropdown5->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
lr_column->set_cell_editor( lr_dropdown5 ).
set cell editor for input fields
lr_column_settings ?= l_value.
lr_column = lr_column_settings->get_column( 'MA_NAME' ).
CREATE OBJECT lr_input_field
EXPORTING
value_fieldname = 'MA_NAME'.
lr_column->set_cell_editor( lr_input_field ).
set cell editor for input fields
lr_column_settings ?= l_value.
lr_column = lr_column_settings->get_column( 'TEAMLEITER' ).
CREATE OBJECT lr_input_field
EXPORTING
value_fieldname = 'TEAMLEITER'.
lr_column->set_cell_editor( lr_input_field ).
*bind content of internal table
lr_node->bind_table( itab_total_list ).
ENDMETHOD.
Message was edited by:
Ingmar Kroll -
Abap WD ALV: Event for calculation row?
Hi,
i have one Abap WebDynpro ALV Component. It is possible to register an event (ON_CLICK) for Cells which are an Link_to_action for example.
My Table:
ID | Group | Var
A1 | Test | 4
A2 | Test | 5
A3 | Dev | 4
A4 | Dev | 6
If i create the ON_CLICK event for the last row, which is then a link_to_action column, i can click on the numbers and the event is triggered
Now i have a table which uses the ALV Calculation feature and the Intermediate Results for the grouping.
My new output view is:
ID | Group | Var
->---Test 9
A1 | Test | 4
A2 | Test | 5
->---Dev 10
A3 | Dev | 4
A4 | Dev | 6
(It calculates the sum of the vars and groups it by the second column)
Now I need an Event if someone clicks on the numbers in the Var Row of the intermediate results row (here: 9 and 10). How can i do this?
If this is not possible, how can i register an event if someone expands or collapses a intermediate result row?
Kind Regards,
Thomas
Edited by: Thomas Rodemer on Oct 9, 2008 3:30 PM
Edited by: Thomas Rodemer on Oct 9, 2008 3:30 PMHi,
Is the DDLBK is filled with support function? if yes then look if you can enhance the method by post method exit etc..
Thanks,
Chandra -
Hi friends,
How to have custom dropdown list for field in abap webdynpro.
It is possible in general abap with FM 'VRM_SET_VALUES' how it's possible in abap webdynpro.
Please reply.....
Thanks in advance.Hi,
Create a context node having attribute field whose values you want to see in the dropdown.
i you are using ui element as dropdownby key then follow the following code.
DATA : node_info TYPE REF TO if_wd_context_node_info.
DATA : it_zinsp TYPE TABLE OF zinsp. " here zinsp is the name of table
FIELD-SYMBOLS : <tablezinsp> TYPE zinsp.
DATA : value TYPE wdy_key_value,
value_set TYPE wdy_key_value_table.
DATA : zlandx TYPE string.
Inserting the countries into the destination drop down
value-key = lc_key.
value-value = lc_select.
INSERT value INTO TABLE value_set.
node_info = wd_context->get_node_info( ).
node_info = node_info->get_child_node( 'CN_DESTINATION' ). " CN_DESTINATION is name of node
CALL METHOD cl_wd_dynamic_tool=>get_table_data
EXPORTING
tab_name = 'ZINSP'
row_count = 0
IMPORTING
data = it_zinsp.
LOOP AT it_zinsp ASSIGNING <tablezinsp> .
SELECT landx FROM t005t INTO zlandx
WHERE land1 EQ <tablezinsp>-zland1
AND spras = sy-langu.
ENDSELECT.
value-key = <tablezinsp>-zland1.
value-value = zlandx.
INSERT value INTO TABLE value_set.
ENDLOOP.
node_info->set_attribute_value_set( name = 'CA_DESTINATION'
value_set = value_set ). " CA_DESTINATION is the name of attribute.
I hope it helps.
Regards,
Rohit -
Sorting issue in ALV ABAP webdynpro
Hi All,
We are displaying the data in ALV format using ABAP webdynpro.
The issue here is sorting the values. The field is the character field, as the field may contain character or numberic values.
When we sort a set of values in ascending order, the values are sorted wrongly.
Example values sorted in ascending order:
11055
11260
5662
8697
9984
The above values are sorted wrongly. Is this a standard limitation of webdynpro ABAP or do we have any support class or setting available to solve this issue.
Please help.
Regards,
VijayHello Vijay
of course its not a limitation, you can sort it either ways.
Check the following link
http://help.sap.com/saphelp_nw70/helpdata/en/e9/e5eb40c4f8712ae10000000a155106/content.htm
you can use the following classes
Set sort Direction -
CL_SALV_SORTS meth: ADD_SORT (Parameter SEQUENCE)
CL_SALV_SORT meth: SET_SEQUENCE
Get sort direction
CL_SALV_SORT meth: GET_SEQUENCE
hope this helps!!
Regards
Senon -
Set color alv output cell abap webdynpro
Hi Guys ,
i wanted to set the color of some cells in alv output to red in ABAP WebDynpro.
i am using the salv_wd_table.
any piece of code is appreciated.
thanks,
Bobby.Bobby,
If let's say you are build a ALV table to output 'SFLIGHT' table, and you want PLANETYPE '747-400' to be displayed in green, and PLANETYPE '146-200' displayed in red.
Also, let's just say, you already had a context node 'SFLIGHT_NODE' that is mapped to the external node 'DATA' of your ALV.
Now:
1. you need to modify the context node 'SFLIGHT_NODE' to add an attribute -- say 'CELL_COLOR' of type 'WDY_UIE_LIBRARY_ENUM_TYPE' -- to the SFLIGHT_NODE (note, you need to delete 'DICTIONARY structure' that is bind to the 'SFLIGHT_NODE' node, otherwise, you will not be able to create addition attributes)
After, you will have something like this for your context node .
CONTEXT
--> SFLIGHT_NODE
> CARRID
> CONNID
> FLDATE
> PRICE
> PLANETYPE
> <and any other attributes you had pulled from SFLIGHT)
> CELL_COLOR (TYPE WDY_UIE_LIBRARY_ENUM_TYPE)
2. In your supply function to the 'SFLIGHT_NODE', you now need to supply the data to this newly added attribute:
METHOD supply_sflight_node .
** data declaration
DATA:
itab_sflight_node TYPE if_componentcontroller=>elements_sflight_node,
stru_sflight_node LIKE LINE OF itab_sflight_node.
** read sflight data
SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE itab_sflight_node.
** populate the 'CELL_COLOR' field
LOOP AT itab_sflight_node INTO stru_sflight_node .
IF stru_sflight_node-planetype = '747-400'.
stru_sflight_node-cell_color = CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-GOODVALUE_DARK .
ELSEIF stru_sflight_node-planetype = '146-200'.
stru_sflight_node-cell_color = CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-BADVALUE_DARK .
ELSE.
stru_sflight_node-cell_color = CL_WD_TABLE_COLUMN=>E_CELL_DESIGN-STANDARD .
ENDIF.
modify itab_sflight_node from stru_sflight_node.
ENDLOOP.
** bind all the elements
node->bind_table(
new_items = itab_sflight_node
set_initial_elements = abap_true ).
ENDMETHOD.
3. Now, you need to obtain the configuration model of the ALV and config it before display. (say you have an method does this 'init_alv_table_settings', and it is called from your view's wddoinit() method)
METHOD init_alv_table_settings .
DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
l_ref_cmp_usage = wd_this->wd_cpuse_alv_table( ).
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .
l_ref_interfacecontroller = wd_this->wd_cpifc_alv_table( ).
DATA:
node_sflight_node TYPE REF TO if_wd_context_node .
node_sflight_node = wd_context->get_child_node( name = if_flights_view=>wdctx_sflight_node ).
CALL METHOD l_ref_interfacecontroller->set_data
EXPORTING
r_node_data = node_sflight_node.
** get ConfigurationModel from ALV Component
DATA: lr_table TYPE REF TO cl_salv_wd_config_table.
lr_table = l_ref_interfacecontroller->get_model( ).
** change the color of the cell
DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
DATA: lr_column TYPE REF TO cl_salv_wd_column.
lr_column_settings ?= lr_table.
lr_column = lr_column_settings->get_column( 'PLANETYPE' ).
DATA: lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.
CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'PLANETYPE'.
lr_column->set_cell_editor( lr_input_field ).
lr_column->set_cell_design_fieldname( value = 'CELL_COLOR' ).
ENDMETHOD.
Compile and activate your code.
Regards,
Tina Yang
Message was edited by: Tina Yang -
ABAP WebDynpro: Handling the ON_ENTER Event in editable ALVs
Sub: ABAP WebDynpro : Handling the ON_ENTER Event in editable ALVs
Hi,
I would like to know if there exists an event to handle TABout (i.e, when user navigates out of the cell with a TAB key-press) for a cell of an editable ALV.
Alternatively, any help on how to handle ON_ENTER event and how it is triggered when data is entered by user into a cell of an editable ALV, would be really appreciated.
Thanks,
AdithyaHi
I had one similar problem where user enter something into the editable cell and press enter. to handle this scenario i used WDDOBEFOREACTION method of my view to call alv interface method check_data.
if there is any change in the any table cell, it will fire an event on_data_check..which has paramater column name, row index and new and old value of the cell.
you can handle this event and write your business logic in event handler method.
hope it will help
Regards
Saurabh Garg -
Disabling fields(Make the field as non-editable) in webdynpro ALV
HI All,
I have a requirement in the ABAP webdynpro where I have to disable(Make the field as non-editable) the field(or that ALV cell alone) in the ALV after the user has inputed in that field.
Is it possible, if yes, could you please give me some sample code , or links to which I can refer to.
Thanks for your help.
Regards,
Subash MHi,
Use the following approach :
1. Create an ALV and create an inputfield cell editor for the column that you want to make editable/disable.Refer this tutorial for creating an [Editable ALV|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3133474a-0801-0010-d692-81827814a5a1]
2. Now under the same node create an attribute EDITABLE type boolean and bind this to the readonly property of the input field. Include the following code while creating Input field for binding.
lr_input_field->set_read_only_fieldname( 'EDITABLE' ).
3. Now implement the onDataCheck event or OnCellAction event and pass abap_true to this attibute to make the cell readonly/disable.Refer this tutorial for [Events in ALV|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/bd28494a-0801-0010-45a3-fc359d82d3e8]
Hope this helps.
Regards,
Radhika. -
How to code to get intermediate results in webdynpro ALV? Please help!
Hi Experts,
I got following info from help file to generate Intermediate Results(subtotal).
Can somebody help me with sample code to achieve this?
Basically I want to subtotal 'Qty' column based on 'Product' field.
By default, all values in a field are used in the calculation during aggregation. However, you
are also able to generate intermediate results. You group the data records that contain the
values for an intermediate result and display each intermediate result in its own result row.
To generate intermediate results, you have to provide certain information:
● To specify in which field the values from which the intermediate results are calculated
are located, generate an aggregation condition for the desired field. The overall result is
displayed in the result row.
● To specify which data records are contained in an intermediate result, group the data
records: You sort the ALV output by the field that includes the criterion for the
intermediate result.
● To then generate the intermediate results, calculate the intermediate results using the
field with the criterion.
● To then display the intermediate results, switch on the display of intermediate results.
You are able to make the following settings for intermediate results:
● Generate intermediate results
● Display intermediate results
● Setting levels for drilling down intermediate results
● Set the position of the result rows (see Settings for Aggregation [page 196])
● Forbid the generation of intermediate results
Prerequisites
● You have generated an aggregation object for at least one aggregatable field.
● The field with the criterion for intermediate results is not an aggregatable field, and
therefore has an alphanumeric data type.
Generate Intermediate Results
To generate intermediate results in a field that already has an aggregation condition, generate
a sort condition for the field of a column (another column) (see Sorting [page 190]).
In this sort condition, define whether intermediate results are to be generated. To do this, use
the methods of the class CL_SALV_WD_SORT_RULE.
Methods for Generating Intermediate Results
Function Method
Generate intermediate results SET_GROUP_AGGREGATION
Check whether intermediate results are displayed GET_GROUP_AGGREGATION
Display Intermediate Results
Once you have made all settings, to generate intermediate results you have to switch on the
display of these intermediate results. You use the methods of the interface class
IF_SALV_WD_FIELD_SETTINGS for this (implementing class
CL_SALV_WD_CONFIG_TABLE).
Methods for Displaying Intermediate Results
Function Method
Display intermediate results SET_GROUP_AGGR_DISPLAYED
Check whether intermediate results are displayed GET_GROUP_AGGR_DISPLAYED
I have tried a bit but it is not working. here is my code:
get field and create aggregation rule of type total
lr_field = l_value->if_salv_wd_field_settings~get_field( 'Qty' ).
lr_field->if_salv_wd_aggr~create_aggr_rule( ).
lr_aggr_rule = lr_field->if_salv_wd_aggr~get_aggr_rule( ).
lr_aggr_rule->set_aggregation_type( if_salv_wd_c_aggregation=>aggrtype_total ).
l_field = l_value->if_salv_wd_field_settings~get_field( 'PRODUCT' ).
l_sortrule = l_field->IF_SALV_WD_SORT~create_sort_rule( ).
l_sortrule~SET_GROUP_AGGREGATION( 'Y').
l_value->if_salv_wd_field_settings~SET_GROUP_AGGR_DISPLAYED( 'Y' ).
Please help
Message was edited by:
gopalkrishna baligaHi Gopalakrishna balgia,
I think i have answered in the below thread. Check it out.
How to show Subtotal in webdynpro ALV(ABAP)? Kindly help!
Regards
Rakesh -
Using customize portal theme for abap webdynpro.
Dear all,
I have a customized portal theme where we used different color for the portal. When I create a abap webdynpro application for a workflow task (the application will launch when user click on the item in the UWL). When the application launch, it does not use the customized portal theme instead it just use the standard theme.
Anyone knows where can I configure it?
Thanks
Regards
BryanHi Brian,
You can change the color of a table only if u have the Textview as UI element for cell.
You can change the semantic color property of textview.
Please check this.
I would suggest you to use ALV instead of Table as you can change its colors easily by using functions like SET_DESIGN
GET_DESIGN of IF_SALV_WD_TABLE_SETTINGS.
I hope it helps.
Please revert back with issues.
Regards,
Sumit Oberoi -
Export and Import functionality in WebDynpro ALV
Hi Experts,
I have done a webdynpro alv application and it is displaying the data as i wanted. However i have a requirement to get the alv displayed data in an excel sheet( which works with the export button on alv) and update that excel sheet which will be updated back in the alv table.(for eg any import button functinality on alv)
Regards,
TashiHi,
For this you need to use file upload to upload the modified excel data back to ALV. Else why dont you make an ALV Editable.!
For upload excel refer this wiki: [Upload excel in WDA|http://wiki.sdn.sap.com/wiki/display/WDABAP/ExcelFileUploadAndDisplayDataUsingWebDynPro+ABAP]
hope this helps u.,
Thanks & regards,
Kiran. -
Dynamic report output in a webdynpro alv
Hi,
I have created a dynamic report in the R/3 system . In this report, i am creating a report program within the report and subsequently executing this dynamically created report and displaying in the ALV..
Is it possible to handle such a scenario in a webdynpro ALV. One option is to use ITS and display the report in the portal but is there some other way so that i can directly view this report in an alv grid in a view.
all help appreciated!!
regards,
PriyankHi Priyank,
This could be one of the solution:
1] Run the report in background mode (using submit statement, dn't forget to give printer as LOCL), get the spool id programatically. Use the FM's CONVERT_OTFSPOOLJOB_2_PDF or CONVERT_ABAPSPOOLJOB_2_PDF.
Which returns the ouput of table tline, convert this to xtring and bind it to xtring attribute.
In view add a interactive form and bind the xstring attribute to the Interactive form.
By following the above steps, we can display the result in the PDF in WD ABAP.
2] The report result is ALV and in most of the cases we generally do not have function modules or any other easy way to get the output.
In such cases the best approach which we follow is, to run this in background mode and generate the spool and display the ouput in PDF.
3] But if intertactive form is not present in your requirement then we need to debug the logic of the report (if no FM or class present) and get the results and display it in the View.
You can create a service which takes the parameters of the report, submits it and
transfers the result to HTML. In a view you use an IFRame which takes the URL of the service and shows the result HTML.
just additionally read this thread,
Display simple ABAPLIST
Here an IFrame is used to display HTML output of report. But as IFRame gets obsolete the Suresh's solution seems to be pretty cool.
Hope this will help you!
Cheers,
Darshna.
Maybe you are looking for
-
How can I get the project number to be included in my expense report query?
..afternoon gurus. As title suggests, I need to include the project number in my script for the users. I've everything else but I've noticed even with the project number specified in the application (in Step 3), the database table (I'd thought that i
-
The new ITunes software for Windows, ITunes vers. 11.0.1.12, is extemely clumsy for managing my IPhone 4. The help material is designed for the older version so is of no use. The interface is extremely difficult to use except for buying music or vi
-
Assets transfer using ABUMN and getting error already retired.
Hi AA Gurus I have two assets and want to move to sub assets of another asset.e.g asset 201,202 to be transfered to 203-1,203-2. I created sub asset using AS11.I am transferring to sub assets using ABUMN. I get ever time error as "Transaction on asse
-
OTL: Changing the rotation plan name
Hi All, Is there any impact for changing the names of rotation plans, work plans, and shifts, noting that the rotation plan is assigned already for many assignments? thanks,
-
Customer fiscal year in scheduling agreement
hi SD experts, i meet a problem as below, Cumulative issued quantity in SA can not cumulate the previous year's quantity, i have checked the delivery schedule header data and find that Customer fiscal year and customer previouse year (Customer fi