cancel
Showing results for 
Search instead for 
Did you mean: 

Saving data to R/3 directly through Portal

Former Member
0 Kudos

Hi Experts,

I have a situation here where I need to create a form on web dynpro java, which will save and display data from R/3. Is it possible to save data to R/3 directly? I have create adaptive RFC model and JCO connection to display data from R/3. But I dont know saving is possible or not. Please help me to sort out this problem.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi all,

I have called the bapi as told by you. But while I am calling bapi to save the data I am getting the following screen where the fields are to editable/writable. Is there any way to make them writable so that data can be written the fields?

Former Member
0 Kudos
junwu
Active Contributor
0 Kudos

for that node bound to the ui element, you have to create a element in the node first.

Former Member
0 Kudos

hi Jun Wu,

thanks for your instant reply.

i have created all the elements in the node and bind them also. as i have referred the document as suggested by Amol. this is the image after  i have deployed the application. i am not able to figure out the problem.

junwu
Active Contributor
0 Kudos

can u show me the code?

Former Member
0 Kudos

hi Jun Wu,

i have followed the document where the bapi is called using adaptive rfc model. and zero coding is done to call it. On the R/3 side, the insert statement is running to save the data. everything is fine as I have designed the application to display also but for saving same fields i am not getting as writable.

junwu
Active Contributor
0 Kudos

as i said, create an element for the node, don't u understand?

Former Member
0 Kudos

i am getting u. sorry, if i create a node in wed dynpro it will save data in portal database. can u show me the procedure and the code?

junwu
Active Contributor
0 Kudos

you need more knowledge about the model execution.

can you show me the node structure

and the initialization code generated by the wizard

govardan_raj
Contributor
0 Kudos

Hi shilpi ,

that shows that your node cardinality is 0..n

it is should 1..1 check your cardinality of the node. that will sort out the problem of feild not editable at portal .

and which code you  wanted ?\

\

Regards

Govardan

amolgupta
Active Contributor
0 Kudos

Hi Shilpi,

Your scenario may NOT be zero coding scenario. Many times you have to write some code to add elements to node. In your case it is clearly visible that you need to make a element of the node. The node visible in the screenshot has zero elements attached to it thats why it is looking disabled.

You may want to verify it.... Make a node with attributes, Set cardinality to 0..n.  Create a form bound to the node. Do not make an element of the node. Run the application. The form will look disabled. It simply implies that there are zero elements in the node.

In your scenario, just print the size of the node in the view using the following code-
wdComponentAPI.getMessageManager().reportException("custom message to display size",false);

Till the node size comes up as 0, your form will look disabled as it is right now.

As mentioned earlier, this is a common old scenario. Search for some sample code in articles, blogs and forums. I am sure you will get a lot of sample code.

Regards,

-Amol Gupta

Answers (2)

Answers (2)

amolgupta
Active Contributor
0 Kudos

Hi Shilpi,

WebDynpro Java enables you to call BAPIs/RFCs. The onus of saving in your case lies with the BAPI/RFC.

RFC/BAPI expose CRUD (create, read, update, delete) operations to the outside world (out of R3 system).

If your BAPI/RFC saves data, calling the BAPI from WebDynpro Java will do the same. WebDynpro Java just calls the BAPI/RFC. Actual business logic is implemented in the BAPI/RFC.

Cheers,

-Amol Gupta

Former Member
0 Kudos

Hi Amol,

Thanks for instant reply. Actually I am not able to find the procedure to save the data from Portal to R/3. It got displayed as I have referred this document with zero coding RFC connection.

Can you guide me or provide me the proper procedure and code.

amolgupta
Active Contributor
0 Kudos

Hi Shilpi,

Are you able to call a BAPI to read data ? If yes, then from WebDynpro point of view the code to call a BAPI for Read or Save is same.

You should test your BAPI in SE37 transaction in R3. Whatever structures are needed in SE37, same will be needed from WebDynpro Java as well.

There are so many documents to show how to consume a BAPI from R3, search a little.

For e.g. -
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0966c06-9db6-2d10-4d93-b20bc5384...

High level steps -
-------------------------

1). Create Adaptive RFC model

2). Add model in used models

3). Apply template -"Service Controller" on Component Controller or View Controller

4). Context bindings, mappings and create forms, tables as required

5). Apply template - "Action Button", call execute..... method that was created in step 3.

Run the application and enjoy results. This is a common old scenario you will get a lot of documents articles etc if you search a little.

Regards,

-Amol Gupta

govardan_raj
Contributor
0 Kudos

hi Shilpi,

As amol and jun wu suggested , you can do any kind of update read etc (crud) at sap r/3 from webdynpro throug bapi or rfc or webservice (wsdls) , there is not direct way to update the r/3 from webdynpro.

Regards

Govardan

junwu
Active Contributor
0 Kudos

just call the rfc like the display case, nothing special