Send me Weekly Updates!




headershadow

How to share an SQVI query in SAP?

Print Friendly

I assume you already have an understanding about how you can create an SQVI Query..

For those people that have not used this powerful tool before, I "ll demonstrate this with an example. In chapter 2 I will next demonstrate how you can actually share your personal made SQVI query with your colleagues!

Creating a new Query via Transaction Code SQVI

In the SAPGUI, launch the QuickViewer using the transaction code SQVI.

This will show the following screen:

SQVI Quickviewer

First enter a useful name, and next press the "CREATE" button.

As an example, I will quickly create a query, called ZBP_ROLES which  I use a lot in the context of SAP CRM Business Partner Role checks, using a Join between the tables BUT000 and BUT100.

This query will allow me to quickly identify following things:

* which BP roles have been maintained for a certain business partners

* which Business partners are maintained with e.g. the role BUP003 (Employee).

Table Join as Datasource in SQVI

In the title, I just entered a relevant explanation for myself...and in the field Data Source, I choose  "Table Join" as will want to create my query based on the two tables.

Insert Tables to be joined

I next push the button "Insert Table" in order to add my first table (BUT000). This table contains general master data for a Business Partner.

Add Table BUT000

Now you see that my first table has been added.

SAP CRM Table BUT000

I now repeat this step, and also add table BUT100 (this table contains the maintained Business Partner Roles per business partner).

Table join between BUT000 and BUT100

The Join condition in this case is automatically set by the field PARTNER which for this join is correct. You"ll notice this will not always be the case when adding tables ... therefore I usually test this process and especially the join conditions out before I create my query..just by looking at the CRM Datamodel or just testing out the GUIDS and see which match if I use them across tables.

Now that my tables have been added, I push the "green back-button" and I "ll see the next screen, where I can choose my input and output fields.

To keep it very simple, I choose following fields as Input/output:

  • BUT000-PARTNER (not visible in below screenshot as the table is collapsed- but  I marked this field as "list field & selection field".
  • BUT100-RLTYPE (see below screenshot)

Selection of input & Output fields

Now I pres the Save Button ..and next press the "green Back-button".

 

The only thing that always seemed mysterious is that even although I pushed the save-button already, I still get a pop-up asking me whether I would like to save this query or not...I always press "YES"  such a case... :-)

Now you see that in my list my first SQVI Query has been created, which I now can launch using the "Execute-button".

Query is available

I'll quickly also demonstrate the use of this particular query:

suppose I would quickly like to found out how many "Employees" have been created in my demo system, and I actually would like to have a list with all relevant Business Partner Numbers. In such a case, all I have to do is fill out the selection field "BP Role" with the value BUP0003 (you can use the input help, if you are not sure about the technical name of the BP role) and press the execute button.

execute SQVI Query

The output is now being generated by the system. If I would like to, I can easily export the results into MS-Excel or a flatfile..

Output of SQVI Query

So far the query building basic tutorial..

Sharing the SQVI Query with other Users

Part 2, which is perhaps not that well known, even by experienced SAP consultants, is how you can actually share you "personal" SQVI queries with your colleagues. As I work in a Team of 4 SAP CRM consultants currently, I often create a useful Query using SQVI, but as this is created as a "private" query, it 's by default not accessible by my other team members. As such we usually share them using this technique.

Now, for this purpose I quickly created a User Group (CRM_TEAM1) using tcode SQ03.

SQ03 User Group Creation

What I did was just enter a new "User Group name" in the field 'user group'. In this case CRM_TEAM1, I next pressed the button CREATE.

In the following Pop-up , I entered a description for this User Group.

SQ03 User Group Description

Then I pressed the button 'Assign Users and InfoSets" where I added my Own UserID to the list. Here you would actually add your other team members too!

Add User(s) to a User Group in SQ03

I now save these settings.

I now quickly launch the Transaction code SQ01 to show you I have actually access to this user Group.

SQ0 1 -global area

When you launch SQ01, by default it will show the Queries contained in the global area. Here, in the menu I first choose:

Environment >> Query Areas (where I 'll choose "standard area - client specific" as this is where I will see my new created User group.

choose Standard Area

I now can see below that I have access to User Group CRM_TEAM1. But for now there are no queries visible yet.

No Query visible yet so far

In the menu (in transaction code SQ01) I now choose: Query >> Convert Quickview

Convert QuickView in SQ01

In the following screen, I choose the relevant SQVI Query (that I - USER7SAP37) have created before, using the Input Help Button.

choose the SQVI Query

Obviously I select the query ZBP_ROLES  -as I only have created just 1 query on this demo system, the list is pretty limited to choose from  :-)

