ABAP query to schedule through batch job
Hi
i have requirement to schedule batch job for ABAP query report and download the report data to local drive throuh batch job.
we have created ABAP query report, and this report should run through batch job and download the report data to local drive,,
please help, how we can solve this.
Regards
Vanraj
Hi Vanraj,
I have two topics to talk about:
1st: in order to schedule a background job, try to do the following:
- Go to transaction SQ01 and select your query
- Check that you've already created a variant, containing the required selection data.
- Instead of running in online, go to "Query > Execute > Exec.in background"
- This will allow you to schedule the background job.
2nd: it is NOT possible for a background job to download a file to a local PC.
I hope it helps.
Kind regards,
Alvaro
Similar Messages
-
Invoice not generated through Batch Job
Hello
I am facing a Problem in Batch Job. When the delivery is created through VL01n transaction manually, the Invoice for this delivery is created automatically. However for one of the delivery the Invoice was not created automatically through Batch Job.
Can some one help me how to go further on this problem? I have checked the Batch Job and found that it is schedule daily, However the Delviery was created after this schedule time. So ideally this delivery should have been considered for automatic generation of Invoice in the next schedule run of the Batch Job. However this has not happened.
Any views on this
Regards
ScreamsHello,
Please check the billing date and the billing date which is in the variant. in the variant there could be that the billing date might have been specified from and to, in any case billing date for the document is not past the variant billing date it will pick up. -
ACH RUN F110 THROUGH BATCH JOB
Hello,
Is there a way, we can run the ACH Incoming Payment (Customers) through a scheduled batch job for the TCode F110?
I've configured the Incoming and Outgoing Payments successfully and I've been struggling with automating the Payment Run for the Incoming Payment(Customers). We're planning to keep running the Payable (Vendors) manually through F110.
Thanks in advance
SalmanHello Nitin,
It is working but now I am able to either create proposal through batch job or I can do payment run through the job.
Is there a way I could do a payment proposal and payment run through same job or through two jobs?
Thank You
Salman -
How to schedule a batch job to generate security audit log (SM20)
May be this is a repeat question for this forum. Apologize, if it is. Is there a way to schedule a batch job to generate security audit log (SM20) automatically and possibly send a message to SAP Inbox or generate a spool request? Release is 4.6C.
Regards
Nirmal> May be this is a repeat question for this forum. Apologize, if it is.
You don't need to apologize. You only need to do a very simple search...
> Total Questions: 18 (16 unresolved)
Perhaps 16 of those 18 questions you have not followed up on could have been spared as well?
Please do the needfull.
Cheers,
Julius -
Is there a way to access ABAP OO instances from a batch job report
Hello,
I am looking for a way to access ABAP OO instances from a batch job report. My circumstances are the following:
I have got some ABAP OO coding that identifies other objects (class instances) that have to be processed (they have a DoIt method that does some calculation). As this processing is time consuming and performace relevant I have to parallelize this in batch jobs. This batch jobs however can only be "simple" ABAP reports according to SM36. The problem is now that I dont really know how to tell the batch job report what objects to process. Somehow I have to access theses instances from that batch job report.
Does anybody have an idea?
Greetings
MatthiasHi David,
thanks a lot for your help. After a lot of searching on the net this seems to be the only way to cope with it. However I am not sure about the locking mechanisms and if its suitable for mass data processing. In the help page you suggested the following is stated which I do not fully understand::
"The current lock logic does not enable you to set specific locks for the following requirements:
· Many parallel read and write accesses
· Frequent write accesses
· Division into changeable and non-changeable areas
Although the lock logic makes the first two points technically possible, they are not practical because most accesses would be rejected."
Does this mean
a) if I dont want to set "specific locks" for frequent write accessess I am fine
or
b) I am discouraged from use shared memory technics for frequent write accessess?
In the latter case I will have a problem...
What do you think?
Greets
Matthias -
Smartform Printing through Batch Job
Hi
Please help in the following issue :
We have a report thourgh which say 10 pages needs to be printed.
On eachpage we have page numbers like 1 of 10, 2 of 10 etc. and on the last page 10 of 10 will be printed.
when the report is executed in foreground, the rints are perfect s expected. But when the same report is executed through Batch Job, the pages are being printed as 1 of &&, 2 of && etc, when it come to last page the print is 10 of 10.
So, thr Batch job the last page of the print is OK, except all other pages, the issue is only printing this page nos.
Please advise.
Regards
Shankarhi ,
make sure that u declared that page no printing window as final window.try it.
Regards,
karthikeyan k s, -
Creation of file through batch job scheduling
Hi friends,
I have a situation where I need to select vendor / customer and after that I need to select one of the option between invoice or payments when User select vendor then it should create a file through schedule batch job .
I am not getting how to do it .
Please help me if any one knows about it.
Thanks in advance.
GauravWhich part? The creation of the file? Since running in background, you would need to create the file using DATASET statements on the appliation server. You will not be able to put the file on any frontend PC or server, only on the application server where you program is running.
Regards,
Rich Heilman -
Two Deliveries did not go through Batch Job Runing
Hi,
In this company every evening the automatic batch Job for Billing due list is run but on Nov 23 one Deliver and on Nov 30 another delivery has not gone through i.e. the invoices were not created for these two deliveries.
I checked in VF01, the individual invoice is being created. The user is asking the reason for this and how to prevent this type of situation in future.
I don't know the Batch Job number and I think it has been done in VF06.
Please guide me how I can solve this issue.
Thanks,
JansHello Tushar,
Thank you for your reply. I don't know the Variant name also and I don't know the Batch Job number eirther. The user is not aware of these things. I tried to find out from VF06 but I could not figure out anything.
Please explain me your sentece "Execute billing program in foreground and check". you mean to say after creating the same scenario in the quality, I will run the Billing program ( I will take the Billing program from the VF01). If I am correct please let me know.
Regarding debugging, if I have to do how I can do it. I know to go to Debuggiing mode if I put in the command field "/h" , I will be in the debugging mode. But my question is which transaction Should I use VL02N or VF01 to find out the Problem
I have mentioned earlier that I went to VF01 and these deliveries are fine to create invoices but the User is interested to know the Problem and to find out the cause so that they can prevent it occuring in future.
Thanks,
Jans -
How to schedule azure batch jobs?
Hi.
I created an azure batch job app using Azure Batch .net client, following the instructions on http://azure.microsoft.com/en-us/documentation/articles/batch-dotnet-get-started/.
All the concepts are not very clear to me yet, and it lacks a complete documentation (I understand it is still new/under development).
Where do I upload the azure batch program?
How do I schedule it?Hi
If I understand correctly you want to try to only use Batch to run both the web crawling jobs and tasks as well as the client code that creates the jobs and tasks.
I'm pretty sure you can do what you want using Batch. I'll give you the high-level concepts here and some documentation pointers, then hopefully you can find the low-level info in the docs.
To host the client code you should use a Job Manager which is specified when creating a Work Item. The Job Manager is a special task that is run first when a job is created.
To have a job created and run every two hours you need to specify a schedule with the Work Item. A recurrence interval can be specified so a job is created every 2 hours.
To only create the VM's when needed then you should specify an Auto-Pool when creating your Work Item. You will need at least two VM's - one to run the Job Manager task and at least one to run the crawler tasks. Pool lifetime configuration can
be specified so that the pool lifetime is tied to each job that is created every 2 hours - the pool is created when the job is created and the pool is deleted when the job completes.
You'll find these concepts described in the REST API reference for Add Workitem -
http://msdn.microsoft.com/en-us/library/azure/dn820179.aspx
Assuming you're using the C# client API, you'll need some client code to bootstrap and create the Workitem, and will need to find the corresponding C# API's in that documentation -
http://msdn.microsoft.com/en-us/library/azure/dn865466.aspx
Hope that helps.
Regards, Mark -
Subject in the mail sent through Batch Job
Hi,
We have a batch job which is running daily.
Consumer wants the output of the batch job (spool request) in mail. We generally send the mail from batch job by filling the mail id in "Title field".. there is some third party involved in managing spool requests..
But now consumer wants to send the mail with a subject line filled..
I could not find any field or option in SM36 where i can fill in the subject..
Please help. Now we are getting the subject as user id + spool request + system number.Check the below Code.
DATA: NUMBYTES TYPE TST01-DSIZE,
PDFSPOOLID TYPE TSP01-RQIDENT.
DATA: BEGIN OF PDFDATA OCCURS 0.
INCLUDE STRUCTURE TLINE.
DATA: END OF PDFDATA.
DATA: G1_LINES_TXT TYPE I.
DATA : L_DOCUMENT_DATA TYPE SODOCCHGI1,
T_PACKING_LIST TYPE STANDARD TABLE OF SOPCKLSTI1,
W_OBJHEAD TYPE SOLI_TAB,
T_OBJBIN TYPE STANDARD TABLE OF SOLISTI1,
T_OBJTXT TYPE STANDARD TABLE OF SOLISTI1,
LW_PACKING_LIST TYPE SOPCKLSTI1,
L_LINES TYPE I,
W_RECEIVER TYPE SOMLRECI1,
T_RECEIVER TYPE STANDARD TABLE OF SOMLRECI1.
DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE.
DATA: OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE.
DATA: OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE.
DATA: DOC_CHNG LIKE SODOCCHGI1.
DATA: TAB_LINES LIKE SY-TABIX.
*...Read the Spool request number generated.
SELECT MAX( RQIDENT ) INTO G_SPOOL_NUM
FROM TSP01
WHERE RQCLIENT = SY-MANDT AND
RQOWNER = SY-UNAME.
*....Convert Spool to PDF
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
SRC_SPOOLID = G_SPOOL_NUM
NO_DIALOG = 'X'
DST_DEVICE = G_PDEST
IMPORTING
PDF_BYTECOUNT = NUMBYTES
TABLES
PDF = PDFDATA
EXCEPTIONS
ERR_NO_ABAP_SPOOLJOB = 1
ERR_NO_SPOOLJOB = 2
ERR_NO_PERMISSION = 3
ERR_CONV_NOT_POSSIBLE = 4
ERR_BAD_DESTDEVICE = 5
USER_CANCELLED = 6
ERR_SPOOLERROR = 7
ERR_TEMSEERROR = 8
ERR_BTCJOB_OPEN_FAILED = 9
ERR_BTCJOB_SUBMIT_FAILED = 10
ERR_BTCJOB_CLOSE_FAILED = 11
OTHERS = 12.
*...Convert 132 char to 255 char
LOOP AT PDFDATA.
TRANSLATE PDFDATA USING ' ~'.
CONCATENATE GD_BUFFER PDFDATA INTO GD_BUFFER.
ENDLOOP.
TRANSLATE GD_BUFFER USING '~ '.
DO.
IT_MESS_ATT = GD_BUFFER.
APPEND IT_MESS_ATT.
SHIFT GD_BUFFER LEFT BY 255 PLACES.
IF GD_BUFFER IS INITIAL.
EXIT.
ENDIF.
ENDDO.
Creating the document attachment
LOOP AT IT_MESS_ATT.
OBJBIN = IT_MESS_ATT.
APPEND OBJBIN.
CLEAR: OBJBIN,
IT_MESS_ATT.
ENDLOOP.
Creating the document to be sent
DOC_CHNG-OBJ_NAME = 'IG Balance'.
*.....Subject of the email.
CONCATENATE 'Intragroup Confirmation from AoO: ' P_ZAOO INTO DOC_CHNG-OBJ_DESCR.
DOC_CHNG-OBJ_DESCR = 'Intragroup Confirmation from AoO '.
*...Body of the email
OBJTXT = 'Please find attached a summary and details '.
APPEND OBJTXT.
OBJTXT = 'Any queries regarding the attached should be addressed to the contact names on the Report.'.
APPEND OBJTXT.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
Creating the entry for the compressed document
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
DESCRIBE TABLE OBJBIN LINES TAB_LINES.
OBJHEAD = 'Balace.PDF'. APPEND OBJHEAD.
Creating the entry for the compressed attachment
OBJPACK-TRANSF_BIN = 'X'.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 1.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'PDF'.
OBJPACK-OBJ_NAME = 'ATTACHMENT'.
OBJPACK-OBJ_DESCR = 'Balance Report'.
OBJPACK-DOC_SIZE = TAB_LINES * 255.
APPEND OBJPACK..
Entering names in the distribution list
DATA: L_CNT TYPE I.
LOOP AT T_EMAIL INTO W_EMAIL.
IF W_EMAIL-ZCONTACT1 IS NOT INITIAL.
RECLIST-RECEIVER = W_EMAIL-ZCONTACT1.
RECLIST-REC_TYPE = 'U'.
L_CNT = L_CNT + 1.
ELSEIF W_EMAIL-ZCONTACT2 IS NOT INITIAL.
RECLIST-RECEIVER = W_EMAIL-ZCONTACT2.
RECLIST-REC_TYPE = 'U'.
L_CNT = L_CNT + 1.
ENDIF.
APPEND RECLIST.
CLEAR: RECLIST,
W_EMAIL.
ENDLOOP.
SELECT SINGLE ZAOO
ZCONTACT1
ZCONTACT2 FROM ZFI_MT_RPTRMAP INTO W_EMAIL
WHERE ZAOO EQ P_ZAOO.
IF W_EMAIL-ZCONTACT1 IS NOT INITIAL.
RECLIST-RECEIVER = W_EMAIL-ZCONTACT1.
RECLIST-REC_TYPE = 'U'.
L_CNT = L_CNT + 1.
APPEND RECLIST.
ELSEIF W_EMAIL-ZCONTACT2 IS NOT INITIAL.
RECLIST-RECEIVER = W_EMAIL-ZCONTACT2.
RECLIST-REC_TYPE = 'U'.
L_CNT = L_CNT + 1.
APPEND RECLIST.
ENDIF.
Sending the document
IF L_CNT > 0.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
CASE SY-SUBRC.
WHEN 0.
WRITE 'Email sent successfully'.
WHEN 1.
WRITE: / 'no authorization to send to the specified number of recipients!'.
WHEN 2.
WRITE: / 'document could not be sent to any of the recipients!'.
WHEN 4.
WRITE: / 'no authorization to send !'.
WHEN OTHERS.
WRITE: / 'error occurred during sending !'.
ENDCASE.
ELSE.
MESSAGE S000 WITH TEXT-018.
STOP.
ENDIF.
*...Delete Spool Request.
DATA: SPOOLID TYPE TSP01_SP0R-RQID_CHAR.
SPOOLID = G_SPOOL_NUM.
CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
EXPORTING
SPOOLID = SPOOLID
IMPORTING
RC =
STATUS =
ERROR_MESSAGE = -
How to schedule a batch job for VT01N?
Hello SAP gurus,
Below is my concern:
Requirement is I need to schedule a daily shipment job on SAP utilizing Tcode VT01N and we have the Variant name. I have to process daily shipments (for one shipment only) to invoice required. And the job should be scheduled to run daily at a particular time.
I am very new to this thing can some please tell step by step how to proceed.
Thanks for all your help in advance.
Thanks
ShaHi Shayan,
These are the steps:
1.- Go to SM36 transaction.
2.- Put the job name.
3.- Select the "Start condition" button. The system will open a new screen.
4.- Select the option needed (Immediate, date/time, etc.). If you select "Immediate", click on save button.
If you select "Date/time", define the date and the time that you want to run your job. Then, click on the "Period values" button and select the option needed (i.e. hourly, daily, etc.) and save.
5.- Save the "Start time".
6.- Click on the "Step" button. The system will open a new screen.
7.- In the "Name" field, put the program of the VT01N transaction: SAPMV56A
8.- In the "Variant" name, put your variant name that you created before.
9.- Save the "Steps".
10.- Once you go back to the initial screen, save the job.
11.- Check your job scheduled in SM37 transaction.
Hope this help.
Kind regards.
SP -
I/b Idoc through batch job
Hi
If customer sent successfully idoc to our sap system to create orders .But if the Idoc is not created for the I/b idoc for placing orders in our system
Then how we can schedule or deal the customer requirement.
Regards
MKMore details, check the SAP link about EDI and ALE:
https://help.sap.com/saphelp_nw04/helpdata/en/6f/1bd5bea85b11d6b28500508b5d5211/content.htm -
Query on batch jobs with overlapping time during execution time
Dear experts,
This post is related to a task in SAP SCM EM module and currently I am working on an archival activity that comprises of two tasks to be done through 2 different programs (scheduled through batch jobs)
Job 1 is created to deactivate particular Event Handler records (changing a status field on the EH record)
Job 2 (archival job) runs daily and writes deactivated EHs to a local file and subsequently deletes this from SAP server.
Archival job takes an average of 30 hrs to complete .
Therefore my query is on how to schedule Job1, as these seem to be dependent and might impact each other in unexpected manner.
Please advise.
Thanks & regards,
MohanHi Mohan,
You can try as Daniel suggested. Delay Archieving job or can run after deactivating Event Handler records job is finished. Check any parallel processing is available or not.
It can stop your overlapping issue and can increase your performance.
Thanks,
Bala. -
Scheduled Batch jobs error : ora-01031 insufficient privileges
I have created a batch job that runs my database backups on a windows 2000 server. This job works perfect from the command line with the following syntax:
coldbackup.bat PROD
I have tried to schedule this backup to run every evening as follows:
at 01:00 /every:M,T,W,Th,F,S C:\coldbackup.bat PROD
The batch job does run every morning but generates an error when trying to shutdown the database. The error is ora-01031 insufficient privileges and seems to be related to the 'connect / as sysdba' command. The job has been scheduled using the local 'Administrator' user, which have been added to the ORA_DBA group.
I have thought of one solution and that entails hard-coding the username and password into the script, but that creates a security risk.
Can someone explain this behaviour and possible provide a good solution.
Thank youSolution: Yes, I have found the solution to my problem.
I was trying to schedule the batch job from the command line and in doing so the job was running in a 'system' user.
When I scheduled the job from the control panel --> schedule tasks I was able to enter the 'run as' username and password. -
Why am getting this ME083 error in BATCH JOB, where as ONLINE not getting?
Hi Experts,
Am creating Purchse Requisation by using BAPI ---> BAPI_PR_CREATE.
If I run ONLINE, Purchse Requisations are creating in EBAN table, with out any erorr messages, fine.
If the same prog. is scheduled as BATCH JOB in production, the Purchse Requisations are creating, fine, but, there is a ERROR MESSAGE in JOB LOG, saying that " ENTER PLANT " of M essage ID& # is "ME 083 "
So, let me know that,
1 - Why am not getting this error message, If I run it ONLINE?
2 - Even though there r error message in JOB LOG (as I mentione din the above), Why the Purc. requisations are creating?
3 - How to track that, from Where this error is coming in BATCH JOB, How to debug the BATCH JOB, after its scheduling?
4 - How to fix it?It is not uncommon for informational/warning messages to appear when a BAPI is run in batch.
Such messages do not prevent the completion of a job, but may provide information about the status of processing.
When you run the job online the message may just flash briefly on the bottom of the screen, and you might not even notice it.
I get similar messages when I run other BAPIs, where the message is logged but the process continues to run.
To address the question of the message itself, if you look at the code underlying the BAPI, for example, include L2105I01, which contains the methods, you can see the place where the message is issued.
The message is issued if field PR_TYPE in the header structure is initial.
This is fairly easy to find just by examining the source behind the BAPI and the methods that it uses.
You can navigate to include L2105I01 just by clicking on Method process in BAPI_PR_CREATE, just as you can with any other navigable object in ABAP.
You should see this in BAPI_PR_CREATE around line 108.
CALL METHOD l_ref_bapi->process( ).
Double click on process.
Method renumbering is then called by Method process if the actyp = hin (a constant meaning add/create which is set in BAPI_PR_CREATE), and if ITEM_INTVL (Item number interval) is not initial.
Double click on Method renumbering.
Method renumbering then checks if field PR_TYPE is initial, and if it is, then the message 083 that you are getting will be issued. You will also see that the message is issued as a warning only, which is why the document is still created.
You can drill down through the code by double clicking, as usual with navigation.
I found this initially by clicking method set_header, which brought up the include with the method code. I then searched for 083, which is the message id. I then backtracked to find out what the path to Method renumbering was.
Always do a little digging in the source, the message has to come from somewhere. If the first search does not get a hit, try the next one until you exhaust the possibilities. I chose set_header, since it appeared to be specific to the function of the BAPI, and something like that will usually be the best place to start. In this case, it took me right to it.
Brian
Maybe you are looking for
-
How do I find the size of my JPEG photos
I want to find the size of my JPEG photos so I know how many photos I can fit per GB on my flashdrive. I know that my photos are in the "all images" section, on the left side of my "Mcintosh HD" dialogue box, a box which contains just about everythi
-
1)I have one question that might seem naive. Under preferences in the sequence menu in FCP it say the aspect ratio for my project is DV NTSC 3:2.....now, does that affect quality when it is being compressed to the MPEG2-4:3 codec?? Everything seems t
-
Need help in the using VBA in BPS
Hey here i have a problem in layout in using VBA(visual basic for applications)... i have created a layout using 5 keyfigures from cube and i included two calculated columns along with them, and am also using a variable for 0 calweek here, here when
-
Event Type Linkages - No receiver type
We had an issue in our production server where users's were getting the "ambiguous workflow" error. We found the culprit to be an additional entry in the Event Type Linkages (SWE2) that had NO recever type. After we opened up the client, and remove
-
Incident/Accident Log CBIH82 - How to attach a picture?
Hello, How can I attach a picture to a Incident/Accident Log (CBIH82). I know we can use DMS but this is long and fastidious. I use ECC 6 and I know there are update from EHP3+ but I'm not planning to migrate soon. I also see an option in CBIH82, in