1. Create tcode for SAP Query)
Http://www.saphow.com/html/17/n-17.html
SAP
Query
Create
Tcode
There are two ways,
Yes
Directly use the program name
Create
Tcode
, You can also create
Tcode
.
I. Create with a program name
Tcode
- Se93
Enter the required
TC
Ode
, Which must contain letters
Y
Or
Z
.
- Enter the description in
Start object
Select the second option on the page
"Program and selection screen (Report
Transaction )"
.
- Input
Query
Program name, select
GUI support
Page card
"Sap gui
Windows"
And save it.
PS
: Query
Query
Program name,
Sq01 → query → more functions → display report
Name
Create by program name
Transaction code is a very convenient method, but it has certain risks, because in different
System
Medium,
Two different
Query
The program names may be the same, and errors may occur when the program is transmitted in the system. (The program name generated by the target system may change after transmission, so this method is not recommended)
Se93
: Maintain the transaction code
Se93
: Select
Program and
Selection screen (Report transaction)
Se93
: In
Program
Field Input
Query
Corresponding program name
Ii. Create start_report with Parameters
Tcode
Use this method to create
Query
Of
Tcode
, Need to fill in
Query
Of
Usergroup
And
Queryname
And so on
3
Fields
And the corresponding relationship
.
If necessary, you can also specify the variant for the transaction code:
D_SREPOVARI-VARIANT
.
Se93
: Select
Transaction with parameters (parameter transaction)
In
Default values
For
Under the tab,
Transaction
Field Filling
"Start_report"
And select
"Skip initial
Screen"
.
Se93
:
Is
Query
Create
Tcode
2. Create a tcode for SAP reportpainter (grr1, grr2)
In this example, start_report is basically the same as tcode for query. The parameters in the last step are different,
3. You can also customize a program to implement the function similar to start_report. When creating a query tcode, call the custom program .*&---------------------------------------------------------------------*
* & Program name: z_callquery
* T-CODE: zcaq
* & Porgram type: report
* & Description: Call ABAP Query
*&------------------------------------------------------------------
* & Author: longxu
* & Date: 2010.04.01
* & Email: fangkailove@gmail.com
* & Blog: blog.gnolux.com
*&------------------------------------------------------------------
* & Function Spec No .:
* & Funciton Desc:
*&
*&-------------------------------------------------------------------
* & Modification log:
* & Version Date Author description change request
*&-----------------------------------------------------------
*&
*&-------------------------------------------------------------------
* & Refrence object:
* & Name type DESC
*&-------------------------------------------------------------
*&
*&-------------------------------------------------------------------
Report z_callquery.
Parameters:
L_bgrup like AQADEF-BGNAME,
L_quold like AQADEF-QUNAME.
Data: l_reptname like AQADEF-PGNAME.
Call function 'rsaq _ report_name'
Exporting
Workspace = 'G'
Usergroup = l_bgrup
Query = l_quold
Importing
Reportname = l_reptname.
If SY-SUBRC <> 0.
Stop.
Endif.
Call function 'rsaq _ submit_query_report '"or submit_report
Exporting
Queryreport = l_reptname
Variante =''
Exceptions
Only_with_variant = 1
Variant_not_exist = 2
Others = 3.