Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Transaction code for Query

Former Member
0 Likes
3,375

Hello,

How can I create a transaction code for a Query ?

Thanks,

Benoî

1 ACCEPTED SOLUTION
Read only

sergey_korolev
Active Contributor
2,097

Hello Benoît,

No need to use small report

No need to use generated program name (it really can change)

Just create a parameter transaction with reference to START_REPORT transaction. When creating a parameter transaction you have to set the following parameters:

D_SREPOVARI-REPORTTYPE = AQ

D_SREPOVARI-REPORT = precisely the first 12 characters - query user group (including trailing spaces), 13-th character is G for global queries

D_SREPOVARI-EXTDREPORT = Query name as shown in SQ01.

That's it.

Well, and do not forget to check the flag "Skip first screen".

To all others interested: just try to add some SAP query into a role via PFCG, then run it, and then via System -> Status look into the definition of the transaction generated, and you'll see the answer.

Message was edited by: Sergei Korolev

11 REPLIES 11
Read only

Former Member
0 Likes
2,097

Hi,

Goto SQ01 and select the following menu path to findout the Query Program name.

Query --> More functions --> Display Report name.

Create a transaction code in SE93 by using this Report name.

Thats It.

Regards,

Vijay

Read only

0 Likes
2,097

This does not work, the name of the program can change...

Read only

0 Likes
2,097

Hi,

I too suggest you to create a query in SQ01 and then use it in report.Then create transaction for that report.

Read only

0 Likes
2,097

Hi,

if prg-name can change ,

create a short report with fm RSAQ_REPORT_NAME,

submit found reportname and integrate that prg in a transaction

Andreas

Read only

Former Member
0 Likes
2,097

For Creating Query follow the steps as below:

In order to create an ABAP query , one has to do the following.

1. Create an User group.

2. Create a Functional Area

3. Assign the User group to the Functional Area

4. Create the query based on the functional area created.

You can create or execute these, using the transactions below.

SQ01 for Query

SQ02 for Functional Area.

SQ03 for User Group.

First Step is to create a dictionary structure . Include all the fields in this structure that you want to output.

Then create a report program having the following structure .

I guess U cant create, if i find any solution i will get back to you.

Message was edited by: Judith Jessie Selvi

Read only

Bema
Active Participant
0 Likes
2,097

Hi ,

Go to SQ01 transaction.

Select your query name

Then Click on Query->More functions->Display report name

Copy this report name.

Then go to se93

Create a transaction code . Here for the program name , paste the report name you copied.

Regards ,

Beena

Read only

Former Member
0 Likes
2,097

Hi,

Create a short report with FM 'RSAQ_QUERY_CALL' inside. Link the report with your transaction code.

Svetlin

Read only

sergey_korolev
Active Contributor
2,098

Hello Benoît,

No need to use small report

No need to use generated program name (it really can change)

Just create a parameter transaction with reference to START_REPORT transaction. When creating a parameter transaction you have to set the following parameters:

D_SREPOVARI-REPORTTYPE = AQ

D_SREPOVARI-REPORT = precisely the first 12 characters - query user group (including trailing spaces), 13-th character is G for global queries

D_SREPOVARI-EXTDREPORT = Query name as shown in SQ01.

That's it.

Well, and do not forget to check the flag "Skip first screen".

To all others interested: just try to add some SAP query into a role via PFCG, then run it, and then via System -> Status look into the definition of the transaction generated, and you'll see the answer.

Message was edited by: Sergei Korolev

Read only

2,097

hi Sergei, i have a problem trying to do that. when i assign de user group with trailing spaces, the system show me the message EU270 "Do not use blank characters", i use the separator character "_", but anyway the problem persist, and the system shom me the message AQ801, "User group ZSD________G has not yet been created"

can you help me please ?, i really need to solve these problem asap

thanks in advance.

Read only

0 Likes
2,097

"D_SREPOVARI-REPORT = precisely the first 12 characters - query user group (including trailing spaces), 13-th character is G for global queries" still helpful in 2020! Thanks!

Read only

Former Member
0 Likes
2,097

Done