cancel
Showing results for 
Search instead for 
Did you mean: 

Dropdown key populated by BAPI

0 Kudos

Hi Everybody

I have a Z bapi that returns a table wit a single field. I want the contents of this single field to be displayed in Dropdown by key. Please don t ask me to create a node as I think that thats not required. Everything is properly mapped and mapping creates the nodes. Please tell me the code that I must write in doInit of my view to get values in the dropdown.

Thanx in advance

Saptarshi

Accepted Solutions (0)

Answers (1)

Answers (1)

Sunitkroy
Participant
0 Kudos

Hi

Just chk the following code.......

Bapi_Flight_Getlist_Input bapiinput = new Bapi_Flight_Getlist_Input();

wdContext.nodeBapi_Flight_Getlist_Input().bind(bapiinput);

wdContext.nodeAirlineValue().addElement(wdContext.nodeAirlineValue().createElement());

wdContext.currentBapi_Flight_Getlist_InputElement().modelObject().execute();

wdContext.nodeOutput().invalidate();

int size = wdContext.nodeFlight_List().size();

IWDMessageManager msg = wdComponentAPI.getMessageManager();

//String compAirlineid = "AA";

IPrivateTestComponentView.IAirlineValueElement airlineelem = wdContext.createAirlineValueElement();

List retval = new ArrayList();

final IModifiableSimpleValueSet ValueSet =

wdThis

.wdGetTestComponentController()

.wdGetContext()

.getNodeInfo()

.getChild("AirlineValue")

.getAttribute("AirlineID")

.getModifiableSimpleType()

.getSVServices()

.getModifiableSimpleValueSet();

for (int indx=0;indx < size ; indx++)

{

ValueSet.put(wdContext.nodeFlight_List().getElementAt(indx).getAttributeValue("Airlineid"),"Airlineid" + indx);

}

wdContext.nodeAirlineValue().addElement(airlineelem);