Skip to Content
avatar image
Former Member

Bapi_Currency_Getlist problem?

hi

I am using Bapi_Currency_Getlist, i want to access currency from this Bapi and show it in Drop down box(should it be key or Index?).

I am getting following methods of bapi:

1) bapi_getlist_input(under this i am getting node (a)currency_list(bapi1090_2)and (b)Bapi1090_2

(c)output(Bapi_currency_getlist_output)

2)Bapi_Currency_getlist_ouput

3)Bapi1090_2

4)Bapireturn

What model node should i bind to my custom controller?

What should be my coding at wdInit method of custom controller?

Please help me if some body has done this kind of thing with this bapi?

regards

Nidhideep

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Sep 23, 2006 at 09:03 AM

    Hi Bhandari,

    U can declare DropdownbyIndex in UI Element and directly mapping the Node element.

    What I am saying If u getting 10 currency values from BAPI .

    The out put node Attribute to be mapped to the UI element in the view.

    And follow this code.

    1.import the model

    2.in controller gettting the BAPI from model to controller means Edit model binding.

    3. in controller wdInit method create instace and give the input and write the exe method.

    Bapi_Currency_Getlist input = new Bapi_Currency_Getlist();

    wdContext.currentZ_Bapi_Currency_Getlist().bind(input);

    input.set(inputparams);

    input.set(inputparamsone);

    try{

    wdContext.nodeZ_input.Z_Bapi_Currency_Getlist().modelObject().execute();

    wdContext.node<outputNode>.invalidate();

    }

    catch(Ex)

    {

    }

    and after u create the View in the View. before getting model in to View Directly mapping to the out node attribute.

    This might works

    thanks

    Lohi.

    Message was edited by: Lohitha M

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 23, 2006 at 10:56 AM

    Hi,

    Kindly refer this links

    how-to-bind-dropdownbyindex-values-to-the-context

    dropdownbyindex

    Regards,

    Saravanan K

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 23, 2006 at 11:16 AM

    Hi Nidhideep,

    see this link for when to use DropDownByIndex (DDI) vs DDK (DropDownByKey) and how populate data from R/3.

    webdynpro-populating-dropdown-values-programmatica

    create context value attribute and bind to DropDownByKey

    not getting value from DropDownByKey

    DropdownList box to display R/3 table

    dropdownlist-box-to-display-r3-table

    Regards, Suresh KB

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 25, 2006 at 04:49 AM

    Hi

    See this thread

    /message/2187817#2187817 [original link is broken]

    Kind Regards

    Mukesh

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 25, 2006 at 05:59 AM

    Hi Nidhideep,

    I guess your Currency list is coming form Bapi_Currency_getlist_output node.

    Use the below code to get Currency from Model

    
    IContextElement conElement=wdContext.currentContextElement();
    IWDNodeInfo nodeInfo=wdContext.getNodeInfo();
    IWDAttributeInfo aInfo=wdContext.getNodeInfo().getAttribute("Currency");
    IModifiableSimpleValueSet dropValueSet=matAttrInfo.getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
    String currency =null;
    int nodeLength=wdContext.nodeBapi_Currency_getlist_ouput().size();
    for(int i=0;i<nodeLength;i++)
    {
    currency =String.valueOf((( USe Currecny Code //IPrivateTestView.ICurrencyElement)
    (wdContext.nodeBapi_Currency_getlist_ouput().getElementAt(i))).getMatnr());
    dropValueSet.put(currency ,currency );
    }
    

    Is model currecies and Simple Type Currecny both are different? I guess both are same. You can use directly simple Currecny type.

    Correct me if i am wrong.

    Regards,

    Sridhar

    Add comment
    10|10000 characters needed characters exceeded