So many times I saw Transaction Code for SAP Query defined in a strange way; many ABAP developers uses to create a TCode for SAP Query as they do for common reports.
This is dangerous because the report is auto-generated and sometimes this report changes (especially after a system upgrade) or it does not contains new implementations (you have to force regeneration).
The right way to create a Transaction Code is to refers directly to the SAP Query (AQQU object type).
From transaction SE93 create a new Object as shown in the image below
in the next screen complete the fields
Skip initial screen X
Box “Classification” (as you want)
Box “Default value” add the following parameters:
|D_SREPOVARI-EXTDREPORT||<sap query name in SQ01>|
|D_SREPOVARI-REPORT||<user groups belonging to the query>|
If user group is in global area you ave to add “<space>G”.
For example if you want to use the query ZQUERY in global user group area ZUSERGR you have to set:
Further informations on SAP Query could be found on OSS note “393160 – SAP Query Using queries.pdf”.