on 06-25-2014 8:25 AM
Hi Experts ,
I am facing an issue where domain having two fixed values ...
INITIAL VALUE TEXT
X Yes
= ' ' No
In webdynpro when I bind the data element of this domain three dropdown text is coming ...
1 . Space
2 . Yes
3. No
I am trying to set this field in ui with default value = NO.
In the coding part when I set the field value = abap_true then Yes is set in UI as default but when value = abap_false it's picking only initial value means Space is set as default ..
I need to set it as NO.
Please help me to solve out this issue.
Thanks in advance.
Samrat
Hi Samrat,
It seems that you have 3 rows set in VALUE range of domain. Please remove the blank line from domain. Also make sure that nothing is set for 'No' i.e. it should be having space value.
If the issue still persists, please share the snap shot of your domain values.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rama ,
I have checked with function module DD_DOMA_GET , but it returns only two values which I have already mentioned. I do not have option to change the domain fixed value .
My question is asrise that why in the dropdown three values is coming ?
Please share suitable way to solve the issue .
Thanks ,
SAMRAT
Hi Samrat,
Please check out the below SAP note related to your issue.
The below note is valid to NW 701 - 711.
1402444 - WD ABAP: Superfluous blank entry in DropDowns
Apply the above note if its valid to your system release.
Hope this resolves your issue.
Regards,
Rama
Hi Samrat,
Please try to implement the note as suggested and check.
1402444 - WD ABAP: Superfluous blank entry in DropDowns
Regards,
Rama
Hi Samrat,
The other workaround would be like this as you dont want to create new data element.
1)As soon as you launch the screen, you set the dropdown value as ' ' (which is No as per your requirement).
2)Build the attribute's set and bind it to your drop down as shown below.
In WDDOINIT( ) of your controller , write the below code
METHOD wddoinit .
*==========================================================================*
*Set the value to No
*==========================================================================*
DATA lo_nd_ddbk TYPE REF TO if_wd_context_node.
DATA lo_el_ddbk TYPE REF TO if_wd_context_element.
DATA ls_ddbk TYPE wd_this->element_ddbk.
DATA lv_ddbk_test TYPE wd_this->element_ddbk-ddbk_test.
lo_nd_ddbk = wd_context->get_child_node( name = wd_this->wdctx_ddbk ).
lo_el_ddbk = lo_nd_ddbk->get_element( ).
lv_ddbk_test = 'No'.
* set single attribute
lo_el_ddbk->set_attribute( name = `DDBK_TEST` value = lv_ddbk_test ).
*==========================================================================*
*Populating dropdown values
*==========================================================================*
DATA value_set TYPE wdr_context_attr_value_list.
DATA entry TYPE wdr_context_attr_value.
DATA symbol TYPE string.
DATA wd_node_info TYPE REF TO if_wd_context_node_info.
CONCATENATE 'No' space INTO symbol. "#EC NOTEXT
entry-value = ''.
entry-text = symbol.
INSERT entry INTO TABLE value_set.
wd_node_info = lo_nd_ddbk->get_node_info( ).
wd_node_info->set_attribute_value_set( name = 'DDBK_TEST' value_set = value_set ).
CONCATENATE 'Yes' space INTO symbol. "#EC NOTEXT
entry-value = 'X'.
entry-text = symbol.
INSERT entry INTO TABLE value_set.
wd_node_info = lo_nd_ddbk->get_node_info( ).
wd_node_info->set_attribute_value_set( name = 'DDBK_TEST' value_set = value_set ).
ENDMETHOD.
The output is as follows :
Hope this workaround would help you.
Thanks
KH
Hi Samrat,
Try to change the domain fixed values as shown below and hope you're using dropdown by key(DDBK)
Now, i've created DDBK in my test WDP component as shown below
1) Created attribute with default value
2) Created DDBK as shown below
3)When i run the appl'n , following is the output
Hope this helps you.
Thanks
KH
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Then as replied my rama, there might be 3 rows set in your domain.
I've created a domain as shown below having only two values X=Yes and ' ' = No.
and my default value in DDBK is ' ' i.e No
And when i run the appl'n, DDBK is set to NO as shown below
and it shows only 2 values in my DDBK .
And when i read my domain values with FM : DD_DOMA_GET, it results into only 2 values as shown below
PS : Use FM : DD_DOMA_GET and pass you domain value and see the result once.
Hope this helps you.
Thanks
KH
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.