cancel
Showing results for 
Search instead for 
Did you mean: 

Save Data in Web Dynpro for Java

Former Member
0 Kudos

Hello,

I am currently use Web Dynpro and have a question about this. I need a way to save data but not in the context node. maybe in a data base? can anybody help?

Regards

Thomas

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

Check this link to connect to R3 table.

http://help.sap.com/saphelp_nw04/helpdata/en/c3/76b45d9688e04abe1a1070410ddc1e/frameset.htm

and to connect to sql and store data here is the code to connect to sql.

String userName = "sa";
				String password = "jktsql";
				String url ="jdbc:microsoft:sqlserver://jothi:1433;databaseName=student";
				String querry="select * from empDetail where name=?";
				Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
				Connection con =DriverManager.getConnection(url, userName, password);
				Statement st=con.createStatement();
				PreparedStatement ps=con.prepareStatement(querry);
				ps.setString(1,name);
				ResultSet rs=ps.executeQuery();
				while(rs.next())
				{
String strn=rs.getString(1);
					String strp=rs.getString(2);
}

Regards,

H.V.Swathi

former_member185086
Active Contributor
0 Kudos

Hi Thomas

In WebDynpro Context is just like a placeholder of data which also ensure that data will be available accross

different controller, To understand Context and model(Your Backend )relationship follow

[this|http://help.sap.com/saphelp_nw04s/helpdata/en/8f/db0c533a4e514d9720ed2307a40f84/frameset.htm] and

for WebService model [ read this thread|/message/1026147#1026147 [original link is broken];, [other links|; are ,[JavaBean Model|;

Best Regards

Satish Kumar

Former Member
0 Kudos

Hi,

For that first you need to create Model.The model can be

1)Adaptive Webservice Model

2)Adaptive RFC Model

3)EJB Model

4)Java Bean Model

If your backend is non sap system then you can write the connection logic in a java class

and expose that function as webservice.In webdynpro you can import that webservice as adaptive webservice model.

If your backend logic is present in EJB then you can create EJB Model.

If your backend is r/3 system then you need to create Adaptive RFC Model.

Regards,

Sudhir

former_member197348
Active Contributor
0 Kudos

Hi Thomas,

Welcome to SDN!

What is your backend? Is it R/3 or some other database?

If it is R/3, you need to have RFC. If it is any other database, you can use webservices. Check these links

https://www.sdn.sap.com/irj/sdn/nw-wdjava?rid=/webcontent/uuid/403e6bf5-426e-2910-b0a8-a95548724af9#... [original link is broken]

/docs/DOC-8661#section10 [original link is broken]

or you can directly connect to database check this link

Regards,

Siva