on 07-03-2008 10:11 AM
Hi Experts,
I want to include a bapi from R/3 into a drop down list in JAVA NWDS project. For example
Bapi is say Bapi_flight_get_list. I want that airline id(like AA, LH etc.) should come in drop down list which user can select.
Thank you in advance.
Hi Pranav,
You may have resolved your issue, but i was jst trying to help.
U need to execute the bapi first and then u need to bind the context to the drop down list.
For that u need to write ur code in init.
Code for executing the bapi:
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try
{
wdContext.current<model node name>Element().modelObject().execute();
wdContext.node<node name in which data gets populated>().invalidate();
}
catch(WDDynamicRFCExecuteException e)
{
manager.reportException(e.getMessage(), false);
}
Now the data gets populated in your node and u need to do the following to populate ur data into a dropdown.
1. take drop down by key UI element.
2. create a value attribute in the context with any name(ex: airlineid ).
3.bind that value node to your UI element.
4. write the following code in init() after executing bapi.
try{
ISimpleTypeModifiable dd = wdThis.wdGetAPI().getContext().getModifiableTypeOf("airlineid");
IModifiableSimpleValueSet values = dd.getSVServices().getModifiableSimpleValueSet();
values.put(<value from the model node>,<value from the model node>);
}catch(Exception e){wdComponentAPI.getMessageManager().reportSuccess(e.toString());}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.