cancel
Showing results for 
Search instead for 
Did you mean: 

Need to bind value attributes of Component controller with value attributes

Former Member
0 Kudos

Hi,

I am developing a Java Web Dynpro application which is importing RFC Model.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Kaushik,

Do you mean that you want to capture the data in your controller context to RFC context with Drag and drop.

If i understud it properly, then up to my knowledge you can not do it that way. you need to code it manually.

Thanks,

Prasanthi.

Former Member
0 Kudos

Hi Prasanthi,

Also there is a problem in declaration.

The Context Nodes of the model are of the type sort and that of the Component

Controller are type integer.

So, according to me mapping is not possible.

I got it, I have to bind it by code.

Regards

Kaushik Banerjee

Edited by: Kaushik Banerjee on Feb 10, 2009 8:51 AM

Former Member
0 Kudos

Hi Koushik,

Go through the above link , instead of the BAPI call the RFC you have written n make sure that you make it RFC enabled.

Follow that procedute with your RFC and in pg no 23 give the code as i posted above instead of what given in this pdf , it will work fine man , i have used this pdf only at first.

Regards,

Sam Charles J.

Former Member
0 Kudos

Hi Sam,

I am coding like this.

Zadd_Value_Input in = new Zadd_Value_Input(); 
  	wdContext.notifyAllMappedNodes(in);
  	wdContext.currentContextElement().setNum1(5);
  	wdContext.currentContextElement().setNum2(8);

I am not getting how to map the node element with wdContext as know method is coming.

Regards

Kaushik Banerjee

Former Member
0 Kudos

Hi Koushik,

Let me know wats num1 and num2 if its the component attribute values , then y r u setting it ???

you are supposed to set the import parameters of the RFC through the wdContext.currentContextElement.getNum1()

Regards,

Sam charles J.

Former Member
0 Kudos

Hi Sam,

I did it .

I will close the question.

Step1> Designing Views...

Make attributes in View Context.

Make UI Elements in the View and map the inputelemnts to View Context.

Step2> Create Component Controller.

Make Component Controller's context element.

Create Ztable in se11.

Create RFC in se37.

Step3> Import the RFC Model.

Step4> Link the RFC Model with View Controller attributes by drag and drop.

Write the code to bind the model and to execute the logic.

That's it and data get's inserted in the Ztable.

Now, my point is we can directly link the View Context attribute with model.

Do we need to link the view context with Component Controller Context and then bind the Component

Controller Context with Model.

Your code was absouletly right, what I was missing I didnot add the Component Interface to View Context.

I missed that step.

Regards

Kaushik banerjee

Former Member
0 Kudos

Hi Koushik,

Ya to make a model work , you must come through the component controller (Model -> Component -> View) , you cant straight away link view context with model , any way you got the solution na tats ok.

Regards,

Sam Charles J.

Former Member
0 Kudos

Hi Kaushik,

You can refer to below link (& associated tutorial links) for Adaptive RFC model in Web Dynpro Java application.

https://www.sdn.sap.com/irj/scn/wiki?path=/display/wdjava/faq-Models-Adaptive+RFC

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a00f7103-6790-2a10-ac9c-fcac7c5b... (pdf for Accessing ABAP functions in Web Dynpro Java)

Kind Regards,

Nitin

Former Member
0 Kudos

Hi,

I am developing a Java Web Dynpro application which is importing RFC Model.

The RFC has been made.

The logic written.

My requirement is to send data through input field to the RFC which will update the ztable.

I am able to import RFC through Java Web Dynpro but the not able to map the component controller value attributes say Id and name with RFC attributes Id and Name.

My colleague told me it is declaritively(i.e., through programmtic maens).

Is it Object Oriented Coding in Java Web Dynpro?

Please give me some docs supporting.

I don't need the BAPI Model.

I need how to connect with custom RFC.

Regards

Kaushik Banerjee

Former Member
0 Kudos

Hi Kaushik,

Go through the doc sent by Nitin,that is clearly explained and it should solve your problem

https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a00f7103-6790-2a10-ac9c-fcac7c5b... (pdf for Accessing ABAP functions in Web Dynpro Java)

Regards

Santhosh

Former Member
0 Kudos

Hi Kaushik,

It is very simple to enter values in webdynpro and to update the ztable through RFC

All you hav to do is

1. Create the ztable , RFC to import data into that table,

2. Create the model in webdynpro with that RFC

3. First map the ModelInputElements to the component controller(say zid, zname) (you can have your own value attribute in component controller say id , name )

4. Map the attributes to the view where the input field is there

5. Now write the code as follows,

Zxxx in = new Zxxx();

wdContext.nodeZxx_InputElement.bind(in);

in.setZid(wdcontext.currentContextElement().getId()); // getId component controllers attribute and getZid is model' s mapped attributre

in.setZname(wdcontext.currentContextElement().getName()); // getName component controllers attribute and getZname is model's mapped attributre

/* u need not have to map that model attrobute to component attribute for that */

try

{

in.execute();

}

Catch(Eception e)

{

e.printStackTrace();

}

Regards,

Sam Charles J.

Former Member
0 Kudos

Hi Sam,

ZXXX

means you are telling about attributes ZId and Zname.

Regards

Kaushik Banerjee

Former Member
0 Kudos

Hi Kaushik,

Its the name of the input node u have binded from model to component controller .

say if ztest is the name of the rfc u wrote in se37

the ztest_input in = new ztest_input();

Regards,

Sam Charles J.

Former Member
0 Kudos

Hi Sam,

I am failing to bind Input nodes that is RFC is not being not binded with Component Controller nodes.

I am failing to bind it by drag and drop.

Regards

Kaushik Banerjee