cancel
Showing results for 
Search instead for 
Did you mean: 

How to pust data to backend?

Former Member
0 Kudos

Hi all,

In my WebDynpro appl, I have designed a view that has 8 input fields and 2 dropdown lists. How to pust data from this appl to backend. I have a Bapi that can save the data to the back end. What are the development steps.

Its urgent, any code help or PDF/blog references is highly appreciated.

regards,

Ganesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Ganesh

Put some button say "Save" on your view and an action behind it which calls the action in the controller say savedata.

Bind all your view elements to the RFC node present in your controller by going into diagram view. For drop down lists pass the lead selections to the corresponding RFC inout fields in your controller.

Please find a link to appropriate tutorial. Do award points if you find this info useful

http://sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/creating%20a%...

Former Member
0 Kudos

Hi Girish,

<b>I want to pust data to backend and not to get the data from backend</b>. I had the PDF you mentioned, I need a PDF/blog that talks abt writing data to database. Please send it across to my mail id: ganesh.jonna@gmail.com

Thanks in advance

regards,

Ganesh

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

I think you have idea about Custom contorller. Inside custo contoller you have to create one value node which contains some attributes(inpt parameters for BAPI). Then bind into component controller. Finally bind into the view with appropriate UI Elemtnts(8 input fields and 2 dropdown). Before execute BAPI you have to bind input parameters.

Kind Regards,

S.Saravanan.

Former Member
0 Kudos

Hi saravanan,

Can you send any PDF/step-by-step guide.

All I need is just an example of pushing data to backend(R/3). I imported that Adaptive RFC which can pust data to R/3. Then I have created Value node and value attributes then bound these value attributes to Model attributes. Then I have button in my appl, when I click on that button(shud execute my BAPI),the data shud be saved to database. This is my code:

public void onActionSave(....)

{

wdThis.wdGetMaterialCustController.executeBapi_Ep_Demo_Input();

}

will this work? But my data is not being saved to Database. In my Custcontroller I have written this code in wdInit()

Bapi_Ep_Demo_Input input=new Bapi_Ep_Demo_Input();

wdContext.nodeBapi_Ep_Demo_Input().bind(input);

and again in custcontroller I defined a method called executeBapi_Ep_Demo_Input() which contains code like:

try{

wdContext.currentBapi_Ep_Demo_Input().modelObject.execute();}

catch(Exception e){

e.printStrackTrace();

}

Please suggest me, where I cud have gone wrong?

Thanks a lot in advance

Former Member
0 Kudos

Hi saravanan,

Can you tell me why shud I create a VlaueNode and Value attributes? why not a model node and model attributes since Iam mapping to the fields of a model?

can you tell me what to write in Init() method of CustomeController and Save button, and aslo the same in my View also?

Please let me know. Its urgent.

Former Member
0 Kudos

Hi,

The purpose of creating value node is: This value node bind into view. In future the BAPI structure is change then only delete model node on custom controller and reimport the BAPI. There is no need to distrub the view.

Kind Regards,

S.Saravanan.

Message was edited by: Saravanan S

Former Member
0 Kudos

Hi,

Tell me here what to create a ValueNode or ModelNode??

I have created ValueNode and corresponding Value attributes, when I gave EditModelBinding, under Context root of my CustomeController the attributes are present already. Then where and how shud I bind these model attributes and CustomeControllerr's attribute? Plz send me any PDF if you have or clearly state me where and what exactly have to be written in wdInit() of CustomController and save() method and onSaveAction()?

Thnaks and Regards,

Ganesh

Former Member
0 Kudos

There are tutorials on backend access from Web Dynpro, see https://www.sdn.sap.com/irj/sdn/developerareas/webdynpro?rid=/webcontent/uuid/5b77db42-0a01-0010-d7ba-8aa375593dd3">here [original link is broken] [original link is broken].

Armin

Former Member
0 Kudos

Hi Armin,

None of the PDFs talk abt pusing data to backend.

If you know the development procedure plz let me know. Its urgent

regards,

Ganesh

Former Member
0 Kudos

Hi,

I am guessing that you have a custom controller and

that is where you are trying to execute your BAPI. You

are talking about pushing data to the back-end being

different from fetching data from R/3 as mentioned in the

tutorials that Armin mentioned. Actually these are not too

different. It depends on your BAPI what function it

performs.

For example, a PO create BAPI will create a purchase

order in the back-end. So this is pushing data. But a

PO fetch BAPI will fetch details of a purchase order from

the back-end. So this is pulling data. But it all depends

on your BAPI.

For answering your question, where have you created

your model. In the custom controller? How is your view

linked to these model fields?

Regards,

Satyajit.

Former Member
0 Kudos

Hi,

Hi please check the following link. Your problem might be solved.

https://www.sdn.sap.com/irj/sdn/profile?userid=3455405

Kind Regards,

S.Saravanan.

Former Member
0 Kudos

Hi Satyajit,

Thanks for all you guys who helped me. Its almost resolved.

I created the model in the custome controller.

Thanks again.