SAP Query Maintenance Functions


Performing maintenanceincluding locking your queries against changes, transporting them between clients, and so onis a task you will likely perform on a regular basis as you work with SAP Query. Having a good understanding of these maintenance functions is the key to properly administering the reporting solution in your organization.

Locking Your SAP Queries

Earlier in this chapter, I encouraged the use of the SAP Query tool's locking feature. The locking feature, described in the "Special Attributes" section in Chapter 3, allows a user to lock an SAP query. A locked query can be executed, copied, and transported (to the standard or global application area), but it cannot be altered or deleted by anyone other than the person who locked it (not the person who created it). Note that any user who opens an SAP Query (via the Change or Create button) and selects the Change Lock check box has his or her SAP user ID locking that query.

Best practice dictates that if you are creating queries associated with Rule 1, it is a good practice to lock your own queries during the creation process. In line with Rule 2, you should never select the lock indicator for queries that you intend to delete (those starting with a DELETE_ prefix). Finally, for those queries that will be used by multiple users and will become company staples (refer to Rule 3), you should ask your system administrator/owner to lock these individual company reports. This way, you can rest assured that queries cannot accidentally be modified or deleted.

Helpful Hint

Keep in mind that when a user locks a query and then is no longer a user, the only way the query can be unlocked is for the system administrator to reset that user's password and log in as that user to unmark the query. Another workaround is to simply make a copy of the query and then make changes to the copied version.


Copying Existing SAP Queries (Same Client, Same Query Group)

Although it is a great idea not to duplicate one report over and over, there are instances in which a standard report contains everything you need but is missing only a field or two. Because of Rule 3, you cannot change a company query. However, you can simply make a quick copy of the report (and its variant, if it has one; this is covered in Chapter 6, "Using Reporting Selection Screens: Advanced Skills," in the section "Variants") and than make the change you need to the copied version.

Follow these steps to copy a query:

1.

Navigate to the main screen of the SAP Query tool by using transaction code SQ01 and select from the list the query you want to copy (or type the query's name in the Query box at the top of the screen).

2.

Click the white copy button on the Application toolbar. A dialog box like the one shown in Figure 4.2 appears.

Figure 4.2. The Copy a Query dialog box allows you to enter a new name for your copied query.


3.

Type in a new name for your copied SAP query in the To Query Name box and then press Enter. Be sure to follow the naming rules discussed earlier in this chapter when naming the copied query.

4.

When your copied SAP query appears in the same user group as the original, change the long report title (description) of the copied query to distinguish it from the original.

Copying or Moving Existing SAP Queries (Same Client, Different Query Group)

In some cases, you might want to copy or move an existing query from one query group on the client to another. At any time, if you want to see a list of valid query groups on the client, you can navigate to the SAP Query tool main screen (by using transaction code SQ01) and press Shift+F7, to get a list. This list will appear only if you are currently assigned to multiple query groups (or if you have an administrator or SAP_ALL login type of security access). Although it is a great idea not to duplicate reports between query groups, in some cases, there is a business case for moving or copying a query to a different query group.

Follow these steps to copy a query to a new query group:

1.

Navigate to the main screen of the SAP Query tool by using transaction code SQ01 and select from the list the query you want to copy (or type the query's name in the Query box at the top of the screen).

2.

On a scrap of paper, write the name of the query and the name of the query group in which it currently resides.

3.

Press Shift+F7 to view a list of all query groups to which you are assigned.

4.

Double-click the query group you want to move the query to. You are now on the main screen of the SAP Query tool, and the query group is listed on the top left of the screen.

5.

Click the white Copy button on the Application toolbar.

6.

When a dialog box like the one shown in Figure 4.2 appears, take a look at your scrap of paper and type the query and query group names into the form.

7.

Type a new name for your copied SAP query in the To Query Name box, ensuring that the Query (User) Group lists the new query group name to which you are moving the query.

8.

Press Enter. Your copied SAP query, with its new name, appears in the new query group, along with the original query group.

9.

Be sure to change the long report title (description) of the copied query to distinguish it from the original (as needed), and be sure to follow the naming rules discussed earlier in this chapter when naming the copied query

10.

If you want to move and not copy a query, return to the original query group by pressing Shift+F7 and then delete the copied query as described in the following section.

Deleting SAP Queries

To delete an SAP query, follow these steps:

1.

Navigate to the main screen of the SAP Query tool by using transaction code SQ01 and select from the list the query you want to delete (or type the query's name in the Query box at the top of the screen).

2.

Select the trash can Delete button on the Application toolbar (see Figure 4.3).

Figure 4.3. The Delete Query dialog box allows you to delete existing queries.


3.

When a Delete Query dialog box like the one shown in Figure 4.3 appears, confirm that you want to delete the query by pressing Enter. A message appears in the bottom left of the screen, letting you know that the query has been successfully deleted.

Helpful Hint

Keep in mind the following guidelines when deleting reports:

  • Never delete another user's report.

  • Never delete a report that has the prefix ABC_(where ABC is an abbreviation of your company's name).

  • If you are unsure whether to delete a report, ask first. (It's better to be safe than sorry!)





SAP Query Reporting
SAP Query Reporting
ISBN: 0672329026
EAN: 2147483647
Year: 2006
Pages: 161

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net