Background processing of Program
Hi all,
I have a requirement of background processing of a program which is called from another program.
Requirement : during execution of Program A, Program B is Submitted to run in background with two field values from Program A.
Is it possible ? I am able to explore it. Please help.
Regards,
Nibha
DATA: number TYPE tbtcjob-jobcount,
name TYPE tbtcjob-jobname VALUE 'JOB_TEST',
print_parameters TYPE pri_params.
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.
SUBMIT submitable 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 = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
ENDIF.
System fields
sy-subrc Meaning
0 Background task scheduled successfully.
4 Scheduling cancelled by user on the selection screen.
8 Error during scheduling, i.e. when accessing JOB_SUBMIT internally.
12 Error in internal number assignment.
Similar Messages
-
Regarding SUBMIT statement - to process a program in background
Hi All,
I have issue of submitting a program in background and also i need to process the no of records come from program by splitting them by 1000(n).
First of all i have program whose code is like following:
<b>REPORT z_update_material_master.</b>
TYPES: BEGIN OF t_marc,
matnr LIKE marc-matnr, "Material Number
werks LIKE marc-werks, "Plant
beskz LIKE marc-beskz, "Procurement Type
sobsl LIKE marc-sobsl, "Special procurement type
fhori LIKE marc-fhori, "Scheduling Margin Key for Floats
dzeit LIKE marc-dzeit, "In-house production time
plifz LIKE marc-plifz, "Planned delivery time in days
webaz LIKE marc-webaz, "Goods rcpt processing time
pwwrk LIKE t460a-wrk02, "Production plant in planned order
erhor LIKE t436a-erhor, "Opening periodr
zlt TYPE p DECIMALS 3, "Total replenishment lead time
ztlt TYPE p DECIMALS 3, "Total replenishment lead time
wzeit TYPE p DECIMALS 3, "Total replenishment lead time
upd(1) TYPE c, "UPDATE INDICATER
ind TYPE c,
END OF t_marc.
DATA: i_marc TYPE SORTED TABLE OF t_marc INITIAL SIZE 0
WITH HEADER LINE
WITH NON-UNIQUE KEY matnr werks,
i_marc_rpt LIKE i_marc OCCURS 0 WITH HEADER LINE.
DATA: l_plantdata LIKE bapi_marc,
l_headdata LIKE bapimathead,
l_plantdatax LIKE bapi_marcx,
l_tabix LIKE sy-tabix.
CONSTANTS: c_s TYPE c VALUE 'S',
c_x TYPE c VALUE 'X'.
DATA i_temp_bapi_return LIKE bapi_matreturn2
OCCURS 0 WITH HEADER LINE.
DATA BEGIN OF i_temp_zppe0091_01 OCCURS 0.
INCLUDE STRUCTURE zppe0091_01.
DATA: END OF i_temp_zppe0091_01.
DATA: l_tab_nam LIKE rstable-tabname VALUE 'ZPPE0091_01'.
SELECT * FROM zppe0091_01
INTO CORRESPONDING FIELDS OF TABLE i_temp_zppe0091_01.
IF sy-subrc EQ 0.
LOOP AT i_temp_zppe0091_01 WHERE upd = c_x.
l_tabix = sy-tabix.
l_headdata-material = i_temp_zppe0091_01-matnr.
l_plantdata-plant = i_temp_zppe0091_01-werks.
l_plantdata-replentime = i_temp_zppe0091_01-wzeit.
l_plantdatax-replentime = c_x.
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
EXPORTING
headdata = l_headdata
plantdata = l_plantdata
plantdatax = l_plantdatax
TABLES
returnmessages = i_temp_bapi_return.
IF NOT i_temp_bapi_return[] IS INITIAL.
READ TABLE i_temp_bapi_return WITH KEY type = c_s.
IF sy-subrc EQ 0.
i_marc_rpt-matnr = i_temp_zppe0091_01-matnr.
i_marc_rpt-werks = i_temp_zppe0091_01-werks.
APPEND i_marc_rpt. CLEAR i_marc_rpt.
ELSE.
i_temp_zppe0091_01-upd = space.
MODIFY i_temp_zppe0091_01 INDEX l_tabix TRANSPORTING upd.
ENDIF.
ENDIF.
ENDLOOP.
ENDIF.
Now i want to call this program from another program that is already exists by using <b>SUBMIT</b>
statement in background and i need to process this program by dividing records by <b>1000</b> into seperate session.
how can i do it. Can any body tell me the solution with syntax.
I might get lot of records from above program so i want to split them into diffrent sessions based on number of records(1000).
can any body give me the solution.
Thanks in advance.
Thanks & Regards,
Rayeez.Try implementing the following code. Use the code accordingly...
MOVE 100 TO c_recs_b4_split.
IF num_src_trans > c_recs_b4_split.
target_break = num_src_trans / p_thread.
ELSE.
target_break = num_src_trans + 1.
ENDIF.
wa_subbch = 1.
last_index = 1.
No batch split required if total recrods less than 100
IF num_src_trans < c_recs_b4_split.
CLEAR : range_btch.
REFRESH: range_btch.
IF wa_subbch = p_thread.
target_break = num_src_trans.
ENDIF.
MOVE 'S_SRCTRN' TO range_wa-selname.
MOVE 'S' TO range_wa-kind .
MOVE 'I' TO range_wa-sign .
MOVE 'EQ' TO range_wa-option .
LOOP AT itab_src_trans INTO st_src_trans.
MOVE st_src_trans-src_tran_id TO range_wa-low.
APPEND range_wa TO range_btch.
ENDLOOP.
Step 3 Submit the batch.
v_job_no = v_job_no + 1.
PERFORM submit_tp_jobs.
ELSE.
DO.
Step 1 Collect data for the target count
CLEAR : range_btch.
REFRESH: range_btch.
IF wa_subbch = p_thread.
target_break = num_src_trans.
ENDIF.
MOVE 'S_SRCTRN' TO range_wa-selname.
MOVE 'S' TO range_wa-kind .
MOVE 'I' TO range_wa-sign .
MOVE 'EQ' TO range_wa-option .
IF wa_subbch = p_thread.
target_break = num_src_trans - v_cnt .
ENDIF.
LOOP AT itab_src_trans INTO st_src_trans FROM last_index.
last_index = sy-tabix.
batch_total = batch_total + 1.
IF batch_total <= target_break.
MOVE st_src_trans-src_tran_id TO range_wa-low.
APPEND range_wa TO range_btch.
ELSE.
EXIT.
ENDIF.
v_cnt = v_cnt + 1.
ENDLOOP.
CLEAR batch_total.
Step 2 Submit the batch.
v_job_no = v_job_no + 1.
PERFORM submit_tp_jobs.
ADD 1 TO wa_subbch.
IF wa_subbch > p_thread.
EXIT.
ENDIF.
ENDDO.
ENDIF.
FORM submit_tp_jobs .
DATA : l_jobcount LIKE tbtcjob-jobcount,
l_jobrelease LIKE btch0000-char1,
w_job_flag VALUE 'X',
w_process_mode,
w_user_print_params LIKE pri_params.
l_jobname = p_batch.
CONCATENATE 'TP_' l_jobname '_' v_job_no INTO l_jobname.
CONDENSE l_jobname NO-GAPS.
w_process_mode = ' '.
IF NOT range_btch[] IS INITIAL.
PERFORM create_post_ctrl.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = l_jobname
IMPORTING
jobcount = l_jobcount.
SUBMIT zfi_pc_tran_proc
AND RETURN
WITH p_batch = p_batch
WITH p_jobid = p_jobid
WITH p_mode = w_process_mode
WITH p_subbch = wa_subbch
WITH p_jobq = p_jobid
WITH p_cntlmt = p_cntlmt
WITH p_tpiop = p_iop
WITH SELECTION-TABLE range_btch
USER sy-uname
VIA JOB l_jobname NUMBER l_jobcount
TO SAP-SPOOL
SPOOL PARAMETERS w_user_print_params
WITHOUT SPOOL DYNPRO.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = l_jobcount
jobname = l_jobname
strtimmed = 'X'
IMPORTING
job_was_released = l_jobrelease
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.
ENDIF.
ENDFORM. " submit_tp_jobs
Pl. add the points.... -
I want to run java program on windows environment as background process
Hi all
I want to run java program on windows environment as background processSo command prompt return after executing java command and program on background In Linux we can do this easily �but I do not how to do this in windows
for example look this programe
import java.io.*;
import java.util.*;
public class TestClass {
class ravi extends Thread{
public void run(){
try {
String target_file = "ravind.txt";
File targetfile = new File(target_file);
PrintWriter writer = new PrintWriter(new FileWriter(targetfile)) ;
for (int i =0 ; i < 100 ;i++ ){
Thread.sleep(10000);
writer.println(" ravindra shukla ");
} catch (Exception e) {
e.printStackTrace();
public static void main(String[] args) {
TestClass test1 = new TestClass();
TestClass.ravi r1 = test1.new ravi();
r1.start();
System.out.println(" return from main ");
first i compile this
javac TestClass.java
then i run this by using this command
java TestClass
but becouse i put sleep on threads run function so it takes to much time to get return on command promt .... i want to run this programe as background process so command promt return as soon as i execute java commandThanks dude
This solution �start java TestClass� works fine �. But it does not solve my problem
It opens another black window and that black window persist till the life time of my program
Is it possible application run on complete background without opening another black window �as in Linux -
Error during background processing which is created by Std.program RFBIBL00
Hi Gurus,
I am using standard program RFBIBL00 to generate batch session for the Tcode FB01.
My BDC is working fine , if i choose foreground or display error only option in SM35.But when i process the same session in
background it is giving error Field BSEG-DMBTR does exist in SAPMF05A 0302.
One more thing i want to point out when i process the session in forground or in display error only option
there i am getting information message Field BSEG-DMBTR does exist in SAPMF05A 0302. But for background due to same message i.e (Field BSEG-DMBTR does exist in SAPMF05A 0302) session processing is failed.
Actually through ZProgram data being uploaded to application server. Then i am executing std. program RFBIBL00 to generate session.And when i go to SM35 & choose the just created session for background processing,then processin i failed.
We have recently upgraded from 4.7 to ECC 6.0. Previously RFBIBL00 program is working fine but after upgrade it is not working.
Please give your valuable suggession.
Regards,
S C Patil.How are you related to this almost identical problem?
Field BSEG-DMBTR. does not exist in the screen SAPMF05A 0302
Thomas -
I want to run background process at plsql program based on the timeout
Hi
when it comes to ready state I want to run background process at plsql program based on the timeout
Thanks and Regards
ch saivikramThanks dude
This solution �start java TestClass� works fine �. But it does not solve my problem
It opens another black window and that black window persist till the life time of my program
Is it possible application run on complete background without opening another black window �as in Linux -
How can i run my java program in background process?
hi all,
i am working on desktop monitoring so when i start my program on client machine that is visible to all but i want this program client not visible to all instead of this can be run in background process . so, nobody can see that.
so, how i can do this ?
pls pls help me
thanks in advanced to helper
regards
maulik & riteshthis will run the java program in the background.It'll just use the Windows Java Console instead of the command-line console. It has nothing to do with running as a background process.
Edit: though this might be exactly what the OP wants: not "background process" but "no DOS console". -
GUI_DOWNLOAD and background processing
Hello,
I have created a process which creates a file. this process uses GUI_DOWNLOAD to put the file on the users C drive or other directory on our network. The user wants to run this process in background and the program is returning a 6 (error unknown) from the GUI_DOWNLOAD FM. I was looking on SDN and found out the GUI_DOWNLOAD only works in foreground. You have to use OPEN and CLOSE DATASET statements to process in background. I am thinking about putting a button to denote foreground/background processing and using the appropriate statements to process the file. I will then have to get the file from the app server to a place will the user can get access to it.
<b>first question</b> - is there a FM to do a FTP from the app server to a directory on our network for the user to access?
<b>second question</b> - is this the right approach or is there something else that I should be doing.
thanks in advance for your helpHi,
Yes, your right, GUI_DOWNLOAD wil not work in background mode, you need to place the file in Application server, here.
See the below link for a FTP program, use the proper commands(i do not know whether downloading the file is possible through the commands)
http://www.sap-img.com/ab003.htm
or else, write a small program which downloads the data from the application server, but it should run in the foreground
Regards
Sudheer -
The request could not be submitted for background processing.
Post Author: Chriss
CA Forum: Administration
It's an BOE XI SR2, on Win2k3 server, with a print cluster with two print spools, handling 3000+ printers. I discovered this error to be intermittent and only on one of the spools. It turned out that the only common factor was an HP4250 print driver. I backed all the 4250s down to 4200 drivers and the intermitent error ("Error in File. The request could not be submitted for background processing.") went from about 100 a day to zero. The other spool had a different version of the HP4250 driver and would on rare occassion cause this error, "Error in File ... Page header or footer longer than a page." but never the background processing error.
For reference, when I got this error in XI R1, this was the solution for 'the error with one name and many causes':The error "The request could not be submitted for background processing" can be related to a corrupt or wrong versioned crpe32.dll in the Crystal bin folder. Renaming to crpe32.dll_bak and using the repair command in the the "Add/Remove Programs" tool in the "Control Panel" will reinstall the correct dll. Then restart the Crystal services.Post Author: krishna.moorthi
CA Forum: Administration
For Crystal reports :
Error : "The request could not be submitted for background processing"
I think,this was not related to a corrupt or wrong versioned crpe32.dll.
but the below mentioned is one of the reason for getting this error.
I got the error when the main report(crystalreports10) having more than 2 subreports not assigned proper tables for the subreports.
Example: (this code raise the abone mentioned error.)
rpt.SetDataSource(Exdataset);
rpt.Subreports["subreportname1"].SetDataSource(Exdataset); // Exdatatset.Tables[1]
rpt.Subreports["subreportname2"].SetDataSource(Exdataset);// Exdatatset.Tables[2] -
Submit Report (Regarding Background Processing)
Hi Guru's,
I want help regarding Background Processing.
I have developed a program which is running fine in forground but in Background mode no values are comming.
All values are becomig Zero.
Plz help.
*--- Submit Report for 'COGI' (Postprocessing of Error Records from Automatic Goods Movements)
SUBMIT coruaffw USING SELECTION-SCREEN '1000'
WITH r_cumul = 'X'
EXPORTING LIST TO MEMORY
AND RETURN.
*---- Get the List
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = it_list_tab
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
*--- Convert to Ascii
CALL FUNCTION 'LIST_TO_ASCI'
TABLES
listobject = it_list_tab
listasci = it_asci_tab
EXCEPTIONS
empty_list = 1
list_index_invalid = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE i000 WITH 'Problem in converting LIST to ASCII'.
ENDIF.
DESCRIBE TABLE it_asci_tab LINES w_cogi.
w_cogi = w_cogi - 5.
CALL FUNCTION 'LIST_FREE_MEMORY'
TABLES
listobject = it_list_tab.Hi Arbind,
You have used return you need to add the addition with.Try this way hope it works
SUBMIT zreport EXPORTING LIST TO MEMORY
AND RETURN
WITH P_1 = P_1
WITH P_2 = P_2
WITH P_3 = P_3
WITH S_4 IN S_4
WITH S_5 IN S_5
WITH S_6 IN S_6. -
I have two questions here. But, I guess they both are related
1. I have a calendar application, where I display set of
events based on time for a day. I need to start a background
process to check if any of the events are scheduled for the next
half an hour and show the reminder to the user.
Like I mentioned, I believe that there should be a background
thread running to check the current day event's time against the
local time and display reminder.
2. Next question is, I have a search component, where the
user enters the text and clicks on the search to fetch the results
based on the text entered.
I need a little customizable behavior here, where I need to
fetch the results based on the user input automatically(without
clicking the search button) based on the time lag after the last
character entered.
Any help/views in this regard is highly appreciated.
Thanks In Advance,
Suresh.Hi,
The issue is bcz. in background screen container is not recognized.
Change the code as follows:
SET PF-STATUS 'SCREEN_100'.
SET TITLEBAR 'xxx'.
<b>*if program is run in background
CALL METHOD cl_gui_alv_grid=>offline
RECEIVING
e_offline = off.
IF off IS INITIAL.
IF container1 IS INITIAL.
CREATE OBJECT container1
EXPORTING
container_name = 'CC_ALV1' .
ENDIF.
ENDIF.
CREATE OBJECT g_grid1
EXPORTING
i_parent = container1.</b>
PERFORM prepare_field_catalog.
PERFORM exclude_button.
PERFORM display_alv.
Best regards,
Prashant -
Background processing of S_ALR_87013558 report with output in txt file
Dear Friend's,
Here I have a requirement of, to execute standard report S_ALR_87013558 (Budget/Actual/Commitment/Rem Plan/Assigned) in background processing mode. Here we have to run this report in background on daily basis at a particular given time.
Once this report gets executed in background, output of this report should get converted automatically into txt file and this converted txt file must be downloaded in a respective folder automatically by giving desired path.
After completion of this process, downloaded txt file they have to use for internal MIS reporting purpose.
Is this possible via standard PS or else I have to go for the development.Please suggest, what should be the approach?
Regards,
SandeepHi Sandeep,
Check if you can create batch job to run for S_ALR_87013558 using SM36
The Program name is GP8YTY7TBR1TYRPCIPKAC6X9GZG
Please check with ABAP.
Regards,
Nitin -
Background processing- download multiple itabs into one excel with tabs
Hello,
I want to run a report as a background job and download the outputs in excel file into different tabs.
Problem is OLE does not run in background mode.
Are there any other alternatives for that?
I searched the forum and did not get any useful answer for background procesing. All the topics use for foreground processing.
(Old query for reference:- )
[background processing] multiple work sheets in single attachment file
Thanks.Hi,
Even i had the same issue before, what i did is, i written a program which will run in the background and stores the data in application server file, and also it sends the email to user saying that 'the data is soted in application server, to veiw please run the ZXXXX transaction code to view,
The second transaction code is having the OLE code which will download the data into an excel sheets with more than 1 tab.
Thanks
Sudheer -
RHINTE20 and background processing
Does anyone know how to set a variant when running RHINTE20?
When I run the program it presents a list of objects to be corrected, and I manually select all the subtree with the icon and then run Create Several Objects. It's these last two steps I'd like to specify in the variant, so I can setup the job to run nightly (grab the folders and process all objects).
Thank you in advance for any hints to resolve this.
Cheers, Al PerkinsHi Albert,
Make all your selections and click on Save (CtrlS). You will be taken to Variant Attributes screen. Give the variant name, meaning, check "only for background processing" and save. Then when you execute the program, you should be able to select your saved variant by clicking on Get Variant (ShiftF5).
Donnie -
Experience in ABAP OO and heavy background processing?
Hi,
we're planning to develop a new application with a (very) high part of background processing. We plan to use the ABAP OO. We also want to make a good OO-Design (with many SETTER and GETTER methods and so on). I'm afraid we will get a lot of "program to program" communication and we will atomize our application. Also it's sounds to me like a conflict with the stuff from the Performance-course BC490.
Has anybody experience with ABAP 00 and applications that normally designed for a "number cruncher"?
Thanks and regards,
StefanHi Mariana,
I've started with two technical prototypes that have a very little business logic. One prototype is designed in the "good old" ABAP and one in the ABAP OO and a selfmade OO-framework from our company. This framework is very comforable and offers a lot of methods and superclasses. For vectors there is a own superclass. So for you question: We use a own object to pass the vectors.
Also we use the software objectif for the OOD. I've learned how important a good OOD is, before I started any coding.
My prototypes have a very simple business logic. They creates bills for 10.000 invoice recipient. The only feature is, that every recipient can have his own customizing to decide which items should be together on one invoice to a individual invoice date.
I must admit that the API in the OO prototype are more understandable, but for the performance I see still the follow bottlenecks with the I/O:
- When I instance a business object, all attributs are loaded into the memory. In the old ABAP I use only the required fields. So the "smelly" SELECT *-Statement is back again...
- A business-class (A) that have dependent business-classes (B1, B2, B3...BN) should instance his dependes objects with the first access the the class (A). When the classes (B1,B2...BN) has also dependent classes, this object should be instances (B1 has C1,C2,C3..CN), too. There is always a "vector"-class between this classes that notice the reference of his objects.In my prototype for example you have a invoice recipient.
In my prototype for example I have a class invoice recipient (class A). This recipient has a vector of bill-header (class B) and every bill-header has a vector of bill-items (class C). Between every of this classe is a vector-class that manage the references of the objects.
I've programmed this lazy (hope that this is the correct word that a OO-gurus use). This means I instance only the class A. If there is a call to a method from object A that need the information from the class B-objects, than i look if the reference of the vector-class for the B-Object is already available. When not I instance the vecotr-class and this reads all dependens object B.
So there is much more I/O than in old ABAP, after all.
However I'm a OO beginner.
Therefore I'm waiting that an OO-expert from our company take a look to my prototype coding and improve this for a better performance. I'm looking forward for some good tips. I will let you know when I've good some other nuts and bolts.
Perhaps SAP needs a OO-database instead a rational database, so that all GET-methods goes directly to the database to avoid a instance with all attributs in the memory of the application-server...
Many greetings from germany,
Stefan -
RFC in background process.
Hi All,
I hve to process a RFC in background process.
For doing that firstlly i hve creted va rfc n it's wkg fine then using this syntax i called this rfc for background task
CALL FUNCTION 'Y_DYNTABLE1_AJ' IN BACKGROUND TASK
DESTINATION 'rfc_bacground'
buy whenever any error raise this rfc created a error log in sm58 n i can watch it in sm58 but whenever it's work fine then i'm unble to see there result in sp01, beco'z it's nt creating any spool in sp01 n my result is in table form.
pls help me how to get my result
regards,
AnujWith this option you can EXPORT the whole internal table to INDX table and you can IMPORT the table for later usage.
Please refer to demo programs DEMO_DATA_EXT_CLUSTER_EXPORT_D and DEMO_DATA_EXT_CLUSTER_DELETE.
Make sure that you delete the the cluster after you import the data.
Maybe you are looking for
-
Installed new software, after restart black screen with Darwin/BSD promt
Hi I have been struggling with thisissue. I installed some new software, a webcam driver called ilook 1321. I restarted my computer but forgot to take the disc out! Now when I start my ibook G4 i get the black screen with Darwin/BSD (localhost) (cons
-
Status of Production Order step
Hello Experts, I have 3 steps in production order and I do confirmation at each step. Is there any report that shows what steps are completed in a list of production order? Thanks in advance. Tom
-
How do I transfer Yahoo e-mail addresses to the Contact app?
How can I transfer my e-mail addresses from my Yahoo address book to the Contact app on the main screen of the iPod touch? If I go into my Yahoo mail on the iPod, the addresses are there but if I click directly on the Contacts app on the main screen
-
ESS Payslip : Show Overview - Error
Hi, I am getting the following error when i click on Show OVerview drop down. This is error is happing for few employees, for some employees it is working perfectly. all the employees have been assigned with the same set of roles. And I have implemen
-
Hello, I'm trying to remotely administer my windows clusters and fail them over with a PowerShell Script. The server I'm using is not a clustered server. I've already installed the Failover Clustering Tools. I'm able to retrieve information about