Skip to Content
author's profile photo Former Member
Former Member

Save Data in Web Dynpro for Java

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 26, 2009 at 01:16 AM

    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#section10 [original link is broken]

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

    or you can directly connect to database check this link

    tutorials-on-access-the-database-for-data

    Regards,

    Siva

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 26, 2009 at 02:14 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Feb 26, 2009 at 04:44 AM

    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|webdynpro-using-javabean-model--please-help; are ,[JavaBean Model|web-dynpro-and-jdo-javabean-model;

    Best Regards

    Satish Kumar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 26, 2009 at 11:27 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.