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

BAPI - DropdownByKey

Hi Experts,

I have a 2 column(no,text)in a table in bapi like

01 - one

02 - two

03- three

.. ...

.. ...

in my Webdynpro Screen i have DropdownbyKey based on no i can display the text. for eg: If i select two it indicatiing no 2

for current selected value (wdContext.current<node>element.getno)

How to do that?

Regards,

Manivannan P

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Aug 27, 2009 at 06:10 AM

    Hi,

    Follow this procedure,

    Create a parameter of type string to onSelect action, lets say "key"

    Go to the outline view

    select the drop down by key right click and select parameter mapping.

    from the right side drag the "key" previously created to the left side "key"

    access this parameter from code this will return you the selected key.

    Ex your method signature will look as follows

    public void onActionTest(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, java.lang.String key )
      {
        //@@begin onActionTt(ServerEvent)
               
            wdComponentAPI.getMessageManager().reportSuccess(key);
     
        //@@end
      }

    Regards,

    Sunaina Reddy T

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 27, 2009 at 07:06 AM

    Hi

    You can try the below code insie the method which is assigned to on Select property of drop down:

    int noSelected = wdContext.nodeXYZ().getLeadSelection();//XYZ is the node name to which dropdown is mapped

    String text = wdContext.nodeXYZ().getXYZElementAt(noSelected).getText();//Text the attribute of drop down

    Thanks

    Susmita

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 27, 2009 at 07:16 AM

    Hi,

    instead of the DropDownBykey you can use the DropBownByIndex UI element.

    fthis element has the property "texts" just bind this with the attribute of the rfc.

    Regards,

    Ramesh Babu.v

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 27, 2009 at 07:16 AM

    Hi,

    instead of the DropDownBykey you can use the DropBownByIndex UI element.

    fthis element has the property "texts" just bind this with the attribute of the rfc.

    Regards,

    Ramesh Babu.v

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 27, 2009 at 05:23 AM

    Hi,

    IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(IPrivateMain.IContextElement.text);

    ISimpleTypeModifiable textType = attributeInfo.getModifiableSimpleType();

    // Set field label and populate valueset

    textType.setFieldLabel("text");

    IModifiableSimpleValueSet valueSet =

    textType.getSVServices().getModifiableSimpleValueSet();

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

    valueSet.put("Key_"i,"text "i);

    }

    // initialize context value attribute 'text'

    wdContext.currentContextElement().settext("Key_0");

    refer the following link

    http://help.sap.com/saphelp_nw04/helpdata/en/b3/f68e4ab25d7549888eb612bcb359f1/content.htm

    and there was another thread posted in sdn for the similar question

    Value of RFC in Dropdownbykey

    Regards

    Manohar

    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.