cancel
Showing results for 
Search instead for 
Did you mean: 

General question on querying in SAP

Former Member
0 Kudos

Sorry in advance for what is probably a very basic question. Our company's conversion to SAP is still brand new, so my experience with SAP is still quite limited. I'm an analyst accustomed to being able to run SQL queries on our master data for auditing and reporting purposes. It seems like it's not that simple in SAP. I discovered the SQVI tcode which allows me to build very basic queries, but what if I would like something more robust? Would SQ01 and SQ02 be what I need? I don't have access to them currently so I can't play around, but I can look into gaining access if needed.

Here is an example of something I would like to be able to do. I would like to run a query on customers to find out which customers aren't tied to a sales representative. If I were able to write a simple SQL query for this, it would look like:

select a.*
from KNA1 a
left outer join KNVP b on a.KUNNR = b.KUNNR and b.PARVW = 'PE'
where b.KUNNR is null

I can't figure out how to do this in SQVI for anything. I can create outer joins but not complicated selection criteria. Would this be easy to do in SQ01? In my perfect world, there would be a transaction in which I could write my own SQL query like this, but I'm rather sure no such screen exits. Thanks in advance for any advice.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Why don't you go for screating small program in SE38.

You can define some internal tables as then you you write SQL statements.

You can keep breakpoints and debug them and you can work the SQL Statements or here ABAP statements to be in SAP

Regards

Vamsi

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks - it definitely sounds like I need to get access to the SQ screens and SE38. I have never coded in ABAP so I am not sure whether our SAP development team will give me access to SE38 but I would love to learn so hopefully they will.

Former Member
0 Kudos

Hi,

For this I think you need to create SAP query based on Infoset, check the following document to see how you can join two tables in SAP Query,

[http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10eab7af-0e54-2c10-28a5-87b47adbe1a5?quicklink=index&overridelayout=true]

Regards,

Durgesh.

Former Member
0 Kudos

This message was moderated.