cancel
Showing results for 
Search instead for 
Did you mean: 

view and component controller problem!

Former Member
0 Kudos
119

Hi all,

I'm running a webdynpro application that calls a RFC with data from a view and then execute that function from the component controller...the problem is that I don't know how to do that.

Thanks in advance,

Jesus.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

hi

first you have to map the context nodes and attributes in the view to those in component controller . now add the controller to the view. do all necessary initialisation of the model node in the implementation part on controller. now create a method in the controller . inside the method write the code to execute the rfc. now call method from any action in the view.(this method won't be accessible from view if the componentcontroller is not added to the view).

regards

rahul.

Former Member
0 Kudos

Right click on the Component controller you will get option to apply template .

select the service controller template . It will create a method in the controller if you select the correct attributes of the model node.

Just call the method from the view as Pran has said.

Hope that would solve your problem.

Get back if you have further queries.

Regards

Noufal

Former Member
0 Kudos

Check this tutorial:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/web dynpro tutorial and sample applications.faq#q-4

guru_subramanianb
Active Contributor
0 Kudos

Hi,

Adding to Anil's comment,you should also create SLD for your R/3 client system which you wish to connect through JCO using webdynpro.Then create a Model out of it and supply it with the input & output parameters required and bind it with your component controller.

Regards,

Guru

Former Member
0 Kudos

Hi,

1. Goto the view properties and the "cpmponentController" in the required controllers.

2. and write the following code in the view.

wdThis.wdget<<ComponentController>>.execute<<MetodName>>

3. Makesure that you created a mapping btn the componentController ModelNodes and viewModelNodes

Regards, Anilkumar

Former Member
0 Kudos

Hi

You will have to bind the component controller with the view controller. This would make the component controller object accessible to the View controller and there by its methods

wdThis.wdGet<component controller>.<method>

Regards

Pran

Former Member
0 Kudos

HI,

Probably you didn't understand me... I need to execute a BAPI from the component controller with data that come from a different view. Hope this time you got it.

Thanks to all.

Jesus

Former Member
0 Kudos

Hi Jesus

Hope I get it right this time

->Create nodes in your component controller that model the data

->map the nodes to the view you want to fetch the data from.

->populate this node from your view based on whatever action. This data then becomes available in your component controller

Regards

Pran

Former Member
0 Kudos

Hi pran, you almost get it.

Please can you tell me the instrucction that >I have to do with my nodes?...I have already donde something..have don the bind to the bapi and of course the execute method that I use to call the bapi from the view.

I'm wondering if you have hotmail or MSN..mine is castillo_jesus@hotmail.com..if you don't mind you can add me to your contacts so we can chat about my problem.

Thanks a lot.

Jesus

Former Member
0 Kudos

Hi jesus,

Bind ur view context nodes with ur controller context node so that again u need not pass the values from view to the controller. Now u have all the values in the controller itself. Now in the controller method set all these values to the model node.

sample code to set the values from current context to the model node (where agenda is my attribute and ztrng_Insert_Inputone is my model node that is bound):-

wdContext.nodeZtrng_Insert_Inputone().currentZtrng_Insert_InputoneElement().setAgenda(wdContext.currentContextElement().getAgenda());

(previously u should have model node and context node also mapped). Thus once u set all the nodes, u can execute ur bapi now.

Regards,

R.S.Sirisha.

Former Member
0 Kudos

Hi,

Please refer my article on Linking RFC to Web Dynpro.It will help you to solve your query.

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/webdynpro/li... rfc to web dynpro.pdf

Regards,

Vijith