cancel
Showing results for 
Search instead for 
Did you mean: 

Application Trip : Dropdownbykey

Former Member
0 Kudos

Hi all,

I m enhancing the application Trip on webdynpro/abap.

I want to delete the empty row from the drop down by Key from this UI-element (Destionations , Additional informations ..)

My UI element is binded to an attribute with a context that have a cartidanlity (1,1). and the null property is disabled.

Is there a specific method that add the empty row to these UI-elements ?

What can i do to delete this empty row from these standars UI-elements ?

References :

Web Dynpro Component: FITE_VC_GENERAL_DATA

View Information: GENERAL_DATA_VIEW

Information on Field

Field ID: TT_STATU

Type of UI Element: DROPDOWN_BY_KEY

UI Element Library: STANDARD

Best regards

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

when the cardinality is 1:1, the webdynpro framework creates a empty element. This avoids getting null pointer exception during the attribute access.

If you do not want this empty element automatically,then you can change the cardinality to 0:1 and make sure that you test that the node has elements and element is not initial. Otherwise you end up solving null pointer exceptions.

Former Member
0 Kudos

Hi,

Thank you for repliying. But i can not change the cardinality for a standard context in enhancement (All the propeties are disabled ).

Is there an issue to remove the empty row from the dropdowbykey by Code, or other ideas ?

Best regards

Former Member
0 Kudos

>

> Hi,

>

> Thank you for repliying. But i can not change the cardinality for a standard context in enhancement (All the propeties are disabled ).

> Is there an issue to remove the empty row from the dropdowbykey by Code, or other ideas ?

>

> Best regards

Hi ,

if there is always 1 element ,why do bind that to dropdowbykey ?

is this data element is an DOMAIN with key - value pairs ?

Former Member
0 Kudos

Hi,

Here is the hierarchy of my context node GENERAL_DATA :

GENERAL_DATA (Cardinality (1,1) , Selection (1,1))

|----- ...

|----- TT_STATU

|----- TT_COMSP (Nul Value disabled) This attribute is binded to a DropdownByKey it shows a lot of values in the VIEW

|---- ...

This is made by standard, i just want to delete the empty row.

Thank you & Best regards

Former Member
0 Kudos

Hi Jcrios,

I have two suggestions:

1) You can enable the NULL property of this attribute TT_STATU through code in a post_exit method as shown below:


Data : lr_node_info type ref to if_wd_context_node_info,
          lr_node type ref to if_wd_context_node.

lr_node =  wd_context->get_child_node( 'GENERAL_DATA_VIEW' ).
lr_node_info = lr_node->get_node_info( ).

lr_node_info->set_nullable( is_nullable = abap_true name = 'TT_STATU' ).

2) If the above thing does not solve the problem then you can try setting the valueset for this attribute in a Post exit method. This may or may not help as I am not aware when the framework inserts the empty row.

You can use the above code to get the node_info and then set the value set of this attribute using the

lr_node_info->set_attribute_value_set( ) method.

3) If you just want that on launch of this application the user should not see an empty value then ina post exit method, set the lead selection to some other element.

Please revert back in case of doubts/issues.

Regards,

Sumit