Background jobs question
HI,
Whern I Run get-wmiobject without asjob, one pc return result.
When I run with asjob, both child jobs are failed.
Without asjob
Get-WmiObject win32_operatingsystem -computername (Get-Content C:\ps\testpc.txt)
SystemDirectory : C:\Windows\system32
Organization :
BuildNumber : 6002
RegisteredUser : human
SerialNumber : 1234-OEM-123456-1234
Version : 6.0.6002
Get-WmiObject : ....
+ Get-WmiObject <<<< win32_operatingsystem -computername (Get-Content C:\ps\testpc.txt)
+ CategoryInfo : InvalidOperation: (:) [Get-WmiObject], COMException
+ FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
with asjob
PS C:\ps> get-job -id 11 | select-object -expand ChildJobs
Id Name State HasMoreData Location Command
12 Job12 Failed False pc1
13 Job13 Failed False pc2
For "Get-WmiObject win32_operatingsystem -computername $env:computername
-asjob":
PS C:\Windows\system32> Get-WmiObject win32_operatingsystem -computername $env:computername -asjob
Id Name State HasMoreData Location Command
1 Job1 Running False mylocalpc Get-WMIObject
PS C:\Windows\system32> get-job
Id Name State HasMoreData Location Command
1 Job1 Completed True mylocalpc Get-WMIObject
PS C:\Windows\system32> Receive-Job -id 1
SystemDirectory : C:\Windows\system32
Organization :
BuildNumber : 7601
RegisteredUser : my
SerialNumber : 1234-OEM-123456-1234
Version : 6.1.7601
Similar Messages
-
Critical Roles & RAR Background Jobs Question
Hello,
I have the following queries, related to GRC AC 5.3 RAR.
1- I would like to include all roles starting with S* into critical roles.
My question is can I say S* in critical roles, OR do I have to manually enter each & every role starting with S* (Please note that currently we have around hundreds of roles starting with S and entering each of them manually is a tedious task).
2- We have several background jobs scheduled in RAR and when I click search button, I get a list of around 600 jobs executed in the past few months.
My question is can I purge the background jobs history in such a way that, when I click "SEARCH" button, I get only those background jobs, which have been executed in the past 1 week?
Thanks,
HaleemHi Varun,
I created message with SAP in the component GRC-SAC-SCC and below is the response.
Dear Customer,
You have to manually enter each & every role in critical roles section and the exclude objects in management report section.
SAP GRC AC 5.3 SP11 does not support wildcard operations in critical roles/ profiles and exclude objects of management reports. We will support the wildcard in future SAP Versions of GRC.
Thanks
Based on the above message, I understand that I will have to enter all the roles manually for critical roles in critical roles section of RAR -> rule architect and exclude objects of management report section.
Thanks,
Haleem -
HOw to find out a report name when you know only the name of background job
Hi experts ,
my question is i need to find out teh report name for which i knew only the background job name of the report .
thanx
Venky.Go to tcode SM37->Give job name and execute->choose tool bar button STEPS (Disply Steps list) ->Then you will get program or command
-
Background job executed as SAP*, need advice to change owner.
Hi all,
I'm facing an issue where my SAP background job currently has 2 job "SAP_CCMS_CPH_REORG" and "SAP_CCMS_CPH_HRCOLL" under the ownership of sap. I would like to move them away from SAP ID.
I have tried to recreate the job using sm36 (and using my ID with sap_all profile) in testing environment, but it not seem to work.
Highly appreciates any advices and/or pointers with regards to the above mention question.
Thank you.Hi all,
Thank you for the reply but I have forgotten to add a few updates.
The issue is that I can change owner from SAP* to my ID with sap_all profile.
But, after execution,
Job with sap* owner ended successfully, with spool status marked as completed.
whereas
Job with my ID as owner ended successfully, but spool status marked as "waiting"
error mesage:
Description Value
Status: Frontend unavailable
Last event:
Message: Request on hold
Date: 19.02.2009
Time: 11:57:28
Job status: On hold
Error class: Delayed
Area: Data transfer
Printout: Not printed
Apologies for the inconveniences caused. -
Can we Create Post Good Issue Document as Background Job
Hi SAP Techies,
My current projects requires me to run Post Good Issue , as Background Job, Is it possible to do it.If yes
What is the entire process.
Regards
NaveenHi
The answer to this question lies in transaction VL23.
You can create a variant and schedule it to run; for example at 10:00 pm every night.
You need to explore this more but this t-code is the main answer.
Please reward points if you found this helpful.
Regards
SDC -
Sending output to a printer in a background job
I did a quick search on this issue and found a few suggestions. One suggestion was to use something like this:
SUBMIT RSFLFIND ... TO SAP-SPOOL DESTINATION 'LT50'.
I looked at the SAP help for SUBMIT and it was quite helpful however it raised a few questions. The program that am writing will be run in the background. I want to create a simple report that will print at several different printers when it is done. Looking at the help section (specifically this part):
"The SUBMIT statement accesses an executable program rep. The executable program is executed as described under Calling Executable Reports.
The program name rep can either be specified directly or as the content of a character-like data object name. The data object name must contain the name of the program to be accessed in block capitals. If the program specified in name is not found, an irretrievable exception is generated.
The selscreen_options additions can be used to determine the selection screen for the program accessed and to supply it with values.
The list_options additions allow you to influence the output medium and the page size in the basic list for the program accessed.
You can schedule the program for background processing by specifying job_options. "
It seems like I would create a simple program like this:
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 DESTINATION 'LT50'.
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.
That will then call the background job and the output will go to the print spool. I have a few reservations about this. The print spool will not be determined until the background job. The background job creates sales orders and the material group, in the sales order, determines the printer that the final report will go to. Also, if this is the way to do it, do I just do simple write statements in the background job?Hi,
Please try this ... perhaps it may help.
SUBMIT submitable TO SAP-SPOOL
SPOOL DESTINATION 'LT50'.
IMMEDIATELY 'X' "Add here
VIA JOB name NUMBER number
AND RETURN.
OR
SUBMIT submitable TO SAP-SPOOL
SPOOL DESTINATION 'LT50'.
IMMEDIATELY 'X' "Add here
WITHOUT SPOOL DYNPRO "Add here
VIA JOB name NUMBER number
AND RETURN.
Regards,
Ferry Lianto -
Hi,
I'm looking for ideas.
We have an inbound process for special messages transfered from XI system via asynchrounous call. Messages are identified by a GUID.
The inbound process will save the messages in a database table and create background jobs for processing big messages while small messages are processed directly.
To avoid any interference, we want to lock messages as long as they are processed. For this we have a lock object and the Enqueue/dequeue modules.
Now my question is: How can I pass a lock to the background job (created by SUBMIT VIA JOB) and have it released there after processing is done. The Job will run in a new LUW.
And then, if any error in background (or online) processing occurs, how to make sure all existing locks are released?
Thanks for some good ideas on how to proceed.
Regards,
Clemensresolved - we won't do it. We'll create some kind of queue: A fully-buffered database table where we put the lock entries and remoce them when it's time to do so. This way we can integrate an activity monitor watching the objects being processed.
Thanks for reading
Clemens -
Background Job in COGI(REM Backflush error handling)
Hi Everyone.
I have one question.
Our company use REM Backflush .
And Our REM profile setting is next.
- Use GI Backflush at GR posting
- Don't use report point backflush
- Create cumulated and individual postprocessing record
In this circumstance, we use T-code COGI to process backflush error.
When I execute the COGI in online, There is no problem
<b>But, After I make a job for background in sm37, When I execute background gob for COGI, There is a problem. In real, Background gob is will executed. But COGI errors remain as before.</b>Hi,
Actually you should use
Transaction MF47
Program RMSERI11, for post process record.
For post processing , manually entry like storage location and Batch number(if batch management is enabled) is required , if the post process record is created according to this error.
And hence it is not possible to correct all the records by background job.
Thanks
Thamizh -
Background Job: SWEQSRV - system_cancelled
Hello gurus.
We are on ECC6 and recently upgraded our system to Unicode.
Now there are irregular dumps in ST22 with information of the background job (SWEQSRV) being cancelled by the system. "SYSTEM_CANCELLED".
Error analysis
The current program has been terminated from another mode, e.g. with
Transaction SM50.
This usually happens during 'system off-peak periods' e.g. during the night or early in the morning when there is minimun system usage.
Does any one know what could be cause for this?
Regards.
WandaiHello Wandai,
maybe noone answered this question because you spelled "cancelled" correctly. The dump message spells SYSTEM_CANCELED.
I have the same question. We are on ERP 6.04 but have not migrated to Unicode yet.
The SWEQSRV jobs (several of them) run very often. The dumps occur only once or twice a day. Since the joblogs are automatically purged there is not much you have to analyze the cause.
Regards
Andreas -
Start background Job when another is finished (NOT with the JobSteps)
Hi guys,
i need your help.
I've already searched here in forum, but i wasn't able to find a good solution.
I have this problem.
I have a program that create a background job with the FM FM JOB_OPEN.. SUBMIT report with parameters .. JOB_CLOSE.
I want that if i run this report again (20 secs after for example) it does:
- Check if there is an already running Job with the same name (means with state 'R') (This task is simply, with a select on TBTO table)
- If it's found, it have to create a new job with the same name that starts automatically AFTER the first running job is finished (don't care about the end-state of the first job).
I've already tried with pred_jobcount & PRED_JOBNAME parameters of the JOB_CLOSE FM but it doesen't works!
The JOB_CLOSE, creates a job in Planned state. But when the first Job is finished, the second job(Planned) doesen't start automatically.
In this scenario, i CANNOT use endless loops (wait until the first job is finished and then submit the second) Job-steps (one job that contains multiple steps) events (i have to start only one job after the predecessor is finished), because this report could be run many times and each job should be collected like a "stack" (only when the first job is finshed the second "registered" should be started and so on, until the aren't more planned jobs).
<REMOVED BY MODERATOR>
Thx a lot for your help.
Andrea
Edited by: Alvaro Tejada Galindo on Jun 12, 2008 12:19 PMHi Veda
i can tell u but ... some reward points are very appreciated ....
I'm joking (of course)
Here the question:
I have a program (called A) that submit a new program (called B) with the JOB_OPEN .. submit JOB_CLOSE. The program B should start only if another program B (called before for example) is finished.
Here the solution.
I add a parameter (with no-display clausole) to the program B. In this parameter i pass to the program, the job number returned by the JOB_OPEN function.
When i create the JOB with the function, the "jobname" parameter is set with value 'G_DELIVERY' (Here u can change the name of the job as u want : this is the jobname that u see in SM37 transaction).
In the start-of-selection of program B i put a "waiting" procedure like this :
First i save a timestamp of system-date and system-time (called for example r_date and r_time)
select from table TBTCO all the jobs called "G_DELIVERY" with jobnumber <> from the jobnumber parameter (that means exclude itselfs) with status running ('R') -> that have startdate /starttime less than the r_date and r_time <- (this is the key of the selection that solve the problem).
if it is found (means there is another running job started before this one).
wait up to 60 seconds. "for example
repeat the selection.
endif.
When the job called before ends, this one programs exits from the loop and continues. If u submit more programs "B", they'll works like a stack.
I should say to u just one thing.... I solved my problem in another way (because i've changed the logic so this problem was no more) so i didn't implemented that logic, but it should works very good.
Try it and tell me!
Bye
Andrea -
Hi All,
I have an urgent query here regarding the Bakcground job.
Let's say I need to schedule a background job on hourly basis to fetch the data.
If first job runs more than 60 minutes, then will the second job will fetch the data.
What will happen in this scenario?
Thanks
Neeraj ManochaMy question is............
Let's say, I have a SAP standard table. In which our transactional data stores. I have also maintained my our database and build a program (i.e. Ztest) to fetch the data from the SAP standard table and store into my own database.
So I schedule a background job for the program (Ztest) to fetch the data. I schedule this job on hourly basis.
once first job will be runnig it will create one more instance to run after one hour.
Here my question is...
What if first job schedule on 1pm and runs for more than 60 mins (let's say it takes 90 mins to complete)?
Till what time it will fetch data (either till 1pm or 1pm +90 mins)?
If it fetch the data till 1pm +90 mins, then when second job will start and from what time it will start to fetch the data.
Hope this clears.
Thanks
Neeraj Manocha -
Schedule background job programatically
Hi,
I want to schedule background job programatically .
Also, I want to specify the scheduled start time & start date .
Please suggest .
Moderator message - This question has been asked and answered many times before. Please search before posting.
Edited by: Rob Burbank on Apr 16, 2009 12:27 PMHi
Please check this link
[http://help.sap.com/saphelp_46c/helpdata/en/fa/096ee5543b11d1898e0000e8322d00/frameset.htm]
Thanks,
Hari -
Run the Report as a Background job and Get the Output in Excel in Local PC
Hello Gurus,
I have one following requirement.
One should be able to run the report as a background job and it should be possible to get the report in Excel format, also when running the report in background. The excel report should have the same information and look as the current SAPreport.
Please provide some solution.
Any helpful answer get surely awarded.
Thanks a lot,
VarlanirGUI_* WS_* Function In Background, CSV Upload
GUI_* and WS_* function modules do not work in background
When scheduling a job in the background the appropriate statement to read in your file is OPEN DATASET, and the file must be on the file system that the SAP server can see.
At anytime, a user can switch of the Personal Computers even though the job is still running in the background. Therefore GUI_* and WS_* function modules are not designed to work in that way, as they need to access your personal computer file.
To choose the correct download method to used, you can check the value of SY-BATCH in your code,
if it is 'X' use OPEN DATASET and if it is ' ' use WS_UPLOAD.
*-- Open dataset for reading
DATA:
dsn(20) VALUE '/usr/test.dat',
rec(80).
OPEN DATASET dsn FOR INPUT IN TEXT MODE.
IF sy-subrc = 0.
DO.
READ DATASET dsn INTO rec.
IF sy-subrc <> 0.
EXIT.
ELSE.
WRITE / rec.
ENDIF.
ENDDO.
ENDIF.
CLOSE DATASET dsn.
*-- Open dataset for writing
DATA rec(80).
OPEN DATASET dsn FOR OUTPUT IN TEXT MODE.
TRANSFER rec TO '/usr/test.dat'.
CLOSE DATASET dsn.
What is the difference when we use upload, ws_upload, gui_upload function modules?
UPLOAD, WS_UPLOAD, GUI_UPLOAD, are used in BDC concepts. ie., Batch Data Communication.
Batch Data Conversion is a concept where user can transfer the Data from non SAP to SAP R/3. So , in these various Function Modules are used.
UPLOAD--- upload a file to the presentation server (PC)
WS_UPLOAD---- Load Files from the Presentation Server to Internal ABAP Tables.
WS means Work Station.
This is used upto SAP 4.6 version.
GUI_UPLOAD------- Replaces WS_UPLOAD. Upoad file from presentation server to the app server. From 4.7 SAP version it is replaced.
How to Upload csv file to SAP?
Common File Download Upload Questions:
How you upload the data from text file to sap internal table? From my knowledge its by upload or gui_upload.
How you download the data from sap internal table to text file?
How you upload the data from xls (excel) file to sap internal table how you download the data from sap internal table to xls(excel) file.
You can upload data from presentation server to an internal table using gui_upload. Use gui_download to download from internal table to flat file.
Use fm ALSM_EXCEL_TO_INTERNAL_TABLE to upload data frm excel.
Use function module GUI_UPLOAD
The FILETYPE refer to the type of file format you need: For e.g 'WK1' - Excel format , 'ASC' - Text Format etc.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = 'C:\test.csv'
FILETYPE = 'ASC'
TABLES
DATA_TAB = itab
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17. -
In background job how commit & rollback work works?
Hello Friends,
My requirement is, to fetch all sales order items based on some condition and load them into one table say OCC1 in job J1. Now the second requirement is to upload the job information J1 with job name, user name, end date in second table say OCC2 in job J2.
My question is if there is some error I found while processing job 2 I have to rollback entire work which means I have to remove all records those I have inserted in to table OCC1. Can any one suggest me how to handle such problem? Some how I am able to create two job and update the tables. However, what about rollback work? Whether there is an implicit commit work after every background job? I am working on SAP 4.6C version.
Thanks,
Amol C.I think by using just ROLL BACK work it will not rollback your first job's data.
You need to make some mechanism which can delete the data from OCC1 if the J2 got error.
Regards,
Naimesh Patel -
Spool error for background job
Hi All,
I have scheduled one job in sap for a report.I have made a distribution list via tcode SO01.
I have given this distribution list to the SPOOL RECEPIENT section in SM 36.
The job is running successfully but is giving the following error and not sending emails to the distribution list.
The error is :-
"Spool list of step 1 could not be sent due to error 7".
Does anybody has any idea about this error?
Please help its a production issue.
Thanks in advance
Vivekanand MeghmalaLook at SAP note : 760838
Symptom
Background job spool lists are not sent.
Other terms
RSBTCRTE, RSPO_SPOOLJOB_TO_OFFICE, SO_DOCUMENT_SEND_API1
Reason and Prerequisites
1. The jobs in question have recipient references in table TBTCO but these have no equivalent in the Business Object Repository.
2. An error occurs when sending in the spool or in the Sapconnect layer.
Solution
This note does not provide a direct solution to the problem but it does provide a source code enhancement that you can use to create more trace information about the cause of the error. When you copy and execute a job with spool list recipients, trace messages are output when errors occur.
After implementing the correction instructions, use transaction SE91 to create the following message:
Message class: BT
Number: 347
Text: Spool list of step &1 could not be sent due to error &2.
In detail, the error numbers mean:
1 = Spool request does not exist (or no longer exists)
2 = Spool request does not contain any data
3 = Empty page area selected
4 = No authorization to send the request
5 = Access to the spool request is not possible
6 = Read error in the Temse layer
7 = Spool request could not be sent (sending problem)
8 = Incorrect request type
9 = Other
Maybe you are looking for
-
GL data Import using Adapters in FDM
Hi All, I am trying to import GL data using the below adapters, I have an Essbase application created to accept the data. I previously imported a text file into Essbase and that worked perfectly. Source Adapter :ES9x-G4-C Target Adapter :EBS-FIN-B FD
-
So i got a new 5c and im trying to back it up from icloud but it tells me to enter a password and i have changed the email for my itunes account and the email on the icloud is wrong so i tried to enter my password but it didnt work. so i need to kno
-
Money back from order cancellation
Dear Apple, I made an online order at www.apple.com/th for a Black 16GB 3G Ipad 2 on May 8th 2011 and cancelled the order in less than an hour after the order was placed. The money had been taken out of my bank account in 3 seconds after I pressed th
-
Hi, I have a requirement to upload a pdf file and print the pdf file together with a smartform in 1 spool. I am not sure how to read and print the pdf file. Tried using GUI_UPLOAD type BIN, but how do you send it to spool in pdf format? Will definite
-
ALE to transfer data of Outline Agreement
Hi, Can anybody tell me process if I want to trasfer data of condition recerd maintained for cotract .i.e. for 01.01.2009 to 31.01.2009 I have maintained one condition record , then for other period I maintained another condition record. And I want