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:
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).
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.
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.
Now you see that my first table has been added.
I now repeat this step, and also add table BUT100 (this table contains the maintained Business Partner Roles per business partner).
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)
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".
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.
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..
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.
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.
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!
I now save these settings.
I now quickly launch the Transaction code SQ01 to show you I have actually access to this user Group.
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.
I now can see below that I have access to User Group CRM_TEAM1. But for now there are no queries visible yet.
In the menu (in transaction code SQ01) I now choose: Query >> Convert Quickview
In the following screen, I choose the relevant SQVI Query (that I - USER7SAP37) have created before, using the Input Help Button.
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 :-)
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)
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
The SAP University Team