Skip to Content
author's profile photo Former Member
Former Member

Runtime error in DropDownByKey

Hi all,

In my appl,

This is the code inside my wdInit() of CustomeController:

Y_Ep_Demo_Get_Material_Input ip=new Y_Ep_Demo_Get_Material_Input();

wdContext.nodeY_Ep_Input().bind(ip);

IWDMessageManager manager= wdComponentAPI.getMessageManager();

IWDAttributeInfo aInfo = wdContext.getNodeInfo().getAttribute("Matnr");

<b>IModifiableSimpleValueSet

vSet=aInfo.getModifiableSimpleType().getSVServices().getModifiableSimpleValu

eSet();</b>

String matnum=null;

int nLen=wdContext.nodeY_Ep_Input().size();

for(int i=0;i<nLen;i++){

matnum=String.valueOf(((IPrivateSD_InsertCompView.IContextElement)(wdContext

.nodeY_Ep_Input().getElementAt(i))).getAttributeValue("Matnr"));

vSet.put("Matnr",matnum);

manager.reportSuccess("in For loop");

}

I am getting error at this line as NullPointerException.

I have created a Model node and done the necessary mapping to Model attr of my Bapi. In the properties of DropDownByKey->selectKey->mapped to context attr.

Please suggest me/let me the procedure to get values into DropDown list from R/3.

Thanks a lot in advance!

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 26, 2006 at 03:04 PM

    Please post the stacktrace.

    Armin

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Ganesh,

      In your below code i could see some value your trying to bound it to input node. After this input, you didnt call execute method any where?

      wdContext.nodeY_Ep_Input().bind(op);

      ??? execute method - call

      Secondly, you are getting result size and material number from input node only.. Dont you have output node in your context.

      int len=wdContext.nodeY_Ep_Input().size();

      mgr.reportSuccess(""+len);

      matnum=String.valueOf(((IPublicSDI_Cust.IY_Ep_InputElement) (wdContext.nodeY_Ep_Input().getY_Ep_InputElementAt(i))).getMatnr_Out());

      Correct me if i am wrong.

      Regards,

      Sridar

  • Posted on Jul 26, 2006 at 03:17 PM

    Hello Ganesh,

    You are getting null pointer exception in that line may be because your 'aInfo' is null value in your previous line of code.

    i.e. the line

    IWDAttributeInfo aInfo = wdContext.getNodeInfo().getAttribute("Matnr");

    Make sure that you have the attribute 'Matnr' in your web dynpro context node. Also the attribute name is case sensitive. So check for the case correctness of the attribute also.

    Regards,

    Sudeep.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 08, 2007 at 04:16 PM

    Hi JG,

    I had a similar problem trying to get the AttributeInfo from a Context.

    The problem is due to the fact that this attribute was inside a particular node and not on the root node. Also, to avoid the assigning of missing attributes, you should use the constant way of accessing the attributes rather than accessing them via a String constant.

    Please try to adapt this piece of code:

    IWDAttributeInfo ai = wdContext.node<node_name>().extending().getAttribute(IPrivate<view_name>View.I<node_name>Element.<context_name>);

    ISimpleType stm = ai.getModifiableSimpleType();

    ISimpleValueServices svs = stm.getSVServices();

    ISimpleTypeModifiable vSet = svs.getModifiableSimpleValueSet();

    Best regards,

    Ivan

    Message was edited by:

    Ivan Mirisola

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.