SQVI Query using "Alias"

Can we use a table again in SQVI Transaction code?

What is “Alias” in SQVI Transaction Code?

One of my colleague came to me and said I don't know if we can use a table multiple times in SQVI query. I thought there should be something which can help us. We searched and find “Alias” functionality in SQVI. Let's create a SQVI Query using “Alias”.


Objective : Create a query to display Purchase Requisition Number with service details


 Step 1: Execute transaction code SQVI and Enter.



Step 2: Enter Query Name (Start with Z/Y) in selection Screen in Text Box in front of Label Quick View and Click Create Button



Step 3: Enter Title, Comments and select data Source as Table Join from dropdown and keep checked Basis mode radio button and press Enter.


Step 4: Now It will open the Screen where you can insert tables and create join between them. Purchase requisition data exist in EBAN table and Service Data Exists in ESLL table.
As there are more other tables as well which are linked with these table to fetch all data which is built by purchase requisition transactions but I will take only basic details. 



Step 5: Insert EBAN and ESLL tables.


System by default purpose the link based on foreign key relationship

Now the business problem is, Service details are stored with Sub Package of ESLL-PACKNO which is equal to EBAN-PACKNO.

Means to fetch Service details we have to pass EBAN-PACKNO to ESLL-PACKNO After fetching record we have to pass ESLL-SUB_PACKNO to ESLL-PACKNO again. So, we have to refer ESLL two times.

In SQVI we can't insert one table multiple time so here “Alias” functionality help us. 



    Step 6: Click Alias > Click Create Button, enter table name and it's Alias.


   Step 7: Enter continue and Insert Alias table which is the replica of table ESLL. It is not necessary that join proposed by SAP will fulfil your expectation to generate required output. So delete purposed join and drag and drop field to create new join.  



Step 8:  Click Back and Create “Select Screen” and Select Output “List Fields”.


Step 9:  Click Save now Query will create. Click Back and Save Again.


Step 10:  After Save go to  Menu > QuickView > Additional functions > Generate Ptrogram

Step 11:  After generating program, know your program name by 
 Menu > QuickView > Additional functions > Display Report Name



Here program name is: AQAKSYSTQV000234ZMM_PRSERVICES 

Step 12:  Run above program on se38/sa38



So by this we can create SQVI query with same table multiple time using alias, we generated program, and we execute the same program to fetch required display.

Have a nice day.















 







 

Comments

Popular posts from this blog

Automated Note Search & Customer Code Detection Tool