SAP Query
  1. You need to create User Groups and Functional Areas first (before you create any queries) - to which you will have to assign the relevant users.
  2. Remember that Query Areas - whether Standard or Global - have an effect on the view of the reports that are with the User Group and Functional Area selected.
  3. You can save an Ad Hoc Query and run it from ABAP Query where you have SAP standard selection options.
  4. For ABAP Query - always set the list format columns to 200 to maximise the screen output. When executing the query, save a variant and then tick the checkbox "execute only with a variant" to force the user to use the same parameters.
  5. Need to know the name of your query or run it with SA38, use the menu path Query More Functions Display Report Name. Generally the report name will be AQ50/SAPQUERY/HRtest - where the AQ stands for ABAP Query, 50 is the client name, SAPQUERY/HR is the user group and test is the report name.
  6. If you specify an ABAP Query to output in table format - then you will be able to sort, sum and find values in the resultant output.
  7. When creating a functional area which calls the PCH (org mgt) database, don't populate the field "selection screen version". Choosing either 900 or 901 from the drop-down options, will result in a different screen selection which does not allow the option of entering the evaluation path.
  8. When setting up a functional area which calls the PCH (org mgt) database, remember to include all the requiredPA and org mgt infotypes.
  9. When running a query in a functional area which uses the PCH database, ensure that you use the correct evaluation path which will offer the correct results - you can start off by using the evaluation path "o-s-p" which can be used in many queries.
  10. When selecting data in ABAP Query, it can happen that in order to be able to select on a particular field, you need to output it in the query. In other words, you have to stipulate the field as an output, in order to use it as a filter in your selection criteria. Seems weird but this applies to a few fields - one of which is the employee's employment status.
  11. Having created a query using one of the above 2 methods, you can view the source code by looking at the saved report using transaction code SE38. You can modify and add to the code and then rerun the report in SE38 or SA38. It is a good way to start to learn how to write ABAP reports - although it is unlikely to be the most efficient way of writing the code. Remember that once you have added to the code, you might experience problems editing it in ABAP or Ad Hoc Query.
  12. You can change the authorisation of a user to allow them to create, modify or run ABAP queries.
  13. Users can be assigned to user groups which are in turn assigned to functional areas. It is possible to amend the profile assigned to a user - to allow them to use ABAP Query - without them having been assigned to a user group.
  14. When choosing the fields to be output in the report, modify the field widths. The SAP standard ones can be quite wide, which can cause the data to flow onto a second output line. Modify the field widths in your report.
  15. Once having saved the report, it is wise to execute it from the main ABAP query screen. You can execute it from within the edit mode, but this can cause "system dumps" in compiling on certain occasions.
  16. You can transfer the results from a SAP Query directly into MS Word using the mailmerge functionality within Word. This would allow you to create templates in Word with the fields stipulated in the query. When looking at the output result in ABAP Query, choose the download to MS Word and choose the mail merge option. Choose new file to set up your template in Word using the available fields and save the template in a specified directory. The next time you link to Word, choose the "existing file" option and point SAP to the directory and file where you saved the template. The mail merge functionality will then kick in. Excellent for employee specific forms etc.
  17. Useful Transaction Codes
  18. SQ01 - ABAP Query
  19. SQ02 - Functional Areas
  20. SQ03 - User Groups
  21. Useful User Parameters
  22. AQB - Default User Group
  23. AQQ - Default Query
  24. AQR - Default List
  25. AQS - Default Functional Are