cancel
Showing results for 
Search instead for 
Did you mean: 

populating dropdown with values from RFC

Former Member
0 Kudos

how to populate values in a dropdown with values coming from RFC?...can anyone help me out with the code?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Parama,

Use dropdownbyIndex UI element and bind to the model attribute from RFC and write the following code in init

IPrivateEVSView.IAElement oE = wdContext.nodeA().createAElement();

IPrivateEVSView.IAElement oE1;

oE.setB("Select");

wdContext.nodeA().addElement(oE);

for(int i=0;i<wdContext.nodeC().size();i++){

oE1 = wdContext.nodeA().createAElement();

oE1.setB(wdContext.nodeC().getCElementAt(i).getELEMENT());

wdContext.nodeA().addElement(oE1);

Regards

Raghu

Former Member
0 Kudos

Please do supply me the code for DropDownBykey since I am using DropDownBykey.

Former Member
0 Kudos

hi,

Writ down the following code onAction


 public void onActiongetflightlist(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin onActiongetflightlist(ServerEvent)
wdThis.wdGetFlightModelCustController().executeBapi_Flight_Getlist_Input();
	ISimpleTypeModifiable myType=wdThis.wdGetAPI().getContext().getModifiableTypeOf("Drop_flightList");
	IModifiableSimpleValueSet values=myType.getSVServices().getModifiableSimpleValueSet();
			
			int nodesize=wdContext.nodeFlight_List().size();
			for(int i=0;i<nodesize;i++)
			{
				
				values.put(""+i,wdContext.nodeFlight_List().getFlight_ListElementAt(i).getAirline());
				
			}
}

here u have to create one context Drop_flightlist and it bind to the dropdownbykey "selectedkey" property

Edited by: Abhilasha Dahare on Sep 30, 2008 11:15 AM

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi,

Try to bind your model node attribute with dropdown ui value property.

Regards,

Gurprit Bhatia

Former Member
0 Kudos

Hi

follow this code implemented in wdModifyview

Create one SimpleType in Dictionaries with time data .

Then use Dynamic programming to achieve your need

in wdDomodifyView() method, write following code

wdContext.getContext().reset(false);

IWDTransparentContainer tc= (IWDTransparentContainer)view.getElement("RootUIElementContainer");

tc.destroyAllChildren();

for(int i=0;i<15;i++)

{

wdContext.getNodeInfo.addAttribute("attr"+i,"<SimpleTypePackage>.<SimpleTypeName> ");

}

for(int k=0;k<15;k++)

{

IWDDropDownByKey ddk=(IWDDropDownByKey)view.createElement(IWDDropDownByKey.class,"ddk");

ddk.bindSelectedKey("attr"+k);

tc.addChild(ddk);

}

or follow the link provided with all the discussion that may be help full to you

[]

Regards

Raghu

Former Member
0 Kudos

Hi,

Use DropDownByIndex and bind the Texts property of DropDownByindex to the model node.

Former Member
0 Kudos

Hi,

call the rfc in DoInit() of view.

and goto DropDownByIndex properties,

set the following property

texts=<your rfc out put attribute>

deploy the application.

Regards,

ramesh

Edited by: Ramesh Babu V on Sep 30, 2008 2:42 PM

Former Member
0 Kudos

hi,

refer this link.

http://saptechnical.com/Tutorials/WebDynproJava/EVS/Demo.htm

Regards,

Sunaina Reddy T