cancel
Showing results for 
Search instead for 
Did you mean: 

Scheduling Ad hoc query

Former Member
0 Kudos

Dear all,

I have created Ad hoc query and I would like to schedule a job to run this query and export the result into a local file (Unconverted txt file). I would appreciate your letting me know the useful links to guide me the procedures to take.

Thank you,

Kiyomi

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Scheduling a query can be the same as running a normal abap.

When you run an ABAP query it creates a ABAP program as well.

Copy that name, and do the normal scheduling in SM36.

Make sure there is a variant for the query.

Moving it to a local file you may need some help from you BASIS guys, if it is not possible then copy the query to an ABAP program and then add in the code to move it to a local file.

Former Member
0 Kudos

Thank you, Mark, for your advice.

Unfortunately, I have no basis of ABAP and help is not available. Therefore, I am looking for the possibility to do this with SAP Ad Hoc query without going through ABAP (something like creating a local package and scheduling it with Microsoft SQL Server using wizard). I wonder if it would be possible with SAP? or am I obliged to learn ABAP to do this seemingly simple task?

Former Member
0 Kudos

On the selection screen of an ABAP query there is the field "file store" which I am guessing you can use to save the file to.

In SM36 it is fairly easy to set up a job

You need a job name and then go to the step list.

You need to enter the program name, which if you save a variant of the query beforehand it should populate the query's program's name. You then need to add the variant. (have a look at the external command option)

Once this is all done you then need to define the frequency of the report, this is done in the start condition screen. You need to select the date and time icon.

Hope this helps more.

Former Member
0 Kudos

I am using InfoSet Query (S_PH0_48000513 - Ad Hoc Query) and I do not see the field "file store" in the selection screen. After I execute my Query with "Output" button, I save the result with Export - Local File - Unconverted.

Does SAP has any documentation to explain the procedures I should take step by step? I tried to find one but without success ......

Thank you very much for your kind help.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hey

I was thinking of the same thing for a scheduled report..

I was going to to use the vb recorder tweak it and use windows scheduled tasks.

Maybe that is helpful ? Maybe not but i thought I'd mention it.

Pav

Former Member
0 Kudos

If you want when i create mine ill share it ?

rwarri1
Active Contributor
0 Kudos

Hi,

You cannot download a file to a network/local drive when executing in batch as the batch is not connected to the network/local during execution. Batch jobs can only create files on the interface server which can then be transferred to a network drive with a separate batch job (via ftp)

Cheers !

Former Member
0 Kudos

Thank you, Rajesh,

Is there any SAP documentation exist to explain how to do so step by step? Unfortunately, help from ABAP specialist is not available, and I need to make it by myself......