Problem in spool file
Hi,
Iam new to oracle. When I give the below query at SQL prompt.
SQL> select col1||'`ß`'||col2 from tablename where rownum<2;
1-J7WGX*`ß`*1-7OKC-23
Iam getting ß within appostropies...... If I remove appostropies and give the query it is throwing an error.
If I give the same query in spool as below.
SqlExport=`sqlplus -s username/password@databasename <<EOF
spool test1.sh;
set linesize 1000;
set PAGESIZE 0 space 0 feedback off echo off verify off heading off;
set termout off trimspool on;
select col1||'`ß`'||col2 from tablename where rownum<2;
exit sql.sqlcode;
spool off;
EXIT;
EOF`
test1.sh[11]: ||col2 from tablename where rownum<2;^Jexit sql.sqlcode;^Jspool off;^J EXIT;^J EOF: not found
SqlExport=ß
Please let me know any reason behind this.
I have set language parameters in .profile as
#EXTENDED CHARACTER SET SUPPORT
set NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
set NLS_LIST_SEPARATOR=ß
export NLS_LIST_SEPARATOR
May be this will help. I don't have linux installed on my system
In the script first define one variable with value. then you that variable in the query like:
SQL> var b nvarchar2(10);
SQL> begin :b:='`ß`'; end;
2 /
PL/SQL procedure successfully completed.
SQL> select empno||:b || ename from emp;
EMPNO||:B||ENAME
1`ß`gggg
7369`ß`SMITH
7499`ß`ALLEN
7521`ß`WARD
7566`ß`JONES
7654`ß`MARTIN
7698`ß`BLAKE
7782`ß`CLARK
7788`ß`SCOTT
7839`ß`KING
7844`ß`TURNER
EMPNO||:B||ENAME
7876`ß`ADAMS
7900`ß`JAMES
7902`ß`FORD
7934`ß`MILLER
15 rows selected.
SQL>
Similar Messages
-
SFTP MGET of large files fails - connection closed - problem with spool file
I have a new SFTP job to get files from an FTP Server. The files are large (80mg, 150mg). I can get smaller files from the ftp site with no issue, but when attempting the larger files the job completes abnormally after 2 min 1 sec. each time. I can see the file is created on our local file system with 0 bytes, then when the FTP job fails, the 0 byte file is deleted.
Is there a limit to how large an ftp file can be in Tidal? How long an ftp job can run?
The error in the job audit is Problem with spool file for job XXXX_SFTPGet and an exit code of 127 (whatever that is).
In the log, the error is that the connection was closed. I have checked with the ftp host and their logs show that we are disconnecting unexpectedly also.
Below is an excerpt from the log
DEBUG [SFTPMessage] 6 Feb 2015 14:17:33.055 : Send : Name=SSH_FXP_STAT,Type=17,RequestID=12
DEBUG [SSH2Channel] 6 Feb 2015 14:17:33.055 : Transmit 44 bytes
DEBUG [ChannelDataWindow] 6 Feb 2015 14:17:33.055 : Remote window size decreased to 130808
DEBUG [PlainSocket] 6 Feb 2015 14:17:33.071 : RepeatCallback received 84 bytes
DEBUG [SSH2Connection] 6 Feb 2015 14:17:33.071 : ProcessPacket pt=SSH_MSG_CHANNEL_DATA
DEBUG [SFTPMessageFactory] 6 Feb 2015 14:17:33.071 : Received message (type=105,len=37)
DEBUG [SFTPMessageStore] 6 Feb 2015 14:17:33.071 : AddMessage(12) - added to store
DEBUG [SFTPMessage] 6 Feb 2015 14:17:33.071 : Reply : Name=SSH_FXP_ATTRS,Type=105,RequestID=12
DEBUG [SFTPMessage] 6 Feb 2015 14:17:33.071 : Send : Name=SSH_FXP_OPEN,Type=3,RequestID=13
DEBUG [SSH2Channel] 6 Feb 2015 14:17:33.071 : Transmit 56 bytes
DEBUG [ChannelDataWindow] 6 Feb 2015 14:17:33.071 : Remote window size decreased to 130752
DEBUG [PlainSocket] 6 Feb 2015 14:17:33.087 : RepeatCallback received 52 bytes
DEBUG [SSH2Connection] 6 Feb 2015 14:17:33.087 : ProcessPacket pt=SSH_MSG_CHANNEL_DATA
DEBUG [SFTPMessageFactory] 6 Feb 2015 14:17:33.087 : Received message (type=102,len=10)
DEBUG [SFTPMessageStore] 6 Feb 2015 14:17:33.087 : AddMessage(13) - added to store
DEBUG [SFTPMessage] 6 Feb 2015 14:17:33.087 : Reply : Name=SSH_FXP_HANDLE,Type=102,RequestID=13
DEBUG [SFTPMessage] 6 Feb 2015 14:17:33.087 : Send : Name=SSH_FXP_READ,Type=5,RequestID=14
DEBUG [SSH2Channel] 6 Feb 2015 14:17:33.087 : Transmit 26 bytes
DEBUG [ChannelDataWindow] 6 Feb 2015 14:17:33.087 : Remote window size decreased to 130726
DEBUG [PlainSocket] 6 Feb 2015 14:17:33.118 : RepeatCallback received 0 bytes
DEBUG [SFTPChannelReceiver] 6 Feb 2015 14:17:33.118 : Connection closed: (code=0)
ERROR [SFTPMessageStore] 6 Feb 2015 14:17:33.118 : Disconnected unexpectedly ( [errorcode=0])
ERROR [SFTPMessageStore] 6 Feb 2015 14:17:33.118 : EnterpriseDT.Net.Ftp.Ssh.SFTPException: [errorcode=0]
ERROR [SFTPMessageStore] 6 Feb 2015 14:17:33.118 : at EnterpriseDT.Net.Ftp.Ssh.SFTPMessageStore.CheckState()
ERROR [SFTPMessageStore] 6 Feb 2015 14:17:33.118 : at EnterpriseDT.Net.Ftp.Ssh.SFTPMessageStore.GetMessage(Int32 requestId)I believe there is a limitation on FTP and what you are seeing is a timeout built into the 3rd party application that tidal uses (I feel like it was hardcoded and it would be a big deal to change but this was before Cisco purchased tidal) there may have been a tagent.ini setting that tweaks that but I can't find any details.
We wound up purchasing our own FTP software (ipswitch MOVEit Central & DMZ) because we also had the need to host as well as Get/Put to other FTP sites. It now does all our FTP and internal file delivery activity (we use it's api and call from tidal if we need to trigger inside a workflow) -
I have a written a hot backup script and I am having the following problem.
In my script I do:
dbms_output.put_line('alter system switch logfile;');
dbms_output.put_line('archive log all;');
dbms_output.put_line('!cp /oracle/u01/oradata/design/arch/*.dbf /oracle/u011/oradata/design/recovery/archive_bkup');
dbms_output.put_line('!compress /oracle/u11/oradata/design/recovery/archive_bkup/*.dbf');
I spool the above and in the spool file it shows up as
alter system switch logfile;
archive log all;
!cp /oracle/u01/oradata/design/arch/*.dbf
/oracle/u11/oradata/design/recovery/archive_bkup
!compress /oracle/u11/oradata/design/recovery/archive_bkup/*.dbf
alter database backup controlfile to trace;
!cp /oracle/u01/oradata/design/arch/*.dbf
/oracle/u11/oradata/design/recovery/archive_bkup
This command fails as it shows up as 2 lines. How can I get in one line.
Thanks.The reason that is happening is because your LINESIZE is set too low for this (probably 80).
what you need to do is, do a SET LINESIZE 132 (or something larger, depending upon how big the
entire line can be - up to 255 - limit of DBMS_OUTPUT.PUT_LINE) and then run the PL/SQL
statements:
SQL> set serveroutput on
SQL> set linesize 132
SQL> begin
2 dbms_output.put_line('alter system switch logfile;');
3 dbms_output.put_line('archive log all;');
4 dbms_output.put_line('!cp /oracle/u01/oradata/design/arch/*.dbf /oracle/u011/oradata/design/recovery/archive_bkup');
5 dbms_output.put_line('!compress /oracle/u11/oradata/design/recovery/archive_bkup/*.dbf');
6
7 end ;
8 /
alter system switch logfile;
archive log all;
!cp /oracle/u01/oradata/design/arch/*.dbf /oracle/u011/oradata/design/recovery/archive_bkup
!compress /oracle/u11/oradata/design/recovery/archive_bkup/*.dbf
PL/SQL procedure successfully completed.
SQL> -
Deleting the spool files that has been generated
Hi all, currently Im facing a problem when spool files are generated after executing a report program in background. I actually need the spool files to be deleted as soon as the printing has been completed and not to remain in the sp02 transation. The real issue is with the number of spool requests that remain in the sp02 when large number of files are be printed. Need your suggestion to delete the spools that got accumulated as soon as the printing is completed.
Fill the print parameters RELEASE "Delete immediately after printing" (see [GET_PRINT_PARAMETERS|http://help.sap.com/abapdocu_70/en/ABENPRINT_PARAMETERS_FUNCTION.htm] and [Overview of All Print Parameters |http://help.sap.com/abapdocu_70/en/ABENPRINT_PARAMETERS_OVERVIEW.htm])
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
no_dialog = 'X'
release = 'X'.
Regards,
Raymond -
Spool file problem,Can't see the query in output file.
Hello ,
I am facing a very old school kind of problem .....about spool file ....
The scenario -
I have made a script by name DB_Status_checkup.sql which i want to fire on the database to check the database status. In this script their are many queries regarding the data dictionary views to know about the database. It consist of nearly 25-30 different select queries..
The problem is i want to make a spool file of the output of that query....i want to see the SQL query & the output below in the spool file, so it will be easy for me to judge the result. But i can't see the SQL query , i can only see the output , & in so many queries it all gets jumbled up....even i can't understand where the next output starts ...
Sample of my SQL Script ....
clear buffer
spool D:\DB_status.txt
/*To check the database startup time*/
Select to_char(startup_time, 'HH24:MI DD-MON-YY') "Startup time"
from v$instance
.........next query n so on....
spool off;
In the output pf the spool file at D:\db_status.txt..
Startup time
08:25 16-JUL-10It shows only the output of the query in the spool file not the query,
What should i do to get the SQL query as well as the output of that query just below it in the spool file ???
Please suggest if you have anymore ideas , regarding this .....
ORACLE 10g R2
Windows Server 2008
Thanks in advance ...Why don't you just use database control, instead of re-inventing the wheel?
Apart from that, SQL*Plus has it's own reference manual, which you apparently refuse to read.
The answer to your quiz/doc question is
set echo on
Sybrand Bakker
Senior Oracle DBA -
Hello ,
I am having some problem in spooling a file i am using a single script that connect to different user to fetch a data i am using html to spool a file.
whenever it connect to different user it show message "connected " in spool file .
Is their any method to remove this message coming in spool file .
with regards
VineshI am using oracle 9i it is not working there .
Command which i am using is given below.
set markup html on;
spool on;
set feed off;
spool C:\Temp\vinesh.xls;
select EMPLOYEE_ID,FIRST_NAME from employees
where rownum<2;
set markup html off ;
spool off;
conn dotsoft/abcd1212@dot
set markup html on;
spool on;
set feed off;
spool C:\Temp\vinesh.xls APPEND;
select unique_id_no EMPLOYEE_ID,customer_name FIRST_NAME
from working_lines where rownum<2;
set markup html off ;
spool off;
it is only working for 1st connection showing error for 2nd connection.
with regards
Vinesh Gupta -
Spool file error - Buffer Overflow
I've a sql script that is running from a.sql file. The script fetches almost 9 million data as a result of the query. Main problem is related to spool file generation. It is saying buffer overflow. But, when i write that query from sql prompts it is running within 2 mins and completes the task within 15 mins.
I've written -
set serveroutput on size ######
But, still it is not working. Total application is freeze whenever i want to run it. Tell me any suggestion if u have.
Satyaki.i guess what you are more concerned with is the output produced by your query (the spool file).
you need not to see what is displayed on the screen all you need is open up the spool file to
check for those data in there.
to suppress the output from the screen and still generates spool file. use the SET TERMOUT option.
e.g.
-- code for a producing a sample spool file
spool r:\sample_spool.txt;
select * from emp;
spool off;
at the SQL*Plus command line:
SQL> @r:\sample_spool.sql;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7566 JONES MANAGER 7839 02-APR-81 2975 1000 20
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7839 KING PRESIDENT 17-NOV-81 5000 10
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7788 SCOTT ANALYST 7566 09-DEC-82 3000 20
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 12-JAN-83 1100 20
7900 JAMES CLERK 7698 03-DEC-81 950 30
7934 MILLER CLERK 7782 23-JAN-82 1300 10
14 rows selected.
SQL> -- the above example displays the output on the screen
SQL> -- now we want to turn it off by using the SET TERMOUT option
SQL> SQL> set termout off;
SQL> @r:\sample_spool.sql;
SQL>
after executing the script sample_spool.sql it does not display output from the screen which
we want to avoid the buffer overflow error. and still produce the spool file:
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7566 JONES MANAGER 7839 02-APR-81 2975 1000 20
7902 FORD ANALYST 7566 03-DEC-81 3000 20
7839 KING PRESIDENT 17-NOV-81 5000 10
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7788 SCOTT ANALYST 7566 09-DEC-82 3000 20
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 12-JAN-83 1100 20
7900 JAMES CLERK 7698 03-DEC-81 950 30
7934 MILLER CLERK 7782 23-JAN-82 1300 10
14 rows selected. -
Can a spool file be sent as an attachment in the decision step?
Hi,
I have z program that runs in background and produces a spool file. Normally, I can use tcode SP01 to display this file. At the end of this z program, I call SWW_WI_START_SIMPLE to send a workflow into SAP inbox. I want to know if I somhow can send the spool file along also? I read about attachment and SOFM object but still can't figure out what I need to do yet. Please help.
Thank you,
THHi Th,
Check this code if helpful.
FORM pdf_conversion.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = spoolno
no_dialog = ' '
IMPORTING
pdf_bytecount = numbytes
pdf_spoolid = pdfspoolid
btc_jobname = jobname
btc_jobcount = jobcount
TABLES
pdf = pdf
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11.
ENDFORM. " PDF_CONVERSION
FORM SPOOL *
FORM spool.
PERFORM display.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
destination = 'LOCL'
immediately = ' '
new_list_id = 'X'
expiration = '9'
in_parameters = p_pripar
layout = 'X_65_132'
line_count = 65
line_size = 132
mode = 'DEFVALS'
no_dialog = 'X'
IMPORTING
out_parameters = p_pripar
valid = val
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
NEW-PAGE PRINT ON NEW-SECTION PARAMETERS p_pripar NO DIALOG.
PERFORM display.
NEW-PAGE PRINT OFF.
CLEAR t_filename_tx.
CONCATENATE 'c:\temp\' p_mat '.pdf' INTO t_filename_tx.
CONDENSE t_filename_tx.
SELECT * FROM tsp01 INTO TABLE t_tsp01
WHERE rqowner EQ sy-uname.
SORT t_tsp01 BY rqcretime DESCENDING.
LOOP AT t_tsp01.
spoolno = t_tsp01-rqident.
EXIT.
ENDLOOP.
IF sy-subrc EQ 0.
PERFORM pdf_conversion.
ENDIF.
sending that inernal to mail
FUNCTION z_p_traveler_workflow.
""Local interface:
*" IMPORTING
*" REFERENCE(V_FILE_PATH) LIKE RLGRAP-FILENAME
*" REFERENCE(DOKNR) LIKE CRVD_A-DOKNR
*" REFERENCE(DOKVR) LIKE CRVD_A-DOKVR
*" TABLES
*" PDF STRUCTURE TLINE
D A T A
DATA: w_gd_doc_data LIKE sodocchgi1.
internal table for body content of the email
DATA: t_message LIKE solisti1 OCCURS 0 WITH HEADER LINE.
internal table for receivers of email
DATA: t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE.
internal table for attachment data
DATA: t_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE.
*internal table for Information about structure of data tables
DATA: t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
internal tables for attachment data
DATA: t_xi_pdf LIKE tline OCCURS 0 WITH HEADER LINE,
t_xi_temp LIKE bapiqcmime OCCURS 0 WITH HEADER LINE,
t_xi_mime(255) TYPE c OCCURS 0 WITH HEADER LINE,
t_html LIKE solisti1 OCCURS 0 WITH HEADER LINE.
for splitting of the filepath
DATA : BEGIN OF t_split OCCURS 0,
row(50),
END OF t_split.
DATA: w_tab_lines LIKE sy-tabix,
w_subject TYPE so_obj_des, " for email header
w_file_path1 TYPE string. "file path
DATA : w_lines TYPE i,
w_temp(500) TYPE c,
w_offset TYPE p,
w_lineslen(2) TYPE p,
w_mimelen(2) TYPE p,
w_tabix LIKE sy-tabix.
DATA : w_len TYPE i,
w_index LIKE sy-index,
w_doc_type TYPE so_obj_tp,
w_filename TYPE so_obj_des .
internal table for gettting personal numbers of quality engineers
DATA: BEGIN OF t_ztptwf2 OCCURS 0,
pernr LIKE ztptwf2-pernr, "personal number
END OF t_ztptwf2.
internal table for gettting userids of quality engineers
DATA: BEGIN OF t_pa0105 OCCURS 0,
usrid LIKE pa0105-usrid, " user id of the quality engineer
END OF t_pa0105.
move file path to w_file_path
w_file_path1 = v_file_path.
*assign subject of the email
w_subject = text-006. "Travaler Document to Approve
refreshing the internal tables
REFRESH : t_objbin, t_packing_list, t_split.
CLEAR : t_objbin, t_packing_list, t_split.
CLEAR : t_xi_pdf, t_xi_temp.
REFRESH : t_xi_pdf, t_xi_temp.
CLEAR: w_temp, w_offset, t_xi_temp.
move attachment data to t_xi_pdf[].
t_xi_pdf[] = pdf[].
Reformat the line to 255 characters wide
DESCRIBE TABLE t_xi_pdf LINES w_lines.
DESCRIBE FIELD t_xi_pdf LENGTH w_lineslen.
DESCRIBE FIELD t_xi_temp LENGTH w_mimelen.
LOOP AT t_xi_pdf.
w_tabix = sy-tabix.
MOVE t_xi_pdf TO w_temp+w_offset.
IF w_tabix = w_lines.
w_lineslen = strlen( t_xi_pdf ).
ENDIF.
w_offset = w_offset + w_lineslen.
IF w_offset GE w_mimelen.
CLEAR t_xi_temp.
t_xi_temp = w_temp(w_mimelen).
APPEND t_xi_temp.
SHIFT w_temp BY w_mimelen PLACES.
w_offset = w_offset - w_mimelen.
ENDIF.
IF w_tabix = w_lines.
IF w_offset GT 0.
CLEAR t_xi_temp.
t_xi_temp = w_temp(w_offset).
APPEND t_xi_temp.
ENDIF.
ENDIF.
ENDLOOP.
*move data from t_xi_temp to t_xi_mime
LOOP AT t_xi_temp.
t_xi_mime(255) = t_xi_temp-line.
APPEND t_xi_mime.
CLEAR t_xi_mime.
ENDLOOP.
*move data from t_xi_mime[] to t_html[]
t_html[] = t_xi_mime[].
*move data from t_html[] to t_objbin.
LOOP AT t_html.
t_objbin-line = t_html-line.
APPEND t_objbin.
CLEAR t_objbin.
ENDLOOP.
*fill the body of email
t_message = text-005. "Mail with PDF attachment
APPEND t_message.
CLEAR t_message.
t_message = text-004. "Please double click the attachment to verify
APPEND t_message.
CLEAR t_message.
concatenate 'COPY FOR VIEWING ONLY-NOT TO BE'
'USED/PRINTED FOR PRODUCTION' into t_message separated by
space.
APPEND t_message.
CLEAR t_message.
IF NOT doknr IS INITIAL.
CONCATENATE text-001 "The Document
doknr
text-002 "and Version
dokvr
text-003 INTO "is changed
t_message SEPARATED BY space.
APPEND t_message.
CLEAR t_message.
ENDIF.
DESCRIBE TABLE t_message LINES w_tab_lines.
READ TABLE t_message INDEX w_tab_lines.
w_gd_doc_data-doc_size = ( w_tab_lines - 1 ) *
255 + STRLEN( t_message ).
w_gd_doc_data-obj_langu = sy-langu.
w_gd_doc_data-obj_name = 'SENDFILE'.
w_gd_doc_data-obj_descr = w_subject.
w_gd_doc_data-sensitivty = 'O'.
CLEAR t_packing_list.
t_packing_list-head_start = 1.
t_packing_list-head_num = 0.
t_packing_list-body_start = 1.
t_packing_list-doc_type = 'RAW'.
t_packing_list-body_num = w_tab_lines.
APPEND t_packing_list.
IF NOT w_file_path1 IS INITIAL.
w_len = strlen( w_file_path1 ) - 3.
w_doc_type = w_file_path1+w_len(3) .
TRANSLATE w_doc_type TO UPPER CASE .
SPLIT w_file_path1 AT '\' INTO TABLE t_split .
DESCRIBE TABLE t_split LINES w_index .
READ TABLE t_split INDEX w_index .
w_filename = t_split-row .
w_len = strlen( w_filename ) - 4.
w_filename = w_filename(w_len) .
DESCRIBE TABLE t_objbin LINES w_tab_lines.
t_packing_list-transf_bin = 'X'.
t_packing_list-head_start = 1.
t_packing_list-head_num = 1.
t_packing_list-body_start = 1.
t_packing_list-doc_type = w_doc_type.
t_packing_list-body_num = w_tab_lines.
t_packing_list-doc_size = w_tab_lines * 255.
t_packing_list-obj_descr = w_filename.
APPEND t_packing_list.
ENDIF.
fill the Receivers
SELECT * FROM ztptwf2 INTO TABLE t_ztptwf2.
IF NOT t_ztptwf2[] IS INITIAL.
SELECT usrid FROM pa0105 INTO TABLE t_pa0105 FOR ALL ENTRIES IN
t_ztptwf2 WHERE pernr = t_ztptwf2-pernr AND subty = '0001' .
LOOP AT t_pa0105.
t_receivers-receiver = t_pa0105-usrid.
t_receivers-rec_type = 'B'.
APPEND t_receivers .
CLEAR t_receivers.
ENDLOOP.
ENDIF.
IF NOT t_receivers[] IS INITIAL.
Call the FM to post the message to SAPMAIL
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = w_gd_doc_data
commit_work = 'X'
TABLES
packing_list = t_packing_list
contents_txt = t_message
contents_bin = t_objbin
receivers = t_receivers
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.
ENDIF.
FREE: t_objbin,t_message,t_packing_list,t_receivers.
i hope this code will solve your problem.
Sankar -
Decrease print spool file size generated by PS CS5 Mac OS 10.6.8?
Hi,
Certain big/hi-res Photoshop (CS5) documents - sent from a 2010 era Intel Mac to an older HP 1200dpi Laserjet (LJ 2100M/HPs PostScript, standard HP/Apple drivers) - were taking forever to print.
In one case, for example, a 6MB on disk, Grayscale 8 bit, 109MB/40MB "doc size" .psd, when printed from Photoshop, generated a 135833k spool file.
The same .psd opened with and printed from Preview, only a 3229k spool file - which printed out in a short time.
Am I missing something?
Thanks for any comments or suggestions.The plug-in is there but no twain interface for the scanner appears as an option under file import in PS
you answered your own question -- Adobe will point the finger at Epson, and Epson will call Adobe out for breaking their driver -- but the 1250 is how old
this question gets answered here a couple times a month, and there are many web articles explaining the problem in more detail...
the short answer is scan in the stand alone scanning software (ViewScan may solve your issue)
most notably, that approach keeps Ps running in 64 bit and keeps it freed up to continue working while that ancient scanner chugs away
PS: I am not trying to beat you up for using good hardware that is still working for you, I am just trying to add a second opinion what others have said -
Data in spool file does not match output.
This is a strange issue, and I'm not even sure it's a problem in SAP, but I don't know where else to ask and haven't found anything like it online:
We create pick lists on dot matrix printers. Occasionally, the output is missing a digit or character - for example in the middle of the delivery number. If delivery number is 81234567, the dot matrix output might be 8123467. The SAP spool file is not missing any data. And the paper dot matrix output is never skewed nor looks like it has jammed or "hiccuped". There is no space where the missing piece of data should be - it's all run together nice and neat. It occurs on different bits of data (sometimes, delivery#, name, batch, etc.), and it occurs on different printers at different sites. So far, it has always been only one digit or character missing every time it occurs. Reprint from the spool and it comes out fine.
So, SAP data is correct, and it occurs on different printers. Maybe it's a network issue? A printer buffer issue - but it happens on two different units, and that would be a weird coincidence. I really have no ides. Has anyone ever experienced anything like this?
Thanks,
AnkeHello -
Difficult to answer accurately here as no access to spool data on the affected system and exact methods used. But, perhaps if you can print the RAW (OTF) data to a fileprinter and send that as a .txt file to the printer hardware vendor they could investigate why certain characters do not print.
Regards. -
Need Spool file 255 characters for background HR Reports into Excel
We have been looking for a solution for problem this for more than 2 years now.
Problem:
1. Requirement is to run large HR reports either standard or with Ad Hoc Query in background mode in a company with more than 50,000 employees.
2. Nobody wants printed reports these days. We want to save the forests. Customers prefer to be emailed an Excel file so they can do further data analysis, filtering, pivot tables etc.
3. Reports are running OK in foreground for smaller sections of the organisation, where you send the output to Excel from ALV, or save as a local file in spreadsheet format.
4. But large reports for entire company are awkward, tie up your PCs resources, and complex reports accessing many tables can timeout before completion.
5. So scheduling these reports to run in background would be the ideal solution.
6. However when we access the report output from SP02, we find that most reports (say with more than 13 or so fields) have an output wider than 255 characters and the output of the spool file wraps to the next line in Excel. It is very tricky to then parse the data back into one row for each employee. And you have a problem if you output is for 50,000 or so employees, because then you file is 100,000 rows and will not load completely into Excel limit problem of 65,536 characters.
7. We simply want a spool file that does not wrap the data to the next line after 255 characters.
8. But how to explain this simple requirement to some technical people. It seems a lot of posts on SDN think we always want to print a spool file. NO remember the forests!
Possible Solutions:
I see a lot of posts here that refer to OSS note 186603, but they dont mention the target for the output of the spool is to import into an Excel File (i.e. spreadsheet format). Just search for 186603 or Spool request with more than 255 columns. There is also a reference to OSS note 313566. I am not sure if these will work?
I have also seen the suggestions that you need to define a customer printer format that does not wrap the output after 255 characters (create a new format type in transaction SPAD).
Can anyone help us!
John McKeeHi,
Can you please check whether you can use:
CONSTANTS C_LF TYPE X VALUE '0A'.
CONSTANTS C_CR TYPE X VALUE '0D'.
Regards,
Lakshmi. -
Display error messages in spool file
I am running the below code (ssn_run.sql) using sqlplus 10.2.0.1.0 on my windows XP professional client PC.
The database is a Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit running on Solaris
There are 3 insert statements and 3 update statements. I have mentioned 'show sqlcode' after each of these
dml statements. Hence currently, I look at the spool file, analyze before I confirm that every sqlcode is a 0.
Now, is there a way to alter this code so that it can show if any of the sqlcode is not 0(if there is a problem) somewhere
at the end of the spool file ? Or even if I am able to just indicate if there is any ORA- error anywhere in the code and can indicate this somewhere at the end of the spool file, that is fine as well.
--The code
accept input_ssn prompt 'Enter SSN :'
set feedback on
set echo on
set term on
set heading on
set pagesize 0
set linesize 10000
set verify on
undefne sdate input_ssn
col sdate new_value sdate
col input_ssn new_value input_ssn
select to_char(sysdate,'YYYYMMDD') sdate from dual;
spool C:\PERSON_DATA_&&sdate._&&input_ssn..TXT
select 'REPORT GENERATED ON : '||SYSDATE FROM DUAL;
INSERT INTO ADDRESS_OLD SELECT * FROM ADDRESS WHERE ADDRESSID IN(SELECT ADDRESSID FROM PERSON_ADDRESS
WHERE PERSONID IN(SELECT PERSONID FROM PERSON WHERE SIN = '&&input_ssn'));
show sqlcode;
commit;
INSERT INTO PERSON_OLD
(PERSONID, TITLE, FNAME, MNAME, LNAME, ACFM, SIN, UNAME, AKANAME, DCFM,
IROWID, SUFFIX, PTYPE, OLD_SSN)
SELECT PERSONID, TITLE, FNAME, MNAME, LNAME, ACFM, SIN, UNAME,
AKANAME, SIN FROM PERSON WHERE SIN = '&&input_ssn';
show sqlcode;
commit;
INSERT INTO MEMBER_OLD
(CLNT, MKEY, PERSONID, MEMNO, OLD_MEMNO)
SELECT CLNT, MKEY, PERSONID, MEMNO,MEMNO
FROM MEMBER WHERE PERSONID IN(SELECT PERSONID FROM PERSON WHERE SIN = '&&input_ssn');
show sqlcode;
commit;
UPDATE ADDRESS SET STREET1 = 'ROCKY RD',STREET2=NULL,CITY = 'ALABASTER',PROVINCE = 'AL',POSTAL='34216',
PHONE1='1111111111' WHERE ADDRESSID IN(SELECT ADDRESSID FROM PERSON_ADDRESS WHERE PERSONID
IN(SELECT PERSONID FROM PERSON WHERE SIN = '&&input_ssn'));
show sqlcode;
commit;
UPDATE PERSON SET FNAME = TRANSLATE(SIN,'0123456789','ACEGIKMOQS'),
LNAME = TRANSLATE(SIN,'0123456789','SQOMKIGECA'),
UNAME = TRANSLATE(SIN,'0123456789','ACEGIKMOQS')||' '||TRANSLATE(SIN,'0123456789','SQOMKIGECA'),
AKANAME=NULL WHERE SIN = '&&input_ssn';
show sqlcode;
commit;
UPDATE MEMBER SET MEMNO = MKEY WHERE PERSONID IN(SELECT PERSONID FROM PERSON WHERE SIN = '&&input_ssn');
show sqlcode;
commit;
spool off;
set term on
set feedback on
set HEADING on
set verify on
--End of code
ThanksQUESTION:
As in the code above, I am inputting a value while running the script. And I am spooling all of it to a spool file. I also get the old and new values , like
old 7: client_54.PERSON_OLD WHERE OLD_SSN = '&&input_ssn'))
new 7: client_54.PERSON_OLD WHERE OLD_SSN = '123456774'))
old 11: WHERE PERSONID IN(SELECT PERSONID FROM PERSON_OLD WHERE OLD_SSN = '&&input_ss
new 11: WHERE PERSONID IN(SELECT PERSONID FROM PERSON_OLD WHERE OLD_SSN = '123456774'
Is there a way I can get rid of these in the spool file? -
Hi,
I am facing one small problem in UTL FILE COPY package. We have an automated scheduled batch process. As a daily batch process it moves the files from one folder to other. During movement, it first copies the file from source folder to destination folder using FILE COPY package and then removes the file using FILE REMOVE package from the source folder.
Few cases are found that the file when files are copied they are copied as 0 bytes in destination folder but the source file had 1 MB file size. The interesting part is I am unable to replicate the issue. Means when i try to run once again the package its working properly and files are copied with correct size. This kind is issue is occuring very rarely though as once in month but the question is why FILE_COPY package is not working properly sometimes.. I am unable to understand.
Thanks a lot for going through this. Any suggestions.
Regards,
AshishAnyhow make sure that the copy will start after the full generation of files.
You can think like a spool file generation with huge data. In that case initially spool file available with 0 byte only. After finish of query only it shows its actual size. -
Spool file of a background job
Hello Friends,
In an SAP system, there is a background job which creates a spool file.
If there is no printer configuration done on the SAP server, how to find the location of this file in the filesystem?
Thanks & Regards,
Kunal Patel.Hi,
Thanks for your reply.
I was able to locate the file in the filesystem.
Actually I changed a setting in the printer LOCL so that the spool is stored in Global directory.
But now there is a new problem.
The spool file in the filesystem is in a very different format as below:
Could you let me know how to change the format of the spool?
Command executed: more : /usr/sap/DHS/SYS/global/100SPOOL/00010000026674 :
Target host: unix0006
COL0N COL0H05.03.2008
4 4 4 9 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
5
5 5Lene
5 5Gitte
5 5Orla Bech
5 5Janni 5We
4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 3 - P COL0N COL0H05.03.2008
4 4 4 4 4 4 4 4 4 4 4 4 4 4 9 4 4 4 4 4 4 4 4 9 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 9 4 4 4 4 4 4 4 4 4 4 9 4 4 4 4 4 4 4 4 4 4 4 4
4 4 4 4 4 4 9 4 4 4 4 4 4 4 4 9 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 9 4 4 4 4 4 4 4 4 4 4 9 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4
5 ú 5
5 ú 5
5 ú 5
Rgds,
Kunal. -
Javax.mail.MessagingException: 451 Error while writing spool file??
Hi all friends,
Can any one plz tell me why Iam getting below error when Iam trying to send mail with attachment.Iam using Java Mail API.
javax.mail.MessagingException: 451 Error while writing spool file
Plz tell me what are the reasons behind it.
Regards
BikashThe problem here is that the SMTP server was unable to write its spool file.
The error is probably on the OS side of things and has nothing to do with email except that the lack of the system resource is causing email to fail.
Have the server admin take a look at his error log to find out why the the user that smtp is running as could not write the file.
Maybe you are looking for
-
I know this question has been asked before, and I have followed previous threads' instructions to download windows cleanup utility, but when I successfully install it, I cannot find it on my computer. Please help! And whoops, my bad for posting this
-
How to add a tip to flexfield columns
How to add shorttip to Flex: (BankDetails) columns/segments. I know how to add shortip if it is a messtext input, I would like to know is there a way to add shorttip to Flexfield columns using personalizations.
-
Replacing HD from another Macbook
I have a 2006 Macbook Core Duo and am picking up a Macbook Pro Core 2 Duo with a slower and smaller HD. Can I just swap the HD from the Macbook and startup up the Pro without any problems? Or do I need to reformat etc etc. Thanks
-
IPhoto 8.0.3 update causes iPhoto Places to malfunction
Well I applied the latest update to iPhoto, only to discover that this update basically rendered the Places-functionality unusable. When I try to drag the map, the map tile under my mouse cursor gets selected and moves with my cursor. I already tried
-
Hi At school I made a project on microsoft publisher and i brought it home to print it but i have an old verson of microsoft office on my mac so it won't open. So i tried to get a trial of it for my mac but when i try to open it it says can not ru