on 10-31-2006 6:07 AM
Hi all,
I Inserted several drop down by key in my view at design time. When I try to run the application it displays an error as
java.lang.ClassCastException at com.sap.tc.webdynpro.progmodel.context.Paths.getAttributeInfoFor(Paths.java:202)
My requirement is,
I am getting a table with two fields(key,value) from R/3 I want to display these in the drop down by key box how to bind them to this drop down.
Hi Refer the below link
DropdownList box to display R/3 table
see this link for when to use DropDownByIndex (DDI) vs DDK (DropDownByKey) and how populate data from R/3.
populating dropdownbyvalue with the r/3 value?
/message/2187817#2187817 [original link is broken]
create context value attribute and bind to drop down by key
Dropdown by key
http://help.sap.com/saphelp_nw04/helpdata/en/4a/8613e41629344194e4f40393740d51/content.htm
For DropdownbyKey
http://help.sap.com/saphelp_nw04/helpdata/en/08/13dbfb6e779743bb2ca641ebcb3411/content.htm
For DropdownByIndex
http://help.sap.com/saphelp_nw04/helpdata/en/24/25e08d4ba6c743b55f1d375637ba8d/frameset.htm
Regards,
Saraswathi
Pls reward points for useful info.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
See the code example of key binding here
http://help.sap.com/saphelp_nw04/helpdata/en/02/dcba4b70e94c44bce33b766afc9b3d/frameset.htm
cheers
LM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi L.M,
I have already gone through this help file and implemented it, the result is I could see the drop down but in a readonly mode which does not display the list on clicking the box (but could see values if it was binded to a table). Here is the code,
IWDMessageManager msgmgr = wdThis.wdGetAPI().getComponent().getMessageManager();
IWDAttributeInfo aInfo=wdContext.nodeDropdowns().getNodeInfo().getAttribute("Language");//.getNodeInfo().getAttribute("Dropdowns.Language");
if(aInfo!=null)
{
IModifiableSimpleValueSet valSet=aInfo.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
for(int i=0;i<wdContext.nodeF4_Language().size();i++)
{
valSet.put(wdContext.nodeF4_Language().getF4_LanguageElementAt(i).getSprsl(),wdContext.nodeF4_Language().getF4_LanguageElementAt(i).getSptxt());
}
wdContext.currentF4_LanguageElement().setSprsl("E");
}
else
{
msgmgr.reportSuccess("attribute info fail");
}
i have tried it in both init() and modify() of the view.
my context is like this
Context
(1 modelnode)F4_Language(binded to custom node)
(1 attributes)spras,sprsl,sptxt
(2 valuenode)Dropdowns
(2 attribute)Language(which is mapped/binded to dropdownby key)
Please help me,
With regards,
Sai Krishna.
Hi Raj,
If we use drop down by index can we find out the selected value, if so the problem is very much reduced.
Because, my requirement is, I should display a table with 7 columns where 3 columns are drop downs, when user fills some rows, these rows are to be stored back in R/3.
Thanks & Regards.
Sai Krishna.
hi
You are facing good problem,now do this thing:
In component controller :
1)Make an instance of your BapiNode
2)Make an AbstractList of the parameter you are passing into R/3,for eg,if your paramter is input then do this:
AbstractList list = <structureofyourparameter>.<structureofyourparameter_List>();
now create instance of your structure:
table = new <structureofyourparameter>();
3)Now bind this table to your node like this:
wdContext.node<Bapiinputnode>.node<parameternode>.bind(table);
4)<Instance of your Bapi node>.set<parameter>(list);
in executebapi method:
list.add(table);
wdContext.node<BapiNode>.current<Bapiinputelement>.modelobject.set<parameter(List);
Now execute your bapi.
If your problem is not solved send me strucutre of your Bapi node and structure of your input paramter.
Regards
Nidhideep
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.