cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the details from the BAPI

Former Member
0 Kudos

Hi

I am getting values for the Drop down list from the BAPI.

So please let me know how to get the valus for the Drop down list when i want to show that values first time view executes.

let me when/where to execute the bapi to get the details for dropdown list

regards

mmukesh

Accepted Solutions (0)

Answers (4)

Answers (4)

former_member187658
Participant
0 Kudos

Hi Mukesh

1. Create a value node with the following specifications:

cardinality : 0..n

selection: 0..1

singleton: true

2. Link your drop down UI element to this value node's attribute.

3. Create drop down bapi execute method in the component controller, and call it in the view's wdDoInit().

4. Then write the following code in the Init() itself after calling bapi execute()


    	int size = modelNode's output node size;
	
    IPrivate<viewname>View.<valuenode element> classEle = null;
	classEle = wdContext.node<value node>().create<value node>Element();
	classEle.setVa_Class("");
	wdContext.node<value node>().addElement(classEle);
    
    for(int i=0;i<size;i++)
    {
    	classEle = wdContext.node<value node>().create<value node>Element();
    	classEle.setVa_Class(wdContext.node<model node>().node<model node output node>().get<model node>ElementAt(i).get<drop down value>);
    	wdContext.node<value node>().addElement(classEle);
    }

Hope this helps you. If yes, please reward the points.

Thanks & regards,

Anupreet

suresh_krishnamoorthy
Active Contributor
0 Kudos

Hi Mukesh,

To show dropdown list in intial screen execute the BAPI in wdDoInit().

Create a method in that write code for getting dropdown value and call the method from wdDoInit().

Regards, Suresh KB

former_member4529
Active Contributor
0 Kudos

Hi Mukesh,

You need to configure the JCO connections and import the RFC model into your WDP app. Please check the following docs:

1) <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/11c3b051-0401-0010-fe9a-9eabd9c216de">Effective Web Dynpro - Adaptive RFC Models</a>

2) <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/41/38bc8f813719488ddc9d9b21251ec3/frameset.htm">Adaptive RFC (SAP Library - Web Dynpro for Java)</a>

3) <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0019b1a-775f-2910-beb8-d81f27d0d8d0">WDJ - Adaptive RFC TroubleShooting Guide</a>

Thanks,

Dipankar

abhimanyu_lagishetti7
Active Contributor
0 Kudos

Hi Mukesh,

Execute the BAPI in wdDoInit().

Place a drop down control on the View Layout

bind it with the node, where the drop down results exists.

Regards

Abhimanyu L