cancel
Showing results for 
Search instead for 
Did you mean: 

How to do table join thru SAP Query

Former Member
0 Kudos

Hello,

I want to fetch data from diffrenet tables in SAP in a report format. Can anyone suggest me how to do SAP query for table joining. I searched in forum, but i could find links.

thanks

Jason

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Jaison,

The underlying configuration for the query reporting tools is a simple three-step process that generally takes less than 10 minutes to complete:

1. Create a new query group.

2. Create a new InfoSet.

3, Assign the InfoSet to the query group.

Step 1: Create a new query group

The first required piece of configuration for using the query reporting tools is the creation of a query group. As mentioned earlier, query groups permit a user access to create, modify, and execute reports in a certain area within the SAP R/3 system. To create a new query group, perform the following steps:

u2022Navigate to the query group initial screen via transaction SQ03 (Maintain User Groups2)

u2022Ensure that you are in the standard (i.e., client specific) query area by following the menu path Environment Query Areas and selecting the standard area

u2022Enter the name of the query group you are creatingu2014 ZTEST in the example u2014 and click on the Create button

u2022In the Create or Change dialog box, enter a description for the query group and click on the Save button, which returns you to the query group initial screen. The SAPGUI status bar. Displays a message confirming that query group ZTEST has been saved

Step 2: Create a new InfoSet

The second required piece of configuration is the creation of an InfoSet to serve as the data source for queries. To create a new InfoSet, perform the following steps:

u2022Navigate to the InfoSet initial screen via transaction SQ02 (Maintain InfoSet)

u2022Ensure that you are in the standard (i.e., client specific) query area by following the menu path Environment Query Areas and selecting the standard area

u2022Enter the name of the InfoSet you are creating u2014ZTEST in the example u2014 and click on the Create button

u2022On the Title and Database dialog box enter a description for them InfoSet in the Name field u2014 in the example I entered Test InfoSet u2014 and select a data source. For the example, I have selected the F1S logical database from the dropdown list. Fixed point arithmetic is selected by default. Click on the green check mark to continue

u2022You will now see a screen listing the tables stored in logical database F1S. As you can see, F1S contains three tables: SPFLI (Flight schedule), SBOOK (Flight demo table), and SFLIGHT (Flight booking). To view the fields in these tables, enter a description for the InfoSet in the Name field u2014 in the example I entered Test InfoSet u2014 and select a data source. For the example, I have selected the F1S logical database from the dropdown list. Fixed point arithmetic is selected by default. Click on the green check mark to continue

u2022The next step is to assign fields to the field groups (shown at the upper right of the screen) within the InfoSet (in Release 4.6C and higher field groups are automatically created based on the tables within the logical database). Only the fields included in the field groups will be available for use in the query reporting tools that use this InfoSet as a data source. Click on the Flight schedule field group to select it, right-click on one of the Flight schedule fields in the data fields list on the left (e.g., Airline carrier ID), and select Add field to field group.

u2022Click on the Assign users and InfoSets button. On the Assign Users screen, enter the IDs of the users you want to include in the query group. Be sure to include your own user ID

u2022Save the entry by clicking on the Save button in the standard toolbar. The SAPGUI status bar displays a message confirming that query group ZTEST has been saved.

u2022Repeat earlier step to add more fields to the field groups. Be sure to add fields to the appropriate field group u2014 for example, fields in the Flight schedule table should be added to the Flight schedule field group, fields from the Flight demo table should be added to the Flight demo table field group, and fields from the Flight booking table should be added to the Flight booking field group

u2022Once you have added a series of fields to your field groups, click on the Save button in the standard toolbar. The SAPGUI status bar displays a message confirming that InfoSet ZTEST has been saved

u2022Click on the Generate button in the application toolbar to generate the InfoSet. The SAPGUI status bar displays a message confirming that InfoSet ZTEST has been generated

u2022After the InfoSet has been successfully generated, return to the InfoSet initial screen by clicking on the green back arrow button in the standard toolbar.

Step 3: Assign the InfoSet to the query group

The last step you need to perform is to assign the InfoSet to the query group, so that intended users have access to the intended InfoSets (e.g., so those in the sales query group have access to the sales InfoSet, and so those in the HR query group have access to the HR InfoSet). To assign the InfoSet to the query group, perform the following steps:

u2022On the InfoSet initial screen (transaction SQ02), make sure the newly created InfoSet ZTEST is present in the InfoSet text box and click on theUser group assignment3 button

u2022On the Assign to User Groups screen, highlight the newly created query group name by clicking on the small gray box to the left of its name

u2022Click on the Save button ( ) in the standard toolbar. The SAPGUI status bar displays a message confirming that the assignment of InfoSet ZTEST has been saved

At this point, the configuration is complete, and the query reporting tools are available for use by end users. The sections that follow detail how the query tools can be used, so that you can ensure the proper use of the tools by your end users, and so you can support end users in using the tools as needed.

Try it out. It is simple !!!

Thanks,

RKM.

Former Member
0 Kudos

guys, I think my question got misinterpretted. As I was looking for simple table joining and all through SQVI t code. I am a fuctional consultant, not an ABAPer.

I just wanna joint fields between to tables which are having similar fields and need to assign a T Code for that report which I created through SQVI

Thanks

Jaison

Former Member
0 Kudos

Hi Jaison,

We can close this issue then.

Thanks,

RKM.

Edited by: RAVI MISRA on Jan 6, 2009 4:36 AM

former_member244309
Participant
0 Kudos

In transaction SQVI, when you initially create a quickview query then you need to select the Data source = "Table join". This will bring you to a screen where you can insert the tables (use 'Insert table' button) that you want to join and then you can begin creating your report. If you want to add another table later, then you would click on the u2018Data sourceu2019 tab at the initial screen and click the button to u2018Change joinu2019.

For any query you create in SQVI, you will need to convert it to an SAP Query before you can link a transaction to it. To do this, go to SQ01 and then go to menu path Query --> Convert Quickview. This link has more info about converting a quickview: [http://help.sap.com/saphelp_46c/helpdata/en/b4/bbcd34f7b911d2963d0000e82de14a/frameset.htm]

Former Member
0 Kudos

Hi Jaison,

as per my understanding if you are making a query using sqvi then you can not assign a t code to same as sqvi is for use specific.But you can create a simple query using SQ03, SQ02, & SQ01.After you have created the query then copy the progme name taht is generated by the system and assign a t code to in the transaction SE93.

Regards

Bibhu

Former Member
0 Kudos

hi

check

or

first go to Sq02

On the left hand side there is a field by the name of infoset.

Give any appropriate name. Then click on create button.

then a screen will appear , write the name. In data source field click on Logical Database . Here you have to select PNPCE, PAP, PNP according to your requirement.

If you want to create Query on anything related to applicant select PAP. If ur query is based on Master data select PNPCE.

After selecting click on tick mark (green in colour) which is given below. A screen with different folders of infotypes will appear. Select the required infotypes which you want accoridng to your requirement. Then click on tick mark again.

Then click on generate button (red & white in colour) (3rd button from the left). A screen will appear with the name

create object directory entry. Here you have to click on local object button.. you will now see that the system haas generated a Message saying "Infoset------- generated.

In sq02 there is a button with the name Role/User Group Assignment . Assign the user group out here.

Then go to SQ01, click on infoset query. Select ur user group. You can see the name of the query which you have created.

-ashok

former_member186399
Active Contributor
0 Kudos

Hello Jaison

Please refer following link and let me know your feedbacks.

Link: []

Regards

gajesh