fill out query name and infoset name

In the above screen I entered the same name for the Query & Infoset.. this seems to work just fine for me.

Our wanted result appears now in the SQ01 list (for UserGroup CRM_TEAM1)

Query is now also available in SQ01

Now, my colleagues and I can just launch this query using the transaction code SQ01.

I hope this was somewhat useful for you .... to be honest - I only learned the Query sharing trick the past year --after more then 12 years working in SAP  :-)

But I sure think it's been useful (as my other experienced colleagues also were not aware of this...

cheers and good luck

Davy

The SAP University Team

 

Davy has been working as an SAP Consultant since 2000 and started working in the SAP IS-U Module , but as of 2002 he has mainly worked as functional SAP CRM consultant and SAP Authorizations consultant.
More about

13 thoughts on “How to share an SQVI query in SAP?


Comment author said

By ranjeet on 10 November 2012 at 04:52

Thank you! I am new to SAP FICO and learning lot of new things. Thank you for sharing this info!

 

Comment author said

By Eugeniu Jomir on 11 February 2013 at 11:50

Hi Davy, thanks for sharing this. By the way do you came to know a way to find out the SQVI queries by user? i.e. I am interested to know if someone has created a querry in SQVI.

 

Comment author said

By Davy Pelssers on 20 February 2013 at 09:22

Hi Eugen, I have not an immediate answer ..
the only tables related to SQVI queries I could find back are:
AQLQCAT
AQGQDOC

and a function module which might be useful in a way:
RSAQ_REMOTE_QUERY_CALL_CATALOG

but not entirely what you were looking for I think.
cheers mate
davy

 

Comment author said

By vikram on 19 July 2013 at 21:25

Excellent!.. detailed steps with screenshots helped a lot.. Davy, what do you do,. We might need to be in touch,. my e m a i l : vikram ramev at g m a i l dot c o m - no spaces.

 

Comment author said

By Brian on 9 September 2013 at 17:36

what if Convert Quickview is grayed out?

 

Comment author said

By Davy Pelssers on 16 September 2013 at 20:14

you might want to check your authorizations in that case using SU53.

I have never had that issue so far..

cheers
Davy

 

Comment author said

By Nakul on 16 September 2013 at 08:48

absolutely a useful one.
thanks
:)

 

Comment author said

By Elizete on 14 October 2013 at 16:42

Hi Davy,

I did a query using SQVI transaction. Later I added a new table in the original join of this query and it works, but after that, I regretted and I'd like to delete this table from the join, but I couldn't.
Do you know how to do to delete a table from a query in SQVI ?
Thanks,
Elizete

 

Comment author said

By Davy Pelssers on 14 October 2013 at 18:06

Hi Elizete
as far as I know you can not delete the table once saved. but as you are using SQVI, you can easily recreate the query and delete the wrong one.
In the new query just do not add the table you want to delete.

cheers

 

Comment author said

By Elizete on 14 October 2013 at 18:45

It is exactly what I thought and is what I'll do.

Thanks.

 

Comment author said

By Davy Pelssers on 31 October 2013 at 12:39

When changing things in an existing and working query, you could of course Always create a copy upfront, before making any new changes, just to assure you are not screwing up the entire query..

If you select your existing query in SQVI, you can use the copy button in the menu, to copy it to another name, allowing you can play around without risk :-)

cheers
Davy

 

Comment author said

By susan e on 30 October 2013 at 13:41

Davy,
We have a query that is in Production. We are asked to include more fields to the report. So i added additional tables like VBKD and KNA1 and KNVV to the origianl infoset, made changes to the query and transported it to Quality. Then in Dev, i made some changes to the query again and saved it, now the same query does not pull up any data. I recreated a new infoset with the same fields and new query i get the same error "no data selected". The strange part is, when i run the Quickviewer query using SQ01 i get the data, but if i run the infoset query i get no data!! Any help in this direction is appreciated. Just do now know what could be going wrong.
The tables used are
VTTK--> VTTP-->LIPS-->LIKP-->VBKD
LIKP-->KNA1-->KNVV

 

Comment author said

By Davy Pelssers on 31 October 2013 at 12:34

Without seeing the table join conditions in a screenshot I can not really Judge anything.

If the system says 'no data selected", than most probably one of the join conditions is likely to be wrong.

What happens a lot is that the system proposes a join condition itself, which on itself is wrong. I usually check and test them out myself, to see how the tables are linked together by which keyfields.

cheers
Davy

 

Leave a Reply

*