APEX_PLSQL_JOB.SUBMIT_PROCESS / Process Type "PLSQL DBMS JOB"
Has anyone got APEX_PLSQL_JOB.SUBMIT_PROCESS to work? I've seen several threads which my exact problem but am unsure if anyone has got it to work.
Here is my process:
declare
jobnumber number;
begin
IF apex_plsql_job.jobs_are_enabled THEN
jobnumber := apex_plsql_job.submit_process(
p_sql => 'insert into temp_jobtest
values (''APEX PLSQL Job'',sysdate);
commit;');
END IF;
end;Process runs and APEX_PLSQL_JOBS shows SYSTEM_STATUS as "COMPLETE" but no rows are ever added to the temp_jobtest table. I tried submitting directly using dbms_job and it worked as expected.
I have read: Background jobs
I really wish we could still create a process type of (PLSQL DBMS JOB). If this functionality has been deprecated then why is it still referenced in the User Guide?
From the APEX User Guide, Release 2.2, B28550-01, July 2006; page 13-15; heading - "Using a Process to Implement Background PL/SQL"
The simplest way to implement the APEX_PLSQL_JOB package is to create a page
process that specifies the process type PLSQL DBMS JOB. By selecting this process
type, Application Builder will submit the PL/SQL code you specify as a job.
"Ok, I do see it.....if I was still working in a version pre 2.0"
Which is exactly what I have done. I had access to a HTMLDB 1.5 environment.
--I create a new application in 1.5 with 1 page.
--Added a page process with a process type of "PL/SQL DBMS JOB".
--Exported the application.
--Import the application into APEX 2.2 environment
--copy page from imported application to my application
--copied the process from my copied page to the page in my application where I want the process
So far it is working just as I expected.
Thanks Jeleeb! I present you with a silver medal.
Similar Messages
-
PLSQL DBMS JOB - how to schedule ?
Hi, I came across the process type "PLSQL DBMS JOB" - how can I schedule it within APEX?
I understood using PLSQL DBMS JOB it just executes once and thats it.
I like to use the process PLSQL DBMS JOB to execute once a day and call a procedure I have defined already. A code example wud be v.m. appreciated.
TIA
BernhardFirst you need to make sure your init.ora has the following things defined<br><br>
job_queue_processes=2<br>
job_queue_interval=10<br>
<br>the value above are recommended by Oracle<br><br>when I did this and restarted the database with the new init.ora (or pfile) it said something was no longer used so what I am suggesting above may not be entirely required but it seems to have worked for me...
<br><br>
then its just a case of executing the following<br><br>
declare<br>
jobno number;<br>
BEGIN<br>
dbms_job.submit(JobNo, 'begin my_thing_to_execute; end;', SYSDATE,
'SYSDATE + 1/24');<br>
COMMIT;<br>
dbms_output.put_line(jobno);<br>
END;<br>
<br>
the first sysdate is when to run next, the second sysdate+1/24 is how often to run so this is saying run hourly. if you want daily then it would be just +1.<br><br>that should get ya going to start with anyway. it can pay to put a little insert into a dummy table in your code that you want the dbmsjob to execute so then you know for sure that its working.<br><br>if you are talking about a dbms job thing in APEX then this is probably irrelevant as this is a dbmsjob in the database, not through APEX -
Problem with PLSQL dbms job in apex
Hi,
I am completely new to apex, and am facing a issue which i feel is strange.
There is a button on the apex page and a process is associated with that button. Some tables are being updated in the code written in that process and a db procedure is called which creates some files on the unix box(utl_file). The type of that process is PLSQL DBMS job.
Now its been observed that the code written on that button is executed at odd times i.e no one made any action on the button.
So my questions are,
Is this PLSQL DBMS job same as that of the database dbms_job?? but the logs have no entry.
Is there a case when the button might be pressed earlier but the job executed late because of resources not being available?
Any logs created by apex so that i can track the job??
Any idea if i can replace this plsql dbms job with any other process type??
Secondly, there are 4 files being generated out of which 3 are generated with 644 permission and 1 file is generated with 600. Why does this happen?
Apex version :3.1
db version: 10.2.0.4
Regards,
AnkitLooks like it's still a database bug. In 10.1.0.4, I get the correct results in sqlplus from the query but I get incorrect results in sqlplus if I do it like this:set serveroutput on
declare
l_cursor integer := DBMS_SQL.OPEN_CURSOR;
l_desc_tbl DBMS_SQL.DESC_TAB2;
l_ignore number;
l_col_cnt integer;
l_col_val varchar2(32767);
BEGIN
DBMS_SQL.PARSE(l_cursor,
'select connect_by_isleaf LEAF,DESCRIPTION,PLACE from test_tab start with id = 1 connect by prior id = id_master',
DBMS_SQL.NATIVE);
l_ignore := DBMS_SQL.EXECUTE(l_cursor);
DBMS_SQL.DESCRIBE_COLUMNS2(l_cursor, l_col_cnt, l_desc_tbl );
for i in 1 .. l_col_cnt loop
DBMS_SQL.DEFINE_COLUMN(l_cursor, i, l_col_val, 32767 );
end loop;
while (DBMS_SQL.FETCH_ROWS(l_cursor) > 0)
loop
for i in 1 .. l_col_cnt loop
DBMS_SQL.COLUMN_VALUE(l_cursor, i, l_col_val);
-- print the column value
dbms_output.put_line(l_col_val);
end loop;
dbms_output.put_line(chr(10));
END LOOP;
if DBMS_SQL.IS_OPEN(l_cursor) then
DBMS_SQL.CLOSE_CURSOR(l_cursor);
end if;
END;
/Scott -
APEX_PLSQL_JOB.SUBMIT_PROCESS with no results
Hi,
When I run APEX_PLSQL_JOB.SUBMIT_PROCESS I can see the process ran in the view APEX_PLSQL_JOBS from the sql workshop, but nothing has happened.
For instance: when I submit the following, no results show up in the table.
Any ideas as to how I can check what's going wrong?
DECLARE
t_job_id NUMBER;
t_sql VARCHAR2(4000);
BEGIN
t_sql := 'BEGIN INSERT INTO EXAMPLE ( COL1, COL2, COL3, COL4) '||
' VALUES (1, 763707, 20, 30 ); END; ';
t_job_id := APEX_PLSQL_JOB.SUBMIT_PROCESS (p_sql => t_sql);
apex_debug_message.log_message('Job started: '||t_job_id);
COMMIT;
END;
I am using APEX version 4.1.1.00.23 on Oracle 11gHi,
When I run APEX_PLSQL_JOB.SUBMIT_PROCESS I can see the process ran in the view APEX_PLSQL_JOBS from the sql workshop, but nothing has happened.For instance: when I submit the following, no results show up in the table.
Any ideas as to how I can check what's going wrong?
>
This may be because the job has an error. Check DBA_ERRORS View for errors.
Always post your code snippets in a pair of {code} tags as explained in the FAQ.
>
DECLARE
t_job_id NUMBER;
t_sql VARCHAR2(4000);
BEGIN
t_sql := 'BEGIN INSERT INTO EXAMPLE ( COL1, COL2, COL3, COL4) '||
' VALUES (1, 763707, 20, 30 ); END; ';
t_job_id := APEX_PLSQL_JOB.SUBMIT_PROCESS (p_sql => t_sql);
apex_debug_message.log_message('Job started: '||t_job_id);
COMMIT;
END;I am using APEX version 4.1.1.00.23 on Oracle 11g>
In the above code, are all the columns of type Number? VARCHAR2 columns will need to be in quotes, right?
Also check the Debug report of the page after running it in Debug mode. Maybe you will get some clues there too.
Cheers, -
Apex_plsql_job.submit_process job not Working through Apex
Hi,
I am using Apex 4.2 and Oracle DB 11g.
I have a process (which calls a procedure) to run on page load which is taking quiet some time (more than a min) so I thought of using Apex_Plsql_job API. It is submitting the job (though it is submitting the job to DBA_JOBS rather than APEX_PLSQL_JOBS as said by Doc which even disappears in no time from dba_jobs).
declare
l_sql VARCHAR2(4000);
l_job NUMBER;
begin
l_sql := 'BEGIN Pkg.procedure(param1); END;';
l_job := APEX_PLSQL_JOB.SUBMIT_PROCESS(p_sql => l_sql, p_status => 'Background process submitted');
end;
Now My issue is the procedure is not being called. Am I missing something. Can anyone help me pls.
Thanks,
ShoaibHi,
APEX_PLSQL_JOB package works just fine for me.
What I did check your code I think there is mistake. You have not declare parameter "param1" for job PL/SQL code
Maybe code should look like this
DECLARE
l_sql VARCHAR2(4000);
l_job NUMBER;
BEGIN
l_sql := q'!DECLARE param1 VARCHAR2(255) := 'MY_VALUE'; BEGIN Pkg.procedure(param1); END;!';
l_job := APEX_PLSQL_JOB.SUBMIT_PROCESS(p_sql => l_sql, p_status => 'Background process submitted');
END;
Or something like
DECLARE
l_sql VARCHAR2(4000);
l_job NUMBER;
BEGIN
l_sql := 'BEGIN Pkg.procedure(' || Px_MY_ITEM || '); END;';
l_job := APEX_PLSQL_JOB.SUBMIT_PROCESS(p_sql => l_sql, p_status => 'Background process submitted');
END;
Regards,
Jari -
Hello ghurus,
I am running APEX 3.1 on Oracle 10g 10.2.0.1 and am trying to run a potentially long running procedure in the background so the user doesn't have to sit and watch the hourglass.
The button process has the following code:
DECLARE
return_code NUMBER;
exec_stg VARCHAR2(4000);
squote VARCHAR2(1) := chr(39);
edit_cnt NUMBER;
BEGIN
SELECT COUNT(*)
INTO edit_cnt
FROM edit_history eh
WHERE eh.rept_inst = :f104_curinst
AND eh.rept_time_frame = :f104_curterm
AND eh.submission = :f104_cursubm
AND eh.edit_complete_dtm IS NULL;
univdb.exception_logging.insert_log(0, 'NO SQL ERROR', 'apex_editsubm','count=' || to_char(edit_cnt));
IF edit_cnt = 0
THEN
INSERT INTO univdb.edit_history
(rept_inst,
rept_time_frame,
submission,
audit_id)
VALUES
(:f104_curinst,
:f104_curterm,
:f104_cursubm,
:app_user);
COMMIT;
univdb.exception_logging.insert_log(0, 'NO SQL ERROR', 'apex_editsubm',
'insert row successful');
exec_stg := 'univdb.edit_any_submission(' || squote || :f104_curinst ||
squote || ', ' || squote || :f104_curterm || squote || ', ' ||
squote || :f104_cursubm || squote || ', ' || squote ||
:app_user || squote || ');';
univdb.exception_logging.insert_log(0, 'NO SQL ERROR', 'apex_editsubm',exec_stg);
return_code := apex_plsql_job.submit_process(exec_stg);
univdb.exception_logging.insert_log(0, 'NO SQL ERROR', 'apex_editsubm','return_code=' || to_char(return_code));
commit;
END IF;
END;
The calls to exception_logging write a row to a table so I can see what's happening in the process and I get the following rows writte:
count=0
insert row successful
univdb.edit_any_submission('UNIV', '200701', 'TEF', 'ELSA_LESLIE');
return_code=103
The last message implies to me that the job was successfully submitted but when I query the apex_plsql_jobs table, job 103 does not exist and the procedure never gets executed. The procedure does work when tested outside of APEX.
I checked all of my grants according to the post in this thread and they are all there:
Re: Missing apex_plsql_job in 3.1
Does anyone have a suggestion?
...elsaHi Elsa
I am also having similar problems calling the APEX_PLSQL_JOB.SUBMIT_PROCESS as well where it doesn't insert into the APEX_PLSQL_JOBS table.
I also noticed that you used SCHEDULER. One of the challenges we are having is when the user presses the submit button, the browser hangs and doesn't return the result set until the process is complete. This process can take 20 mins before the screen loads saying the process was finished. I have tried used DBMS_JOB as we aren't on 10g and can not use SCHEDULER, but still having that issue where the user has to wait 20 mins before the process finishes.
Did you ever solve that problem where the user clicks the button and then a page is returned immediately while the job is firing away with scheduler
Any help would be great and much appreciated.
Thanks -
CHAIN: custom process type: EVENT: complex status: bad planned jobs
Hi experts,
I've implemented a custom process type (in RSPC/Settings/MaintainProcess) called ZWX_COND.
The main properties of ZWX_COND are: "ZCL_RSPC_DECISION" as ObjectTypeName, "00 ABAP Class" as ObjectType and "(Scheduled) processs ends with complex status" as PossibleEvents.
Class ZCL_RSPC_DECISION is a copy of the standar one CL_RSPC_DECISION. I've only made the necessary changes in methods GET_EVENTS and GET_EVENT (I only need two events) and EXECUTE (to choose one of the two events depending on a customized table).
I've made a main process chain with that new type (a decision step). I've connected that step with the process chain "A" for case 01 and with the process chain "B" for case 02. I've verified the main process chain and all is correct.
Once I've activated and planned the main process chain, un unknown job BI_PROCESS_CHAIN appears. In addition, although the decision step ends correctly (green color) and the event RSPROCESS with parameter XXXX_02 is triggered (it's correct, since it's indicated in that way in the customized table), process chain "B" doesn't start. In fact, neither process chain "A" nor process chain "B" starts. Both process chains remain in yellow color, but the corresponding jobs are not activated or finished, they are just released.
I see that the start condition (event parameter) for the planned jobs corresponding to process chains "A" and "B" is incorrect, since it is XXXX in both cases. I think the condition must be XXXX_01 for process chain "A" and XXXX_02 for process chain "B".
I'd like to implement this process type because I want the process to end with a green status. If I use a custom process type with events "succesfull" or "incorrect", I can make the decision and the chain process works, but the process chain ends with red status when the event triggered is the "incorrect" one.
Please, could somebody help me? I don't know if it's a program error or I'm implementing it in the wrong way.
Thanks in advance,
César Rueda
PS. Sorry by my English
Message was edited by:
César Rueda
Message was edited by:
César RuedaHi,
i am experiencing the same thing .... have you got an answer , i did not see any notes on this type of issue . -
Syntax for APEX_PLSQL_JOB.SUBMIT_PROCESS with an OUT parameter
Hi All,
I am using APEX_PLSQL_JOB.SUBMIT_PROCESS and calling a procedure that has both an IN and an OUT parameter.
The IN parameter works fine; I am able to call my procedure from APEX and pass it the :APP_JOB item as the IN parameter. The OUT parameter I can't get working. I can call my procedure from a different block in SqlDeveloper and everything works, so I'm confident that my procedure code is correct. I just can't get the OUT parameter returned via APEX.
This is the plsql code that I'm calling from an APEX dynamic action:
DECLARE
l_sql VARCHAR2(4000);
l_instance VARCHAR2(30);
l_job number;
l_rows_processed number;
BEGIN
l_instance := :P9_INSTANCE;
l_sql := 'BEGIN update_tl_tables_1(:APP_JOB, :F103_ROWS_PROCESSED); END;';
l_job := APEX_PLSQL_JOB.SUBMIT_PROCESS( p_sql => l_sql, p_status => 'Background process submitted');
l_rows_processed := :F103_ROWS_PROCESSED;
insert into gse_lng_jobs (instance, job_id, rows_processed) values (l_instance, l_job, l_rows_processed);
COMMIT;
END; My procedure is created as:
create or replace
procedure UPDATE_TL_TABLES_1 (l_app_job IN number, l_rows_processed OUT number)
IS......Again, this works fine from SqlDeveloper. Can anyone suggest the proper plsql code? I've tried this using a page item, a system item etc. and no luck. I first tried just passing my procedure a local variable like l_rows_processed, but the procedure wouldn't even run, so I'm assuming the API needs an actual APEX item but I'm out of ideas here.
thanks in advance,
johnThat's not going to work because the job hasn't run yet when you perform the insert. So :F103_ROWS_PROCESSED wont contain anything useful.
Why don't you try performing the insert as part of the job, e.g.
l_sql := 'BEGIN update_tl_tables_1(:APP_JOB, :F103_ROWS_PROCESSED); insert into gse_lng_jobs (instance, job_id, rows_processed) values ('''||l_instance||''', '||l_job||', :F103_ROWS_PROCESSED); END;';
...something like that. -
How to Reschedule the DBMS jobs after Cloning
Hi ,
Before Cloning , i took the backup of dbms jobs using the command
SELECT job, what, next_date, next_sec FROM dba_jobs;
After the clone is done , how should I resubmit the job?. Do we need to submit the job using the plsql block with commit in like below
VARIABLE jobno NUMBER
BEGIN
DBMS_JOB.SUBMIT(:jobno,
what=>'statspack_alert.sql;',
next_date=>sysdate,
interval=>'sysdate+1' );
COMMIT;
END;
or
Can I submit the jobs directly like below
Execute dbms_job.submit(
what=>'statspack_alert.sql;',
next_date=>sysdate,
interval=>'sysdate+1');
In the plsql block , can i hard code the job number?.
If we are using the bind variable, when the job is sumbitted , does it get assigned with job number?
Do we need to submit the job as the owner of that job or sysdba can submit the job on behalf of the owner?
Please address my questions
Thanks
NaveenCan I submit the jobs directly like below
Execute dbms_job.submit(
what=>'statspack_alert.sql;',
next_date=>sysdate,
interval=>'sysdate+1');What happens when you actually do it?
Why ask us rather than do it yourself?
PROCEDURE SUBMIT
Argument Name Type In/Out Default?
JOB BINARY_INTEGER OUT
WHAT VARCHAR2 IN
NEXT_DATE DATE IN DEFAULT
INTERVAL VARCHAR2 IN DEFAULT
NO_PARSE BOOLEAN IN DEFAULT
INSTANCE BINARY_INTEGER IN DEFAULT
FORCE BOOLEAN IN DEFAULT
In the plsql block , can i hard code the job number?.NO
If we are using the bind variable, when the job is sumbitted , does it get assigned with job number?yes, see above
Do we need to submit the job as the owner of that job or sysdba can submit the job on behalf of the owner?No option to assign OWNER, so need to CONNECT as desired owner before DBMS_JOB.SUMBIT -
Hi!
Oracle 10.2.0.4 32, Apex 4.0.2, BIP 10.x Win.
I have to generate cca. 1000 reports in PDF (some customer bills) through BI Publisher print server.
PDF is defined through "Reports queries" and "Reports layouts" directly defined from Apex env. Report template is Word RTF file. Report query has one parameter:
and R.BILL_ID = :G_BILL_IDRunning from App page process it is not acceptable to do that because operation should takes hours and user cannot have open freezed browser.
So I found out "APEX_PLSQL_JOB.SUBMIT_PROCESS", which submit process in "job" as background process.
On page I left just "SUBMIT_PROCESS" call:
BEGIN
APEX_PLSQL_JOB.SUBMIT_PROCESS ('begin bills_pkg.generate_biils; end');
END;and put the whole logic in package. Small problem was to change Apex item (Application item), what I solved and change with:
APEX_UTIL.set_session_state(p_name => 'G_BILL_ID', p_value => cur_array(i).B_ID);for every record in cursor (I know his is not optimal but I just wanted to get working demo).
Call from package procedure is like (slightly modified from Apex page process which was working!):
open cur;
-- assign to have that value as parameter for !??
APEX_UTIL.set_session_state(p_name => 'G_BILL_ID', p_value => cur_array(i).B_ID);
print_one_report (cur_array(i).B_ID);
close cur;where "print_one_report" is mine procedure which saves PDF in db (proc was the same as before when was working but with too long result).
Unfortunately then all generated PDF reports (which I save in database) has 0 bytes length (I call the same procedure called as before when reports were generated but from Apex page process directly).
Seems that "G_BILL_ID" is no longer having correct values ... like session problems.
How to achieve and fix that (generate PDF from cursor) or is there any article how to manage BI Publisher printing with APEX_PLSQL_JOB.SUBMIT_PROCESS?
Rg,
Damir Vadas
P.S.
Should
apex_custom_auth.define_user_session (p_user, p_session_id );
apex_application.g_flow_id := p_app_id;might help?
Edited by: user1050751 on May 13, 2011 12:57 PMDamir,
Here is one way that you could get a background job to create your thousand reports (4 steps).
1st define your report query and layout within APEX (and BI-Publisher builder - Word plugin).
2nd write a custom process to call apex_util.get_print_document to generate your 1000 reports and place them in a blob column.
http://download.oracle.com/docs/cd/E17556_01/doc/apirefs.40/e15519/apex_util.htm#CHDDECIA
DECLARE
l_document BLOB;
l_security_group_id NUMBER;
CURSOR your_cur IS
SELECT...your thousand records
BEGIN
wwv_flow_api.set_security_group_id(p_security_group_id);
l_security_group_id := wwv_flow_api.get_security_group_id;
FOR your_rec IN your_cur LOOP
BEGIN
set any item values that will be referenced in your report query here
l_document := APEX_UTIL.GET_PRINT_DOCUMENT (p_application_id => v_your_app_id,
p_report_query_name => v_your_defined_report_name,
p_report_layout_name => v_your_defined_layout_name,
p_report_layout_type => 'rtf',
p_document_format => 'pdf',
--p_print_server =>
INSERT INTO your_table... id, l_document, file_name, mime_type...
COMMIT;
EXCEPTION
WHEN others THEN
write an error to a job log...
END;
END LOOP;
EXCEPTION
WHEN others THEN
write an error to a job log...
END;3rd write logic that will submit your custom process using APEX_PLSQL_JOB.SUBMIT_PROCESS or you can use dmbs_scheduler package.
4th write code to retrieve the report data from the blob column and display or distribute to users.
I've never called the apex_util.get_print_document recursively like this before so I'm not sure how it will perform. There are 4 versions of the get_print_document API so use the one that best fits your needs with performance in mind.
After writing the above logic I found this post that is very similar.
Scheduling reports with dbms_scheduler
An alternative method to what I've listed above is scheduling reports using the Bi-Publisher web service.
http://bipconsulting.blogspot.com/2010/04/how-to-schedule-report-with-bi.html
Regards,
Todd
Edited by: tfa on May 16, 2011 8:03 AM -
APEX_PLSQL_JOB.SUBMIT_PROCESS not working
Hi,
I'm trying to run APEX_PLSQL_JOB.SUBMIT_PROCESS (see: [http://download.oracle.com/docs/cd/E14373_01/apirefs.32/e13369/apex_plsql_job.htm#insertedID3|http://download.oracle.com/docs/cd/E14373_01/apirefs.32/e13369/apex_plsql_job.htm#insertedID3]
I have on an On Load before Header page process:
DECLARE
v_num PLS_INTEGER;
BEGIN
IF apex_plsql_job.jobs_are_enabled THEN
HTP.p ('Jobs are enabled on this database instance.');
ELSE
HTP.p ('Jobs are NOT enabled on this database instance.');
END IF;
v_num := apex_plsql_job.submit_process (p_sql => 'BEGIN null; END;'); -- I kept the sql code to a minimum for demonstration purposes
HTP.br;
HTP.p (v_num);
END; The output is:
Jobs are enabled on this database instance.
+10083+
It seems to work (no errors) but it is not registering in the APEX_PLSQL_JOBS view. When I do have "working" code in the p_sql parameter I know it isn't getting executed.
SELECT *
FROM apex_plsql_jobsAny ideas on this? I'm using APEX 3.1.2 on Oracle 10.2.0.4.0
Thank you,
Martin
[http://apex-smb.blogspot.com/]Hi Martin,
If it is in the WWV_FLOW_JOBS table then the job has been submitted successfully. Is the system_status column set to 'COMPLETE'?
You only need to set the security group if you are running the code outside of APEX.
Have a look at my example on apex.oracle.com
Workspace : EDIDEV
Username : USER
Password : jadohi
Run App Flow Jobs Example - 33462
Enter a value in Enter Val Text field and press Submit
The process will insert a record in the flow jobs table, you may need to press refresh to see the job complete and for the value to appear in the PT_TEMP_TABLE
Regards
Paul -
How to Send an Email to Outlook using process type in RSPC?
Hi,
How to Send an Email to Outlook using process type in RSPC?
We created lot of process variants, actually we want to send an mail to users if the DP Background job was succesfully finished.
Actually i tried with create message its not happening...
Plz let me know .. its urgent ...
Regards,
SatishHello Satish,
If you want to send a friendly message to your users, then you can do this by building an ABAP program that calls function module SO_NEW_DOCUMENT_SEND_API1 . You can then insert this ABAP program in your process chain (using the ABAP program process type) or as a second step in your background job. With this technique, you can send an email to SAP users, or to external users (e..g Outlook email addresses)
Here's a sample ABAP code:
data: ls_docdata type SODOCCHGI1,
lt_objcont type table of solisti1,
lt_receivers type table of somlreci1,
ls_objcont type solisti1,
ls_receivers type somlreci1,
ls_user type syuname.
* Fill these variables with subject and msg lines that you need.
data: MAIL_SUBJECT TYPE STRING,
MSG_LINE1 TYPE STRING,
MSG_LINE2 TYPE STRING,
MSG_LINE3 TYPE STRING,
MSG_LINE4 TYPE STRING,
MSG_LINE5 TYPE STRING.
ls_docdata-obj_descr = mail_subject.
ls_objcont-line = msg_line1.
append ls_objcont to lt_objcont.
ls_objcont-line = msg_line2.
append ls_objcont to lt_objcont.
ls_objcont-line = msg_line3.
append ls_objcont to lt_objcont.
ls_objcont-line = msg_line4.
append ls_objcont to lt_objcont.
ls_objcont-line = msg_line5.
append ls_objcont to lt_objcont.
* t_userlist contains the list of users to whom th email will be sent.
loop at t_userlist into ls_user.
ls_receivers-receiver = ls_user.
"Change the type here if email is for outlook users, See documentation
" of function module in SE37
ls_receivers-rec_type = 'B'.
ls_receivers-express = 'X'.
append ls_receivers to lt_receivers.
endloop.
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
EXPORTING
document_data = ls_docdata
tables
OBJECT_CONTENT = lt_objcont
receivers = lt_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
You can test out the function module first in SE37 (just put the name of the FM and click execute). Testing it in SE37 will help you get your parameters right.
Hope this helps. -
HI all;
I want to cancel the process type if it takes let's say more than 2 hrs.; the reason is sometimes the rollup job don't finish and just hang it forever...until more than 12 hrs and we have to manually cancel the job in the morning when we come to the office. This is affecting the runstats job when we do after the process chain completes.
so, is there any set up that I can do to cancel the process types let's say rollup for a cube if this doesn't finish by 2 hrs automatically.
thank you.Bhanu;
they are SEM cubes; and there are several situations sometimes the rollup gets stucks..; for example if some users do the planning in the same cube, or locks.,,etc..we tried to tell all the planner not to do any activities during the daily process chain time. we are doing rollup and compress every day for the sem cubes. -
Process Types in Process Chains - Loading - Repeatable/repairable
Hi,
I know SAP recommends that we do not change the properties of the Process Types for Process Chains. I want to know if any one has ever changed the property of "LOADING" process type to "repeatable" or "repairable". We are keen to change this attribute of "LOADING" process to repeatable. Any experiences, good or bad, would be highly useful to us to take a decision and would be highly appreciated.
regards
UdayHi Simon,
So far, I have not come across any documents that explain the difference between the two options. But, I believe the 'repairable" would start from where it has stopped in the program calles, while "repeatable" will restart the current job (not the whole process chain) from the start. Please remember to post it here, if you ever come across any documentation on these options.
Uday -
Hi,
Can anybody pl tell me the difference between Scheduled Job and Released job in background processing. Or send me some doc regarding types of background jobs.
Thanks...
HardikThere are two ways to schedule a job from a program:
1. the "express" method using the BP_JOBVARIANT_SCHEDULE function module
2. the "full-control" method using the JOB_OPEN, JOB_SUBMIT, and JOB_CLOSE function modules.
With this method, you have full control over such job options as printing, start time options, and so on.
To schedule a job from within a program using the express method, you need only call the BP_JOBVARIANT_SCHEDULE function module.
With BP_JOBVARIANT_OVERVIEW, you can offer your users a simplified display and management function for their "express-method" jobs.
call function 'BP_JOBVARIANT_SCHEDULE'
exporting
title_name = 'Documentation Check' " Displayed as title of
" of scheduling screens
job_name = 'DocuCheck' " Name of background
" processing job
prog_name = 'RSTWGZS2' " Name of ABAP
" report that is to be
" run -- used also to
" select variants
exceptions
no_such_report = 01. " PROG_NAME program
" not found.
call function 'BP_JOBVARIANT_OVERVIEW' " List the jobs that
exporting " have been scheduled
title_name = 'Documentation Check' " Displayed as title
" of overview screen
job_name = 'DokuCheck' " Jobs with this name
" are listed
prog_name = 'RSTWGZS2'
exceptions
no_such_job = 01.
For further information check the link below
http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/3a80eb505211d189550000e829fbbd/frameset.htm
Maybe you are looking for
-
HTML special characters in form input
In my site I store form input in my database. Before I store the data, I parse out smart quotes, en dashes, and other extended special characters and convert them into HTHML quivalents such as ’ All is well and good until the user goes to edit their
-
We set up the Data Management Gateway and created a new data source (odata to SQL via sqL user) Did a connection test and it was successful! Tried the URL (maybe it needs more): https://ourdomain.hybridproxy.powerbi.com/ODataService/v1.0/odatatest Th
-
Back fell off pavilion dm1-4027sa how do I get it back on?
I dropped my notebook and the back fell off everything works but I can't get the back on how do I do it?
-
JRun 4 Update 7 with Myeclipse load class conflict
Hi, I have installed JRun 4 with Updater 7 and Myeclipse. I run my web application on jrun 4 under myeclipse 6.0.1, but I got an error message. Next, I set, in jrun-web.xml, false to <load-system-classes-first> and I got another error which states th
-
How to sort folios on Library View
Hello: Is there a way to sort the folios in the Library? I know they appear on the library in the order you published them on the Folio Producer but wanted to know if there's a way to do it (maybe changing the cover date or something else) Saludos,