cancel
Showing results for 
Search instead for 
Did you mean: 

DropdownList box to display R/3 table

Former Member
0 Kudos

Hi,

I want to display a R/3 table of 5 columns in the dropdownbox with only one column, how can I do that?.

Is this possible without simple types. Since we dont know the contents of drop-down box at design time, I cant use simple type. How can I achieve this feature?.

Thanks.

/sunita.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Try this

Use the Dropdown by index

1.Creat a node for the Dropdown

2.Bind The values from BAPI after Execution

IPrivate<ViewName>.I<DropName>Node node = wdContext.node<DropName>();

int len=wdContext.node<BAPIList>().size();

for(int l=0;l<len;l++) {

String id=String.valueOf(((IPrivate<viewname>.I<BAPIList>Element)(wdContext.node<BAPIList>().getElementAt(l))).get<Parameterid>());

String value=String.valueOf(((IPrivate<viewname>.I<BAPIList>Element)(wdContext.node<BAPIList>().getElementAt(l))).get<Parametervalue>());

IPrivate<ViewName>.I<DropName>Element element = wdContext.create<DropName>Element();

element.set<Param>(id"-"value);

node.addElement(element);

}

Kind Regards

Mukesh

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Sunitha,

see this link for when to use DropDownByIndex (DDI) vs DDK (DropDownByKey) and how populate data from R/3.

create context value attribute and bind to drop down by key

Regards, Suresh KB

Answers (1)

Answers (1)

saraswathi_d
Participant
0 Kudos

Hi,

If u want to populate values using a DropDownByKey UI Element this code will help you.

IWDAttributeInfo ainfo = wdContext.node<<NodeName>>().getNodeInfo().getAttribute("<<Value Attribute that is bound to the Drop Down by Key element>>");

ISimpleTypeModifiable st = aiinfo.getModifiableSimpleType();

IModifiableSimpleValueSet vs = st.getSVServices().getModifiableSimpleValueSet();

for(int i=0;i<wdContext.node<<name of the node>>().size();i++)

{

vs.put(Key,Value}

}

Also go through the following link to know more about Drop Down by key element.

http://help.sap.com/saphelp_nw04/helpdata/en/08/13dbfb6e779743bb2ca641ebcb3411/frameset.htm

Check this for a sample application using Drop Down by key UI element.

http://help.sap.com/saphelp_nw04/helpdata/en/c6/a5d4a523bf4b4c9085a114e46c6ed3/frameset.htm

Also check out the following discussion in forum :

https://www.sdn.sap.com/sdn/collaboration.sdn?contenttype=url&content=https%3A//forums.sdn.sap.com/s...

Regards,

Saraswathi

Pls reward point if it is useful information

Former Member
0 Kudos

Thanks All.