Skip to Content

Problem with connecting to SAP system

Hi all,

I am currently working on a Java application, which should create a .rpt file. Now I am facing a problem when trying to connect to a SAP system with this application.

I am working with Crystal Reports for Eclipse and all the report creation stuff is working fine. Now I tried to build up a connection to a SAP system in order to add tables and fields to my report.

I used an existing report (which I created in Crystal Reports 2008) to get all the necessary data for connecting and added this data to my code.

When I start the application a com.crystaldecisions.sdk.occa.report.lib.ReportSDKException is thrown. It says there is an error when searching for the JNDI-name (usciq74).

Is there anything missing or wrong with my code? Or does anyone have an example how to build up such a connection?

Thanks a lot for your help!

Kind regards,

Tobias

The data I read from the existing report looked like this:

========= TABLES ============

Name: 0PUR_C01/TW_TEST_CR2

QName: 0PUR_C01/TW_TEST_CR2

Alias: 0PUR_C01_TW_TEST_CR2

Desc: Neue Query

========= CONNECTION ===========

User: null

Password:

Kind: SQL

-


Server Type = SAP BW Query

PreQEServerName = usciq74

R3NAME = Q74

Database DLL = crdb_bwquery.dll

Database = CLIENT=003 LANG=DE ASHOST=usciq74 SYSNR=77 USER=WELLERTO R3NAME=Q74

Database Name = CLIENT=003 LANG=DE ASHOST=usciq74 SYSNR=77 USER=WELLERTO R3NAME=Q74

Server Name = usciq74

Server = usciq74

What I now added to my programm was the following code:

PropertyBag propertyBag = this.connectionInfo.getAttributes();
 
propertyBag.put("Server Type", "SAP BW Query");
propertyBag.put("PreQEServerName", "usciq74");
propertyBag.put("R3NAME", "Q74");
propertyBag.put("Database", "CLIENT=003 LANG=DE ASHOST=usciq74 SYSNR=77 USER=WELLERTO R3NAME=Q74");
propertyBag.put("Database Name", "CLIENT=003 LANG=DE ASHOST=usciq74 SYSNR=77 USER=WELLERTO R3NAME=Q74");
propertyBag.put("Server Name", "usciq74");
propertyBag.put("Server", "usciq74");
propertyBag.put("Database DLL", "crdb_bwquery.dll");
   
this.connectionInfo.setAttributes(propertyBag);
this.connectionInfo.setUserName(***);
this.connectionInfo.setPassword(***);
this.connectionInfo.setKind(ConnectionInfoKind.SQL);   
    
Table table;
String table_name = "0PUR_C01/TW_TEST_CR2";
String table_alias = "0PUR_C01_TW_TEST_CR2";
table = new Table();
table.setName(table_name);
table.setAlias(table_alias);
table.setQualifiedName(table_name);
table.setConnection(new Connection());
table.setConnectionInfo(connectionInfo);
      
reportClientDocument.getDatabaseController().addTable(table, null);

Edited by: Tobias Weller on Feb 25, 2009 3:19 PM

When I build up a connecting in CR I need the SAP integration kit, is there anything similar needed here or is this another problem?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Feb 26, 2009 at 03:29 PM

    The Crystal Reports for Eclipse product doesn't support connections to SAP BW.

    The Crystal Reports Designer product supports it with the add-on SAP Integration Kit.

    Sincerely,

    Ted Ueda

    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.