Select-Options in web ui component
Hi All,
I am new to crm7.I need to create the select-options in web ui component(BSP_WD_CMPWB).Please let me know the how to do this.
Thanks,
Santhosh
Hi Santosh
do one thing access the BP_HEAD_SEARCH component, from there access the Main search view there go to EH_ONSEARCH method . Here in this method it is clearly given how to instantiate and how to use this method, for your reference I'm giving here again
data: lr_advanced_query TYPE REF TO cl_crm_bol_dquery_service,
lr_bp_head_coll type ref to if_bol_bo_coll.
1) lr_advanced_query = cl_crm_bol_dquery_service=>get_instance( 'BuilHeaderAdvancedSearch' ).
Get the instance of cl_crm_bol_dquery_service instance .
2) lr_advanced_query->add_selection_param( iv_attr_name = 'PARTNER'
iv_sign = 'I'
iv_option = 'EQ'
iv_low = lv_partner
iv_high = '' ).
On the returned instance (lr_advanced_query) call the method add_selection_param ( ) method
3) lr_bp_head_coll = lr_advanced_query->get_query_result( ).
call the query result
after doing the above steps , the view coding will support you to build the screen , it will looks like below.
<thtmlb:advancedSearch id = "advs0"
fieldMetadata = "<%= controller->GET_DQUERY_DEFINITIONS( ) %>"
header = "<%= SEARCH->get_param_struct_name( ) %>"
fieldNames = "<%= controller->GET_POSSIBLE_FIELDS( ) %>"
values = "//SEARCH/PARAMETERS"
maxHits = "//SEARCH/MAX_HITS"
ajaxDeltaHandling = "false"
onEnter = "search" />
remember your controller class must inherit from CL_BSP_WD_ADVSEARCH_CONTROLLER , other wise advanced search controller functionality will not work, for this pls check the inheritace of main search view controller class.\
Thanks & Regards
Raj
after doing this
Similar Messages
-
Hi,
Is there any way to deafult current date to date select-option in web dyn pro?hi,
Check following code:
DATA:
lr_componentcontroller TYPE REF TO ig_componentcontroller,
l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
DATA:
lt_range_table TYPE REF TO data,
lt_types TYPE string_table,
rt_range_table TYPE REF TO data,
text TYPE string,
typename TYPE string.
DATA: vbeln TYPE lips-vbeln,
erdat TYPE lips-erdat,
auart TYPE vbak-auart,
trnsp TYPE vtadd01t-add_info,
kunnr TYPE likp-kunnr.
DATA:
num_events TYPE i.
DATA: uname TYPE sy-uname.
uname = sy-uname.
wd_context->set_attribute( name = 'CUSTOMER'
value = uname ).
wd_context->GET_ATTRIBUTE( Name = 'TRANSPORTER_CODE'
Value = uname ).
create the used component
l_ref_cmp_usage = wd_this->wd_cpuse_select_options( ).
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
get a pointer to the interface controller of the select options component
wd_this->m_wd_select_options = wd_this->wd_cpifc_select_options( ).
init the select screen
wd_this->m_handler = wd_this->m_wd_select_options->init_selection_screen( ).
lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'VBELN_VL' ).
wd_this->m_handler->add_selection_field(
i_description = 'Sales Document'
i_id = 'VBELN'
i_obligatory = 'X'
it_result = lt_range_table
i_value_help_structure = 'LIPS'
i_value_help_structure_field = 'VBELN' ).
lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'ERDAT' ).
wd_this->m_handler->add_selection_field( i_id = 'ERDAT' i_obligatory = 'X' it_result = lt_range_table ).
*lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'VTTK_ADD01' ).
*wd_this->m_handler->add_selection_field( i_id = 'VTTK_ADD01' I_DESCRIPTION = 'CHAHA' it_result = lt_range_table ).
wd_this->m_handler->add_selection_field(
i_description = 'Transporters Code'
i_id = 'VTTK_ADD01'
it_result = lt_range_table
i_value_help_structure = 'VTADD01T'
i_value_help_structure_field = 'ADD_INFO' ).
*Supress Global options in Used Component
wd_this->m_handler->set_global_options(
i_display_btn_cancel = ''
i_display_btn_check = ''
i_display_btn_execute = ''
i_display_btn_reset = '' ).
lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'VBAK-AUART' ).
wd_this->m_handler->add_selection_field(
i_description = 'Sales Document Type'
i_id = 'AUART'
i_obligatory = 'X'
it_result = lt_range_table
i_value_help_structure = 'VBAK'
i_value_help_structure_field = 'AUART' ).
ENDMETHOD.
METHOD onactionexecute .
DATA: node_saledoc TYPE REF TO if_wd_context_node.
DATA: node_crdate TYPE REF TO if_wd_context_node.
DATA: node_transcode TYPE REF TO if_wd_context_node.
DATA: node_doctype TYPE REF TO if_wd_context_node.
DATA: node1 TYPE REF TO if_wd_context_node.
DATA: node2 TYPE REF TO if_wd_context_node.
DATA: rt_saledoc TYPE REF TO data.
DATA: rt_crdate TYPE REF TO data.
DATA: rt_transcode TYPE REF TO data.
DATA: rt_doctype TYPE REF TO data.
FIELD-SYMBOLS: <fs_saledoc> TYPE table,
<fs_crdate> TYPE table,
<fs_transcode> TYPE table,
<fs_doctype> TYPE table.
Retrieve the data from the select option
rt_saledoc = wd_this->m_handler->get_range_table_of_sel_field(
i_id = 'VBELN' ).
Assign it to a field symbol
ASSIGN rt_saledoc->* TO <fs_saledoc>.
Retrieve the data from the select option
rt_crdate = wd_this->m_handler->get_range_table_of_sel_field(
i_id = 'ERDAT' ).
Assign it to a field symbol
ASSIGN rt_crdate->* TO <fs_crdate>.
Retrieve the data from the select option
rt_doctype = wd_this->m_handler->get_range_table_of_sel_field(
i_id = 'AUART' ).
Assign it to a field symbol
ASSIGN rt_doctype->* TO <fs_doctype>.
Retrieve the data from the select option
*rt_transcode = wd_this->m_handler->get_range_table_of_sel_field(
*i_id = 'VTTK_ADD01' ).
Assign it to a field symbol
assign rt_transcode-> to <fs_transcode>.
node_saledoc = wd_context->get_child_node( name = 'S_VBELN' ).
node_saledoc->bind_table( <fs_saledoc> ).
node_crdate = wd_context->get_child_node( name = 'S_ERDAT' ).
node_crdate->bind_table( <fs_crdate> ).
node_doctype = wd_context->get_child_node( name = 'S_AUART' ).
node_doctype->bind_table( <fs_doctype> ).
IF <fs_doctype> IS NOT INITIAL
AND <fs_crdate> IS NOT INITIAL
AND <fs_saledoc> IS NOT INITIAL
wd_comp_controller->execute_zotddelvnote_vend_tari( ).
ENDIF. -
Hi all expert,
May you know within GUi, we can define select option.With the select option, we can do choose EQ BT NE and not between.
Is there any possibility make the same select option in web UI ?
Thanks in advance
best regardsHello Edward,
this will help you to select which select options you want to have per attribute:
1) Launch transaction 'sm34'
2) Enter view cluster name as 'CRMVC_DQ' and click on 'Maintain'
3) Find DQuery Object Name for example 'BTQOpp' under Comp Name 'BT' and click on'exceptions per attribute.'
4) Find the Attribute Name for example 'PROSPECT_NAME'
5) Check the boxes you need for example CP for "contain pattern"
Good luck.
Kind regards
Manfred -
Event should trigger when press enter on select option in web dynpro.
I want to trigger a event for validation when enter is pressed in select option in web dynpro.
as the select option is created by the coding and there is no method to trigger the event.
please advice.Pls post it ABAP Forum
Rgds
Sumanth.Gururaj
Consultant/Systems Analyst- SAP SD/MM -
Select-options in WEB UI View on SAP CRM7
Hello,
I wanted to know how to make a u2018select-optionu2019 on a view in Web UI on CRM7.
Is there a standard BSP application that I can use in component usage for this?
I need to have show only one value but for one field I may have several values filled like a multivalues in select-options as in Transaction SE16.
I can't use an advanced search page because for some criteria I can have more 100 different values.
Tank you for your response.Thank you Kiran for your response, but you misunderstand my question.
In my process I can't use a ADVANCED SEARCH PAGE for these reason :
- the display of fields depends on a value selected from a dropdown list on a first view
- Some fields can contain multiple values (value list) not a range value like Between, but i can't show all theses values in a view like in an ADVANCED SEARCH PAGE
I need to know if exist a standard BSP application that can used in USAGE COMPONENT for my specific BSP application like a Popup to put several values and associate this value list to a field of my specific view.
Regards.
David Méloux -
SELECT OPTIONS IN WEB DYNPRO ABAP
Hello experts, im working with select options in a WEB Dynpro.
There are four buttons (cancel,check,reset,copy) that apears above my select option.
My question is: There is a way to hide that buttons?
THANKS!Sure, you can disable them using the SET_GLOBAL_OPTIONS methdo of the IF_WD_SELECT_OPTIONS class. Something like this:
wd_this->m_handler->set_global_options(
i_display_btn_cancel = abap_false
i_display_btn_check = abap_false
i_display_btn_reset = abap_false
i_display_btn_execute = abap_false ). -
Select options in web dynpro ABAP (Event on_check)
Hi,
how can I raise a message in the event-handler method on check for a specifc field out of the Select-Option.
Best regards,
MarcusHello,
Create a new method and call it when you want to show the message.
METHOD message_handling .
DATA:
lr_current_controller TYPE REF TO if_wd_controller,
lr_message_manager TYPE REF TO if_wd_message_manager.
lr_current_controller ?= wd_this->wd_get_api( ).
lr_message_manager = lr_current_controller->get_message_manager( ).
lr_message_manager->report_t100_message(
msgid = iv_msgid
msgno = iv_msgno
msgty = iv_msgty
p1 = iv_p1
p2 = iv_p2
p3 = iv_p3
p4 = iv_p4 ).
ENDMETHOD.
In this method, the program show a message that is declared in a mesasge class. If you look at IF_WD_MESSAGE_MANAGER there are other methods to show a message.
And you can find more information at this blog https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/8402. [original link is broken] [original link is broken] [original link is broken]
Regards, -
Select options in web dynpro ABAP (search help f4 problem)
hi...
from the Tutorial of select options i have created select option for two parameters S_CARR_ID and S_CONN_ID but i get f4 help for only S_CARR_ID, but the parameters passed to both for m_handler->add_selection_field are the same.
i also tried to attach my search help by passing one more parameter (I_VALUE_HELP_ID) but it dose not help.
could any one suggest me how to get f4 help.
thank you.
Regards
kailash.
code snap ->
init the select screen
wd_this->m_handler =
wd_this->m_wd_select_options->init_selection_screen( ).
create a range table that consists of this new data element
lt_range_table =
wd_this->m_handler->create_range_table(
i_typename = 'S_CARR_ID' ).
add a new field to the selection
wd_this->m_handler->add_selection_field(
i_id = 'S_CARR_ID'
it_result = lt_range_table
i_read_only = read_only
create a range table that consists of this new data element
lt_range_table =
wd_this->m_handler->create_range_table(
i_typename = 'S_CONN_ID' ).
add a new field to the selection
wd_this->m_handler->add_selection_field(
i_id = 'S_CONN_ID'
it_result = lt_range_table
i_read_only = read_only ).hi kailash,
check wheteher the field u r refering is having search help.
if it has then set the additional parameters in method add_selection_field
I_VALUE_HELP_STRUCTURE = 'VBC07'(name of the table) I_VALUE_HELP_STRUCTURE_FIELD = 'FKART'( field name)
ex:
wd_this->go_select_options1->add_selection_field( i_id = 'FKART'
I_WITHIN_BLOCK = 'BLOCK1'
I_VALUE_HELP_STRUCTURE = 'VBCO7'
I_VALUE_HELP_STRUCTURE_FIELD = 'FKART'
it_result = lo_range_table
i_read_only = lv_read_only
regards,
janakiram.
Edited by: janakiram raju on Mar 11, 2008 11:40 AM -
Validation of select-options in WEb DynPro ABAP
Can anyone please help me on validating select-options. I want to have a functionality like what we use in normal text field while validating the field. We generally use the REPORT_ATTRIBUTE_ERROR_MESSAGE funciton.
How can we achieve the same thing with select-options, cuz the select-options are not bound with any attribute.
Edited by: Tirth Pandya on May 7, 2009 2:02 AMHi,
Refer to this link..Re: validate select option fields -
Hi,
I have a report, this has select options for users to enter the selection criteria. On the screen users can see 'Cancel', 'Check', 'Reset' and 'Copy' buttons but NO 'SAVE'!!!
Is there a way to save the selection made by the user as a variant? by doing this users can just select their Variant and execute the report.
Thank you,
Renu>
Renu P wrote:
> So, You mean to say that, If I'm a user and when every I run a WDA report " Do I have to enter the selections each and everytime? "
>
> - Renu
Short answer - yes. You can of course build something application specific to save the select-option values, but there is nothing like the variant supplied by the framework.
Using personalization you can save single input values as favorites (right mouse click on a field and choose User Settings->Use Current Value as Default. However this isn't really like the old style variant, no does it capture complex values like those that can be represented within a select-option. -
Web Dynpro Abap: Select-Options: Save Selection Data
Hello,
I am using select-options in web dynpro abap. Need to add a feature where the user can save his selection values as a variant.
All I can think of is getting all the selection values and saving these into a Z table.
Can you suggest a better way?
Thank you.
IreneHi Irene,
Alas, it's currently not possible. You could write your own wrapper though adding a save button. Inside of the action handler you could retrieve the range tables of all fields, convert their content to a structure you like and save it a fitting db table. My suggestion is to use XML and a DB table with a XSTRING field in the data section to store the range table values.
Using personalization will allow you to customize your ui and to hide certain select option fields.
Best regards,
Thomas -
Select-options for input field
hi,
Is it possible to use 'Select-options' in web dynpro for the input field like we use in abap?
Ex. material is the input field. i want to select range also for this input field using 'Select-options'
I have tried only with ovs(f4 help) for the input field. can u pls tel me how to use if it is possible ?
Thanks,
Aishwarya.DATA: LT_RANGE_TABLE TYPE REF TO DATA,
RT_RANGE_TABLE TYPE REF TO DATA,
READ_ONLY TYPE ABAP_BOOL,
TYPENAME TYPE STRING. DATA: LR_COMPONENTCONTROLLER TYPE REF
TO IG_COMPONENTCONTROLLER,
L_REF_CMP_USAGE TYPE REF TO IF_WD_COMPONENT_USAGE.
create the used component
L_REF_CMP_USAGE = WD_THIS->WD_CPUSE_SELECT_OPTIONS( ).
IF L_REF_CMP_USAGE->HAS_ACTIVE_COMPONENT( ) IS INITIAL.
L_REF_CMP_USAGE->CREATE_COMPONENT( ).
ENDIF.
WD_THIS->M_WD_SELECT_OPTIONS = WD_THIS->WD_CPIFC_SELECT_OPTIONS( ).
init the select screen
WD_THIS->M_HANDLER =
WD_THIS->M_WD_SELECT_OPTIONS->INIT_SELECTION_SCREEN( ).
WD_THIS->M_HANDLER->SET_GLOBAL_OPTIONS(
I_DISPLAY_BTN_CANCEL = ABAP_FALSE
I_DISPLAY_BTN_CHECK = ABAP_FALSE
I_DISPLAY_BTN_RESET = ABAP_FALSE
I_DISPLAY_BTN_EXECUTE = ABAP_FALSE ).
*create a range table that consists of this new data element
LT_RANGE_TABLE = WD_THIS->M_HANDLER->CREATE_RANGE_TABLE(
I_TYPENAME = 'matnr' ).
add a new field to the selection
WD_THIS->M_HANDLER->ADD_SELECTION_FIELD(
I_ID = 'matnr'
IT_RESULT = LT_RANGE_TABLE
I_READ_ONLY = READ_ONLY ).
This is my code followed by saptechnical. but when i exec, am getting err like the type matnr is invalid. -
Select-options for date field.
Hi all,
i need to give select options for Date field.How can i give that.
Thanks & Regards
Ravi.Hi Ravi,
Use the Component WDR_SELECT_OPTIONS to include select options in Web Dynpro ABAP. Follow these steps:
1. In your Component , "Used Componet" tab add Component WDR_SELECT_OPTIONS . Component Use can be any name that you want to give, eg SELECT_OPTIONS
2. Go to the View where you want to include the Date Select Options. I am assuming that you already have an Attribute of Type DATS in your context.
3. View: Properties Tab:Create Controller Usage and select
SELECT_OPTIONS WDR_SELECT_OPTIONS
SELECT_OPTIONS WDR_SELECT_OPTIONS INTERFACECONTROLLER
4. View Layout Tab:Include a View Container. In this view container we will show the Date Select Options.
5. View Attributes Tab: Create Following two attributes:
M_HANDLER type IF_WD_SELECT_OPTIONS
M_WD_SELECT_OPTIONS type IWCI_WDR_SELECT_OPTIONS
6: View Methods Tab: Create a method eg CREATE_SELECTION_SCREEN. Call this method in the WDDOINIT of the view.
7:CREATE_SELECTION_SCREEN: Write following Code:
* Data Declaration
data:
lt_range_table TYPE REF TO DATA.
data:
lr_componentcontroller TYPE REF TO IG_COMPONENTCONTROLLER,
lr_componentusage TYPE REF TO IF_WD_COMPONENT_USAGE.
* Execution
* Create Used Component
lr_componentusage = wd_this->wd_cpuse_select_options( ).
if LR_COMPONENTUSAGE->HAS_ACTIVE_COMPONENT( ) is initial.
lr_componentusage->create_component( ).
endif.
* Get pointer to interface controller of select options
wd_this->M_WD_SELECT_OPTIONS = wd_this->wd_cpifc_select_options( ).
* initialize selction screen
wd_this->M_HANDLER = wd_this->M_WD_SELECT_OPTIONS->init_selection_screen( ).
* Create Range Table for: Date
CALL METHOD WD_THIS->M_HANDLER->CREATE_RANGE_TABLE
EXPORTING
I_TYPENAME = 'DATS'
RECEIVING
RT_RANGE_TABLE = lt_range_table.
* Add Selection Field for: Date
CALL METHOD WD_THIS->M_HANDLER->ADD_SELECTION_FIELD
EXPORTING
I_ID = '<name of date attribute in the context>'
* I_WITHIN_BLOCK = MC_ID_MAIN_BLOCK
* I_DESCRIPTION =
* I_IS_AUTO_DESCRIPTION = ABAP_TRUE
IT_RESULT = lt_range_table
* I_OBLIGATORY = ABAP_FALSE
* I_COMPLEX_RESTRICTIONS =
* I_USE_COMPLEX_RESTRICTION = ABAP_FALSE
* I_NO_COMPLEX_RESTRICTIONS = ABAP_FALSE
* I_VALUE_HELP_TYPE = IF_WD_VALUE_HELP_HANDLER=>CO_PREFIX_NONE
* I_VALUE_HELP_ID =
* I_VALUE_HELP_MODE =
* I_VALUE_HELP_STRUCTURE =
* I_VALUE_HELP_STRUCTURE_FIELD =
* I_HELP_REQUEST_HANDLER =
* I_LOWER_CASE =
* I_MEMORY_ID =
* I_NO_EXTENSION = ABAP_FALSE
* I_NO_INTERVALS = ABAP_FALSE
* I_AS_CHECKBOX = ABAP_FALSE
* I_AS_DROPDOWN = ABAP_FALSE
* IT_VALUE_SET =
* I_READ_ONLY = ABAP_FALSE
* I_DONT_CARE_VALUE =
* I_EXPLANATION =
I_TOOLTIP = 'Select Date'.
8: To Fetch Data entered in the selection field, write following code on action of button click:
data:
lt_date type REF TO DATA.
FIELD-SYMBOLS:
<fs_date> TYPE table.
* retrieve Date from Select Options
CALL METHOD WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD
EXPORTING
I_ID = '<attrib_name>'
RECEIVING
RT_RANGE_TABLE = lt_date.
* assign Date Field Symbol
ASSIGN lt_date->* to <fs_date>.
9: Windows Window Tab: In the View Conatiner, embed the WND_SELECTION_SCREEN view from SELECT_OPTIONS component Usage of WDR_SELECT_OPTIONS component.
Regards,
Reema. -
OVS Help in Select Options-Text to be Shown and Code to be captured
Hello Experts,
I am using Select options in web dynpro abap.
On a particular View container i have added a selection field using ADD_SELECTION_FIELD which has an OVS help to it.
The selection field is of type CODE.
And on click of a button i am reading the select option fields using GET_RANGE_TABLE_OF_SEL_FIELD and assigining this to a
field symbol which inturn is being set to an attribute.
My requirement is to show the TEXT to the user and send the CODE to the method which is called
when the button is clicked and a table is populated.
Normally we can keep two attributes one for TEXT and the other for CODE but for Select options i am not very sure how this can be achieved.
Because in select options we are reading the values present on the select option field and there may be multiple values.
Please guide me through this.
Thanks in Advance,
ShravanHello Shravan,
This can be easily achieved if you convert the selection field to dropdown.
Create a valueset containing the list of valid values and then pass this to the ADD_SELECTION_FIELD method
"Creating valueset
DATA lt_valueset TYPE wdy_key_value_table.
DATA ls_valueset LIKE LINE OF lt_valueset.
ls_valueset-key = 'EN'.
ls_valueset-value = 'English'.
APPEND ls_valueset TO lt_valueset.
"Creating selection field as Dropdown
lr_helper->add_selection_field( i_id = <ID>
it_result = lt_range
i_as_dropdown = abap_true
it_value_set = lt_valueset ).
BR, Saravanan -
Reusing select option in different tabstrips of same view
Hi Experts,
I have a view. In this i have two tabstrips namely tab1 and tab2.
I have created one select option and i am using it twice inside (two fields- one for date and one for register no.) one view controller of tab1.
Now is it possible to use the same select option twice inside tab2. Note that here i have to create another view controller for tab2.
Can u plz explain in details.
Thanks in advanceHi,
When you create the 2 viewcontainer Ui elements inside the 2tabs repsectively. Use the same instance of the Select options
in both tabs would throw the error that same instance of Selectoptions already exists.
You need to create the 2 select options instances, i mean Component usages to achieve the same.
Is this dynamic. I mean embeding view inside the view container of Window context is dynamic or static.
Regards,
Lekha.
Maybe you are looking for
-
I am unable to send emails to the entire group that I have created in Address book. If I have say ten emails I cannot send email with a couple of clicks I must open the group and add each email one at a time. I have multiple Macs and only have this p
-
External Hard Drives Recommended for media and scrasj disks?
I a working as a pro, but new to Final Cut Pro. I am wondering which external harddrives which would work best for a scratsj disk and a media disk (two separate). I am concedering La Cie Rugged drives which are Firewire 800 / 7200 Rpm and do not need
-
Cache size question...
howdy, just a quick one. i've noticed in the new firefox (1.5) there is an option in preferences to limit the cache size. however, there seems to be no option in safari. :: is there a method to set the cache size in safari? :: any info is greatly app
-
Session not Sticky with HttpClusterServlet
Hi, I am using HttpClusterServlet for load balancing. The cluster is configured to Round-Robin algorithm. As per my understanding, the weblogic implements the Round-Robin with Sticky session. But the problem I am facing is that the session is not sti
-
What's the Best Way to do Different Takes?
Hello there ... I'm slowly making my way around Garageband ... I did a recording the other day of a combo ... electric piano, bass, drums, sax, and a vocalist ... It was the first recording I've ever done in my life ... and I am amazed at the results