Save Time by Automating Your SAP Queries

  • by Atul Bakliwal, Service Delivery Leader for SuccessFactors/SAP HR, IBM India
  • October 15, 2004
You can automate frequently run SAP Queries via two options: You can send the output to a shared location or email the output to users. The author explains how to send the output to a shared location, which requires use of a function module exit.
Key Concept
R/3 accesses the function module exit EXIT_RSAQEXCE_001 when Private file is selected as the output option on the query selection screen. The function module exit works with two parameter tables, LISTDESC and DATATAB. The table LISTDESC contains the description (column headers) of the data table fields and the table DATATAB contains the actual data of the query output. The sample ABAP code in steps 1 and 2 combines the column headers and the actual data in an internal table, I_TAB_FINAL. Step 3 includes the code for creating the query output on UNIX and transferring the file to the shared destination in tab-delimited format.

Your company uses SAP Query to meet its reporting needs. Some queries run weekly or monthly. Have you ever wondered if you could set them up to run automatically? Well, it is possible. SAP allows you to run the query in the background and send the output to a shared location or to send the output to users in their SAP inbox or external email account.

I’m going to show you the option of sending the output to a shared location. I’ll explain the other option of sending the output to users in their SAP inboxes or external email accounts in a subsequent article.

You need to follow these steps to send the output to a shared location:

  • Step 1. Set up the query: Select the output format, dynamically default the dates, and save the query with a variant

  • Step 2. Write the ABAP code to put the file on the shared location

  • Step 3. Set up the job to run in the background

Atul Bakliwal

Atul Bakliwal is a seasoned, pragmatic SAP ERP HCM/SuccessFactors leader with over 20 years of deep expertise in solutioning, planning, managing, and delivering multi-faceted global implementations. He currently works for IBM India as a Service Delivery Leader for SuccessFactors/SAP ERP HCM, managing multiple implementations and AMS projects of various sizes and complexities in the SuccessFactor/SAP HR space.

See more by this author


No comments have been submitted on this article. 

Please log in to post a comment.

To learn more about subscription access to premium content, click here.