cancel
Showing results for 
Search instead for 
Did you mean: 

How to show the content of a data object in listbox

waldemar_schakiel
Participant
0 Kudos

Hello together,

i have created a service employee_srv for my data object "Employee". How can I show the content of this data object in a listbox in my view, for example DropDownByKey.

Regards

Waldemar Schakiel

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Waldemar

Which perspective are you using for developing applications in NWDS? WebDynpro Java perspective or Mobile Applications for Handhelds perspective?

Regards

Vidyadhar

waldemar_schakiel
Participant
0 Kudos

Hello,

I m using the Webdynpro for Handhelds perspectivce.

Regards

Waldemar Schakiel

Former Member
0 Kudos

Hi

You need to create a service and inside it create a query which with output as employee DO.

Add dependency of service component to UI component and apply service template which will create the context nodes.

Bind the attribute to dropdown.

Regards

Vidyadhar

Former Member
0 Kudos

Hi,

You can go through the sections under Developing Mobile Application for Handheld

a. Creating a Service

b. Creating a Query

c. Creating Mobile UI Component

d. Applying the Component Controller Template

in http://help.sap.com/saphelp_nwmobile71/helpdata/en/8F/0B674240449C60E10000000A1550B0/frameset.htm

and then as mentioned by Vidyadhar Bind the list box to the Query output.

If you want to use ValueHelp feature, help can be found at

http://help.sap.com/saphelp_nwmobile71/helpdata/EN/46/3591388578141de10000000a1553f6/content.htm

Best Regards,

Amit

Answers (3)

Answers (3)

waldemar_schakiel
Participant
0 Kudos

Hello Shruthi R,

have you perhaps a adequate code for WebDynpro Mobile for Java?

Regards

Waldemar Schakiel

Former Member
0 Kudos

Hi,

I am sorry,but I don't have the code sample in webdynpro Java.

You could search for sample code in the forum for webdynpro JAVA. I am sure there are articles related to creating dynamic context nodes in the webdynpro Java forum.

I think this link will help you to create dynamic context nodes.

http://help.sap.com/saphelp_nw04/helpdata/en/89/73a840bd6d3c13e10000000a155106/frameset.htm

Regards,

Shruthi

waldemar_schakiel
Participant
0 Kudos

Hello Shruthi R,

could you give me a simple code example for this problem.

Thanks

Waldemar

Former Member
0 Kudos

Hi,

An example to create a dynamic context in Webdynpro ABAP:

data:

rootnode_info TYPE REF TO if_wd_context_node_info,

dyn_node TYPE REF TO if_wd_context_node,

tabname_node TYPE REF TO if_wd_context_node,

tablename TYPE string.

rootnode_info = wd_context->get_node_info( ).

cl_wd_dynamic_tool=>create_nodeinfo_from_struct(

parent_info = rootnode_info

node_name = tablename " Data object Table name

structure_name = tablename

is_multiple = abap_true ).

***Bind data to Dynamic table:

DATA: stru_tab TYPE REF TO data.

FIELD-SYMBOLS:

<tab> TYPE table.

  • create internal table

CREATE DATA stru_tab TYPE TABLE OF (tablename).

ASSIGN stru_tab->* TO <tab>.

dyn_node = wd_context->get_child_node( name = tablename ).

  • Bind internal table to context node.

dyn_node->bind_table( <tab> ).

Shruthi

Former Member
0 Kudos

Hi,

You will have to fetch the generated structure of the data object dynamically , create an context corresponding to the generated stucture dynamically and bind the key ( Which you want to display in the dropdownbykey) to the listbox. You can populate the data for the same by fetching data from the CDS of the data object.

Shruthi R