Sorun Cevaplayalım

İşinizle ilgili öngörüler edinin, gerçek zamanlı bilgilere göre karar alın.

SAP Eğitim ve Sertifika Dönemleri

Uzmanlığınızı ve deneyiminizi SAP çözümleri kullanarak tasdik edin.

Çözüm Ekibi Başvurusu

Kullanıcılara hızlı ve pratik çözümler üreterek görev almak isteyenler.

SAP BLOG InfoSet Queries Simplified

SAP Blog

Kayıtlı Üye
Katılım
22 Ara 2017
Mesajlar
1,079
Tepki puanı
6
In this blog I would be discussing some basic concepts for Managing Queries in SAP. These queries are quite powerful and can be learnt by functional and business users which can give them pretty handy tool to cater to any reporting requirement they might have.

I have been using queries but often tend to get confused so I am including some easy steps which would help to understand

  • How to build a query
  • What are the different options on queries like SQ01, SQ02 that can be used to modify queries
  • Linking to a Tcode
  • Making changes in the layout using Variant
  • Other useful information
How to Build a Query


SQ01: It is the Query group which has got a lot of infoset Queries in it .You can also choose query area to be standard or Global;

Standard: Non transportable

Global: Associated with a transport

queries-creation.png




You can choose your Query Group from below and see the infoset queries associated with it

I choose Z_*

2.-Select.png


After you select the query group you would see the Query associated with it as below

My query name is Z_vendor . Select the query Z_vendor and click on infoset query to open the query

3.-Queries.png




This now Opens the SQ01 Tcode which shows the additional logic for this query;

Or you can also go to SQ02 and open this query by clicking on change

4-queries2.png


Click On Join to add tables from which you need to read the data

5-Queries-2.png


Create a field group and drag and drop to add fields these are going to be either the Selection fields or will be the result column in your report.

6-Field-group.png


Click on regenerate to finalize the query

7-field-groups.png


If you click on ‘Extras’ button on the top it would take you to build any custom logic if needed for any of your fields. I added a Z field called ZNAME_ALL

8-add-custom-fields.png


Cliced on ‘CodingForAddition’ button

9-add-code.png


You can put the code here: This code is added to concatenate all the name 1 ,2 4 values into one field ZNAME_ALL.
10-codeing.png




Different Layout Options in SQ01 and SQ02


Lets now go back to SQ01 and click on ‘Infoset Query’

12-sq01.png

Here the system provides you an option to do below:

  • choose the fields which you want to show for selection
  • Choose the result column
  • Provide default value for selection fields

13-sq01-query.png


Now we will do remaining changes in SQ01 for this query:

14-SAP-query.png


You get the below 1st screen where you can put a variant .

There is also an option to ‘Execute only with Variant’

15-Vendor-search.png




Screen2 :

Shows the filed group associated with the query:

16-vendor-master-team.png


You can choose which field you want to show up on the query



17-check-boxe.png




Finalize the layout

  • First checkbox makes the field available for selection
  • ‘No’ Column decides the order of the field
  • Selection text : You can provide the selection Text that appears on the screen
  • ‘SV’: You can specify only a value on the selection screen — I have never used this
  • ‘1L’: Specify a line only— I have never used this



18-test-ing1.png


Click ON basic list and you find some more options to edit:

19-Screen.png


20-Test-screen.png


Linking to a Tcode


Once you are done with editing your query you can run now it but remember first to click on Query > More Functions > Generate program. The program gets generated and then click on Display report name to display the name of the program



20-generate-program.png


Report Name is generated as AQZZZ_MM========Z_VENDOR =

Assign this now to a T code:

Using SE93 Either you can directly assign this to your Tcode but remember the program name can generate differently in different systems

22-tcode-with-progra.png


The right way to do this would be to use SE93 option ‘Transaction with parameters’

23-screen.png


24-starta-report.png


Navigate below and enter these values;

D_SREPOVARI-REPORTTYPE AQ >> Queries

D_SREPOVARI-REPORT Z_MM G >> This should be 13 characters name of the query group with space and then G for Global query

D_SREPOVARI-EXTDREPORT Z_VENDOR_NAME >> Query Name



25-queries.png






Execute the query to see the selection screen using the Tcode or running the program



26-vendor-search.png


Making changes in the layout using Variant


If you want to change the layout using variant then in SE38 choose the variant option

27-vendor-search-2.png


Select the variant and click on change

28-vendor-search.png


This screen determines default values for specific fields

29-vendor-search.png


Variant attributes decide the other mandatory field criteria. The field can hidden or make a field mandatory etc. There is a checkbox which says ‘Protect Variant’ this ing a variant means the variant can only be changed by the person who created it or last changed it.

30-vendor-searhc.png




Remember the layout you specify on the screen can also be managed using the layout button



31-vendor-search.png


Rearranged the column order;



32-Vendor-columns.png




33-vendor-layout-1.png


34-Vendor-search.png


Remember the settings which you apply on the Variant and layout for display overrides the settings done in SQ01

To remove the protected lock on variant run the program RSVARENT to remove protected variant

It will remove all variants in the program which are protected

35-cancel-variant-protection.png


Other useful information


Read more about queries in the help document as below

https://help.sap.com/saphelp_nw70ehp3/helpdata/en/4e/4c5be17e1f6d30e10000000a15822b/frameset.htm

Other Tocdes used are as below:

Transaction Target User Purpose
SQ01 End Users Editing and executing Queries and InfoSet Queries
SQVI End Users Editing and executing QuickViews.
SQ02 System administrators Editing InfoSets
SQ03 System administrators Editing User Groups
SQ07 Translators Language Comparison: Translation of text modules



Thanks for reading my blog. Hope you find the document useful . Do leave a comment if you think I can include something more or if I need to change something.



Regards

Vinita

Okumaya devam et...
 
Üst