T-code: SQVI
For Creating New SAP Query choose “CREATE”
Give a name and click Create
Here we are creating SAP Query under the name “SAPQUERY” & ensure the description & the Data Source is been defined. In Data Source you have four options
1. Logical Database
2. SAP Query Info set
3. Table
4. Table Join
You can also choose “BASIS MODE” or “LAYOUT MODE”
Note: You can find the difference between “BASIS MODE” or “LAYOUT MODE” from the following screen shots.
Here I am Selecting Basis mode and select table join if more than two tables
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjljV4j27Hr_bQ-VhRaXzFZvbim9LiK9n55VoQ_bZVmm90E3VaVU1T3h_fXZtd97ASvQAkitx-ePg6CNidUeE0skQ8cmVRN4nGHyJMkJWQBPfRpvhjesCtj6-jGGK7Lc-v1HXdI/s400/2.bmp)
After defining the selection criterions then you get the below screen for inserting the Tables from were you to have extract the Query.
Now Click on Insert table button on top, and choose the table you require. In this example we are inserting two Tables VBRK and VBRP.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgANgAY70c3XoUiBBGdxY1Qf6DgQWw9D1pKNKRbUvShEI8DUyqAn0V-Uq7BwMuM2KPDQyu_xq1Y2THoXPkDke1P9-uh5LZaS_ycyfr4LiaNhPS1HY_Ms-9oN6z-jk7MHf8kVtzf/s400/3.bmp)
Choose Insert table Again and choose VBRP
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrKmhkK8BhjH8AkDNFvrLgG4xJ382SrDL2CaydFeqeilrEGDIKde6-aspLuUJn6RTi_DQtFegvF7TEhMuhD1L08R31BLX1ii_9_lYXIARprw1iTFzeburv__qJXumTsYK0nbi-/s400/4.bmp)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifWSEbIW4ZAzsFBgrEnme4Q-80IKR5iJBZ1K86SqvM2C9T-hkf3CfBnOaYD3_rHZtOPo6LtrxE8KeRl9J8OJJAVh7QY0FzZbICg5x5UKbcpBjxEFPzaXSwXAQyCC_qyyBzLDly/s400/5.bmp)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWhasTkBwUIsxq7cZbSbzm8vzXa1Zi11zZqBYXQ0F7mg8RE6Wv4t27MWrVUNxPYI5LT2eSeLEsz1lswHc9eUI4buCArMnx-_YFhdwd5KfSCy8tU7w99y-mjGj9GGM47HT6RwrU/s400/6.bmp)
Note: Ensure that when you join more than one tables the Primary keys should have linkage as in the below case the field name “VBELN” is the primary key were it is linked in both the tables.
Now Click on
Check button
for join conditions
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3X0YPtWazifrd3_2MvXgqDxq2Lh8roubOOr6gRRLC8T4Rxjj0IL3l-zxBqgptGM6ijsymMmR6ag-OCd9b6AeYrEcS6EMOBAajNbmR0zCbM3uQWAK6TzDAflbPz5SljCi7hB8_/s400/8.bmp)
Once you get the message “Defined Join conditions are correct”. In the bottom
of the screen then you can go back by clicking the back button.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI4knS4A34fcVR0dapwSLyxRwWHSAanFJ-r0ZzzpkpSeBVkKgGm8bPraG3h1xj4NWnxtdzvaOVnp124g-2QWqEoggvpMOII9NzV2e_xPNudfbs5nNE9rBzharLu9zEvpxsZKrJ/s400/9.bmp)
When you drill down you will find the list of fields used for the particular table in that we can select whether the particular field is only the listed field or the selection field or both.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqQ_FJkFEwrw1eckNT-8wk-IrzL0MjIk_Ih3e3MX7jtFVV-HWwSKfImY3v7AcBvtCeYpVu7Iwvy6zq5_IONh6OBHvfndSio5vehxvmpvzaErYu22FXcIoItV8WD9vUb3TOHdt-/s400/10.bmp)
Listed field is the Output field & the selection field is the Input field which has to be keyed in when generating the Query.
Below screen shot is shown for Table VBRK in that few fields are been selected for Listing as well as selection
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhzWnJ9eiHaeHXkN7TyH3Ep2Gxfsab9jaZYJ3ojyhCei5LqEF4Ul_M3glcQ34NTWf1qUNTmRMGCSVg9qmNiv4Jo0jZ-HmJaDJ5cTnA_jvgtm4NqYyWc2TNvk7uvt4n0Z4PZTtzy/s400/11.bmp)
After selecting the Listed & selected fields either by Basis or Layout mode check out for any errors click the check button.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhJwaE0yAP6uyWf2xCG9OLhSUErtgOmGCqfx8EAjaHV3kxfATyXcyLhqyOCg03GzAal4qokxxLddUDHeKmhMaDfmmuNv_HncMwSlKfKI-A4YK6So0Dz4Zud-eraef02bSKc7KX5/s400/12.bmp)
After clicking you ensure that you get a message “NO errors were found during consistency checks” is seen at the bottom of the screen after seeing this message the Query can be saved by clicking the SAVE button
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIONLjZT3l70ogD6qM-klQ576ZkHHQ8ilPLDwUnXQcirWhd28WGeLU2c-o8uXwPPOlO3lvx7x0xI-d-sKXi-7oo5j4Fw_aoSmhy_tc2PP7lX8JypPr8pYJCxF4hQQIDKZ-T556/s400/13.bmp)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHjKiS6ob5BF_RY1ONzFY3z01zyiFXJ89nFuzbsV5S6KKgDi0V3TkjbZpuOg4gphag9ae6_6L18sUfFjVkq7JfAg4s9hlHuuZf1p6yi_DfFDzY67K9fzSqthlhF6DUvj4ILCXJ/s400/14.bmp)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrGQAFlQt6Hv4JeG0-uhNbSiX3mPSrguKMUzw9yvLqw59D9T7Vc7NfWrmLkbhyphenhyphenHpGd2ZWXDvQkkW1NgT-ipfFrM3hc-MjPDVTWMXuHAESnGNt45xmZ4mEKWRIZU09dEW8zKGNk/s400/15.bmp)
Adjust the number of records
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIeK6LeZhUK7GjjfFiOodYL1-LeMFNrOp0uaznCuLokMP9HGgBvKaQ3CuLgJwl-pEbaMOqTffZd0CjytWzRu_y3IxW38FScByyPfx90pzhxPNtujbh_wBc89xLuYwVtypdwtD6/s400/16.bmp)
Below screen appears in SAP List viewer
The output
No comments:
Post a Comment