cancel
Showing results for 
Search instead for 
Did you mean: 

How to update data in RFC through web dynpro application

Former Member
0 Kudos

Hi,

My requirement is i am fetching data using RFC call in web dynpro application

and displaying in a form ,in form i want to change some data and there is one save button,after changing data in form when i will click save buton so it should be

reflect in R3.But my quastion is since form's input fields are binded into output node so how i will send data as input in same form.

Thanks & Regards

muna

Accepted Solutions (0)

Answers (8)

Answers (8)

Former Member
0 Kudos

plz send best example for Updating records in R3.

Former Member
0 Kudos

Consider You have GetdetailNode and you want to add it to ChangeNode . Your getdetail node has same structure as Changenode then try following code

Note : - For refrence Bapi name is "BAPICHANGE" and customer controller name is CUSTNAME. Zst_STRUT is structure name of getdetail and change bapi interface table

BAPICHANGE Change_para = new BAPICHANGE();

wdContext.nodeBAPI().bind(Change_para);

IPublicCUSTNAME.getdetailElement currElement_getdetail =

(IPublicCUSTNAME.getdetailElement) wdContext.nodegetdetail().currentgetdetailElement();

// create instance with refrence to existing model object

Zst_STRUT request = currElement_getdetail.modelObject();

// assing it to change bapi parameters

Change_para.addchange(currElement_getdetail);

Regards

shweta

Former Member
0 Kudos

hi

Suppose you are using Bapi_get to getting the Data and Bapi_update to update the data.

Follow this concept:

1.Get all the data from the getnode of the bapi and put it in some list.

2bind your Bapi_update directly to the form

3.The getdetail list put that list in the list of Bapi_update.

Like this your data is on the form which you got and when you update something on form it is binded to the modify Bapi so it will be modified.

Regards

Nidhideep

Former Member
0 Kudos

Hi,

As per the scenario you explained, you calling a bapi which fetches records and you r trying insert data using the same bapi. Firstly, check whether ur bapi is code in such way that it fetches and inserts the records.

For eg: get sales order bapi, it will only get the sales orders based on a condition. But it will never insert data in r/3.

If ur bapi is capable enough to do this, u can proceed binding the input node to form. (I think this way will not be possible in get bapi's, because get bapi's purpose is to just get data).

Your requirement is to get data and modify it. So u should have a modify bapi for this. If you have that u can follow the below steps:

1. Initialize the get bapi.

2. Execute get bapi, passing the required parameters.

3. Initialize the modify bapi

4. Set the results in ur output node of get bapi to modify bapi input node.

5. Bind modify bapi input node to the form in ur view.

6. Execute Modify bapi now with changed data.

Hope this will work.

Regards,

Aparna .P

Former Member
0 Kudos

Hi Anil and monalisa,

According to Anil's suggestion I bind both input and output node in form but

problem is it is creating duplicate field for same purpose.For example in input node

and output node user id is common,When i am selecting user id for both input and output field it is creating two input field for user id in form.

monalisa actualy my requirement is how same form will be act as input as well as output purpose.

Thanks & Regards

muna

Former Member
0 Kudos

HI,

Let me know it you are using two RFC's or only one for both urposes.

Better to create sepete ones for retrivign the data and saving the data.

Then you can retriving the data by using retriveBAPI and saving SaveBAPI.

First let me know if you are using the one of two BAPIS.

Thanks,

Lohi.

Former Member
0 Kudos

Hi Anil ,

Thanks for your reply.Actualy that form is already binded in output node is it posible again bind into input request node,I think it is not possible becaus that will be replaced by input request node and output will not come.

Thanks & Regards

muna

Former Member
0 Kudos

Hi Muna,

You can bind the complete modeNode in the form .

While doing the mapping from Component/Custome controller to form , you select both request and response nodes so that you can bind the fields in the form to both request and response nodes.

Regards, Anilkumar

monalisa_biswal
Contributor
0 Kudos

U have to create one value node with cardinality 1..1 as an intermediate between two RFCs.

After retrieving Data from RFC populate the value node using

WDCopyService.copyCorresponding()

Similarly onSave action populate RFC model node with the values of the value node.

Former Member
0 Kudos

Hi,

You can bind the inpufields to the contextAttributes in requestXXX node sothat you can eneter the data in inputfields.

Regards, Anilkumar