Spool in a trigger
Is it possible to have a spool command in a trigger, I need to trace the sql statements in a trigger, could any one please explain me.
Thanks & regards
bala
Nope. SPOOL is a SQL*Plus command. Totally unknown to PL/SQL.
Similar Messages
-
Trigger with spool to a printer
I'm tryng to fire a trigger after a insert in table2 ,
The trigger spool a file to a printer, but the trigger give me an error
the body is
BEGIN
Spool /server/file.txt
SELECT c1,c2,c3 from t1;
Spool off;
HOST lp -d Laserjet4 /server/file.txt;
END;Right... The logic should be
Spool file.txt
BEGIN
SELECT c1,c2,c3 from t1;
END;
Spool off;
HOST lp -d Laserjet4 /server/file.txt;
and u may write a shell script to run this. -
Trigger a Output as Spool on Delivery Deletion via Vl02n
Dear All,
My requirement is that when I delete a delivery in VL02n , a spool should be generated . I have a SAP SCRIPT which can be triggered via a Z output type .
How do we link to trigger this output type on delivery deletion?
Thanks
DishaHi Disha,
If you want to create a spool for one delivery, you can do it manually.
But if you want to convert every output trigger into spool, you have to use the function module to convert the script data into spool.
You can use the FM CONVERT_OTF to convert the OTF format into spool.
Once this is done the otuput will be saved in spool with a spool number
You can convert this spool into PDF using the program RSTXPDFT4 and save it in a place in a directory. -
Spool overflow, spool_internal_error
All SAP BASIS experts,
I am facing a spool overflow problem. When user give any print command in QAS server, it is not completed. After some time error appear spool internal error / spool overflow problem. I am also checked data in RZ20-- SAP CCMS Monitor Templates -> Spool System. Here's showing used no. 100% & this is red colour.
After that I run SE38 & run RSPO0041 & RSPO0043, but no improvement. After that I am run & checked SNRO, their has no any abnormalities.
So please suugest me for resolve this issue. Due to this issue my system log folder also filled up & user not log in GUI. Resultant i m clear the logs manually on regular base.
For ref. print scrns as follows:-Hi Johan,
Hereas no any option for attachment the dump file. So I am paste its details as below:-
Runtime Errors SPOOL_INTERNAL_ERROR
Date and Time 10.04.2015 15:11:36
Short text
Internal error in the spool system.
What happened?
Error in the SAP kernel.
The current ABAP "SAPLKKBL" program had to be terminated because the
ABAP processor detected an internal system error.
Error analysis
When calling the SAP spool system, an (unspecified) internal
error occurred.
More detailed description of error: "spool overflow "
Further information:
See below under "Spool error information".
Trigger Location of Runtime Error
Program SAPLKKBL
Include LKKBLF01
Row 439
Module type (FORM)
Module Name LIST_OUTPUT_NEW
Source Code Extract
Line
SourceCde
409
set handler gt_stack3-r_kkbl_print->handle_top_of_page
410
for gt_stack3-r_kkbl_events
411
activation space.
412
413
set handler gt_stack3-r_kkbl_print->handle_end_of_page
414
for gt_stack3-r_kkbl_events
415
activation space.
416
endif.
417
418
clear gt_stack3-r_kkbl_print.
419
420
else. "<<<Y6DK065711
421
if lflg_top_of_page = 'X' or
422
( ( gt_stack2-flg_append_mode = 'X'
423
or gt_stack-is_layout-block_mode = 'X'
424
) and
425
( not sy-subty o con_hex02 or
426
( gt_stack-is_layout-suppress_dynpro = 'X' and
427
lflg_new_page is initial ) ) ).
428
429
perform top_of_page2 using gt_stack-it_fieldcat "Y6DK065711
430
gt_stack-t_columns
431
gt_stack-is_layout
432
gt_stack-s_lprint
433
gt_stack2-s_header
434
gt_stack-listtype
435
gt_stack-i_callback_program
436
gt_stack-i_callback_top_of_page.
437
else.
438
* Provozieren des top_of_page Ereignisses
>>>>>
write space.
440
endif.
441
endif.
442
*--- Ende Top-of-page Handling
443
444
perform globals_for_output.
445
* Sichern Feldkatalog im Falle BEFORE_LINE_OUTPUT auf Zeilenbasis
446
* der Feldkatalog ver?dert wird
447
if not gt_stack2-i_callback_before_line_output is initial.
448
gt_fieldcat_sav[] = gt_stack-it_fieldcat[].
449
endif.
450
clear gflg_fc_changed.
451
452
stop_here con_bp-il2.
453
*--- Listenausgabe einfache Liste
454
if gt_stack-listtype = con_listtype-simple.
455
if gt_stack-is_layout-no_unit_splitting is initial and
456
gflg_safety is initial.
457
perform data_out_simple tables rt_outtab
458
using l_line
Regards,
Deepak -
How to generate a Spool based on output type in SAP Script
Hi all,
Is it possible to generate a spool based on output type for a SAP Script (without explicitly trigger in Tcode VF02 and selecting output type from there )
Actually a background job will be scheduled to process output types selected in VF01 / VF02
When output type is ZABC in the background a work flow is called pdf is generatedAny suggestions please
-
Creation of Spool File with Triggers
Hi,
I have created an OnUpdate trigger using the Essbase Console. I am using a calculation script to change the value of an account that is being used in the trigger. The trigger doesnot craete a spool file. Can anyone help me with it.Are you sure that the data value that should change did change?
Here I am plugging Glenn's presentation twice in like five minutes. Check out this (unrelated) thread -- it explains how to get to his Kaleidoscope presentation.
How to use a substitution variable in a load rule?
FWIW, this part of the presentation was really good (it was all good, but I particularly enjoyed this bit).
Regards,
Cameron Lackpour -
Inbound IDoc creating background job even for trigger immediately setup
All,
I have a very serious problem in our production system.
Scenario:
Vendor is chagend in system A (Outbound) and the same is interfaced to System B (Inbound) and i am using trigger immediately option, but still I am seeing a background job is created for 'RBDAPP01' and creating the spool request. The issue is I am sending 1000 of idocs and the spool number is increasing daily in system B.
So, can any one explain me why the background job is getting triggered even though I set the partner profile settings as 'Trigger Immediately'.
The above issue is not happening in our quality system it simply updagtes vendor information in system B with out creating any background job. Please note that the same settings are maintained in both the systems.
Your immediate inputs are really valuable for me.
Regards,
SumanThis is an performance issue on the receiving system. In case the system does not have enough resources to process the IDoc immediately it will always schedule a background job to ensure the processing of data.
You need to check whether the system has enough work processes available during the time when 1000 of IDocs are received or send the IDocs in packages with some time in between.
Regards,
Kai -
How to Trigger a Job from se38 Report
Hi,
I need to trigger a job from an se38 report program.
Currently the code I'm using is:
SUBMIT YARTZ_SPOOL
USER SY-UNAME
VIA JOB 'YARTZ_JOB2'
NUMBER 1
TO SAP-SPOOL
SPOOL PARAMETERS l_print_parms
WITHOUT SPOOL DYNPRO
AND RETURN.
But the SY_SUBRC return I get is 8 which stands for 'Error In job Scheduling'
Is the method used correct?
Or am i going wrong in scheduling the job? As far as Job scheduling goes, I used the Date/Time schedule and scheduled it at a time 20 minutes later.
Thanks.Hi,
use the code
IF p_bjob = 'X'.
CONCATENATE sy-cprog sy-datum sy-uzeit
INTO jobname SEPARATED BY '_'.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = jobname
IMPORTING
jobcount = jobcount
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
IMPORTING
out_archive_parameters = arc_params
out_parameters = print_params
valid = valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF valid = chk.
SUBMIT YARTZ_SPOOL
WITH <selection-screen parameters if any>
AND RETURN
USER sy-uname
VIA JOB jobname
NUMBER jobcount
TO SAP-SPOOL
SPOOL PARAMETERS print_params
ARCHIVE PARAMETERS arc_params
WITHOUT SPOOL DYNPRO.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = jobcount
jobname = jobname
strtimmed = 'X'
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
invalid_target = 8
OTHERS = 9.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
MESSAGE i029 WITH jobname.
ENDIF.
ELSE.
MESSAGE s000 WITH text-003.
STOP.
ENDIF.
ENDIF.
reward points if useful
regards,
Anji -
How to trigger a mail once BG job finished.
Hi,
Could anyone please let me know how to trigger a mail once Background job finished. I let you give one scenario where exactly I require this concept. Say, I execute t.code MB52 with particular variants in background to find stuck qty(s) of material(s) in given site(s).Now I want that system will trigger a mail to concern team once job finished.
Thanks,
AKYou can try using workflow transaction SBWP.
you need to create a distibution list in the above transaction and add the requested mail ids to it.
then when you create a jon using transaction SM37 you have the option SPOOL LIST RECIPIENT where you can add the created distibution list
so when ever the job has run sucessfully then a mail is sent to all the mail id's in the list.
hope this helps.
cheers
sundeep -
How to start a trigger in a begin/end block ?
Hi all, I need to start a trigger inside a block begin end in order to manage errors.
The trigger is created inside trigger_faef_c.sql as
CREATE OR REPLACE TRIGGER TRIGGER_FAEF
and I would like to start the trigger in another file "create_trigger.sql" with this format:
BEGIN
@trigger_faef_c;
EXCEPTION WHEN OTHERS THEN
dbms_output.Put_Line('#255#> Error in trigger_faef_c ' || Sqlerrm );
END;
I have this error executing the script:
PLS-00103: Encountered the symbol "@" when expecting one of the following:
begin case declare exit for goto if loop mod null pragma
raise return select update while with <an identifier>
<a double-quoted delimited-identifier> <a bind variable> <<
close current delete fetch lock insert open rollback
savepoint set sql execute commit forall merge pipe
The symbol "<an identifier>" was substituted for "@" to continue
Can anyone help me please ?
I have to use EXCEPTION WHEN OTHERS THEN.
Thansk
ErikHi Erik,
I think you mean Create the trigger(?), i.e, executing the trigger_faef_c.sql script.
SQL*Plus doesn't have exception handling (Someone please correct me if I'm wrong).
One way to circumvent that is to rewrite the script itself to PL/SQL. Something like:
Declare
stmt varchar2(32767);
Begin
stmt := 'Create Trigger ....';
Execute Immediate stmt;
Exception
When Others Then
--Do what?
End;
/And then just execute that
@trigger_faef_c.sqlDon't know if you want to go that way. I use it myself to be able to run the same deployment scripts multiple times, without causing various failures due to "Table Already Exists" and so on.
But, for triggers, I would never do that, since this has CREATE OR REPLACE.
For triggers, I just (This time script is plain static SQL)
WHENEVER SQLEXCEPTION CONTINUE
SPOOL deployment.log
@trigger_faef_c.sql
@other_script.sql
SPOOL OFF
EXITRegards
Peter -
How do you get a list of all the trigger DDLs?
I want to get a list of all the DB trigger DDLs of owner 'ABS'. I want to do it using 1 SQL statement.
This is what I ran:
SELECT
TO_CHAR(DBMS_METADATA.GET_DDL('TRIGGER', TRIGGER_NAME, 'ABS'))
FROM
ALL_TRIGGERS
WHERE
OWNER = 'ABS';
I get this error: [1]:
(Error): ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 4414, maximum: 4000)
Then I looked up in the web and they ask to use DBMS_LOB.SUBSTR instead. So I do that:
SELECT
DBMS_LOB.SUBSTR(DBMS_METADATA.GET_DDL('TRIGGER', TRIGGER_NAME, 'ABS'), 32767, 1)
FROM
ALL_TRIGGERS
WHERE
OWNER = 'ABS';
Now I get this error:
[1]: (Error): ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at line 1
Looks like you cannot show more than *4000* chars. There are 43 triggers whose DDL is more than 4000 chars long.
Why is this?
How can I solve my problem?
Edited by: Channa on Feb 16, 2010 9:45 PMHerald, fantastic news. SET LONG did the trick.
But I had to put a very big value. 32000 was not enough. Otherwise some of the triggers (big ones) got cut off.
This is my complete code which did it.
SPOOL F:\Channa\zz_zzTemp\Binuka\OutPut.txt
set trimspool on
set pages 0
set long *1000000000*
set linesize 32767
SET TERMOUT OFF
SELECT DBMS_METADATA.GET_DDL('TRIGGER', TRIGGER_NAME, 'ABS')
FROM ALL_TRIGGERS
WHERE OWNER = 'ABS' AND trigger_name NOT LIKE 'BIN$%'
SPOOL OUT
THANKS A LOT. REALLY APPRECIATE IT.
P.S: I had to include the NOT LIKE 'BIN$%' in the where clause because otherwise I got this error:
ERROR:
ORA-31603: object *"BIN$cqXDSqghrFngQKjAJAovgw==$0"* of type TRIGGER not found in
schema "ABS"
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.DBMS_METADATA", line 2805
ORA-06512: at "SYS.DBMS_METADATA", line 4333
ORA-06512: at line 1
no rows selected
I THINK BIN$... triggers are dropped triggers in the DB recycle bin???
Edited by: Channa on Feb 17, 2010 2:58 AM
Edited by: Channa on Feb 17, 2010 3:01 AM -
Trigger works fine in Toad but not in the Application Form
Hi All,
I created a trigger that executes BEFORE UPDATE ON PO_REQUISITION_LINES_ALL. When I exceute in Toad a manual update on this table, the trigger appears correctly, but When I am on PIC form in PO, and execute save with blank value, the trigger doesn't work and doesn't appear.
Do you know which is the reason?.
Regards,
Mariano.-Hi Srini,
The problem is on Form POXRQERQ.fmx on PIC transactions. Trigger works fine If a create a new transaction. Because the message appears correctly in the screen, but when I update and change a value in the specific field on the screen, the message of the trigger doesn't appear and I don't know why...
Please Help Me!
Regards Mariano.-
Version Of Application : 11.5.8
Version Of Database : Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
Version Of OS : AIX Version 5.3!
PROMPT Creating TRIGGER XX_PO_Espec_Iweb_Requis ...
CREATE OR REPLACE TRIGGER XX_PO_Espec_Iweb_Requis
BEFORE UPDATE OR INSERT ON PO_REQUISITION_LINES_ALL
FOR EACH ROW
DECLARE
BEGIN
RAISE_APPLICATION_ERROR(-20000,'You couldn't update or insert the PIC');
END;
SHOW ERRORS
SPOOL OFF -
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) -
Essbase trigger error : Application shuts down
Hi,
I am implementing a trigger in Essbase BSO application. Trigger is as below
CREATE OR REPLACE TRIGGER 'SPMTEST'.'SPMTEST'.'SPMONUPD'
WHERE (Jan,[2010], Sales, Actual, [100-10], [New York])
WHEN Jan > 20 and Jan < 25 THEN SPOOL EssSPM
WHEN Jan > 30 THEN SPOOL ESSSPMTEST
END
But when I lock send value from excel to the above intersection, its gives me error as
Network Error [10054] : cannot receive data.
also in the application log it logs following,
[Thu Jul 15 17:10:15 2010]Local/SPMTEST/SPMTEST/admin/Info(1020082)
Spreadsheet Extractor Big Block Allocs -- Dyn.Calc.Cache : [0] non-Dyn.Calc.Cache : [0]
[Thu Jul 15 17:10:17 2010]Local/SPMTEST/SPMTEST/admin/Info(1008106)
Exception error log [D:\Hyperion\logs\essbase\app\SPMTEST\SPMTEST\log00012.xcp] is being created...
[Thu Jul 15 17:10:18 2010]Local/SPMTEST/SPMTEST/admin/Info(1008107)
Exception error log completed D:\Hyperion\logs\essbase\app\SPMTEST\SPMTEST\log00012.xcp please contact technical support and provide them with this file
[Thu Jul 15 17:10:18 2010]Local/SPMTEST///Info(1002089)
RECEIVED ABNORMAL SHUTDOWN COMMAND - APPLICATION TERMINATING
Has anyone got with above scenario. Kindly help to resolve problem.
Email : [email protected]
Thanks and Regards
Shyamkant
Edited by: user11292324 on Jul 15, 2010 4:56 AMThis is my VI, i use a "simulate signal" to generate my sine signal. I used other waveform generators but i keep having the same prob. When i use digital i/o or analog dc out, i have no probs.
Attachments:
AC uit sinus.vi 113 KB -
Hi all,
i am using call transaction in my program and collectiong messages into megtab(of type bdcmsgcoll)..
1)can anyone please tel me how to process the messages and
2) how to send the messages to spool
SAISai Ram,
after you getting the messages
loop at it_msg.
call function 'MESSAGE_PREPARE'
endloop.
pass appropriate params to the above FM.
now you have the messages , using NEW-PAGE PRINT ON.
you can trigger the spool job.
DATA: L_PARAMS TYPE PRI_PARAMS,
L_VALID TYPE C.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
IMMEDIATELY = ' '
LINE_SIZE = 220
LAYOUT = 'X_65_255'
RELEASE = ' '
MODE = 'CURRENT'
NO_DIALOG = ' '
IMPORTING
OUT_PARAMETERS = L_PARAMS
VALID = L_VALID
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4.
NEW-PAGE PRINT ON PARAMETERS L_PARAMS NO DIALOG.
PERFORM DISPLAY_REPORT. "here you call your write statements.
NEW-PAGE PRINT OFF.
Regards
Vijay
Maybe you are looking for
-
PO based on used on userid &status have to filter
Hi Guys, Current logic to display u201Cheldu201D status purchase order is as follow. Data: Organization structure User1---Purchasing group2 User2---Purchasing group4 User3---Purchasing group6 User4--- No purchasing group Current Result When the user1
-
XL Reporter Sample AR Aging Report by Transaction come up blank
Hi, I am running B1 2007 with PL38. I downloaded the sample AR Aging Report by transaction from SAP but when I generated the report, I get the worksheet with blank Data. Can anyone make any suggestions. Regards, Peter To
-
Sanyo Phone always mounts read-only
I recently purchased a Sanyo M1 phone that has a USB mass storage mode. The phone has 1GB of internal memory that is formatted with FAT16. When connected via a USB cable, a "SANYO" drive appears on the desktop, and is labeled "/Volumes/SANYO". This d
-
Can i uninstall the pre-installed final cut express?
There is the deal that when you buy a new mac you save a lot on final cut express. The only problem is it comes pre-installed. Could i uninstall it where i could use it on a different computer?
-
The cost to add channel SNY?
WHAT IS the cost to add channel SNY?