Creating IDOC report
Hi,
We want to make a report in which we have to send material master data to non sap system through IDOC. Our Message type will be MATMAS and Basic type would be MATMAS05.
All ALE settings will be taken care.But in our scenerio we need to pass some particular segments so we will use BD56 for the same.
Could you pls let me know how to perform the same as I am new in IDOCs.We have standard program BD10. Please let me know how to start in report for generating outbound IDOC.
Thnx in advanced,
Raghav
hi
try this reference coding
report ycoe_idoc30.
tables : mara.
types : begin of t_mara,
matnr type mara-matnr,
mtart type mara-mtart,
end of t_mara.
data : itab type table of t_mara.
data : wa type t_mara.
data : i_edidd type edidd occurs 0 with header line,
i_edidc type edidc occurs 0 with header line.
data : cdata type edidc.
data : i_final type ymmsd. (YMMSD is the structure with 2 fields MATNR,MTART)
selection-screen : begin of block b1 with frame title text-008.
select-options : matnr for mara-matnr.
parameters : log_sys like tbdlst-logsys.
selection-screen : end of block b1.
start-of-selection.
select matnr mtart from mara
into corresponding fields of table itab
where matnr in matnr.
cdata-mestyp = 'MATMAS'.
cdata-idoctp = 'YIDOC62'.
cdata-rcvprt = 'LS'.
cdata-rcvprn = log_sys.
loop at itab into wa.
i_final-matnr = wa-matnr.
i_final-mtart = wa-mtart.
i_edidd-segnam = 'YSEG62'.
i_edidd-sdata = i_final.
append i_edidd.
endloop.
call function 'MASTER_IDOC_DISTRIBUTE'
exporting
master_idoc_control = cdata
tables
communication_idoc_control = i_edidc
master_idoc_data = i_edidd.
if sy-subrc = 0.
loop at i_edidc.
write:/ 'IDOC GENERATED ',i_edidc-docnum.
endloop.
In the selection screen enter the Inputs as
1)Material No
2)LOG_SYS --> Logical system name of the Receiver System.
after executing this program u get IDOC no generated which u can then
check in tcode : WE02/WE05.
Regards
Similar Messages
-
Hi all
I m facing problem to upload data through idoc.the scenario is like we receive electric meter reading in flat file format. And to upload that data JAVA code is written which will create an IDOC FILE this authorization is only give to 2-3 person in organization and to basis guy also as user changed its password in SAP and in JAVA the java code is not going to create the IDOC file and data is not going to upload. after changing user password in sap system ,user not able to upload the data.
ISU_MR_UPLOAD01 is the idoc file generated. So is there any authorization issue, password issue how to see and view IDOC IN SAP, can any one help me out into this.
The error with java throws is as;
1ST ERROR IN TRACE FILE
ERROR file opened at 20061109 133610 India Standard, SAP-REL 640,0,59 RFC-VER 3 MT-SL
T:2736 ======> User TR has no RFC authorization for function group SYST .
T:2736 <* RfcReceive [1] : returns 3:RFC_SYS_EXCEPTION
2ND ERROR ON COMMAND PROMT
C:\j2sdk1.4.2_07>cd bin
C:\j2sdk1.4.2_07\bin>java sandsupload
Creating IDoc...Exception in thread "main" com.sap.mw.idoc.IDoc$Exception: (2) I
DOC_ERROR_METADATA_UNAVAILABLE: The meta data for the IDoc type "ISU_MR_UPLOAD01
" is unavailable.
at com.sap.mw.idoc.jco.JCoIDoc$JCoDocument.<init>(JCoIDoc.java:233)
at com.sap.mw.idoc.jco.JCoIDoc$JCoDocument.<init>(JCoIDoc.java:187)
at com.sap.mw.idoc.jco.JCoIDoc.createDocument(JCoIDoc.java:10521)
at sandsupload.main(sandsupload.java:35)
the part of java code
try {
//create a JCo client pool
JCO.addClientPool( "MyPool", //pool name
3, //maximum pool connections
"333", //SAP client
" TR", //user ID
" XYZ", //password
"EN", //language
" 1.1.1.1 ", //app server host name
"00" ); //system number
//create an IDoc repository
IDoc.Repository idocRep = JCoIDoc.createRepository("MyIDocRepository", "MyPool");
//create a new and empty MATMAS02 document
System.out.print("Creating IDoc...");
Line where it shows error
IDoc.Document doc = JCoIDoc.createDocument(idocRep, "ISU_MR_UPLOAD01");
//get the root segment from the document
//The root segment does not contain any fields or data. It is only
//used as the standard parent segment and won't be transmitted when
//the document is sent to an SAP system.
IDoc.Segment segment = doc.getRootSegment();
//create and add a new and empty child segment of type E1MARAM
//and fill the segment dataHi Gaurav,
Same exception on the same line has been reported and marked as solved here :
IDOC_ERROR_METADATA_UNAVAILABLE:
Btw, I think this forum is not visited often by JCO and ABAP connectivity experts, so maybe you could get a faster response to your problems while posting in "Java Programming" or maybe in some forum under the category ABAP Development.
HTH
Peter -
Hi Friends..
I have created IDOC through program.
IF Shipment = 'X'.
perform shipment. -
>Shipment report
perform shipping. -
>Idoc creation form
PERFORM ftp2.
PERFORM move_ftp_entries.
perform shipment_display.
ELSEIF Receipt = 'X'.
perform Receipt. -
>Receipt Report
perform Receiving.----
>Idoc creation form
PERFORM ftp1.
PERFORM move_ftp_entries.
perform receipt_display.
ELSEIF Test = 'X'.
perform Test. -
> Test report
perform testdata.----
> Idoc creation form
PERFORM ftp.
PERFORM move_ftp_entries.
perform test_display.
ENDIF.
if I follow the above condition Idoc created for every report perfectly.But when I come to the following logic no idoc was created...
perform shipment. -
>Shipment report
perform shipping. -
>Idoc creation form
PERFORM ftp2. -
>FTP generation form
PERFORM move_ftp_entries.
perform shipment_display.----> Display form
perform Receipt. -
>Receipt Report
perform Receiving.----
>Idoc creation form
PERFORM ftp1.
PERFORM move_ftp_entries.
perform receipt_display.
perform Test. -
> Test report
perform testdata.----
> Idoc creation form
PERFORM ftp.
PERFORM move_ftp_entries.
perform test_display.
I want to generate IDOC for all my three reports.
Thanks
GowrishankarHi Gowri,
Tell me one thing. As per your logic you are displaying /generating one report and creating the responding idoc. Correct me if i am wrong. Can you please explain a bit more about your requirement.
Thanks,
Priyabrata -
I have downloaded Idoc(Already existing in the system with status 53) data using FM IDOC_READ_COMPLETELY(by passing an Idoc number) and passing this downloaded data to FM MASTER_IDOC_DISTRIBUTE to create new Idoc with same data.
Idoc does gets created but with status 29(Partner profile missing). I am not able to figure out what is going wrong because Idoc already exists in the system with same data so how can the new Idoc with same data have this issue?
Also I tried to maintain the partner profile data( that i got as warning message in Long text after the creation of Idoc) but still it did not help.Hi Nabheet,
Simply created a report where one FM gets data and using same data I try to create Idoc.
Even this fails to get the Idoc into correct status:
CALL FUNCTION 'IDOC_READ_COMPLETELY'
EXPORTING
document_number = 0000000041115636
IMPORTING
idoc_control = e_edidc
TABLES
int_edids = ts_edids
int_edidd = ts_edidd
EXCEPTIONS
document_not_exist = 1
document_number_invalid = 2
OTHERS = 3.
IF sy-subrc <> 0.
ENDIF.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
master_idoc_control = e_edidc
TABLES
communication_idoc_control = ts_edidc
master_idoc_data = ts_edidd
EXCEPTIONS
error_in_idoc_control = 1
error_writing_idoc_status = 2
error_in_idoc_data = 3
sending_logical_system_unknown = 4
OTHERS = 5.
IF sy-subrc EQ 0.
ENDIF. -
How to create IDOC for customer defined table
hi,
How to create IDOC for customer defined table Records and how to send this IDOC to target system.
what message type will be used and on receiving system how to post these records.
thankx.
pillac.Hi,
You need to create a custom message type and custom IDOC type for this with whatever fields you want send. You need to create segments (WE30), IDOC type (WE30), Message types (WE81) and assign the message type to the IDOC type (WE82).
You will have trigger the IDOC using a Report or something after doing the partner profile settings.
Similary in the target system also, you will have do all the settings.
Take a look the links to find out what settings needs to be done.
http://help.sap.com//saphelp_470/helpdata/EN/0b/2a611c507d11d18ee90000e8366fc2/frameset.htm
http://www.sappro.com/downloads/OneClientDistribution.pdf
Regards,
Ravi
Note : Please mark the helpful answers and close the thread if the issue is resolved. -
hi,
While creating idocs I created logical system using SPRO,then created RFC then Port but when i am creating partner profiles I am unable to get the destination system which I have created.Could any one guide me.Hi,
below is scenario for ALE/IDOC.
ALE-IDOC Scenario using Custom IDOC
Aim: Transfer the data from one system to another using user customized IDOC.
Sender System:
Server: 172.25.8.185
Client: 200
Data from Z table: zsach1
ReceiverSystem:
Server: 172.25.9.198
Client: 800
Data from Z table: zsach1
Data is fetched from Z table on the sender system and inserted it in the Z table of Receiver system using ALE/IDOC.
Settings on the Sender End
Table Creation T Code SE11. The table contains data that is to be sent to Receiver.
ALE Configuration
T-Code SALE
Defining Logical System
200 is our sender
800 is our receiver
Assigning Client to Logical System
200 is our sender
800 is our receiver
Defining Target System for RFC Calls (Tcode SM59)
Click on R/3 Connections and then Create TAB
Step 1
Step 2
Save and test the connection.
Defining Port
The sender system is connected to the receiver system through this Port.
Defining Partner Profiles
The partner for client 200(Sender) is the client 800 (Receiver)
Since this is a sender we have to define only Outbound Parameters in this case.
Here you can see the Message type is Z message type.
2. Maintaining Distribution Model ( TCode BD64 )
Create new Distribution Model
Add Message Type
Now Distribute this Model View
Distribute it from Edit à Model View à Distribute
Defining the Z Segment type
Tcode WE31
Defining the Basic Type
T Code WE30
Click on New
This will take you to next screen as follows
Here you have connected the basic type to the segment type.
Enter again and this will take you to screen as follows
This shows the relation between the basic and the segment types.
Next you need to make the entry of the segment in the system table.
Tcode : WE81
Next is the following entry which is required.
Here you are specifying the message type and the basic type and the release version.
This is all about the configuration you need to do on the sender side.
Now on the sender side you also need a program that will fetch the required data, couple it in the IDOC format and post it.
Here is a small piece of code that could be useful.
*& Report ZSACH_CUST_IDOC *
*report zsach_cust_idoc .
parameters : p_logsys like tbdlst-logsys.data : gen_segment like edidd-segnam value 'ZSACH'.data : control_dat like edidc,
gen_data like z1hdr .tables :zsach1.data: begin of inttab occurs 0,
lname type z1hdr-lname,
fname type z1hdr-fname,
end of inttab.
data :
int_edidd like edidd occurs 0 with header line,
int_edidc like edidc occurs 0 with header line.
select * from zsach1 into corresponding fields of table inttab.if sy-subrc ne 0.
message 'no data' type 'I'.
exit.
endif.control_dat-mestyp = 'ZSACH'.
control_dat-idoctp = 'ZSACH'.
control_dat-rcvprt = 'LS'.
control_dat-rcvprn = p_logsys.
loop at inttab.
gen_data-lname = inttab-lname.
gen_data-fname = inttab-fname.
GEN_DATA-SSN = INTTAB-SSN.
GEN_DATA-DOB = INTTAB-DOB. int_edidd-segnam = gen_segment.
int_edidd-sdata = gen_data. append int_edidd.
endloop.call function 'MASTER_IDOC_DISTRIBUTE'
exporting
master_idoc_control = control_dat
OBJ_TYPE = ''
CHNUM = ''
tables
communication_idoc_control = int_edidc
master_idoc_data = int_edidd exceptions
error_in_idoc_control = 1
error_writing_idoc_status = 2
error_in_idoc_data = 3
sending_logical_system_unknown = 4
others = 5
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno.
else. loop at int_edidc.
write :/ 'IDOC GENERATED',int_edidc-docnum.
endloop.
commit work.
endif.
Settings on the receiver side.
The ALE configuration is same as we did it on the sender side. Please refer to earlier pages.
The receiver specific differences are mentioned below.
T-Code SALE
200 is our sender
800 is our receiver
Steps
Defining Logical System (Same as sender)
Assigning Client to Logical System (Same as sender)
Defining Target System for RFC Calls (Tcode SM59) (Same as sender)
Defining Port(Same as sender)
Defining Partner Profiles Here we are accepting the data from Sender system. Hence we need to configure it as Inbound.
Click on the sign above to go to next screen.
Here the message type is to be created again as it was created on the sender side.
The following steps are repeated, as done on the sender side, on the receiver end
Tcode WE30
Tcode WE31
Tcode WE82
Tcode WE81
Here on the receiver end, we need to specify a process code at the time of defining the partner profile.
Process code is something that has the logic defined about what to be done after receiving the IDOC.
In our case, on receipt of the IDOC, we are updating the Z Table. i.e Inserting the data from the IDOC into the Z Table.
Creating a Process Code
Tcode WE42
The logic associated is coded in the Function Module which is specified in the Identification Field above.
Also the processing type is selected as Processing by Function Module as above.
The function Module is specified in the following screen.
To have your function Module in the above drop down list, the entry is to be made using the following transaction
TCode BD51
Once the entry is done here, the function module appears in the drop down list in the previous stage.
Also it is important to make the following entry
Tcode WE57
Function Module will look something as below:
Source Codefunction z_idoc_input_sach .
""Local interface:
*" IMPORTING
*" VALUE(INPUT_METHOD) LIKE BDWFAP_PAR-INPUTMETHD
*" VALUE(MASS_PROCESSING) LIKE BDWFAP_PAR-MASS_PROC
*" VALUE(NO_APPLICATION_LOG) LIKE SY-DATAR OPTIONAL
*" VALUE(MASSSAVEINFOS) LIKE MASSSAVINF STRUCTURE MASSSAVINF
*" OPTIONAL
*" EXPORTING
*" VALUE(WORKFLOW_RESULT) LIKE BDWF_PARAM-RESULT
*" VALUE(APPLICATION_VARIABLE) LIKE BDWF_PARAM-APPL_VAR
*" VALUE(IN_UPDATE_TASK) LIKE BDWFAP_PAR-UPDATETASK
*" VALUE(CALL_TRANSACTION_DONE) LIKE BDWFAP_PAR-CALLTRANS
*" TABLES
*" IDOC_CONTRL STRUCTURE EDIDC
*" IDOC_DATA STRUCTURE EDIDD
*" IDOC_STATUS STRUCTURE BDIDOCSTAT
*" RETURN_VARIABLES STRUCTURE BDWFRETVAR
*" SERIALIZATION_INFO STRUCTURE BDI_SER
*" EXCEPTIONS
*" WRONG_FUNCTION_CALLED
include mbdconwf.
data : it_emp_data like zsach1 occurs 0 with header line.
data : gen_data like zsach1 .
workflow_result = c_wf_result_ok.
data : counter type int4.select count( * ) from zsach1 into counter.
counter = counter + 1. loop at idoc_contrl. if idoc_contrl-mestyp ne 'ZSACH'.
raise wrong_function_called.
endif. clear gen_data.
refresh it_emp_data. loop at idoc_data where docnum eq idoc_contrl-docnum. if idoc_data-segnam = 'ZSACH'. gen_data = idoc_data-sdata. it_emp_data-mandt = counter.
it_emp_data-lname = gen_data-lname.
it_emp_data-fname = gen_data-fname. counter = counter + 1. append it_emp_data.
else.
message 'ERROR' type 'I'.
endif. endloop. endloop.insert zsach1 from table it_emp_data.
call function 'EDI_DOCUMENT_OPEN_FOR_EDIT'
exporting
document_number = idoc_data-docnum
importing
idoc_control = idoc_contrl
tables
idoc_data = idoc_data
exceptions
document_foreign_lock = 1
document_not_exist = 2
document_not_open = 3
status_is_unable_for_changing = 4
others = 5.call function 'EDI_CHANGE_DATA_SEGMENTS'
tables
idoc_changed_data_range = idoc_data
exceptions
idoc_not_open = 1
data_record_not_exist = 2
others = 3.
data t_itab_edids40 like edi_ds40 occurs 0 with header line.clear t_itab_edids40.
t_itab_edids40-docnum = idoc_data-docnum.
t_itab_edids40-status = '51'.
t_itab_edids40-repid = sy-repid.
t_itab_edids40-tabnam = 'EDI_DS'.
t_itab_edids40-mandt = sy-mandt.
t_itab_edids40-stamqu = 'SAP'.
t_itab_edids40-stamid = 'B1'.
t_itab_edids40-stamno = '999'.
t_itab_edids40-stapa1 = 'Sold to changed to '.
*t_itab_edids40-stapa2 = t_new_kunnr.
t_itab_edids40-logdat = sy-datum.
t_itab_edids40-logtim = sy-uzeit.append t_itab_edids40.call function 'EDI_DOCUMENT_CLOSE_EDIT'
exporting
document_number = idoc_data-docnum
do_commit = 'X'
do_update = 'X'
write_all_status = 'X'
tables
status_records = t_itab_edids40
exceptions
idoc_not_open = 1
db_error = 2
others = 3.endfunction.
Running the Application
Sender system
Execute the program we created earlier
Checking the IDOC
T Code WE02
Checking the data on the Receiver end
Tcode: WE02
The IDOC has arrived here
Checking the Data
Double click on the IDOC
Checking the Database
This way, the data has come to the receiver end successfully.
REWARD IF HELPFULL. -
Error while creating a report in BI publisher
Hi all ,
I am getting an error while creating a new report in BI publisher .
the error shown in console is --
java.lang.SecurityException: /
In the front end - i am getting
Operation failed: d:/OracleBI/xmlp/XMLP/Users/~administrator/annapurna/test/test.xdo
please suggest if anyone knows.Hi,
I am newly using BI publisher . I am using 10.1.3.4.0 . I am just trying to create a report in test name. that is the first step to create a report where i am getting error. I am using default RPD paint , where all the user and Groups are defined . -
How to create a report to bring all data from two different Info providers
Hi All,
I have a peculier problem while creating a report. I have two custom info providers one DSO and another Cube. There are only two common fields between these two Info providers . I need to create a report such that the report displays all the values from DSO but user can have the selection option on one of the fields in the Cube.
Here is an example
DSO Contents:
DocNum- DocItem- DocText- Amount- Quantity
10000---- 10---- ABC---- 100---- 10
10001---- 20---- DSN---- 200---- 10
10005---- 20---- DSN---- 200---- 10
Z1003---- 10---- CAN---- 500---- 1
Cube Contents
DocNum- DocItem- Date----- InvoiceAmt
10000---- 10---- 1/10/2009---- 50
10001---- 20---- 2/20/2009---- 100
10005---- 20---- 2/25/2009---- 100
The report needs to be displayed as shown below when the user selects value for date from 1/10/2009 to 2/20/2009
DocNum- DocItem- DocText- Amount- Quantity
10000---- 10---- ABC---- 100---- 10
10001---- 20---- DSN---- 200---- 10
I hope this was clear for you to understand. I would really appricate if any one can answers about how to resolve this problem. I cannot add the date filed to DSO and I also have Doc Num and Item as the user selection fields in the report.
Thank you all in advance and i would really appreciate for your suggestions.
Regards
Chinna
Edited by: chinna2479 on Mar 3, 2009 7:38 PM
Edited by: chinna2479 on Mar 3, 2009 7:39 PMHi chinna,
Two possible options, I can think of now, but both of them may be a compromise with performance.
1. create an infoset and then a query on top of it, provided we have a one to one relation in both the targets. That is, the combination of doc and item number is not duplicate in either cube or ODS.
2. Create a master data object of doc and item number and have date as an attribute. Load that from cube data and make date as navigational attr.
Use this navgntal attr for selection in your report.
Let us know, if you require any further info.
Naveen.A -
How to create a report for open sales orde documents which are not invoiced
Hi Experts this is urgent,
+pls give the Logic for document flow+
My requirement is create a report for sales orders which are not invoiced using the following table.
VBAK : sales order header
VBAP : sales order item
VBFA : sales document flow
VBUK for processing status
KOMV for duties value and sales order value
LIKP : delivery not header
LIPS :delivery note item
For information : In the header level the processing Status is indicated in the table VBUK field LFSTK for one sales order number. A,B , C are the possible entries.
Case A : When a sales order is invoiced we can display information on the header status :
Overall status : Completed and display a invoice number in the document flow. When the items of the sales orders are invoiced the process status is the following : Overall status Completed
Delivery status Fully delivered
Case B : An open sales order not delivered and not invoiced will have overall status : Open on the header and item level and will not have subsequent documents.
Case C :
When the items for the sales order are delivered but not invoiced the status will be u201Cfully deliveredu201D
And the subsequent documents will be delivery notes and good issue if the delivery note is issued.
With regards
ravi
Edited by: ravik ravik on Jun 25, 2008 3:29 PMHello Ravi,
U neednot develop any report..
there is std report with txn V.02
or copy this and make necessary changes.
Reward, if helpful.
Rgds,
Raghu. -
How to create a report based on a DataSet programatically
I'm working on a CR 2008 Add-in.
Usage of this add-in is: Let the user choose from a list of predefined datasets, and create a totally empty report with this dataset attached to is. So the user can create a report based on this dataset.
I have a dataset in memory, and want to create a new report in cr2008.
The new report is a blank report (with no connection information).
If I set the ReportDocument.SetDataSource(Dataset dataSet) property, I get the error:
The report has no tables.
So I must programmatically define the table definition in my blank report.
I found the following article: https://boc.sdn.sap.com/node/869, and came up with something like this:
internal class NewReportWorker : Worker
public NewReportWorker(string reportFileName)
: base(reportFileName)
public override void Process()
DatabaseController databaseController = ClientDoc.DatabaseController;
Table table = new Table();
string tabelName = "Table140";
table.Name = tabelName;
table.Alias = tabelName;
table.QualifiedName = tabelName;
table.Description = tabelName;
var fields = new Fields();
var dbField = new DBField();
var fieldName = "ID";
dbField.Description = fieldName;
dbField.HeadingText = fieldName;
dbField.Name = fieldName;
dbField.Type = CrFieldValueTypeEnum.crFieldValueTypeInt64sField;
fields.Add(dbField);
dbField = new DBField();
fieldName = "IDLEGITIMATIEBEWIJS";
dbField.Description = fieldName;
dbField.HeadingText = fieldName;
dbField.Name = fieldName;
dbField.Type = CrFieldValueTypeEnum.crFieldValueTypeInt64sField;
fields.Add(dbField);
// More code for more tables to add.
table.DataFields = fields;
//CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo info =
// new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
//info.Attributes.Add("Databse DLL", "xxx.dll");
//table.ConnectionInfo = info;
// Here an error occurs.
databaseController.AddTable(table, null);
ReportDoc.SetDataSource( [MyFilledDataSet] );
//object path = @"d:\logfiles\";
//ClientDoc.SaveAs("test.rpt", ref path, 0);
The object ClientDoc referes to a ISCDReportClientDocument in a base class:
internal abstract class Worker
private ReportDocument _ReportDoc;
private ISCDReportClientDocument _ClientDoc;
private string _ReportFileName;
public Worker(string reportFileName)
_ReportFileName = reportFileName;
_ReportDoc = new ReportDocument();
// Load the report from file path passed by the designer.
_ReportDoc.Load(reportFileName);
// Create a RAS Document through In-Proc RAS through the RPTDoc.
_ClientDoc = _ReportDoc.ReportClientDocument;
public string ReportFileName
get
return _ReportFileName;
public ReportDocument ReportDoc
get
return _ReportDoc;
public ISCDReportClientDocument ClientDoc
get
return _ClientDoc;
But I get an "Unspecified error" on the line databaseController.AddTable(table, null);
What am i doing wrong? Or is there another way to create a new report based on a DataSet in C# code?Hi,
Have a look at the snippet code below written for version 9 that you might accommodate to CR 2008, it demonstrates how to create a report based on a DataSet programmatically.
//=========================================================================
+ * the following two string values can be modified to reflect your system+
+ ************************************************************************************************/+
+ string mdb_path = "C:
program files
crystal decisions
crystal reports 9
samples
en
databases
xtreme.mdb"; // path to xtreme.mdb file+
+ string xsd_path = "C:
Crystal
rasnet
ras9_csharp_win_datasetreport
customer.xsd"; // path to customer schema file+
+ // Dataset+
+ OleDbConnection m_connection; // ado.net connection+
+ OleDbDataAdapter m_adapter; // ado.net adapter+
+ System.Data.DataSet m_dataset; // ado.net dataset+
+ // CR variables+
+ ReportClientDocument m_crReportDocument; // report client document+
+ Field m_crFieldCustomer;+
+ Field m_crFieldCountry;+
+ void CreateData()+
+ {+
+ // Create OLEDB connection+
+ m_connection = new OleDbConnection();+
+ m_connection.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + mdb_path;+
+ // Create Data Adapter+
+ m_adapter = new OleDbDataAdapter("select * from Customer where Country='Canada'", m_connection);+
+ // create dataset and fill+
+ m_dataset = new System.Data.DataSet();+
+ m_adapter.Fill(m_dataset, "Customer");+
+ // create a schema file+
+ m_dataset.WriteXmlSchema(xsd_path);+
+ }+
+ // Adds a DataSource using dataset. Since this does not require intermediate schema file, this method+
+ // will work in a distributed environment where you have IIS box on server A and RAS Server on server B.+
+ void AddDataSourceUsingDataSet(+
+ ReportClientDocument rcDoc, // report client document+
+ System.Data.DataSet data) // dataset+
+ {+
+ // add a datasource+
+ DataSetConverter.AddDataSource(rcDoc, data);+
+ }+
+ // Adds a DataSource using a physical schema file. This method require you to have schema file in RAS Server+
+ // box (NOT ON SDK BOX). In distributed environment where you have IIS on server A and RAS on server B,+
+ // and you execute CreateData above, schema file is created in IIS box, and this method will fail, because+
+ // RAS server cannot see that schema file on its local machine. In such environment, you must use method+
+ // above.+
+ void AddDataSourceUsingSchemaFile(+
+ ReportClientDocument rcDoc, // report client document+
+ string schema_file_name, // xml schema file location+
+ string table_name, // table to be added+
+ System.Data.DataSet data) // dataset+
+ {+
+ PropertyBag crLogonInfo; // logon info+
+ PropertyBag crAttributes; // logon attributes+
+ ConnectionInfo crConnectionInfo; // connection info+
+ CrystalDecisions.ReportAppServer.DataDefModel.Table crTable;+
+ // database table+
+ // create logon property+
+ crLogonInfo = new PropertyBag();+
+ crLogonInfo["XML File Path"] = schema_file_name;+
+ // create logon attributes+
+ crAttributes = new PropertyBag();+
+ crAttributes["Database DLL"] = "crdb_adoplus.dll";+
+ crAttributes["QE_DatabaseType"] = "ADO.NET (XML)";+
+ crAttributes["QE_ServerDescription"] = "NewDataSet";+
+ crAttributes["QE_SQLDB"] = true;+
+ crAttributes["QE_LogonProperties"] = crLogonInfo;+
+ // create connection info+
+ crConnectionInfo = new ConnectionInfo();+
+ crConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;+
+ crConnectionInfo.Attributes = crAttributes;+
+ // create a table+
+ crTable = new CrystalDecisions.ReportAppServer.DataDefModel.Table();+
+ crTable.ConnectionInfo = crConnectionInfo;+
+ crTable.Name = table_name;+
+ crTable.Alias = table_name;+
+ // add a table+
+ rcDoc.DatabaseController.AddTable(crTable, null);+
+ // pass dataset+
+ rcDoc.DatabaseController.SetDataSource(DataSetConverter.Convert(data), table_name, table_name);+
+ }+
+ void CreateReport()+
+ {+
+ int iField;+
+ // create ado.net dataset+
+ CreateData();+
+ // create report client document+
+ m_crReportDocument = new ReportClientDocument();+
+ m_crReportDocument.ReportAppServer = "127.0.0.1";+
+ // new report document+
+ m_crReportDocument.New();+
+ // add a datasource using a schema file+
+ // note that if you have distributed environment, you should use AddDataSourceUsingDataSet method instead.+
+ // for more information, refer to comments on these methods.+
+ AddDataSourceUsingSchemaFile(m_crReportDocument, xsd_path, "Customer", m_dataset);+
+ +
+ // get Customer Name and Country fields+
+ iField = m_crReportDocument.Database.Tables[0].DataFields.Find("Customer Name", CrFieldDisplayNameTypeEnum.crFieldDisplayNameName, CeLocale.ceLocaleUserDefault);+
+ m_crFieldCustomer = (Field)m_crReportDocument.Database.Tables[0].DataFields[iField];+
+ iField = m_crReportDocument.Database.Tables[0].DataFields.Find("Country", CrFieldDisplayNameTypeEnum.crFieldDisplayNameName, CeLocale.ceLocaleUserDefault);+
+ m_crFieldCountry = (Field)m_crReportDocument.Database.Tables[0].DataFields[iField];+
+ // add Customer Name and Country fields+
+ m_crReportDocument.DataDefController.ResultFieldController.Add(-1, m_crFieldCustomer);+
+ m_crReportDocument.DataDefController.ResultFieldController.Add(-1, m_crFieldCountry);+
+ // view report+
+ crystalReportViewer1.ReportSource = m_crReportDocument;+
+ }+
+ public Form1()+
+ {+
+ //+
+ // Required for Windows Form Designer support+
+ //+
+ InitializeComponent();+
+ // Create Report+
+ CreateReport();+
+ //+
+ // TODO: Add any constructor code after InitializeComponent call+
+ //+
+ }+//========================================================================= -
Error while creating a report that uses Oracle OCI JDBC connectivity
Please let me know why my CR and LF characters are removed from my forum posting *****
Hi,
I was trying to create a report that uses Oracle OCI JDBC connectivity. I am using Eclipse3.4 download from "cr4e-all-in-one-win_2.0.2.zip". I have successfully created a JDBC OCI connection.
The connection parameters are given below:
URL: jdbc:oracle:oci8:@xe
Database: xe
username: <userName>
password: <password>
I have tested the above connection in Data source Explorer and it works fine!!!
But I am getting the following error when I drag-and-drop a table from the list of tables. Not sure what I am missing here? Any help is highly appreciated.
com.businessobjects.reports.jdbinterface.common.DBException: InvalidURLOrClassName
at com.crystaldecisions.reports.queryengine.driverImpl.jdbc.JDBCConnection.Open(Unknown Source)
at com.crystaldecisions.reports.queryengine.JDBConnectionWrapper.Open(SourceFile:123)
at com.crystaldecisions.reports.queryengine.Connection.br(SourceFile:1771)
at com.crystaldecisions.reports.queryengine.Connection.bs(SourceFile:491)
at com.crystaldecisions.reports.queryengine.Connection.t1(SourceFile:2979)
at com.crystaldecisions.reports.queryengine.Table.u7(SourceFile:2408)
at com.crystaldecisions.reports.dataengine.datafoundation.AddDatabaseTableCommand.new(SourceFile:529)
at com.crystaldecisions.reports.common.CommandManager.a(SourceFile:71)
at com.crystaldecisions.reports.common.Document.a(SourceFile:203)
at com.businessobjects.reports.sdk.requesthandler.f.a(SourceFile:175)
at com.businessobjects.reports.sdk.requesthandler.DatabaseRequestHandler.byte(SourceFile:1079)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.do(SourceFile:1163)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.if(SourceFile:657)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter.a(SourceFile:163)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.a(SourceFile:525)
at com.businessobjects.reports.sdk.JRCCommunicationAdapter$2.call(SourceFile:523)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.businessobjects.crystalreports.designer.core.util.thread.ExecutorWithIdleProcessing$3.doWork(ExecutorWithIdleProcessing.java:182)
at com.businessobjects.crystalreports.designer.core.util.thread.AbstractCancellableRunnable.run(AbstractCancellableRunnable.java:69)
at com.businessobjects.crystalreports.designer.core.util.thread.PriorityTask.run(PriorityTask.java:75)
at com.businessobjects.crystalreports.designer.core.util.thread.PriorityCompoundCancellableRunnable.runSubtask(PriorityCompoundCancellableRunnable.java:187)
at com.businessobjects.crystalreports.designer.core.util.thread.PriorityProgressAwareRunnable.runSubtask(PriorityProgressAwareRunnable.java:90)
at com.businessobjects.crystalreports.designer.core.util.thread.PriorityCompoundCancellableRunnable.doWork(PriorityCompoundCancellableRunnable.java:144)
at com.businessobjects.crystalreports.designer.core.util.thread.AbstractCancellableRunnable.run(AbstractCancellableRunnable.java:69)
at com.businessobjects.crystalreports.designer.core.util.thread.ExecutorWithIdleProcessing$IdleTask.run(ExecutorWithIdleProcessing.java:320)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Thanks
Karthik
Edited by: KARTHIK1 on Oct 14, 2009 9:38 PMHi Ted,
Thanks for the feedback. I was able to create a report in Creystal Reports Designer 2008 using OCI. It is not allowing only in the Eclipse plugin. In our environment we are not allowed to user Oracle thin connections and ONLY OCI is allowed.
1) Can you please let me know if there is a way to do this?
2) Will it allow data sources using native database driver?
3) If so, can I use JRC to create these reports from a desktop java program?
Thanks & Regards
Karthik
Edited by: KARTHIK1 on Oct 15, 2009 4:38 PM -
OBI 11G sUnquotedTableName.empty() error while creating a report
hello guru's
We have a problem when trying to build a report in OBI 11G. We have migrated an RPD from 10 to 11 and one 1 installation DEV all is OK, on TEST we get all kind of problems.
One of the main issues is when trying to build a report and clicking on the + to expand a node of a dimension object we hget the sUnquotedTableName.empty() error
When going to the logs I see the following details of the error.
Does anyone have a clue and can help us out?
Koen Verheyen
ProblemhMessage Level 10
Relationship ID 0:1
Component OBIPS
Module saw.httpserver.processrequest
Host XXXXXXX
Host IP Address XXXXXX
Thread ID 2836335504
ECID 0000Ijcd5UzFw000jzwkno1Clgr10001eK
Message
Assertion failure: !sUnquotedTableName.empty() at line 1936 of /scratch/aime1/adestore/views/aime1_dadvfa0138/bifndn/analytics_web/main/project/webutil/tablenameutils.cpp
Supplemental Detail
File:tablenameutils.cpp
Line:1936
Location:
saw.httpserver.processrequest
saw.rpc.server.responder
saw.rpc.server
saw.rpc.server.handleConnection
saw.rpc.server.dispatch
saw.threadpool
saw.threads
SessionID: 07vh3ae7bqk8nsnslpm32fhtcm9nsc5cd7va98q
AuthProps: AuthSchema=UidPwd|PWD=******|UID=koen_verheyen|User=koen_verheyen|RunAs=koen_verheyen
ecid: 0000Ijcd5UzFw000jzwkno1Clgr10001eK,0:1
ThreadID: 2836335504
HttpCommand: JSONRequestTableColumns
RemoteIP: 10.10.1.15
HttpArgs:Hi,
I am newly using BI publisher . I am using 10.1.3.4.0 . I am just trying to create a report in test name. that is the first step to create a report where i am getting error. I am using default RPD paint , where all the user and Groups are defined . -
Unable to create a report in bi publisher 10g
Hi All,
Unable to create a report in bi publisher. When we tried to create a report abcd, then it is giving the below error.
Operation failed: /abcd/abcd.xdo.
When we tried to create a report with the existing name, it is saying
An object with the same name already exists: /crm/crm.xdo
I can say this is not any permissions problem, I have logged inwith Administrator user.
ThanksHi,
Can any one..??? -
Creat a report in bi publisher based on dashboards
Hi,
Do you know if is possible creat a report in BIP with the same information and format that is in the dashboards?
Thank youI would think you can in most cases - but there is no automated tool.
Steps I would take is
1) create a new report with the parameters shown in the dashboard.
2) Add a query with the logical SQL from each answer report.
3) Add where conditions based on parameters
4) create a BI Publisher report in the word template based on this data.
Klaus -
Facing problem while creating a report on the value of a UDM in oem gc
Hi,
I have created a report in OEM grid control. I have selected a host for this. And I have selected an UDM from the metric list. The report works fine shows the correct graph in the report.
The problem is that along with the value from the respective udm , I am also getting the values from other metrics.
Between, I also noticed that the metric I selected is not highlighted when visited next time to the report edit page. I guess this could be the cause but dont know how to fix it. May be I am wrong, If any other issues or suggestions to my problem , Please Advise.
Thanks in advance.It is 10.2.0.5. I guess it is a bug but where to check for confirmation.
Thanks.
Edited by: Kuldip on Jul 22, 2010 11:15 PM
Maybe you are looking for
-
Why is there a difference between LR4 image and PS-CS5 version which is much darker
if i get an image to look great in LR4 (v. 2012) after upgrading the cat from LR3,(version 2010) - and it looks great in the new develop mode, then I open up the image in the latest PS CS5, version 12.0.4 x64, the image then looks much darker in P
-
How to display html content with image in Adobe Flash and Flex mobile project?
Hi, I have a html content with image in it. How to display it in Adobe Flash Builder and Flex mobile project? Which control needs to be used for this?
-
if i buy CS6 master collection and install it on my mac,can i use it on a new mac when i update?
-
Where is the log file in 10.1.3 AS?
Hi I am writing System.out.println statements and want to check those messages in the log file. But not sure where the log file is. Appreciate if you can respond.
-
Oranization Unit and Position doesn't exist in pa0001
Hello all, I am new to HR , i had created one Org Unit in tcode PPOC_OLD and also some positions under it with some holders assigned to these positions . These entries can be seen in table HRP1001 but not in table pa0001 . when i give the pernr whic