cancel
Showing results for 
Search instead for 
Did you mean: 

Using 1 View and 2 Controllers

Former Member
0 Kudos

Hi,

I'd like to use the same view to display and change some data, let's say a sales order for example.

I've imported BAPI_SALES_ORDER_CREATE and BAPI_SALES_ORDER_CHANGE into my RFC Model and created 2 Controllers for each BAPI.

I've also bound my View to the controllers, but it seems not possible to map the context elements to 2 controllers at the same time.

Is it the right solution for my scenario?

Any advice?

Thanks,

Nicolas

View Entire Topic
Former Member
0 Kudos

Do you mean that you would like to have both controllers having the same data ?

For ex: you wan to load data using a BAPI, then allow user to make some change, and finally save those changes using another bapi, depending on what have been done (create in case it's a new order, change in case it's a change)...

In that case, you can't map context elements to both, but what you could do is, before calling your final bapi (save or change), copy elements from current context element to input element of your bapi.

To do so, you can use WDCopyService.copyCorresponding(wdContext.currentSaleOrderElement(), wdContext.currentBapi_Create_Input());

Hope this helps !

Former Member
0 Kudos

Hi TWM,

Yop, it's exactly what I mean! ...and your response is great help for me, I will give it a try and let you know about the results and reward your points.

Thanks,

Nicolas

Former Member
0 Kudos

Thanks to all, it now works fine!