Submit job in Apex
Hi ,
How do we submit a job in apex .Iam using dbms_scheduler in apex ...Its not working ..can anyone help me out plzzzz..
Hi 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
Similar Messages
-
Submit background job in APEX -- count on all_jobs return shadow jobs.
Hi, I am trying to submit a job in APEX. The setups are as below:
On Submit - After Computation and Validations
Run Process: Once Per Page Visit
Process:
DECLARE
v_instance_cnt NUMBER;
job_no NUMBER;
BEGIN
SELECT COUNT(0)
INTO v_instance_cnt
FROM user_jobs
WHERE what LIKE 'pagl_refresh.master_refresh%';
IF NVL(v_instance_cnt,0) = 0 THEN
DBMS_JOB.SUBMIT(job_no, 'pagl_refresh.master_refresh('''||:G_BSYS_USER_NAME||''');');
:P3_MESSAGE:= 'Job has submitted. Number is '||TO_CHAR(job_no);
ELSE
:P3_MESSAGE :='The refresh is in progress. Please wait ... ('||to_char(v_instance_cnt);
END IF;
END;
Now, if I run the process, the :P3_MESSAGE message returns "'The refresh is in progress. Please wait ... (5)." . This is due to the count is 5 instead of expected 0.
If I SELECT count(*) FROM dba_jobs WHERE lower(what) LIKE 'pagl_refresh.master_refresh%'; in SQLPLUS, it returns 0. Same result from all_jobs as well.
My suspect is that it returns job counts include those that has been removed before. Yet, how APEX can see this? Does APEX use some special way to look into Job queue?
Please help
ThanksFrom the looks of it, the job is being submitted and run - although I would check the elapsed time to see if it's anywhere close to the 20-30 minutes you anticipate. Assuming not, I would suggest that the problem is in one of the following areas:
1. The way in which you are passing in the arguments is not conforming to the expected input format or values and it's therefore not executing as expected.
2. Your process implictly relies on the state of your apex application in some manner, which is not being reproduced within the procedure when the job is submitted.
In the former case, I would check the procedure's specification against the page items types being passed in - you might have to explicitly convert some of your arguments into the appropriate type
In the latter case, well... bearing in mind that we don't know what your procedure looks like and it's therefore kind of difficult to diagnose the problem, you'll possibly need to pass your session information into the procedure as additional parameters and re-create your session from within the code. -
Submit job to begin at 0230 hrs and run daily
Hi,
Oracle version - 10.2.0.4
Env- Windows 32 bit 2003 server R2
I scheduled a job with the below command to run on daily basis by exactly 02:30 am but the job is not running as per scheduled, it's running 30 minutes before the schedule.
Command used to schedule the job.
DECLARE
X NUMBER;
BEGIN
SYS.DBMS_JOB.SUBMIT
( job => X
,what => 'TESTJOB(20,20302);'
,next_date => to_date('10/08/2011 02:30:00','dd/mm/yyyy hh24:mi:ss')
,interval => 'TRUNC(SYSDATE+1)+2/24'
,no_parse => FALSE
SYS.DBMS_OUTPUT.PUT_LINE('Job Name is TEST JOB ' || to_char(x));
COMMIT;
END;
I came to know this when i queried the dba_jobs view last_date column,
JOB WHAT NEXT_DATE LAST_DATE
123 TESTJOB(20,20302) 08/17/2011 *02:00:00* 08/16/2011 *02:00:03*
Can you pls let me know where i am wrong !!
Thanks
Edited by: 879545 on Aug 16, 2011 2:22 AM879545 wrote:
,interval => 'TRUNC(SYSDATE+1)+2/24'Use 2.5 :
SQL> select trunc(sysdate+1)+2/24
2 from dual;
TRUNC(SYSDATE+1)+2/24
17-aug-2011 02:00:00
SQL> select trunc(sysdate+1)+2.5/24
2 from dual;
TRUNC(SYSDATE+1)+2.5/24
17-aug-2011 02:30:00Nicolas. -
How to schedule a job from Apex?
Hi all.
I want to know the best way to schedule a job using Apex:
- DBMS_JOB?
- DBMS_SCHEDULER?
- Build a wrapper?.
- Any other thing i am not aware of?-
Could an example be to much to ask?
Regards, Luis ...!Hi Luis,
Apex already provides you an built-in wrapper to dbms_scheduler, so you don't have to do.
You should use this http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/apex_plsql_job.htm#AEAPI1203
Thanks -
are there another alternative other than using the DBMS_JOB and DBMS_SCHEDULER to run a schedule job in APEX that calls a certain procedure? thanks.
Here's the documentation for APEX_PLSQL_JOB:
http://download-east.oracle.com/docs/cd/B31036_01/doc/appdev.22/b28550/advnc.htm#BABGHIFB
The documentation says that you can create a page process to call a background PL/SQL job.
But, it looks like that wizard page disappeared around version 2.0.
It's still missing in 3.0.
Here's a discussion about that:
Re: PLSQL DBMS JOB - Process Type -
Problem while scheduling job in apex
Hi All ,
I have problem while creating job in apex .Let me explain my problem clearly.I have created a page in
url: http://apex.oracle.com/pls/otn/
Workspace : PREETHI_WORKSPACE
User ID : [email protected]
Password : bowova1
Application :Parse and upload csv file -21007
Page No:1
Page Name :Parse csv file.
Main functionality of this page is to upload csv file into oracle table .First user will browse a file from local machine and upload it in upload region.After that,user enters a table name and clicks create table button which creates a table in DB and also shows the report for the same .Creating table is happening through "create table " process when user clicks "create table" button.Code is working fine .One more things here is, in csv file the second row should have data type mentioned .
My requirement is ,i have to schedule "htmldb_tools.parse_file" in create table process as a job .In this "create table process" we are calling htmldb_tools.parse_file(:P1_FILENAME,'P1_COLLECTION','P1_HEADINGS','P1_COLUMNS','P1_DDL',:P1_TABLENAME);
Problem Iam facing here is that the scope of item :p1_filename is getting lost when we pass it to procedure .I think problem is due to different apex and database session .
Tried a lot through various ways ..Not finding the solution.
Please help...Hi Marco,
I have tried with the setting what u have mentioned in htmldb_tools.parse_file procedure: wwv_flow_api.set_security_group_id(<workspace_id>);
But Job Getting fail and giving error ""ORA-01400: cannot insert NULL into (ORA-01400: cannot insert NULL into ("FLOWS_020200"."WWV_FLOW_COLLECTIONS$"."SESSION_ID")
ORA-06512: at "FLOWS_020200.WWV_FLOW_COLLECTION", line 319
ORA-06512: at "DIMPLE3_HD_DEV.HTMLDB_SID_50", line 196
ORA-06512: at line 2
Please help me out in this issue.
Regards
Dhan -
Hi sap expert,
Please guide me for the abap coding. my requirement is when i create outbound delivery note, then press SAVE button, serial number will be automatic proposed.
Now , i process as below sequent.
1. using user exit MV50AFZ1 -> FORM USEREXIT_SAVE_DOCUMENT
in this user exit i submit background job to change oubound delivery
2. in the background job, i call BAPI BAPI_OUTB_DELIVERY_CHANGE to change serial number
Question.
1. This step right or wrong, if wrong, please suggest
2. How to coding --> submit job from the user exit
Thank you in advance
JeanHi,
Most of the guys around are with functional experience.
I think you should post this query in SAP-ABAP. U will get
an immediate reply.
Kind Regards
Chakradhar -
Submit Job error... need help....
I got this error when I click on "Submit Job" button to submit a Backup job in 10g EM. Anyway to solve this ?
The job submission has failed for the following reason
ORA-20900: Could not find credential set DBHostCreds for target type oracle_database ORA-06512: at "SYSMAN.MGMT_CREDENTIAL", line 649 ORA-06512: at "SYSMAN.MGMT_CREDENTIAL", line 1309 ORA-06512: at "SYSMAN.MGMT_JOBS", line 263 ORA-06512: at "SYSMAN.MGMT_JOBS", line 48 ORA-06512: at line 1It look like you didn't set the credential for the node and database. check it out and try your operations.
SJH
OCP DBA -
I want to schedula a job in APEX.
Hi,
I have registered in apex.oracle.com to schedule a job in APEX to get reminder mail for
this I need below any of the table required but none of them is not available
in the schema which apex allocated. me please suggest me.
select * from user_scheduler_job_run_details
select * from user_scheduler_jobs
select * from dba_jobs
select * from DBA_SCHEDULER_JOBS
select * from DBA_SCHEDULER_SCHEDULES
select * from DBA_SCHEDULER_JOB_CLASSES
select * from DBA_JOBS
Thanks
Jyothi.949975 wrote:
Please update your forum profile with a real handle instead of "949975".
I have registered in apex.oracle.com to schedule a job in APEX to get reminder mail
Why do you need to get "reminder mail" from apex.oracle.com? What are you doing there that requires this? As stated on the login page:
This service is for demonstration purposes only. Use of this system to store sensitive data is prohibited. For production applications you can download and install Application Express on-premise or sign up for the Oracle Database Cloud Service.
and the Support Information page:
This hosted Oracle Application Express instance is provided as a free demonstration service to anyone. Use of this system to store sensitive, offensive, unauthorized, or illegal data is prohibited. You are also prohibited from running production applications on this service.
for this I need below any of the table required but none of them is not available in the schema which a
pex allocated.
Works for me.
select * from user_scheduler_job_run_details
select * from user_scheduler_jobs
You have to create/execute a job (as shown in the linked thread) before those views will show anything.
select * from dba_jobs
select * from DBA_SCHEDULER_JOBS
select * from DBA_SCHEDULER_SCHEDULES
select * from DBA_SCHEDULER_JOB_CLASSES
select * from DBA_JOBS
You don't have the privileges required to access those views on apex.oracle.com. -
Could I use OEM to submit a job and call an EJB session bean? If answer is yes , could you point me to the right direction , steps should I perform in OEM.
Thanks
SuhailThis is the Basic code to Achieve that.
Call Function 'JOB_OPEN'
SUBMIT RSBDCBTC
via background Job <Job info>
With QIE = <QID Returned by BDC_OPEN_Group FM>
AND RETURN.
Call Function 'JOB_CLOSE'
2) Also go through this
DATA: lv_job_name LIKE tbtco-jobname,
lv_job_nr LIKE tbtco-jobcount,
lv_job_released TYPE c,
lv_job_start_sofort TYPE c,
lv_print_parameters TYPE pri_params.
lv_job_name = 'Z_BGPROGRAM'.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = lv_job_name
IMPORTING
jobcount = lv_job_nr
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF syst-subrc = 0.
" submit job with all the selection screen params...
SUBMIT (lv_job_name)
WITH applfile = applfile " these are the parameters of the background program
WITH p_lines = p_lines
USER syst-uname " you must use this
VIA JOB lv_job_name NUMBER lv_job_nr AND RETURN.
IF sy-subrc = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = lv_job_nr
jobname = lv_job_name
strtimmed = 'X'
IMPORTING
job_was_released = lv_job_released
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
IF syst-subrc <> 0.
MESSAGE i162(00) WITH
'An error occured while closing the background job.'.
STOP.
ENDIF.
ENDIF.
ENDIF.
SKIP 1.
WRITE: / 'Background process', lv_job_name , 'called successfully' NO-GAP.
WRITE: / 'You can check the job in transaction SM37'. -
Scheduling a Mail Sending Job with APEX
Hi
I would like to know if it is possible to schedule an e-mail sending job with APEX(for purposes like birthday reminders etc). Currently, I am able to send e-mail from APEX by creating a process which is triggered by a button. I am using the apex_mail.send procedure to send e-mail. This is working fine, but I would ideally want the email sending process to be scheduled to run independent of a manual trigger, i.e. the system date should be the trigger, and it should repeat after a specified interval. (The method should be such that emails are sent out even when the APEX application is not running,i.e. the process should take the data directly from the database.)
Thanks,
KamalHi Kamal,
I'm new to this apex tool...I doesnt know how to configure email.....Has i have seen in ur message that you could able to send email from apex but u asked about scheduling in email, a kind of deep concept to some one....I'm not thing of the scheduling right now...Can you please guide me in step wise manner of how to configure email...Since i doesnt know this basic thing of configuring email with the APEX...
From ur message im sure that ill be getting answer.....Any way thanks in advance for ur help.....
With Regards,
Hari R...
Edited by: HariPrasad on Sep 13, 2010 11:24 PM -
ORA-00900: invalid SQL statement error while running jobs in APEX 4.2
Hi,
the following procedure compiled successfully in Apex 4.2:
create or replace procedure "DEVLOE" AS
L_TEMPLATE VARCHAR2(32000);
L_base_TEMPLATE VARCHAR2(32000);
begin
l_base_template := '<html>
<head>
<title>HTML Editor Sample Page</title>
</head>
<body>
<p>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span class="plsql-literal" style="line-height: 14.65625px; white-space: nowrap;">Hi #Contact#,</span></span></span></p>
<p>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span class="plsql-literal" style="line-height: 14.65625px; white-space: nowrap;">This is a notification message to inform you that <strong>Development </strong>effort </span><span class="plsql-literal" style="line-height: 14.65625px; white-space: nowrap;">and milestones are yet to be updated for ECR: </span><span class="plsql-operator" style="line-height: 14.65625px; white-space: nowrap;"></span><span class="plsql-word" style="line-height: 14.65625px; white-space: nowrap;">#ECR_NAME#. This ECR has priority #p#. </span></span></span></p>
<table align="center" border="1" cellpadding="1" cellspacing="1" style="width: 500px;">
<tbody>
<tr>
<td>
<span style="font-size:14px;"><span style="color: rgb(255, 0, 0);"><span style="font-family: verdana, geneva, sans-serif;"><u><strong>Department</strong></u></span></span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span style="color: rgb(255, 0, 0);"><u><strong><span style="background-color: rgb(255, 255, 255);">Contact Name</span></strong></u></span></span></span></td>
</tr>
<tr>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Product Management Contact</span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#pdm#</span></span></td>
</tr>
<tr>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">PMO Contact</span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#PMO#</span></span></td>
</tr>
<tr>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Dev Contact</span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#Dev#</span></span></td>
</tr>
<tr>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">QA Contact</span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#QA#</span></span></td>
</tr>
<tr>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Infodev Contact</span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#Info#</span></span></td>
</tr>
</tbody>
</table>
<p>
</p>
<span fckbookmark="1" style="display: none;"> </span><span fckbookmark="1" style="display: none;"> </span>
<table align="center" border="1" cellpadding="1" cellspacing="1" style="width: 500px;">
<tbody>
<tr>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span style="color: rgb(0, 0, 255);">Team</span></span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span style="color: rgb(0, 0, 255);">Start Date</span></span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span style="color: rgb(0, 0, 255);">End Date</span></span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;"><span style="color: rgb(0, 0, 255);">Effort(in person days)</span></span></span></td>
</tr>
<tr>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Development</span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#d1#</span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#e1#</span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#L1#</span></span></td>
</tr>
<tr>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Quality Assurance</span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#d2#</span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#e2#</span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#L2#</span></span></td>
</tr>
<tr>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">Information Development</span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#d3#</span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#e3#</span></span></td>
<td>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">#L3#</span></span></td>
</tr>
</tbody>
</table>
<p>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">The ECR application is located</span> at </span>: https://apex.oraclecorp.com/pls/apex/f?p=1472:1<span fckbookmark="1" style="display: none;"> </span></p>
<span fckbookmark="1" style="display: none;"> </span>
<p>
<span style="font-family: verdana, geneva, sans-serif; font-size: 14px;">Regards,</span></p>
<p>
</p>
<p>
<span style="font-size:14px;"><span style="font-family: verdana, geneva, sans-serif;">ECR Team</span></span></p>
</body>
</html>
FOR c1 IN (select ECR_NAME,PMO_CONTACT, QE_LOE,INFODEV_LOE, DEV_START_DATE, DEV_END_DATE, QE_CONTACT,QE_START_DATE,INFODEV_START_DATE,INFODEV_END_DATE, QE_END_DATE, INFODEV_CONTACT, PDM_CONTACT, DEV_LOE,ECR_PRIORITY, DEV_CONTACT from ECR_NAME WHERE DEV_LOE IS NULL AND ECR_STATUS = 'Effort Estimation is in Progress' AND ECR_PRIORITY <=5)
LOOP
l_template := l_base_template;
l_template:= replace(l_template, '#Contact#', c1.DEV_CONTACT);
l_template:= replace(l_template, '#ECR_NAME#', c1.ECR_NAME);
l_template:= replace(l_template, '#p#', c1.ECR_PRIORITY);
l_template:= replace(l_template, '#PMO#', c1.PMO_CONTACT);
l_template:= replace(l_template, '#pdm#', c1.PDM_CONTACT);
l_template:= replace(l_template, '#Dev#', c1.DEV_CONTACT);
l_template:= replace(l_template, '#QA#', c1.QE_CONTACT);
l_template:= replace(l_template, '#Info#', c1.INFODEV_CONTACT);
l_template:= replace(l_template, '#d1#', c1.DEV_START_DATE);
l_template:= replace(l_template, '#L1#', c1.DEV_LOE);
l_template:= replace(l_template, '#e1#', c1.DEV_END_DATE);
l_template:= replace(l_template, '#d2#', c1.QE_START_DATE);
l_template:= replace(l_template, '#L2#', c1.QE_LOE);
l_template:= replace(l_template, '#e2#', c1.QE_END_DATE);
l_template:= replace(l_template, '#d3#', c1.INFODEV_START_DATE);
l_template:= replace(l_template, '#L3#', c1.INFODEV_LOE);
l_template:= replace(l_template, '#e3#', c1.INFODEV_END_DATE);
htmldb_mail.Send(p_to => '[email protected]',
p_cc => '[email protected]',
p_from => '[email protected]',
p_body => l_template,
p_body_html => l_template,
p_subj => 'cxxxx:' ||c1.ECR_NAME );
END LOOP;
end;
the when I ran:
begin
devloe();
end;
I received the mail as well.
However, when I try to schedule this in the job:
declare
JobNo user_jobs.job%TYPE;
begin
dbms_job.submit(JobNo, 'BEGIN
DEVLOE();
END;', sysdate, 'sysdate + 1/24/60'); commit; end;
The job status shows failures every minute.
dbms_job.run(job_no);
It gave : ORA-00900: invalid SQL statementFirst of all I don't see a procedure header.
Secondly I see you commit inside your procedure. This is a bug.
Thirdly I see you also commit inside a loop. This is also a bug, and needs to be removed asap.
The error indicates a statement doesn't parse. As you don't post the error stack, nor a table definition no one can reproduce the problem.
You need to isolate the statements, one by one, and run them through sql*plus to see what happens.
Sybrand Bakker
Senior Oracle DBA -
Submit Button in APEX 3.2.1 SQL Query (updateable report)
Hi all,
I am fairly new to APEX. I have an updateable report and have created a button for every row as follows:
<input type="button" value="Task Complete" onclick="doSubmit('#REF_STEP_ID#');" />
I have a PL/SQL anonymous block process that calls an oracle procedure On Submit - After Computations and Validations:
BEGIN
tta_pkg.p_task_complete(:REQUEST);
END;
The button works and calls the Oracle procedure. My problem is that the process will try to run anytime the page gets submitted due to any other process in the page. The error I am getting when another process submits the page is as follows.
ORA-06502: PL/SQL: numeric or value error: character to number conversion error. ( If I disable the process, the page works and all other processes are submitted successfully).
Does anyone have any ideas? They will be greatly appreciated.
Thank you,
SylviaSylvia,
Have you tried adding a condition to the process? I'm not sure what options were available in APEX 3.x (which is really old; the current version is 4.2.4), but in the current versions of APEX there's a specific "When button pressed" field that allows you to specify that the process only fires when a specific button is clicked.
Regards,
-David -
How to get spool number when using SUBMIT job
Hi All,
I am calling standard program using SUBMIT through JOB as below. Now I need spool number for this job to covert the output to PDF and send to mail. See the below code and guide me.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = name
IMPORTING
jobcount = number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc = 0.
data: Zscreen type table of RSPARAMS with header line.
Zscreen-selname = 'PM_AENNR'.
Zscreen-kind = 'P'.
ZSCREEN-LOW = '500000000125'.
APPEND ZSCREEN.
SUBMIT RCC00130 WITH selection-table Zscreen TO SAP-SPOOL
SPOOL PARAMETERS print_parameters
WITHOUT SPOOL DYNPRO
VIA JOB name NUMBER number
AND RETURN.
IF sy-subrc = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = number
jobname = name
strtimmed = 'X'
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5Hi,
Do this way, first get print parameters by using function module 'GET_PRINT_PARAMETERS'
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
destination = 'LP01'
list_name = 'TEST'
list_text = 'SUBMIT ... TO SAP-SPOOL'
immediately = ' '
line_size = '1023'
no_dialog = 'X'
IMPORTING
out_parameters = wa_pri_params
valid = w_valid.
If it returns success then
IF w_valid EQ 'X'.
CONCATENATE 'R'
w_tabix
sy-datum+4(4)
sy-uzeit INTO
wa_pri_params-plist.
ENDIF.
SUBMIT rprccc00
WITH firmennr = w_cid
WITH bel_clus = 'X'
WITH testlauf = ' '
WITH not_lokl = 'X'
WITH file_in = w_arc_out
TO SAP-SPOOL WITHOUT SPOOL DYNPRO
SPOOL PARAMETERS wa_pri_params AND RETURN.
COMMIT WORK AND WAIT.
SELECT rqident
FROM tsp01
INTO w_rqident
UP TO 1 ROWS
WHERE rq2name = wa_pri_params-plist.
ENDSELECT.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = w_rqident
no_dialog = 'X'
dst_device = 'LP01'
pdf_destination = 'X'
TABLES
pdf = t_pdf.
Hope it solves your problem
Regards
Krishna -
Hi All
I have a program with selection screen. The selection screen has Job name as one of the parameters. When I press F8 (Execute), this program should get scheduled in the background with the job name taken from selection screen. How to submit a program by itself in background.
Please suggest.
Thanks
ShakirHi,
Press F9 from the program itself after entering the selection parameters
Or
Create a selection variant and go to SM36 and give some valid name , program name with variant and save and schedule.
Regards,
Nandha
Maybe you are looking for
-
Error in Creation of Object ID 00000000 is not allowed
Hi all, When I am Hiring an employee using PA40, I am getting an error as "Creation of Object ID 00000000 is not allowed", when I save it. In the NUMKR Feature, the return value has been assigned to the Personnel Sub Area. Pls. can anybody explain, h
-
TS1369 My new computer will not recognize my iPod Shuffle
My iPod Shuffle is not recognized by my new computer running Windows 7 and consequently the iPod will not sync with my library.
-
Billing Document getting reversed thru VF11 but not the accounting documen
Hi All, I am using this transaction VF11 to reverse the billing document and its corresponding accounting document.But only the billing document is getting reversed but not the accounting doc. For eg The message im getting is Document 92029379 saved
-
Spry accordion works in template, but not pages using that template
So I added a spry accordion to one of my templates and changed the script to default closed. It works great. In the template. But not in any of the pages using that template. Basically I can see the content in the accordion on the page as if there is
-
Extracting pdf that's embedded in xml
I'm needing to extract/parse a pdf file that is embedded in an xml file. I'm able to do it with Microsoft XML Parser, but want to do it on unix using java. I've tried FOP - only good for creating pdf's out of text, but not able to handle embedded bin