2007 Jul 24 3:50 AM
Dear Experts,
I need to dbconnect SQL server database from SAP BW(which is on Unix and Oracle).
As I know,I need to install dbsl for unix(dbmssslib.sl)
But I don't know how to install sql server client on unix server.
I search the SDN,Found that----"You need to install the BI java connectors.
Relational DB's: you need to install the BI JDBC connector ,once u r done with it you should be able to connect any rdbms.
"
Is it right ?
Anybody help me on this.
Thanks a lot
thomas
2007 Jul 24 5:12 AM
Hi
Connecting to an External database from SAP
Step 1: Create an entry for the External database in DBCON table using Trxn: DBCA.
Table: DBCON (Description of Database Connections)
Field Name Description Value (For: E.g.:)
CON_NAME Logical name for a RAJ
database connection
DBMS Database system MSS
USER_NAME Database user <username>
PASSWORD Password for setting up <pwd>/<pwd>
the connection to the database
CON_ENV Database-specific information MSSQL_SERVER=depotserver MSSQL_DBNAME=HOF_INDORE
DB_RECO Availability type for an open database connect
Step 2: Now you can write code to connect to the external database
Your Sample code can be something like this
FUNCTION-POOL z_houston. "MESSAGE-ID ..
DATA: BEGIN OF wa,
c_locid(3),
c_locname(50),
c_locstate(5),
END OF wa.
FUNCTION z_houston_connect.
*"----
""Local interface:
*"----
EXEC SQL.
CONNECT TO 'RAJ' AS 'V'
ENDEXEC.
EXEC SQL.
SET CONNECTION 'V'
ENDEXEC.
*- Get the data from MS-SQL Server
EXEC SQL.
open C1 for
select
loc_id,
loc_name,
loc_state
from ho_loc_mast
ENDEXEC.
DO.
EXEC SQL.
FETCH NEXT C1 into :wa-c_locid, :wa-c_locname, :wa-c_locstate
ENDEXEC.
IF sy-subrc = 0.
PERFORM loop_output.
ELSE.
EXIT.
ENDIF.
ENDDO.
EXEC SQL.
CLOSE C1
ENDEXEC.
ENDFUNCTION.
&----
*& Form LOOP_OUTPUT
&----
Output
----
FORM loop_output .
WRITE: /5 wa-c_locid, 10 wa-c_locname, 65 wa-c_locstate.
CLEAR wa.
ENDFORM. " LOOP_OUTPUT
Regards
Raj