Append spread to xls
Hi friends
Plz any body suggest me
I have to covert the data i am giving in a spread sheet to xls format
the program uses the following routine when the radio button
material from spread sheet are selected
FORM APPEND_SPREAD_TO_XLS .
DATA: p_infile type string.
p_infile = p_file1.
LOOP AT I_SPREADSHEET INTO WA_SPREADSHEET.
WA_FINAL-BID = TEXT-004.
WA_FINAL-ITEM = TEXT-005.
WA_FINAL-DATA = TEXT-006.
WA_FINAL-DOC = SPACE.
WA_FINAL-INDEX = WA_SPREADSHEET-INDEX.
WA_FINAL-LINE = 'D'.
WA_FINAL-SPAC1 = SPACE.
WA_FINAL-chgkey = 'I'.
WA_FINAL-SPAC2 = SPACE.
WA_FINAL-INDEX1 = WA_SPREADSHEET-INDEX.
WA_FINAL-SPAC4 = SPACE.
WA_FINAL-ITDESC = TEXT-007.
WA_FINAL-PROTYP = '1'.
WA_FINAL-PRODESC = TEXT-008.
WA_FINAL-MATNR = WA_SPREADSHEET-MATNR.
WA_FINAL-MAKTX = WA_SPREADSHEET-MAKTX.
WA_FINAL-MATKL = WA_SPREADSHEET-MATKL.
WA_FINAL-WGBEZ60 = WA_SPREADSHEET-WGBEZ60.
WA_FINAL-SPAC5 = SPACE.
wa_final-DDATE = '00/00/0000'.
WA_FINAL-DTIME = '0:00:00'.
WA_FINAL-FDAT = '00/00/0000'.
WA_FINAL-TDAT = '00/00/0000'.
WA_FINAL-QTY = WA_SPREADSHEET-MENGE.
WA_FINAL-MEINS = WA_SPREADSHEET-MEINS.
WA_FINAL-PUNIT = SPACE.
WA_FINAL-CURRY = 'USD'.
wa_final-proid = wa_SPREADSHEET-matnr.
APPEND WA_FINAL TO I_FINAL.
ENDLOOP.
CLEAR I_MATERIAL.
REFRESH I_MATERIAL.
but the problem is when i gave the data in selection screen
Filename to dwnld Spread detl:the excel page vth some data
File name to upload the Spread:some file name
its giving the following error
Error during coversion-field type conflict.
the descrption of the error is
The sending and receiving fields have conflicting types. The receiving field has type P. Value EA was supposed to be transferred to this field, but this conflicts with the type definition for the receiving field.
The incorrect field is field 1 of the receiver structure. Record 7 of the input file contains an error.
plz suggest
any help is highly appreciated
Hi ramiro,
plz check this code getting the same error
plz correct me
FORM APPEND_SPREAD_TO_XLS .
DATA: p_infile type string.
p_infile = p_file1.
CALL FUNCTION 'CONVERSION_EXIT_CUNIT_INPUT'
EXPORTING
input = WA_SPREADSHEET-MEINS
IMPORTING
OUTPUT = WA_FINAL-MEINS .
EXCEPTIONS
UNIT_NOT_FOUND = 1
OTHERS = 2
LOOP AT I_SPREADSHEET INTO WA_SPREADSHEET.
WA_FINAL-BID = TEXT-004.
WA_FINAL-ITEM = TEXT-005.
WA_FINAL-DATA = TEXT-006.
WA_FINAL-DOC = SPACE.
WA_FINAL-INDEX = WA_SPREADSHEET-INDEX.
WA_FINAL-LINE = 'D'.
WA_FINAL-SPAC1 = SPACE.
WA_FINAL-chgkey = 'I'.
WA_FINAL-SPAC2 = SPACE.
WA_FINAL-INDEX1 = WA_SPREADSHEET-INDEX.
WA_FINAL-SPAC4 = SPACE.
WA_FINAL-ITDESC = TEXT-007.
WA_FINAL-PROTYP = '1'.
WA_FINAL-PRODESC = TEXT-008.
WA_FINAL-MATNR = WA_SPREADSHEET-MATNR.
WA_FINAL-MAKTX = WA_SPREADSHEET-MAKTX.
WA_FINAL-MATKL = WA_SPREADSHEET-MATKL.
WA_FINAL-WGBEZ60 = WA_SPREADSHEET-WGBEZ60.
WA_FINAL-SPAC5 = SPACE.
wa_final-DDATE = '00/00/0000'.
WA_FINAL-DTIME = '0:00:00'.
WA_FINAL-FDAT = '00/00/0000'.
WA_FINAL-TDAT = '00/00/0000'.
WA_FINAL-QTY = WA_SPREADSHEET-MENGE.
WA_FINAL-MEINS = WA_SPREADSHEET-MEINS.
WA_FINAL-PUNIT = SPACE.
WA_FINAL-CURRY = 'USD'.
wa_final-proid = wa_SPREADSHEET-matnr.
APPEND WA_FINAL TO I_FINAL.
ENDLOOP.
CLEAR I_MATERIAL.
REFRESH I_MATERIAL.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = P_INFILE
FILETYPE = 'ASC'
APPEND = 'X'
WRITE_FIELD_SEPARATOR = 'X'
TABLES
DATA_TAB = I_FINAL.
IF SY-SUBRC = 0.
ENDIF.
ENDFORM.
thanks in advance
Edited by: sukruthi raj on Mar 11, 2008 1:26 PM
Similar Messages
-
Any one ever append a GIF to a MS xls document with success, LV2010?
My attempts to past a GIF to an xls or xlsx MS 2007 file is unsuccesful. no VI errors are reported but I open the file an no paste is there as I scroll through all the cell row numbers.At the time of the original post, I was using Mike Schroder LV code that opens a GIF for view in a FP. You should find it on the discussion board or NI Developer Zone. In my case it turns out Mike's code open the GIF file but never close the file reference (it gets closed when LV stops running). So if its used as is, a subVI you got an unclosed reference open. Add a close reference to the code (shown below).
Its possible your code tries to open a new reference for the file when one for the file is already open and paste to xls fails, not to mention further other side effects. I went ahead an attached Mike Schroder code below.
Attachments:
Read GIF File_LV71_V0101.zip 698 KB -
How to read a spread sheet ( .xls ) file using a pl/sql procedure or func
Hello All,
Is it possible to read a spread sheet using Oracle pl.sql .
I know their is a util package that is read a file but how to read a spread sheet ... ?
thanks
kumarhi kumar,
Here is an example of how i read an excel file
DECLARE
l_start_file_name varchar2(50) := 'invoice_excel_c';
l_end_file_name varchar2(50) := '.csv';
l_file_name varchar2(100);
l_sql varchar(32767);
refresh_cdc varchar2(5) := '00304';
begin
l_file_name := l_start_file_name||REFRESH_CDC||l_end_file_name;
l_sql :=
'create table exter_invoice_excel '||
'( '||
'Product_name varchar2(255), '||
'Net_Sales Number, '||
'Net_Adjustments Number, '||
'Cancels_Count Number, '||
'Cancels_Amount Number, '||
'Cashes_Count Number, '||
'Cashes_Amount Number, '||
'Claims_Count Number, '||
'Claims_Amount Number, '||
'Returns_Count Number, '||
'Returns_Amount Number, '||
'Free_Prize_Count Number, '||
'Free_Prize_Amount Number, '||
'Free_Promo_Count Number, '||
'Free_Promo_Amount Number, '||
'Promo_Credit_Count Number, '||
'Promo_Credit_Amount Number, '||
'Return_Commission Number, '||
'Net_Discounts Number, '||
'Total_Fees Number, '||
'Sales_Commission Number, '||
'Cash_Commission Number, '||
'Tkt_Charge Number, '||
'Subscription_Commission Number, '||
'Interim_Sweeps Number, '||
'Net_Due Number, '||
'Retailer_id Number, '||
'Retailer_Name varchar2(255) '||
') '||
'ORGANIZATION EXTERNAL ( '||
' TYPE oracle_loader '||
' DEFAULT DIRECTORY GTECHFILES '||
' ACCESS PARAMETERS ( '||
' RECORDS DELIMITED BY NEWLINE '||
' CHARACTERSET WE8MSWIN1252 '||
' BADFILE ''invoice_excel.bad'' '||
' DISCARDFILE ''invoice_excel.dis'' '||
' LOGFILE ''invoice_excel.log'' '||
' FIELDS TERMINATED BY '','' RTRIM '||
' MISSING FIELD VALUES ARE NULL '||
' ) '||
' LOCATION ('''||l_file_name||''') '||
' ) '||
'PARALLEL '||
'REJECT LIMIT UNLIMITED ';
execute immediate l_sql;
l_sql:= 'INSERT INTO INVOICE_EXCEL_TEMP '||
' ( Product_name , '||
' Net_Sales , '||
' Net_Adjustments , '||
' Cancels_Count , '||
' Cancels_Amount , '||
' Cashes_Count , '||
' Cashes_Amount , '||
' Claims_Count , '||
' Claims_Amount , '||
' Returns_Count , '||
' Returns_Amount , '||
' Free_Prize_Count , '||
' Free_Prize_Amount , '||
' Free_Promo_Count , '||
' Free_Promo_Amount , '||
' Promo_Credit_Count , '||
' Promo_Credit_Amount , '||
' Return_Commission , '||
' Net_Discounts , '||
' Total_Fees , '||
' Sales_Commission , '||
' Cash_Commission , '||
' Tkt_Charge , '||
' Subscription_Commission , '||
' Interim_Sweeps , '||
' Net_Due , '||
' Retailer_id , '||
' Retailer_Name , '||
' SOURCE , '||
' INSERTED_DATE , '||
' CDC , '||
' UPLOADED '||
') '||
' select '||
' ltrim(rtrim(product_name)) , '||
' Net_Sales , '||
' Net_Adjustments , '||
' Cancels_Count , '||
' Cancels_Amount , '||
' Cashes_Count , '||
' Cashes_Amount , '||
' Claims_Count , '||
' Claims_Amount , '||
' Returns_Count , '||
' Returns_Amount , '||
' Free_Prize_Count , '||
' Free_Prize_Amount , '||
' Free_Promo_Count , '||
' Free_Promo_Amount , '||
' Promo_Credit_Count , '||
' Promo_Credit_Amount , '||
' Return_Commission , '||
' Net_Discounts , '||
' Total_Fees , '||
' Sales_Commission , '||
' Cash_Commission , '||
' Tkt_Charge , '||
' Subscription_Commission , '||
' Interim_Sweeps , '||
' Net_Due , '||
' Retailer_id , '||
' Retailer_Name , '||
' '''||l_file_name ||''', '||
' sysdate , '||
' '''|| REFRESH_CDC ||''', '||
'''N''' ||
'FROM '||
'exter_invoice_excel '||
'WHERE retailer_id is not null and ltrim(rtrim(product_name)) in (''Loto'',''Inst Tk'')';
execute immediate l_sql;
l_sql :='drop table exter_invoice_excel';
execute immediate l_sql;
exception
when others then
rollback;
l_sql :='drop table exter_invoice_excel';
execute immediate l_sql;
debug_message('INVOICE_EXCEL_UPLOAD/'||REFRESH_CDC,'Unexpected Error '||sqlerrm);
END;
--truncate table invoice_excel_tempjust go through the code, it would help u for sure
cheers -
How to format data in internal table
Hi Friendz...
In a program i have transferred the data from a Excel Spread sheet (.xls file) to an internal table using FM <b>"ALSM_EXCEL_TO_INTERNAL_TABLE"</b>.
The internal table is like this:
begin of xl_data occurs 0,
vendor name
street
address
vat reg no
bank no
end of xl_data.
now i have to include some more fields to this internal table and then i have to download this data to a <b>.txt</b> file.
could you please tell me how should i do this?Please see this sample program. It will upload from excel into internal table, move data to another itab with other fields and download to C:\ drive.
report zrich_0002.
types: begin of ttab ,
fld1(30) type c,
fld2(30) type c,
fld3(30) type c,
fld4(30) type c,
fld5(30) type c,
end of ttab.
types: begin of ttab2 ,
fld1(30) type c,
fld2(30) type c,
fld3(30) type c,
fld4(30) type c,
fld5(30) type c,
fld6(30) type c,
fld7(30) type c,
end of ttab2.
data: itab type table of ttab with header line.
data: itab2 type table of ttab2 with header line.
selection-screen skip 1.
parameters: p_file type localfile default
'C:test.txt'.
selection-screen skip 1.
at selection-screen on value-request for p_file.
call function 'KD_GET_FILENAME_ON_F4'
exporting
static = 'X'
changing
file_name = p_file.
start-of-selection.
clear itab. refresh itab.
perform upload_data.
loop at itab.
clear itab2.
move-corresponding itab to itab2.
itab2-fld6 = 'Another Field'.
itab2-fld7 = 'No, really last one'.
append itab2.
endloop.
call function 'GUI_DOWNLOAD'
exporting
filename = 'C:itab2.txt'
tables
data_tab = itab2
exceptions
others = 22.
* Upload_Data
form upload_data.
data: file type rlgrap-filename.
data: xcel type table of alsmex_tabline with header line.
file = p_file.
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = file
i_begin_col = '1'
i_begin_row = '1'
i_end_col = '200'
i_end_row = '5000'
tables
intern = xcel
exceptions
inconsistent_parameters = 1
upload_ole = 2
others = 3.
loop at xcel.
case xcel-col.
when '0001'.
itab-fld1 = xcel-value.
when '0002'.
itab-fld2 = xcel-value.
when '0003'.
itab-fld3 = xcel-value.
when '0004'.
itab-fld4 = xcel-value.
when '0005'.
itab-fld5 = xcel-value.
endcase.
at end of row.
append itab.
clear itab.
endat.
endloop.
endform.
Regards,
Rich Heilman -
OfficeJet 4315 no longer works after Win 7 and Office 2010 service packs applied
I've used OfficeJet 4315 on a Toshiba Satellite with WinXP (SP3) and Office 2003 and been delighted with the printer. I recently migrated to a brand-new Acer Aspire with Win 7 and Office 2010 (home & student ed.) At first, the 4315 worked well--in fact, all I had to do was plug in the USB connection and the in-OS drivers installed automatically. However, something has now caused the printer too be essentially useless! I think it happened after I applied SP1 to Win 7 and/or the service pack to Office 2010. I can no longer print Word files (.doc or .docx), Excel spread sheets (.xls or .xlsx), PDFs, Web pages, or even e-mails, The only things I can print are .txt files or equivalent and .jpg files or equivalent. I've tried deleting and reinstalling the printer (including deleting the drivers and reloading them from Windows Update). I don't believe I should have to replace a perfectly good printer just to support Windows 7 and Office 2010. I NEED HELP URGENTLY with this problem! If anyone has any knowledge or ideas, I'd be forever in your debt. (HP, I'd even pay to get the help I need on this one!!) TIA.
Hi,
Based on your description, my understanding is that the PDF files cannot be checked out to local drafts folder after Office 2013 is installed.
Did this issue occur with Office files?
I recommend to check if the Office files can be checked out to local drafts folder with Office 2013.
And it is recommended to use Office 2010 with SharePoint 2010 for best practice.
Thanks,
Victoria
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Victoria Xia
TechNet Community Support -
Package Returning Error ORA-06502: PL/SQL: numeric or value error
Hi,
I create a package to export to spread sheet .xls, The package work for simple query if i pass the query to package.
There is no error in package please create the package and do the following as mentioned below
create or replace
PACKAGE export_pkg_spread_sheet
AS
procedure download_excel(vsql in clob );
PROCEDURE excel_header(p_header in out nocopy clob);
procedure excel_content(p_content in out nocopy clob,
vsql in clob );
procedure excel_footer(p_footer in out nocopy clob);
procedure get_usable_sql (p_sql_in IN clob,
p_sql_out OUT clob);
END export_pkg_spread_sheet;
create or replace
PACKAGE body export_pkg_spread_sheet
AS
PROCEDURE excel_header (p_header IN OUT nocopy CLOB)
AS
BEGIN
p_header := '<html><body>';
END;
procedure download_excel( vsql in clob )
as
p_header clob;
p_footer clob;
p_content clob;
begin
owa_util.mime_header( 'application/octet', FALSE );
htp.p('Content-Disposition: attachment; filename="report.xls"');
owa_util.http_header_close;
excel_header( p_header);
excel_content(p_content,vsql);
excel_footer(p_footer);
dbms_output.put_line(p_header ||p_content|| p_footer);
HTP.PRN( p_header ||p_content|| p_footer);
htmldb_application.g_unrecoverable_error := true;
end;
procedure excel_content(p_content in out nocopy clob,
vsql in clob)
as
p_sql_stmt clob;
cur PLS_INTEGER := DBMS_SQL.OPEN_CURSOR;
cols DBMS_SQL.DESC_TAB;
ncols PLS_INTEGER;
TYPE varColumn IS TABLE OF varchar2(32000);
vtab varColumn;
v_column_count NUMBER DEFAULT 0;
v_status INTEGER;
BEGIN
htp.prn('am here');
/* SELECT region_source into p_sql_stmt
FROM apex_application_page_regions
WHERE region_id = p_region_id AND
page_id = p_page_id AND
application_id = p_app_id; */
get_usable_sql (vsql,p_sql_stmt);
p_content := p_sql_stmt;
-- Parse the query.
DBMS_SQL.PARSE(cur, p_sql_stmt , DBMS_SQL.NATIVE);
-- Retrieve column information
DBMS_SQL.DESCRIBE_COLUMNS (cur, ncols, cols);
-- Display each of the column names
p_content := '<table> <tr>';
FOR colind IN 1 .. ncols
LOOP
p_content := p_content || '<td>' || cols(colind).col_name || '</td>';
END LOOP;
p_content := p_content || '</tr>';
vtab := varColumn(null);
for i in 1..ncols
loop
vtab.extend;
DBMS_SQL.DEFINE_COLUMN (cur, i, vtab(i), 2000);
--dbms_output.put_line(vtab(i));
end loop;
v_status := DBMS_SQL.EXECUTE (cur);
LOOP
p_content := p_content || '<tr>';
EXIT WHEN (DBMS_SQL.FETCH_ROWS (cur) <= 0);
FOR i IN 1 ..ncols
loop
DBMS_SQL.COLUMN_VALUE (cur, i, vtab(i));
-- p_content := p_content || '<td>' || 'xyz' || '</td>';
p_content := p_content || '<td>' || vtab(i) || '</td>';
END LOOP;
p_content := p_content || '</tr>' ;
END LOOP;
p_content := p_content || '<table>' ;
DBMS_SQL.CLOSE_CURSOR (cur);
exception
when others then
p_content := '<td>Exception Error in printing data</td><table>' ;
DBMS_SQL.CLOSE_CURSOR (cur);
end;
procedure excel_footer( p_footer in out nocopy clob)
as
begin
p_footer := '</body></html>';
end;
PROCEDURE get_usable_sql (p_sql_in IN clob, p_sql_out OUT clob)
IS
v_sql clob;
v_names DBMS_SQL.varchar2_table;
v_pos NUMBER;
v_length NUMBER;
v_exit NUMBER;
BEGIN
v_sql := p_sql_in;
v_names := wwv_flow_utilities.get_binds (v_sql);
FOR i IN 1 .. v_names.COUNT
LOOP
<<do_it_again>>
v_pos := INSTR (LOWER (v_sql), LOWER (v_names (i)));
v_length := LENGTH (LOWER (v_names (i)));
v_sql :=
SUBSTR (v_sql, 1, v_pos - 1)
|| v_names (i)
|| SUBSTR (v_sql, v_pos + v_length);
v_sql :=
REPLACE (v_sql,
UPPER (v_names (i)),
'(SELECT v('''
|| LTRIM (v_names (i), ':')
|| ''') FROM DUAL)'
IF INSTR (LOWER (v_sql), LOWER (v_names (i))) > 0
THEN
GOTO do_it_again;
END IF;
END LOOP;
p_sql_out := v_sql;
END;
END export_pkg_spread_sheet;
After creating the package pass the parameter to package like this
begin
export_pkg_spread_sheet.download_excel('select * from emp');
end;
Package will allow to download the spread shreet. If i try to pass the a complex query to package it is returning error as mentioned below
ORA-06502: PL/SQL: numeric or value error
In the above package there is a procedure called procedure excel_content which actuall prints the data in the spread sheet this is where the error is coming from there is a variable called vsql have declared it as clob to hold large string but still i am getting the same error when trying to pass a big string.
Please check the error and let me know.
Thanks
SudhirHi Praveen,
This is the query i am using to pass
Declare
qry clob;
Begin
qry := ' 'SELECT
AR.REGION_CODE,
AR.DISTRICT_CODE,
AR.TERRITORY_CODE,
CASE
WHEN AR.REGION_NAME IS NOT NULL AND AR.DISTRICT_NAME IS NULL AND AR.TERRITORY_NAME IS NULL THEN
AR.REGION_NAME
WHEN AR.REGION_NAME IS NOT NULL AND AR.DISTRICT_NAME IS NOT NULL AND AR.TERRITORY_NAME IS NULL THEN
AR.DISTRICT_NAME
WHEN AR.REGION_NAME IS NOT NULL AND AR.DISTRICT_NAME IS NOT NULL AND AR.TERRITORY_NAME IS NOT NULL THEN
AR.TERRITORY_NAME
END TERR_NAME,
AR.EMPLOYEE_ID,
AR.LAST_NAME,
AR.FIRST_NAME,
AR.GENDER,
AR.DATE_OF_HIRE,
AR.PROJECT_EMPLOYEE_TITLE_ID,
AR.COMPANY_ID,
AR.CUSTOMER_EMAIL,
AR.BUSINESS_EMAIL,
AR.CUSTOMER_VOICEMAIL,
AR.CUSTOMER_VOICEMAIL_EXT,
AR.QUINTILES_VOICEMAIL,
AR.QUINTILES_VOICEMAIL_EXT , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_1(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_ADDRESS_TYPE_1" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_2(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_ADDRESS_TYPE_2" , complete_roster_pkg_report.AR_F_ADDRESS_GET_PHONE(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_Phone" , complete_roster_pkg_report.AR_F_ADDRESS_GET_CITY_TOWN(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_City_Town" , complete_roster_pkg_report.AR_F_ADDRESS_GET_COUNTRY_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_Country_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_STATE_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_State_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_ZIP_POSTAL(AR.PROJECT_ID,AR.EMPLOYEE_ID,1 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Shipping_ZipCode" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_1(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_ADDRESS_TYPE_1" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_2(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_ADDRESS_TYPE_2" , complete_roster_pkg_report.AR_F_ADDRESS_GET_PHONE(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_Phone" , complete_roster_pkg_report.AR_F_ADDRESS_GET_CITY_TOWN(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_City_Town" , complete_roster_pkg_report.AR_F_ADDRESS_GET_COUNTRY_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_Country_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_STATE_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_State_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_ZIP_POSTAL(AR.PROJECT_ID,AR.EMPLOYEE_ID,3 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Storage_ZipCode" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_1(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_ADDRESS_TYPE_1" , complete_roster_pkg_report.AR_F_ADDRESS_GET_LINE_2(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_ADDRESS_TYPE_2" , complete_roster_pkg_report.AR_F_ADDRESS_GET_PHONE(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_Phone" , complete_roster_pkg_report.AR_F_ADDRESS_GET_CITY_TOWN(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_City_Town" , complete_roster_pkg_report.AR_F_ADDRESS_GET_COUNTRY_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_Country_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_STATE_NAME(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_State_Name" , complete_roster_pkg_report.AR_F_ADDRESS_GET_ZIP_POSTAL(AR.PROJECT_ID,AR.EMPLOYEE_ID,4 ,TO_DATE(AAH.EFFECTIVE_DATE)) "Home_ZipCode" FROM AR_V_ROSTER AR
LEFT JOIN AR_V_ADDRESS_HISTORY AAH
ON
(AR.PROJECT_ID = AAH.PROJECT_ID AND
AR.EMPLOYEE_ID = AAH.EMPLOYEE_ID)
WHERE
UPPER(AR.USER_EMPLOYEE_ID) = ''Q766730'' AND
AR.PROJECT_ID = 81 ';
export_pkg_spread_sheet.download_excel(qry);
End;
Praveen you can pass your DB table query to check the error. I am trying to pass as mentioned above.
Please let me know if my question is not clear.
Thanks
Sudhir -
How to send multiple attachment s with a mail??
Hi,
How to send multiple attachments with a mail??
Situation::
In my case i have 5 internal tables populated dynamically in the report.
I want to send them in .TXT format as attachment with 1 mail.
Can anybody tell me in 'SO_NEW_DOCUMENT_ATT_SEND_API1',
how we add multiple attachmants to table objin???
thanks,
deepakHi Deepak,
Please find the sample code for sending mail with multiple attachment.
Report ZPAN_02M *
REPORT zpan_02m .
*-MAIN DECLARATION----
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
*-OTHER DECLARATIONS----
DATA : listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
DATA : tab_lines(3) TYPE n.
DATA : att_type LIKE soodk-objtp.
*OBJBIN = ' | '. APPEND OBJBIN.
*---For simple attachment -
DATA : BEGIN OF wi_data OCCURS 0,
c1(10),
c2(10),
END OF wi_data.
wi_data-c1 = 'Line 1'. wi_data-c2 = 'Line 1'. APPEND wi_data.
wi_data-c1 = 'Line 2'. wi_data-c2 = 'Line 2'. APPEND wi_data.
wi_data-c1 = 'Line 3'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 4'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 5'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 6'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 7'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 8'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 9'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 10'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 11'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 12'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 13'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 14'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 15'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 16'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 17'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 18'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 19'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 20'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 21'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 22'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 23'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 24'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 25'. wi_data-c2 = 'Line 3'. APPEND wi_data.
wi_data-c1 = 'Line 26'. wi_data-c2 = 'Line 3'. APPEND wi_data.
class cl_abap_char_utilities definition load.
constants:
con_tab type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
con_cret type c value cl_abap_char_utilities=>CR_LF,
con_nwln type c value cl_abap_char_utilities=>NEWLINE.
LOOP AT wi_data.
CONCATENATE wi_data-c1 con_tab
wi_data-c2
INTO objbin.
condense objbin.
CONCATENATE con_cret objbin INTO objbin.
APPEND objbin.
ENDLOOP.
*---CREATE MESSAGE : DOCDATA -
Name
docdata-obj_name = 'TEST_ALI'.
Subject
docdata-obj_descr = 'Test including ALI/HTML Attachment'.
*---CREATE MESSAGE : BODY -
objtxt = 'Test Document.'.
APPEND objtxt.
objtxt = 'You will find an ALI/HTML attachment in this message.'.
APPEND objtxt.
objtxt = 'Have a nice day.'.
APPEND objtxt.
*-CREATE PACKING LIST-----TEXT--
objpack-head_start = 1.
DESCRIBE TABLE objtxt LINES tab_lines.
READ TABLE objtxt INDEX tab_lines.
docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
CLEAR objpack-transf_bin.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = 'RAW'.
APPEND objpack.
*-CREATE PACKING LIST-----ATTACHMENT--
att_type = 'XLS'.
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( ( tab_lines / 2 ) - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines / 2.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT 1'.
objpack-obj_descr = 'Attached Document 1'.
APPEND objpack.
att_type = 'XLS'.
objpack-doc_size = ( ( tab_lines / 2 ) - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 14.
objpack-head_num = 14.
objpack-body_start = 14.
objpack-body_num = tab_lines / 2.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT 2'.
objpack-obj_descr = 'Attached Document 2'.
APPEND objpack.
*-CREATE RECEIVER LIST----
reclist-receiver = '[email protected]'. reclist-rec_type = 'U'.
APPEND reclist.
reclist-receiver = sy-uname. reclist-rec_type = 'B'.
APPEND reclist.
*-SEND MESSAGE----
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X'
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
CONTENTS_HEX = objhex
OBJECT_PARA =
OBJECT_PARB =
receivers = reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
WAIT UP TO 2 SECONDS.
SUBMIT rsconn01 WITH mode = 'INT'
WITH output = 'X'
AND RETURN.
Hope this is enough for you...
Enjoy SAP.
Pankaj Singh. -
Exporting google spreadsheet documents
When I choose to export a document as an Excell file, the file's name in the downloads area is changed to fm (fm1, fm2, etc) and the file extension is changed to .xlt
Why?
Can I change this behaviour?
Note, when I am trying to download a xls file, the file name will not change, but .xlt will be appended to the .xls original suffix.
Note that an attachement in Mail is saved just fine.Bento is made by FileMaker
Have a look on the [Bento forums|http://forums.filemaker.com/fmbnto> to see if anyone has reported this before. -
Append rows to existing xls file
Hello Friends,
I have a problem with gui_download. I am working on ECC6.0.
I need to append some rows to existing xls file. I am using gui_download but it not working properly.
I am giving append = 'X' also it is not appending rows it is overwriting the existing rows.
Please help in the regard.
Thanks in advance.
Krishna Yerram.Hi,
BOOK2 is laready existed excel file
Please make sure that X is captail
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = C:\BOOK2.XLS
FILETYPE = 'ASC'
APPEND = 'X'
tables
data_tab = data_tab
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Regards
jana -
File Appends .xls Extension During Download
Hi,
I have a form which generates query results in a new window.
The output is saved in the form of a .cvs file. The user then
clicks on a link which opens up a dialog box prompting the user to
either open the file or save it to disk. The title bar for this box
has the name of the file, but it appends a .xls to the filename.
For example, the file will be called PST_0001aajacksn1.cvs.xls.
This causes the excel program to open up, but the results are
bunched together in one row instead of individual rows. The file,
itself, is saved in a temp directory without the .xls behind it .
It does this in Netscape, but in IE it pulls up a formatted
spreadsheet correctly.
Here is the snippet of code:
<cfif IsDefined("url.SiteType")>
<cfset Variables.SiteType = url.SiteType>
<cfelseif IsDefined("form.SiteType")>
<cfelse>
<cfset Variables.SiteType = "Z">
</cfif>
<cfset fprefix = "PST_" & #Session.this_sid# &
"_">
<cfset urlSiteTmp = "/webtmp/">
<cfset redirLoc = "/web/tmp/BOOKS/">
<cfquery name="getRptNbr"
datasource="#application.datasource#">
select bookRPTnextval RPTNBR
from dual
</cfquery>
<cfset nextRpt =fprefix & #getRptNbr.RPTNBR# &
".csv">
<cfquery name="getSite"
datasource="#application.datasource#">
select *
from sites
where site_seq_nbr = #url.site#
</cfquery>
Could someone help me figure this one out? It would be most
appreciated. ThanksHi,
Have you tested with https and http websites both?
For diving deeper, we would narrow this issue first.
And then, using process monitor to capture the fault process, in my test, here is the result, we should check if there is anything wrong obviously during file creation:
Alex Zhao
TechNet Community Support -
Formulas in .xls spread sheets
I am trying the trial version of numbers and when I import in one of my spread sheets from Excel all of the formulas in the calls get removed. Is this because of the trial version or formula problems?
ThanksAnd there was little left, eh? You must be using some of the more obscure Excel formulas. Numbers also does not import Excel's data validation scheme for doing popups nor will it export Numbers popups back to Excel. Numbers is obviously not the correct tool for you if your other spreadsheets are similar to this one.
-
Problem downloading .xls file
Hi All,
Im getting problem when trying to export a spread sheet. Initially teh filename was hardcoded and so it was working fine in IE. The code then was
response.setHeader("Content-disposition", "attachment; filename=Details.xls");
outStream.write(Results.toString().getBytes());
outStream.close();
later the reqmt changed to some new naming conventions for the file and so i modified the code like
SimpleDateFormat formatter = new SimpleDateFormat ("MM/dd/yyyy HH:mm:ss");
java.util.Date currentDate = new java.util.Date();
String dateString = formatter.format(currentDate);
String fileName = dateString+".xls";
response.setContentType("application/vnd.ms-excel");
response.setHeader("Content-disposition", "attachment; filename="+fileName);
the problem im facing now is the in the pop up for download the file name is my servlet name appended with some unknown string which includes numbers and characters. the file type shown is html.If you click save open then a new html page is been displayed with all the values.
Please help me with this issue.
Thanks
NoufalThank you so much Shanu. Its working now. It was my carelesness or rather my ignorance which caused this prob.
But Im still having a query, the excel sheet is having a [1] appended to the file name for ex 19-Jun-2006 06-46-05[1] and the client is not happy with that.
What is the reason for that square bracket and is there any way we can cut that off? your help will be greatly appreciated.
Thanks
Noufal -
Creat file to write to spread sheet
Hi all,
I'm trying to save my voltage and time data after DAQ. The data went
out OK. They are built to be a 2D array and I transposed them. I
wish to write them in Excel and thus can process data in that.
I used "File Path Control", "Open/Creat/Replace File', and
connected the refnum to "Write to Spread Sheet File". Now I have two
questions about writing to spreadsheet file.
First, I'm using Labview 8.0, and there is no dialog pops out even if
the "File Path" is empty. If I enter file path firstly, I have to
specify .xls in order to create a Excel file. How to make the dialog
telling me I haven't select a file path pop up in case I forgot and all
the data would be lost?
Second, Is there a way to append string head to a spread sheet? For example, time (tab) voltage?
Thanks a lot!hi learner2,
if you want to wrtie to an excel file directly, you can try to use a wrtie to spreadsheet vi on the functions palette in file I/O . you can connect your 2D array to the input, specify the format and it will automatically ask you the location where to save your spreadsheet. Try using find examples and type "excel" in the search field to find more examples regarding spreadsheet . -
Append worksheet from second document with NJAWIN
Hi,
I hope somebody can give me a hint joining two excel documents.
I get following macro when I append the second document as object from filename in Excel:
Sub Makro1()
Sheets.Add
Sheets("Tabelle1").Select
Workbooks.Open Filename:="C:\exceltest.xls"
ActiveWindow.Visible = False
ActiveSheet.OLEObjects.Add(Filename:="C:\exceltest.xls", Link _
:=False, DisplayAsIcon:=False).Select
End Sub
My java code looks like this:
app.getWorkbooks()._Open(filename1, Boolean.FALSE, Boolean.FALSE);
DispatchPtr ptr = app.getWorksheets().Add();
ptr.invoke("Select");
app.getWorkbooks()._Open(filename2, Boolean.FALSE, Boolean.FALSE);
Now I get two instances from Excel, instead of appending it.
How could I get these OLEObjects as shown in Macro?
Thanks in advance
rumpiHmm, nobody has answered. I have done this before months. So if smb has the same problem
my function looks smth like this. I'm glad to hear constructive critic:
_Workbook wb2append = null;
try {
File f = new File(file2append);
if (!f.exists())
throw new IOException("File "+file2append+" does not exists!");
String file2appendName = f.getName();
wb2append = openXLS(file2append, Boolean.TRUE);
* Activate first worksheet in workbook
Worksheet sheetfirst = new _Worksheet(application.getSheets().getItem(new Integer(1)));
sheet_first.Activate();
* Rename all worksheets with prefix the filename of this workbook
if (appendPrefix)
renameSheetsWithPrefix(wb2append, file2appendName);
* Copy all worksheets in this workbook after the activated
* (last) worksheet in the target workbook.
wb2append.getWorksheets().Select();
wb2append.getWorksheets().Copy(null, wb_target.getSheets().getItem(new Integer(wb_target.getSheets().getCount())));
wb2append.Close(Boolean.FALSE); -
Why the simulation is not accepting the data iam trying to give.
Why Does the "Read Waveform From File.vi" Behave Differently in the Run-time Engine?
what is the solution for this.Can you explain please.Iam also adding the vi file and the excel file I'm using.
Regards
Bharath
Attachments:
bharath.vi 12 KB
distorted ip.xls 737 KBHi Dennis,
I tried the simualtion you are given.It is giving the waveform but a portion of it only showing. Any time only 1023 samples of data is coming. That too it is coming from 17111 to 18134.I tried to change all the axis and scaling even then it is not changing. I am attaching the text files with tabs inside the elements. Can you please explain me the reason or can you send me the spread sheet file you've given for the simulation.
Thanks
Bharath.
Attachments:
bharath_2.vi 14 KB
plot.docx 29 KB
Maybe you are looking for
-
XML Publisher Bursting - FTP Status Check
"XML Publisher Report Bursting Program" completes successfully even if EMAIL or FTP fails in the bursting process. See the output file below, last FTP fails but the program completed fine. Is there a way to check the Status and mark the program error
-
PDF maker, Acrobat 9.0, Excel 2007 - wrong page sizes
When I use PDF maker, or "Create PDF", with my entire excel workbook, the sheet sizes come out randomly, though they are set as 8.5X11. I notice there have been many reported problems. Are there any current solutions? Thanks.
-
Has anyone managed to get an iPhone to work with BoostMobile?
I've wanted an iPhone for years now but don't feel it will be made available through Boost for purchase so I'm looking for options to somehow make it happen. BoostMobile uses the Sprint/Nextel networks for its customers. I like having no contract and
-
How to insert Integer array in a MySql DataBase
Now i am doing one swing application,in that i have List box,My doubt is ,How to insert the mutiple seleted value into database.
-
Syntax for Database query on a simple java appl?
Connection con; private boolean conFree = true; private String dbName = "java:comp/env/jdbc/gene"; public geneDB () throws Exception { try{ Context ic = new InitialContext(); DataSource ds = (DataSource) ic.lookup(dbName); con = ds.getConne