cancel
Showing results for 
Search instead for 
Did you mean: 

Access to bapi table parameter from view controller

Former Member
0 Kudos

Hi,

I would like to create an extended value help with value list from a bapi table (after a RFC call) but in the view controller (in the on<name>Action method), I do not find a way to access the returned table data (I call Bapi_Currency_Getlist and want to create a value help with returned values).

Note that I binded the bapi table to a Table control and the data is displayed thus the Bapi is called successfully.

How can I access those values inside a method of my view controller?

Thank you in advance for any help,

Olivier.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

You need to map the view context to a (custom or component) controller context that has access to the model.

Add usage relations between the controllers before the context mapping.

Armin

Former Member
0 Kudos

Armin,

First of all than you for your reaction. I couldn't answer earlier because I was too busy to catch up with project deadlines.

I checked the mapping between the custom controller and the view controller is done. It should be OK since I can display the bapi returned table in a Table widget.

But I still don't know how to access this returned table from the wdDoInit() method of the view controller.

My context is as following:

Bapi_Currency_Getlist_Input

-- Curreny_List

-- Currency

I can get a reference to currentBapi_Currency_Getlist_Input, next I can get a reference to currentCurrency_ListElement. But as from this point, I can't get a List or any other container with the currency values. (The bapi I call is bapi_currency_getlist and I try to create a value help with curency values)

Yashpal
Active Contributor
0 Kudos

Hi,

I did'nt get ur question well....but if u want to loop through the currency_list node and currency is the attribute than it think the below code will work for u ...

int size = wdContext.nodeCurrency_List().size();

for(int i = 0;i<size;i++)

{

wdContext.nodeCurrency_List().getElementAt(i).getCurrency();

the above code return the values of all Currency under the Currency_List node.........u canuse the values when u want......

}

Regards,

yashpal

Former Member
0 Kudos

Hello Yashpal Gupta,

Thank you for your help. I succeeded in creating my value help. The only difference with your proposal is that method getCurrency() was not available next to getElementAt(int) but the solution was using wdContext.nodeCurrencyList() anyway.

The code I used is as following:

for() {

wdContext.nodeCurrencyList().currentCurrencyList_ListElement().getCurrency();

wdContext.nodeCurrency_List().moveNext();

}