Restore selected report from biar file using biarengine.jar
Hi Experts,
I have created a biar file with full backup of my boe server using biar command line tool.
Now I want to test the biar by importing a selected report from that biar file. How should I form my properties file? Does the exportQuery property work when action=importXML ?
Many thanks,
PASG
Hi,
I found that always the full backup is being restored if I execute biarengine.jar to restore the biar file and it ignores exportQuery parameter.
What I did to restore a selected report from that biar file is as below:
1. Change the extension of the biar file to .zip.
2. Extract the files.
3. In the BusinessObjects.xml file, keep only those infoobjects which has to be restored and delete all other infoobjects.
4. Zip the files.
5. Change the extension of the zip file to .biar.
6. Execute biarengine.jar to restore the objects.
I checked and found that by this way, I can restore a selective object from the biar file.
Just wanted to know if this is a recommended approach or not. Can there be any issue later ?
Regards,
PASG
Similar Messages
-
Error importing from BIAR file (BO XI 3.0)
Dear BO community,
I am using the BIAR tool for backup purposes. For my backup, I use a properties file as input which looks like the one shown below:
action=exportXML
exportBiarLocation=C:/Temp/BOBackup.biar
userName=Administrator
password=XXX
CMS=XXX:6400
authentication=secEnterprise
includeSecurity=true
exportDependencies=true
exportQuery1=select * from ci_infoobjects
exportQuery2=select * from ci_systemobjects
exportQuery3=select * from ci_appobjects
exportQueriesTotal=3
The file creation seems to work without any problems. A file is created. However, when importing the file into another CMS, I am getting the following error:
Failed to open the BIAR file. Reason: com.businessobjects.sdk.biar.om.internal.iw.ObjectManagerIWException:Input/Output exception occurred: 'Couldn't find entry 'BusinessObjects.xml'.
I have opened the BIAR file using a ZIP program and checked that there is no "businessobjects.xml" file in there. When creating BIARs using only a single query, this file exists and the import is no problem.
Does anyone have an idea what's happening and can help me?
Thank you and best regards!Hello ALL,
I have the same problem when I am trying import from BIAR file. Please tell me how you resolved this issue.
I did not understand much from your previous message.
We are using BO XI R3.1 and below is the error message that Import Wizard is throwing.
Failed to open the BIAR file. Reason: com.businessobjects.sdk.biar.om.internal.iw.ObjectManagerIWException:required dependencies not found target system : 'AWAS3XkMSEtGn1TXI370kAU'
In both pc BO version is boxir3.1 sp3 and currently i m using windows xp professional version 2002 sp3
Thanks
Saurabh shivam -
Error while creating a report from personal files.
Hi All,
We are trying to insert a report from excel file( Env BO XIr3 Desktop intelligence)
Poping up with error "Too many data to display"
Is there any data limit or data size limit or no of rows limit.
Thanks in advance...Hi Rachna,
Can you try one thing can you restrict the values to less then 16000 to check the behavior.
What is the excel version is it 2007 Excel.
Are you trying to use an excel sheet which have more then 256 columns
Regards
Kultar -
Download Reports from SCCM 2012 Using PowerShell
Hi,
I Wants to Download reports from SCCM 2012 using powershell but couldn't find a way.
I used Invoke-Cmreport but it says no reporting Service point on site code XYZ and server ABC
But Reporting Service is enabled and works fine as i can check/download report manually
ThanksHi,
You could have a look at the script in the blog below.
How to Download All Your SSRS Report Definitions(RDL files) Using PowerShell.
http://www.sqlmusings.com/2011/03/28/how-to-download-all-your-ssrs-report-definitions-rdl-files-using-powershell/
Note: Microsoft provides third-party contact information
to help you find technical support. This contact information may change without notice. Microsoft does not guarantee the accuracy of this third-party contact information.
Best Regards,
Joyce -
Not able to extract performance data from .ETL file using xperf commands.
Xperf Commands:
xperf –i C:\TempFolder\Test.etl -o C:\TempFolder\BootData.csv –a process
Getting following error after executing above command:
"33288636 Events were lost
in this trace.
Data may be unreliable
This is usually caused
by insufficient disk bandwidth for ETW lo
gging.
Please try increasing the minimum
and maximum number of buffers
and/or
the buffer size.
Doubling these values would be a good first at
tempt.
Please note, though, that
this action increases the amount of me
mory
reserved
for ETW buffers, increasing memory pressure on your sce
nario.
See "xperf -help start"
for the associated command line options."
I changed page size file but its does not work for me.
Any one have idea, how to solve this problem and extract ETL file data.I want to mention one point here. I have total 4 machines out of these 3 machines above
commands working properly. Only one machine has this problem.<o:p></o:p>
Hi,
I consider that you can try to use xperf to collect the trace etl file and see if it can be extracted on this computer:
Refer to following articles:
start
http://msdn.microsoft.com/en-us/library/windows/hardware/hh162977.aspx
Using Xperf to take a Trace (updated)
http://blogs.msdn.com/b/pigscanfly/archive/2008/02/16/using-xperf-to-take-a-trace.aspx
Kate Li
TechNet Community Support -
How do I restore iTunes library from Backup files on External Hard Drive?
How do I restore iTunes library from Backup files on External Hard Drive and keep the new iTunes library on the External Hard Drive. I have all the media and playlist and .xml .itl files, just want the iTunes to recognise the content.
I backedup my iTunes content by dragging to External Hard Drive. Formatted and reinstalled OS. My iTunes content is so large, that I wish for the Library and content to remain on the External Hard Drive. I have all the music files and playlists, I just cannot get the iTunes application to display all the content. Hoping to Not have to drag and drop all the content to be recopied into new iTunes organised files.
Troubleshooting this by researching other conversations on the web, I have come stuck for a solution. One Troubleshoot told me to hold down the Command key and then lauch iTunes and a dialogue box will appear to Choose a new library, however when I try this, no Dialogue box appear to give me the option!?It sometimes has that funny switch symbol on it too.
tt2 -
How to select data from a table using a date field in the where condition?
How to select data from a table using a date field in the where condition?
For eg:
data itab like equk occurs 0 with header line.
select * from equk into table itab where werks = 'C001'
and bdatu = '31129999'.
thanks.Hi Ramesh,
Specify the date format as YYYYMMDD in where condition.
Dates are internally stored in SAP as YYYYMMDD only.
Change your date format in WHERE condition as follows.
data itab like equk occurs 0 with header line.
select * from equk into table itab where werks = 'C001'
and bdatu = <b>'99991231'.</b>
I doubt check your data base table EQUK on this date for the existince of data.
Otherwise, just change the conidition on BDATU like below to see all entries prior to this date.
data itab like equk occurs 0 with header line.
select * from equk into table itab where werks = 'C001'
and <b> bdatu <= '99991231'.</b>
Thanks,
Vinay
Thanks,
Vinay -
FRM-41213 When calling report from a form using RUN_REPORT_OBJECT
Hi,
I get an error frm-41214:unable to connect to the report server when i am trying to call a report from a form using RUN_REPORT_OBJECT.
My code is as follows:
I have created a simple report using employee table such tht when i give the department number as parameter it should get the corresponding details along with that i also have highlited the system parameters:
DESFORMAT
DESNAME
DESTYPE
also other user parameters as
p_action
p_servername
p_user_connect
and in the before parameter form trigger the following code:
function BeforePForm return boolean is
vc_parameter_form VARCHAR2(4000);
vc_hidden_runtime_values VARCHAR2(1000);
vc_report_name VARCHAR2(100);
begin
IF (:P_ACTION = '_action_') THEN
vc_hidden_runtime_values := '_hidden_';
ELSE
srw.get_report_name(vc_report_name);
vc_hidden_runtime_values:='report='||vc_report_name||'&destype='||:destype||'&desformat='
||:desformat||'&userid='||:p_user_connect||'&server='||:p_servername;
END IF;
vc_parameter_form:='<html><body bgcolor="#ffffff"><form method=post action="'
||:P_ACTION||'">'||'<input name="hidden_run_parameters" type=hidden value="'
||vc_hidden_runtime_values||'">'||'<center><p><table border=0 cellspacing=0 cellpadding=0><tr><td>'
||'<input type=submit></td><td width=15><td><input type=reset></td>'||'</tr></table><p><hr><p>';
srw.set_before_form_html(srw.text_escape,vc_parameter_form);
return (TRUE);
end;
After this i created a form with department table as my datablock:
I created a report object in the form with name REPORT6.
-Created a procedure in the form with the following code
PROCEDURE RUN_REPORT_OBJECT_PROC(report_id REPORT_OBJECT,reportserver VARCHAR2,runformat VARCHAR2) IS
report_message VARCHAR2(100);
rep_status VARCHAR2(100);
vc_user_name VARCHAR2(100);
vc_user_password VARCHAR2(100);
vc_user_connect VARCHAR2(100);
vc_connect VARCHAR2(300);
BEGIN
vc_user_name:=get_application_property(username);
vc_user_password:=get_application_property(password);
vc_user_connect:=get_application_property(connect_string);
vc_connect:=vc_user_name||'/'||vc_user_password||'@'||vc_user_connect;
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_EXECUTION_MODE,BATCH);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_COMM_MODE,ASYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESTYPE,CACHE);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_DESFORMAT,runformat);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_SERVER,reportserver);
SET_REPORT_OBJECT_PROPERTY(report_id,REPORT_OTHER,'p_deptno='
||:Dept.Deptno
||' paramform=yes P_USER_CONNECT='
||vc_connect||' P_SERVERNAME='||reportserver
||' P_ACTION=http://iitv-1:8888/reports/rwservlet?');
report_message:=run_report_object(report_id);
rep_status := report_object_status(report_message);
WHILE rep_status in ('RUNNING','OPENING_REPORT','ENQUEUED')LOOP
rep_status := report_object_status(report_message);
END LOOP /* Wait for Report to be finished */;
IF rep_status='FINISHED' then
web.show_document('http://iitv-1:8888/reports/rwservlet/getjobid'||
substr(report_message,instr(report_message,'_',-1)+1)||'?server'
||reportserver,'_blank');
ELSE
message (rep_status||' Report output aborted');
END IF;
END;
I created a press button and in the when_button_pressed trigger i added the following code:
declare
repid REPORT_OBJECT;
repserver VARCHAR2(100);
runformat VARCHAR2(10);
BEGIN
repid := find_report_object('REPORT6');
repserver := 'rep_iitv-1';
runformat := 'HTML';
run_report_object_proc(repid,repserver,runformat);
END;
Then tried to run the form but i got this error frm-41213 unable to connect to the report server.
Any one please help me.Run_report_object can't work with forms9i
Regards
Vikas Singhal -
Income Statement Report from Flat File
Dear Gurus,
I'm in the process of creating an INCOME STATEMENT report from Flat File as for my learning purpose , can you please help me where to start in order to create the Flat File and how many KEY FIGURES & CHAR do I need.
Thanks,
-NehaHi,
As this is for your learning purpose, create the fields as per your requirement. Then create info objects of the same type in BI. Then you try to load the info cube from the flat file.
for example: if my req is to have 4 fields like student name, marks, grade as my info objects. i have create the same fields in the flat file.
Note: you can create the flat file in excel and save it as csv format.
Edited by: arthishri on Sep 20, 2010 1:46 PM -
Executing a transaction from IRPT file using VBscript in XMII
Hi Everyone,
This is prasad .I want to execute a transcation from irpt file using vbscript in XMII .Can any one help me on this will be helpful to me.
Thanks,
Prasad.Ram,
JavaScript is the main scripting language for MII pages, not VBscript. Even if you are using MII 12.0, you can view the MII Best Practices guide for more information on using JavaScript with MII. The link is [here|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/30f43a39-be98-2910-9d9c-a59785f44e41].
Regards,
Kevin -
BI XI R2 Import to BIAR - BO XI 3.0 import from BIAR file. issue
Hi
I am importing My Universe, Desktop Reports, Web Intelligence report from BO XI R2 in to BIAR.
And then importing it to BO XI 3.0 using the BIAR file.
However import went successfully but on BO XI 3.0 I do not see universes or desktop report that I have imported from BO XI 3.0.
These file .unv .rep gets stored in <BO XI 3.0 Installation Directory > \FileStore\Input
What needs to do when importing so that my BO XI3.0 import will follow same folder structure as like BO XI R2.
Am I doing something wrong
--KuldeepWhen you do the import do you see all the objects marked as imported in the details log? Also are you bringing in the user security?
Regards
Alan -
Fm or class existing for fetching xml contents from a file using abap ?
Hi,
I need to fetch an xml file in a string of type xstring. I am using class cl_gui_frontend_services=>gui_upload.
This returns me content in table format, than i am planning to conver to xstring.
Is there any better approach or any existing function module any one know of ?
thanks
Regards
PoojaHi Pooja,
You can try out this program to read the XML file using abap.
*& Report ZXMLTOITAB *
REPORT ZXMLTOITAB .
TYPE-POOLS: ixml.
TYPES: BEGIN OF t_xml_line,
data(256) TYPE x,
END OF t_xml_line.
DATA: l_ixml TYPE REF TO if_ixml,
l_streamfactory TYPE REF TO if_ixml_stream_factory,
l_parser TYPE REF TO if_ixml_parser,
l_istream TYPE REF TO if_ixml_istream,
l_document TYPE REF TO if_ixml_document,
l_node TYPE REF TO if_ixml_node,
l_xmldata TYPE string.
DATA: l_elem TYPE REF TO if_ixml_element,
l_root_node TYPE REF TO if_ixml_node,
l_next_node TYPE REF TO if_ixml_node,
l_name TYPE string,
l_iterator TYPE REF TO if_ixml_node_iterator.
DATA: l_xml_table TYPE TABLE OF t_xml_line,
l_xml_line TYPE t_xml_line,
l_xml_table_size TYPE i.
DATA: l_filename TYPE string.
PARAMETERS: pa_file TYPE char1024 DEFAULT 'c:\temp\orders_dtd.xml'.
* Validation of XML file: Only DTD included in xml document is supported
PARAMETERS: pa_val TYPE char1 AS CHECKBOX.
START-OF-SELECTION.
* Creating the main iXML factory
l_ixml = cl_ixml=>create( ).
* Creating a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
PERFORM get_xml_table CHANGING l_xml_table_size l_xml_table.
* wrap the table containing the file into a stream
l_istream = l_streamfactory->create_istream_itable( table =
l_xml_table
size =
l_xml_table_size ).
* Creating a document
l_document = l_ixml->create_document( ).
* Create a Parser
l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
istream = l_istream
document = l_document ).
* Validate a document
IF pa_val EQ 'X'.
l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
ENDIF.
* Parse the stream
IF l_parser->parse( ) NE 0.
IF l_parser->num_errors( ) NE 0.
DATA: parseerror TYPE REF TO if_ixml_parse_error,
str TYPE string,
i TYPE i,
count TYPE i,
index TYPE i.
count = l_parser->num_errors( ).
WRITE: count, ' parse errors have occured:'.
index = 0.
WHILE index < count.
parseerror = l_parser->get_error( index = index ).
i = parseerror->get_line( ).
WRITE: 'line: ', i.
i = parseerror->get_column( ).
WRITE: 'column: ', i.
str = parseerror->get_reason( ).
WRITE: str.
index = index + 1.
ENDWHILE.
ENDIF.
ENDIF.
* Process the document
IF l_parser->is_dom_generating( ) EQ 'X'.
PERFORM process_dom USING l_document.
ENDIF.
*& Form get_xml_table
FORM get_xml_table CHANGING l_xml_table_size TYPE i
l_xml_table TYPE STANDARD TABLE.
* Local variable declaration
DATA: l_len TYPE i,
l_len2 TYPE i,
l_tab TYPE tsfixml,
l_content TYPE string,
l_str1 TYPE string,
c_conv TYPE REF TO cl_abap_conv_in_ce,
l_itab TYPE TABLE OF string.
l_filename = pa_file.
* upload a file from the client's workstation
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = l_filename
filetype = 'BIN'
IMPORTING
filelength = l_xml_table_size
CHANGING
data_tab = l_xml_table
EXCEPTIONS
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* Writing the XML document to the screen
CLEAR l_str1.
LOOP AT l_xml_table INTO l_xml_line.
c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data
replacement = space ).
c_conv->read( IMPORTING data = l_content len = l_len ).
CONCATENATE l_str1 l_content INTO l_str1.
ENDLOOP.
l_str1 = l_str1+0(l_xml_table_size).
SPLIT l_str1 AT cl_abap_char_utilities=>cr_lf INTO TABLE l_itab.
WRITE: /.
WRITE: /' XML File'.
WRITE: /.
LOOP AT l_itab INTO l_str1.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab
IN
l_str1 WITH space.
WRITE: / l_str1.
ENDLOOP.
WRITE: /.
ENDFORM. "get_xml_table
*& Form process_dom
FORM process_dom USING document TYPE REF TO if_ixml_document.
DATA: node TYPE REF TO if_ixml_node,
iterator TYPE REF TO if_ixml_node_iterator,
nodemap TYPE REF TO if_ixml_named_node_map,
attr TYPE REF TO if_ixml_node,
name TYPE string,
prefix TYPE string,
value TYPE string,
indent TYPE i,
count TYPE i,
index TYPE i.
node ?= document.
CHECK NOT node IS INITIAL.
ULINE.
WRITE: /.
WRITE: /' DOM-TREE'.
WRITE: /.
IF node IS INITIAL. EXIT. ENDIF.
* create a node iterator
iterator = node->create_iterator( ).
* get current node
node = iterator->get_next( ).
* loop over all nodes
WHILE NOT node IS INITIAL.
indent = node->get_height( ) * 2.
indent = indent + 20.
CASE node->get_type( ).
WHEN if_ixml_node=>co_node_element.
* element node
name = node->get_name( ).
nodemap = node->get_attributes( ).
WRITE: / 'ELEMENT :'.
WRITE: AT indent name COLOR COL_POSITIVE INVERSE.
IF NOT nodemap IS INITIAL.
* attributes
count = nodemap->get_length( ).
DO count TIMES.
index = sy-index - 1.
attr = nodemap->get_item( index ).
name = attr->get_name( ).
prefix = attr->get_namespace_prefix( ).
value = attr->get_value( ).
WRITE: / 'ATTRIBUTE:'.
WRITE: AT indent name COLOR COL_HEADING INVERSE, '=',
value COLOR COL_TOTAL INVERSE.
ENDDO.
ENDIF.
WHEN if_ixml_node=>co_node_text OR
if_ixml_node=>co_node_cdata_section.
* text node
value = node->get_value( ).
WRITE: / 'VALUE :'.
WRITE: AT indent value COLOR COL_GROUP INVERSE.
ENDCASE.
* advance to next node
node = iterator->get_next( ).
ENDWHILE.
ENDFORM. "process_dom
Regards,
Samson Rodrigues. -
Reading data from flat file Using TEXT_IO
Dear Gurus
I already posted this question but this time i need some other changes .....Sorry for that ..
I am using 10G forms and using TEXT_IO for reading data from flat file ..
My data is like this :-
0|BP-V1|20100928|01|1|2430962.89|27|2430962.89|MUR|20100928120106
9|2430962.89|000111111111|
1|61304.88|000014104113|
1|41961.73|000022096086|
1|38475.65|000023640081|
1|49749.34|000032133154|
1|35572.46|000033093377|
1|246671.01|000042148111|
Here each column is separated by | . I want to read all the columns and want to do some validation .
How can i do ?
Initially my requirement was to read only 2 or 3 columns so i did like this ...
Procedure Pay_Simulator(lfile_type varchar2,lac_no varchar2,lcur varchar2,lno_item number,ltotal number,ldate date,lpay_purp varchar2,lfile_name varchar2)
IS
v_handle utl_file.file_type;
v_filebuffer varchar2(500);
line_0_date VARCHAR2 (10);
line_0_Purp VARCHAR2 (10);
line_0_count Number;
line_0_sum number(12,2);
line_0_ccy Varchar2(3);
line_9_sum Number(12,2);
line_9_Acc_no Varchar2(12);
Line_1_Sum Number(12,2);
Line_1_tot Number(15,2) := 0;
Line_1_flag Number := 0;
lval number;
lacno varchar2(16);
v_file varchar2(20);
v_path varchar2(50);
Begin
v_file := mcb_simulator_pkg.GET_FILENAME(lfile_name); -- For the file name
v_path :=rtrim(regexp_substr( lfile_name , '.*\\' ),'\'); For the Path
v_path := SUBSTR (lfile_name,0, INSTR (lfile_name, '\', -1));
v_handle := UTL_FILE.fopen (v_path, v_file, 'r');
LOOP
UTL_FILE.get_line (v_handle, v_filebuffer);
IF SUBSTR (v_filebuffer, 0, 1) = '0' THEN
SELECT line_0 INTO line_0_date
FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
FROM DUAL
CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
WHERE rn = 3;
SELECT line_0 INTO line_0_Purp
FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
FROM DUAL
CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
WHERE rn = 4;
SELECT line_0 INTO line_0_count
FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
FROM DUAL
CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
WHERE rn = 7;
SELECT line_0 INTO line_0_sum
FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
FROM DUAL
CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
WHERE rn = 8;
SELECT line_0 INTO line_0_ccy
FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_0, ROWNUM rn
FROM DUAL
CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
WHERE rn = 9;
ELSIF SUBSTR (v_filebuffer, 0, 1) = '9' THEN
SELECT line_9 INTO line_9_Acc_no
FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_9, ROWNUM rn
FROM DUAL
CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
WHERE rn = 3;
SELECT line_9 INTO line_9_sum
FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_9, ROWNUM rn
FROM DUAL
CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
WHERE rn = 2;
ELSIF SUBSTR (v_filebuffer, 0, 1) = '1' THEN
line_1_flag := line_1_flag+1;
SELECT line_1 INTO line_1_sum
FROM (SELECT LTRIM (REGEXP_SUBSTR (v_filebuffer, '[^|]+{1}', 1, LEVEL)) line_1, ROWNUM rn
FROM DUAL
CONNECT BY LEVEL <= LENGTH (REGEXP_REPLACE (v_filebuffer, '[^|]*')) + 1)
WHERE rn = 3;
Line_1_tot := Line_1_tot + line_1_sum;
END IF;
END LOOP;
DBMS_OUTPUT.put_line (Line_1_tot);
DBMS_OUTPUT.PUT_LINE (Line_1_flag);
UTL_FILE.fclose (v_handle);
END;
But now how can i do ? Shall i use like this select Statement for all the columns ?Sorry for that ..
As per our requirement ...
I need to read the flat file and it looks like like this .
*0|BP-V1|20100928|01|1|2430962.89|9|2430962.89|MUR|20100928120106*
*9|2430962.89|000111111111|*
*1|61304.88|000014104113|*
*1|41961.73|000022096086|*
*1|38475.65|000023640081|*
*1|49749.34|000032133154|*
*1|35572.46|000033093377|*
*1|246671.01|000042148111|*
*1|120737.25|000053101979|*
*1|151898.79|000082139768|*
*1|84182.34|000082485593|*
I have to check the file :-
Validation are 1st line should start from 0 else it should raise an error and insert that error into one table .
The for 2nd line also same thing ..it should start from 9 else it should raise an error and insert that error into one table .
Then the 3rd line should start from 1 else it should raise an error and insert that error into one table .
After that i have to do a validation like i will read the 1st line 2nd column .. It should be like this BP-V1 else raise an error and insert that error to a table . Then i will check the 3rd column which is 20100928 , it should be YYYYMMDD format else same thing ERROR.
Then like this for all columns i have different validation .......
Then it will check for the 2nd line 3rd column . this is an account no .1st i will check it should be 12 char else ERROR .Then I will check that what user has imputed in the form.Like for example User putted 111111111 then i will check with this 000111111111 which is there in the 2nd line . I have to add 000 before that Account no which user imputed .
Then the lines which is starting from 1 , i have to take all the 2nd column for all the lines which is starting from 1 and i have to do a sum . After that i have to compare that sum with the value in the 1st lines ( Starting from 0) 6th column . It should be same else ERROR ...
Then same way i have to count all the lines which is starting from 1 . Then i have to compare with the 7th column of 1st line . It should be same . Here in this file it should be 9.
MY CODE IS :-
Procedure Pay_Simulator(lfile_type varchar2,lac_no varchar2,lcur varchar2,lno_item number,ltotal number,ldate date,lpay_purp varchar2,lfile_name varchar2)
IS
v_handle TEXT_IO.file_type;
v_filebuffer varchar2(500);
line_0_date VARCHAR2 (10);
line_0_Purp VARCHAR2 (10);
line_0_count Number;
line_0_sum number(12,2);
line_0_ccy Varchar2(3);
line_9_sum Number(12,2);
line_9_Acc_no Varchar2(12);
Line_1_Sum Number(12,2);
Line_1_tot Number(15,2) := 0;
Line_1_flag Number := 0;
lval number;
lacno varchar2(16);
v_file varchar2(20);
v_path varchar2(50);
LC$String VARCHAR2(50) ;--:= 'one|two|three|four|five|six|seven' ;
LC$Token VARCHAR2(100) ;
i PLS_INTEGER := 2 ;
lfirst_char number;
lvalue Varchar2(100) ;
Begin
v_file := mcb_simulator_pkg.GET_FILENAME(lfile_name); For the file name
v_path :=rtrim(regexp_substr( lfile_name , '.*\\' ),'\'); For the Path
--v_path := SUBSTR (lfile_name,0, INSTR (lfile_name, '\', -1));
Message(lfile_name);
v_handle := TEXT_IO.fopen(lfile_name, 'r');
BEGIN
LOOP
TEXT_IO.get_line (v_handle, v_filebuffer);
lfirst_char := Substr(v_filebuffer,0,1);
--Message('First Char '||lfirst_char);
IF lfirst_char = '0' Then
Loop
LC$Token := mcb_simulator_pkg.Split( v_filebuffer, i , '|') ;
Message('VAL - '||LC$Token);
lvalue := LC$Token;
EXIT WHEN LC$Token IS NULL ;
i := i + 1 ;
End Loop;
Else
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (9999,'0002','First line should always start with 0');
Forms_DDL('Commit');
raise form_Trigger_failure;
End if ;
TEXT_IO.get_line (v_handle, v_filebuffer);
lfirst_char := Substr(v_filebuffer,0,1);
LC$Token := mcb_simulator_pkg.Split( v_filebuffer, i , '|') ;
--Message('Row '||LC$Token);
IF lfirst_char = '9' Then
Null;
Else
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (8888,'0016','Second line should start with 9');
Forms_DDL('Commit');
raise form_Trigger_failure;
End IF;
LOOP
TEXT_IO.get_line (v_handle, v_filebuffer);
lfirst_char := Substr(v_filebuffer,0,1);
LC$Token := mcb_simulator_pkg.Split( v_filebuffer, i , '|') ;
--Message('Row '||LC$Token);
IF lfirst_char = '1' Then
Null;
Else
Insert into MU_SIMULATOR_output_ERR (load_no,ERR_CODE,ERR_DESC) values (7777,'0022','The third line onward should start with 1');
Forms_DDL('Commit');
raise form_Trigger_failure;
End if;
END LOOP;
--END IF;
END LOOP;
EXCEPTION
When No_Data_Found Then
TEXT_IO.fclose (v_handle);
END;
Exception
When Others Then
Message('Other error');
END;
I am calling the FUNCTION which you gave SPLIT as mcb_simulator_pkg.Split. -
Uploading into database table from text file using tab (GUI_UPLOAD)
i have small doubt
i have 3 fiels in text file using tab as separator
i need to update into database table 'ZABPSP_01'
from 's.txt' located in local disk.
My code is below.
Please let me know the correction.
Awaiting for ur response.
Thanks in advance
REPORT ZABPSPPRG_02.
TABLES: LFA1,MARA,KNA1,ZABPSP_01.
DATA: begin of itab occurs 0,
IKUNNR type zabpsp_01-kunnr,
IMATNR type zabpsp_01-matnr,
IADRNR type zabpsp_01-adrnr.
DATA:END OF ITAB.
DATA: FILENAME1 TYPE STRING.
FILENAME1 = 'C:/s.txt'.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = FILENAME1
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = itab.
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
IF sy-subrc EQ 0.
zabpsp_01-kunnr = ITAB-IKUNNR.
zabpsp_01-matnr = ITAB-IMATNR.
zabpsp_01-adrnr = ITAB-IADRNR.
WRITE : / ' UPLOAD SUCCESS ' .
ENDIF.
\[subject changed, don't write everything in upper case!\]
Edited by: Jan Stallkamp on Aug 6, 2008 2:39 PMHi,
After upload modify the code like below. Also change the file name as some one suggested already. If u are still facing problems then check in debug mode what is happening after FM call.
CALL GUI_UPLOAD FM.
IF sy-subrc EQ 0
IF NOT itab[] IS INITIAL.
MODIFY ZABPSP_01 FROM TABLE itab.
WRITE : / ' UPLOAD SUCCESS ' .
ELSE.
WRITE 'No data in file'.
ENDIF.
ELSE.
WRITE 'Upload failure'.
ENDIF.
Thanks,
Vinod. -
How to delete data from a file using IO package
Hi All,
i am trying to remove some content of the file.
this content is not at starting of file not even at end of file.
can anybody tell me how can i delete number of lines from file using IO package.iam having some data in text file .ex:in flowrist.txt
12/5/07,500,300,6000 like many set of datas are
there.In these if i want to delete the data based on
the date which i specified.How to do this specific
deletion?You need to open a stream to read in the file and then use the indexOf method provided in the Sting class to check if the line contains the date or whatever String you are looking for, if so then skip that line and store or re-write the lines you wish to keep, as well as some extra lines you may wish to add.
Take a look below at this example found on Google.
http://www.java-tips.org/java-se-tips/java.io/how-to-read-file-in-java.html
The above read a file line by line and prints it to console. You should be able to modify this, instead of using System.out to print the line you should use index of to check the lines for a date/String. Index of return -1 if the String you specify is not in the line you parse.
Maybe you are looking for
-
Is there a way to type cast an array of strings to numbers and back again?
I'm working on an application where I want to type cast a string like "power supply" into an array of existing numbers. Then sort the existing numbers, and finally convert the casted numbers back into a string so it can be read by the user. In the at
-
super drive not working
-
I've imported into FCExpress 2 from a Sony Digital 8 Handycam through Firewire. All looks good in FCExp (regular non-HD, TV-like aspect ratio). But when I export to QT Movie and play back in QT Player, the image is stretched horizontally (everyone be
-
Self join or analytical function ..?
Hi I have a table data like this: select * from s_table; ID ADDRESS ADDRESS1 CODE a1 Dallas Tx 10 b1 DFW Tx 20 c1 Houston Tx 30 d1 Elpaso Tx 40 e1 Austin Tx 50 e1 Austin Tx 51 6 rows selected Business rule: I want to concatenate code with a space in
-
Hello, Since upgrading from ECC 604 to ECC 606, we are unable to change the GR based IV flag on the PO when vendor is maintained with this flag. In other words it is forced by vendor record where previously it was defaulted by vendor record and coul