cancel
Showing results for 
Search instead for 
Did you mean: 

Using Bapi to populate Dropdown

Former Member
0 Kudos

Hi All,I have 2 dropdownbykey ie. 1.wbs_element 2.network_list,on select of wbs_element I have to show the related networks.I am populating wbs_elements dropdown by creating simpletype.

and I have created my own custom controller in that cust..controllers wdoinit method I've written the following code....

GetNetworkForWBSModel getNetworkForWBSModel = (GetNetworkForWBSModel)

com.sap.tc.webdynpro.progmodel.model.api.WDModelFactory.getModelInstance(GetNetworkForWBSModel.class,

WDModelScopeType.APPLICATION_SCOPE);

Bapi_Project_Getinfo_Input getinfo_Input = new Bapi_Project_Getinfo_Input(getNetworkForWBSModel);

//wdContext.nodeBapi_WBS_Network_Input().bind(getinfo_Input);

getinfo_Input.setWith_Subtree(true);

getinfo_Input.setWith_Activities(true);

Bapi_Wbs_Elements wbs_element = new Bapi_Wbs_Elements();

wbs_element.setAttributeValue("WBS_ELEMENT","V1.002");

//wbs_element.setAttributeValue("V1.001","V1.001");

getinfo_Input.addI_Wbs_Element_Table(wbs_element);

wdContext.nodeBapi_WBS_Network_Input().bind(getinfo_Input);

try {

getinfo_Input.execute();

} catch (WDDynamicRFCExecuteException e) {

e.printStackTrace();

}

For me no data is coming but Its not throwing any error or exception ...how to find out where I did mistake..but in the backend r3 data is there...

Colleques plz help me out in this..I'll be grateful to you.advance thanks for all.

with regards,

Karthick

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Karthick,

Use the following line of code to claer the node data.

wdContext.node<name_of_the_node_to_be_cleared>().invalidate();

Best Regards,

Nibu.

Former Member
0 Kudos

Hi Karthick,

You have to invalidate your output node and all nodes under this "output" node after executing your RFC.

Regards,

Bhavik

Former Member
0 Kudos

Hi,

I changed the second dropdown to dropdownbyindex ..now the data is coming..But I dont know how to invalidate all output nodes.

Regards,

Karthick