Accessing SQL Server form SAP

HI,
I want to get data on SQL Server from SAP.
What is the procedure to do the above.
Thanks.

hi
in the SAP HELP Content,followthe instructions for Tutorial 2: Accessing SQL Server
<u><i><b>also take  alook at this presentation</b></i></u>
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2e81685c-0701-0010-0eb3-918c6d56783a
Below: is the Tutorial 2 instructions.
In this tutorial you will create a portal component that retrieves and displays information from an MS SQL Server database. Your portal component will display information from the Northwind Categories table in a SAP NetWeaver .NET Table control. You will create a dataset to fill with the data and bind the Table control to this dataset to display data.
Note: using a dataset is one of the data access options, which is not always recommended. You will use a dataset in this tutorial for the simplicity.
To complete this tutorial, you need:
Access to a MS SQL Server with valid permissions for the Northwind sample database
Access to a running portal
A portal user account with administrator's permissions
The tutorial is split into a number of smaller pieces:
Section 1. Creating the SAP Portal Application project
Section 2. Creating and configuring the dataset
Section 3. Adding the SAP NetWeaver Table control and binding it to the data
Section 4. Adding code to fill the dataset and display the data
Section 5. Viewing the component in the portal
Section 1.
=========================================================
Creating the SAP Portal Application Project
On the File menu, point to New, and then click Project.
1. In the New Project dialog box, do the following:
(a)In the Project Types pane, choose Visual C# Projects or Visual Basic Projects.
(b)In the Templates pane, choose SAP Portal Application.
(c)Specify a different name and location, or accept defaults.
(d)Click OK.
A new SAP Portal Application project is created at the specified location. A new portal component named PortalComponent1.ascx is added to your project automatically.
Section 2.
=========================================================
Creating and Configuring the Dataset
Prior to creating a dataset, you need to create and configure the data connection and data adapter.
To create the data connection and data adapter
1. From the Data tab of the Toolbox, drag an SqlDataAdapter object onto your portal component form. Data Adapter Configuration Wizard will help you create both the connection and the adapter.
2. In the wizard, do the following:
2(a)In the Choose Your Data Connection pane, create or select an existing connection to the SQL Server Northwind database.
Important: when you configure the database connection, select the option Use a specific user name and password for server logon information. If your password is not blank, select the Allow to save password checkbox, and then select to Include the password in the connection string, when prompted. Although this is not a recommended practice, we use it in this tutorial for simplicity.
2(b) In the Choose a Query Type pane, select the Use SQL statements option.
2(c) In the Generate the SQL Statements pane, create the following SQL statement:
SELECT CategoryID, CategoryName, Description FROM Categories
If you need to build a different SQL statement, click Query Builder to open the Query Builder dialog box.
2(d) Click Finish.
The wizard adds two objects to your portal component: the SqlConnection1 object containing the database connection information and the SqlDataAdapter1 object containing the data definition.
To generate the dataset
1. From the Data menu, choose Generate DataSet. The Generate Dataset dialog box opens.
Tip: If you do not see the Data menu, click the form; the form must have focus for the menu to appear.
2. Select the New option and name the dataset dsCategories.
3. Select the Categories table in the Choose which table(s) to add to the dataset listbox.
4. Select the Add this dataset to the designer checkbox and click OK.
Visual Studio generates the new dsCategories dataset class and the dsCategories.xsd schema that is added to Solution Explorer. An instance of the new dataset class (dsCategories1) is then added to the form.
Section 3.
=========================================================
Adding the SAP NetWeaver .NET Table and Binding It to The Data
1. From the SAP NetWeaver tab of the Toolbox, drag a Table control onto the portal component.
2. Right-click it to open the Properties box.
3. Set the DataSource property to dsCategories1.
4. Set the DataMember property to Categories.
Section 4.
=========================================================
Adding Code to Fill the Dataset and Display the Data
Although the table is bound to the dataset, the data is not displayed automatically. You must explicitly fill the dataset and bind the table to its data source.
To fill the dataset and display data in the Table control
1. Double-click the form to switch to Code Editor.
2. In the Page_Load event handler, call the data adapter's Fill method, passing it the dataset you want to fill:
[C#]
sqlDataAdapter1.Fill(dsCategories1);
[Visual Basic]
sqlDataAdapter1.Fill(dsCategories1)
3. Call the DataBind method of the Table control to bind it to the dataset:
[C#]
Table1.DataBind();
[Visual Basic]
Table1.DataBind()
4. Save your project.
Section 5.
=========================================================
Viewing the Component in the Portal
Deploy the PAR to the current portal.
In Solution Explorer, right-click the portal component and choose View in Portal.
The table with the list of categories is displayed in the browser.
regards
navjot
reward accordingly
Message was edited by:
        navjot sharma

Similar Messages

  • Put some data form the databse of SQL Server into SAP and auto general PR?

    Dear all,
            Can you tell me how I can put some data from the databse of SQL Server into SAP and auto general PR?
    Best regards,
    Merryzhang
    Edited by: merry zhang on Feb 4, 2009 9:10 AM

    Hi Zhang,
    If i have understood your question properly, I guess you wanted to create Purchase Requistion automatically right?
    Then you have lots of option simpilest one would be create a couple of Z table with all the fields that you require for header and Item.
    create a Program and use BAPI function module to create the PR by reading the values from those Z tables. after creation delete the contents from the table. Schedule this program in Background periodically like everyday or weekly once however you would like it to be. So once the table has contents in it and when the program runs it will create the PR's (Purchase Requisition).
    You can also use a workflow with the Z table. Once the Z table is filled you can trigger a workflow based on the Table change. I'm not sure like how to do it but I nkow that this process can also be used.
    Hope this might have thrown some light upon.
    Thanks,
    Prashanth

  • Accessing SQL Server jar for EP6 SP19/EP7 SP11

    Hi,
    I have application that accesses SQL Server and used to run in old portals (SP under 13) but doesn't run under new portals.
    This is the driver I use:
    <i>com.sap.portals.jdbc.sqlserver.SQLServerDriver</i>
    I tried to include the following jars under the 'lib' folder - didn't help
    P9base.jar, P9sqlserver.jar, P9util.jar
    I get  "[SAP_Portals][SQLServer JDBC Driver]This driver is locked for use with embedded applications".
    What jar/driver do I need to use in order to run applications that access SQL server in the new portals.
    p.s
    I don't want to define connection in VA. I want to use DIRECT connection.
    Thanks,
    Omri

    Solved it on my own.
    MS SQL Server 2000
    jars: msbase.jar, msutil.jar, mssqlserver.jar 
    jdbc:sqlserver://<host_name>:<port>;DatabaseName=<db_name> 
    Driver name:  com.microsoft.jdbc.sqlserver.SQLServerDriver 
    Omri

  • Entity Framework - Code First - Migration - How to access SQL Server and Oracle using the same context?

    Hello,
    I use Entity Framework code first approach.
    My project is working fine with SQL Server. But, I want to access Oracle too. I want to switch SQL Server and Oracle in run time.
    I am able to access Oracle using "Oracle.ManagedDataAccess.EntityFramework.dl" in a new project.
    But, Is this possible to access SQL Server and Oracle in the same project.
    Thanks,
    Murugan

    This should be possible with a Code-First workflow.  In Code-First the database mapping layer is generated at runtime.
    David
    David http://blogs.msdn.com/b/dbrowne/

  • Accessing SQL Server from Oracle

    I found an article:
    http:www.databasejournal.com/features/oracle/article.php/3442661
    It shows how to setup a connection from Oracle to SQL Server.
    I am new to Oracle Using SQL Loader and PL/SQL.
    I would like to use the SQL Loader in Oracle to load a table in SQL Server. It is my understanding that a ctl file is used and is called by an Oracle application.
    I would not have an Oracle application. I would like to use the ctl file to load the SQL Server table. Can someone point me on how to use the ctl file for SQL Server?
    Also, in PL/SQL would there be a connection string to connect to SQL Server when accessing a table.
    Is there a book or some documentation that would address the above?
    Thanks in Advance.

    that article shows you how to access SQL Server database through Oracle, therefore you have no need to use SQL Loader to load data from SQL Server bcos it can be queried directly by using simple select statement.
    If you want to load the data into Oracle just use CREATE TABLE ... AS SELECT ...
    in PL/SQL, what you need is the database link.
    Cheers,
    NH

  • Accessing Sql Server from AS400 Java program

    Hi everybody,
    I am trying to access Sql Server from an AS400 Java program. I have tried various Sql Server JDBC drivers including the Microsoft one but no luck yet. When i try to compile my Java program (with driver file in the classpath) it gives some errors on the driver jar file and also it throws out lots of unreadable text characters. This gave me a feeling that probably its a character coding issue with the jar file, so i tried ftp the file in binary mode as well as copying through the Operations Navigator. But still compilation is giving the same kind of errors.
    Do I need to have some special JDBC Drivers compiled for AS400 specifically. My understanding was that Java is platform independent so any JDBC Type 4 driver will work.
    We are running Java 1.3 on the AS400. Any help on this issue would be great.
    Thanks
    Inder

    Thanks for the help. I am writing a Java program after a long time that's why was making that mistake. Now the program gets compiled correctly but on running the program i am getting the following error message:
    java 001-0070: Exception JVAB544 not expected
    /myjava/test/msbase.jar: 001-0050 Syntax error on Line 1: token ')' not expected
    /myjava/test/msutil.jar: 001-0050 Syntax error on Line 1: token ')' not expected
    /myjava/test/mssqlserver.jar: 001-0050 Syntax error on Line 1: token ')' not expected
    I have no idea what is this error about. Though the same driver files don't give any error when running on a Windows machine.
    Thanks

  • Problem accessing Sql server Procedure from Crystal with JDBC driver

    I have some Crystal reports using SQL Server procedures, most of them are working very well; however, I have 2 that have problems accessing sql server procedures. These reports are working using OLE DB connection without problem, but when I try to relocate the connection to JDBC Crystal generates an error like that the procedure not return records.
    The procedure is working with other products including OLE DB connections from crystal.
    What can I do?
    Thanks in Advance,
    JaimeC

    I am using:
    Crystal report 11 - 11.0.0.1282 and Crystal 2008 = 12.0.0.683
    SQL Server 2005 -  Microsoft SQL Server Management Studio Express     9.00.4035.00
    Windows XP
    I have discovered that the procedures create and work  temporary tables. In other cases when is working ok, the procedures have not working temporary tables.
    Thanks,
    Jaime Carrillo

  • Fetch data from another mirosoft sql server to sap

    Dear all,
                   I want to fetch data from another mirosoft sql server
                    to SAP(my sap server IN unix, oracle 10g).
    Thanks
    Shashi
    Moderator Message: Try to do you own research before posting your question. Get back to the forums in case you are stuck with any issue
    Edited by: Suhas Saha on Jul 26, 2011 3:21 PM

    hi,
    u should see following documentation:
    Oracle9i Heterogeneous Connectivity Administrator's Guide
    Release 1 (9.0.1)
    Part Number A88789_01
    in it u just go to chapter no. 4 (using the gateway),,u'll find ur answer there.
    regards
    umar

  • Access SQL-Server Data from Oracle 10gXE

    Hello,
    I want to access sql-server data from oracle 10g XE. I need the same functionality provided by Sql-server by Linked Servers, by which we can query on any data source(oracle, Excel, Access).
    do, Oracle 10gXE provide us with same functionality ???
    any pointers ???

    Yes, it does work with Express Edition.
    Here is a thread from the XE forum with examples.
    Re: Database Link to MS Access
    They refer to a MS Access database, but the procedure is the same.
    Doug

  • To Restrict SQL account from accessing Sql server via SSMS

    Hi All,
    We are planning to tighten the security of our SQL Server.
    In the initial phase, we want to restrict all the SQL accounts(except sa) from accessing SQL Server via SSMS
    Since the SQL passwords are used in the connection strings(plain text) of our .NET Applications, developers are able to see it and they are accessing SQL server through SSMS with the credentials in the connection string.
    The requirement is, SQL accounts should only be accessing the databases through .NET applications and not through any other applications like SSMS, SQLCMD...etc
    1) We tried "Logon Trigger", but later we came to know that there is security breach in it.
    2) Application Roles - Password is plain text, again back to square one.
    We are looking for an alternate. Please share some ideas.
    Thanks & Regards,
    K.P.Senthil Kumar

    The basic presumption here is that there is on way you can tie a connection to an application as such. There is app_name(), but since this is passed from the application, the application can call itself whatever you want.
    As long as it is only a matter of keeping business users out, you can solve the issue with some three-tiered solution. Either by having a true middle layer, or just having a web server, or the application running on Terminal Server or Citrix.
    But you want to keep the developers out who work with the code. That makes it difficult to lock them out of the middle layer.
    Then again, you say "our SQL Server" is that singular? Don't you have more than one SQL Server? One for developement, one for test and one for production? If you only want to keep the devs out from development, you have different usernames
    and password for different environments, and they are read from config files. The config files for production should be well-protected.
    By the way, only permitting sa from logging in from SSMS is bad idea. Rather, you should disable sa, and everyone should log in with their individual Windows account. And those who should perform system-administration tasks should be member of sysadmin.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • How to connect MS-sql server with SAP BW

    hi all,
    i want the connection procedure to how to connect MS-sql server with SAP BW.so that i can extract the data from ms sql server and can create cubes using that data.please help me in this issue.

    Hi Vamshi,
    Go through this DOC it explains u how to connect to other data bases like SQL...
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/58f4db47-0501-0010-a2bf-ff01b150fdff]
    this is a thread related to connect the SQL server..
    [DB Connect MS SQL Server;
    Regards,
    NR
    Assign points if helpful...

  • Access SQL Server data at time of Windows OS Boot Process

    It is possible to access SQL Server data at time of Windows OS Boot Process and before login into Windows.
    if anybody any idea on this.
    If you think my suggestion is useful, please rate it as helpful.
    If it has helped you to resolve the problem, please Mark it as Answer.
    Varinder Sandhu www.varindersandhu.in

    No, you need to identified before accessing to SQL Server. It is like you try turn on electric cooker before you open the door.
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to access Sql Server Express installed on Virtual PC from Host?

     
    I have SQL Server Express 2008 R2 installed on Virtual PC. and on my Host machine i have SQL Server 2008 R2 ( Enterprise Version) installed.
    Since Management studio that comes with SQL express does not support SQL profiler, i want to access SQL Server Express from the Host machine’s management studio which has SQL profiler.
    But I could access it using VM’s ip address & instance name

    Hi lax,
    Follow below steps in your Virtual Machine:
    1. Allow remote connections to this server
    The first thing you want to check is if Remote Connections are enabled on your SQL Server database. In SQL Server 2008 you do this by opening SQL Server 2008 Management Studio, connect to the server in question, right click the server and open the Server Properties.
    Navigate to Connections and ensure that Allow remote connections to this server is checked.
    2.  Protocols for MSSQLServer
    The next good thing to check is the SQL Server Network Configuration. Open the SQL Server Configuration Manager, unfold the node SQL Server Network Configuration and select Protocols for MSSQLServer (or whatever the name of your SQL Server instance is). Make
    sure that TCP/IP is enabled.
    3. The Firewall
    If there is still no communication happening between your computer and the remote SQL Server you most likely need to configure your firewall settings.
    A good first step is to figure out which port is being used by TCP/IP (and which you need to open in your firewall). You can do this by right clicking TCP/IP and selecting Properties. Click on the tab IP Addresses .
    That was easy enough and all there is left to do is to allow inbound TCP/IP traffic on Port 1433 in your firewall. In Windows 7 this works something like this. Open the Control Panel and navigate to Windows Firewall. Click on Advanced Settings on the left hand
    side and you should see the Windows Firewall with Advanced Security. Select the Inboud Rules on the left hand side and click on New Rule on the right hand side. This opens the New Inbound Rule Wizard which you can use to allow inbound traffic on Port 1433
    for TCP/IP.
    For more information, please refer to
    http://blogs.msdn.com/b/walzenbach/archive/2010/04/14/how-to-enable-remote-connections-in-sql-server-2008.aspx.
    In host machine:
    After you have done steps above, you could use the SQL Server Management Studio in the host machine to connect the SQL Server Express R2 in Virtual PC. If you installed a default instance in Virtual PC, you could use VirtualComputerName to login the SQL
    Server database engine. If you installed a named instance in Virtual PC, you could use VirtualComputerName\InstanceName to login the SQL Server database engine.
    Thanks,
    Maggie
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.

  • Issue with SQL converter: Query Migration Tool for Microsoft SQL Server to SAP HANA

    Hello,
    I found the following blog : http://scn.sap.com/community/business-one/blog/2013/04/10/how-to-convert-sql-from-ms-sql-server-to-sap-hana
    I am trying out this migration tool for converting my MS SQL queries to HANA.
    I am running into issue while converting certain queries.
    The issue is specific to "set" commands which set local variables inside "create procedure" commands.
    e.g.
    a standalone set command:
    SET @var = (SELECT TOP 1 name FROM mytable ORDER BY name)
    is converted well:
    SELECT (SELECT TOP 1 "name" FROM "mytable" ORDER BY "name") INTO var FROM DUMMY;
    But when the same is part of create procedure:
    CREATE PROCEDURE [dbx].[XXXXX_YYYY_ZZZZ]
    AS
    SET @var = (SELECT TOP 1 name FROM mytable ORDER BY name)
    it fails in converting the same:
    --Statements in the input file contain errors; conversion was canceled
    I would like to understand who can help me here.
    Thanks...

    Hi Mayur,
    that tool cannot convert stored procedures. it is still being developed. For these you have to do it manually.

  • Can you tell me how I can put the data of sql server into SAP to auto gener

    Dear all,
             Can you tell me how I can put the data of sql server into SAP to auto generate PR?
    Best regards,
    Merry zhang

    Many thanks ,it is ok now.

Maybe you are looking for

  • Moving iTunes Library to external hard drive when iTunes can't consolidate.

    Hi guys, hope you can help. I want to move my whole iTunes library to an external hard drive and then delete it all from my laptop, and from reading around I realise I have to consolidate the library into the iTunes music folder. However, as my inter

  • Error Message when Combining Files to PDF in Acrobat XI-Pro

    Hi! I am trying to combine multiple CAD files to PDF and keep encountering an error message. I'm using the Combine Files to PDF, dragging in the corresponding files (.DWG files) into Acrobat and then clicking the Combine button. They convert to PDF b

  • Need help in finding open source for creating Login component

    hi Pls any one help me out in finding some good open source for creating login component for my application i have heard about josso but i am not able to find how to use it if anyone can help in setting up josso i wil be very thankful to that person

  • Script for smartphones

    Hi All, I haven't used DW in quite awhile. Every so often I update/upgrade my (small company) website. I usually purchase templates that I can adjust rather than code from scratch. I have more of a design background and not so much code expertise. Re

  • Errrors while buliding"\Desktop\Flash Player\Source" of AdobeAccess

    Hi, I am trying to rebuild the "AdobeAccessPro4-setup\Reference Implementation\Sample Video Players\Desktop\Flash Player\Source" by using "Flash® Builder™® 4.7" and Flex4.6 SDK, But I couldn't able to rebulid it because of following errors, Can anybo