cancel
Showing results for 
Search instead for 
Did you mean: 

Sales Query using SQ01

Former Member
0 Kudos

I would like to create a query or maybe two queries that return the following.

1. All Sales orders that have been invoiced in a particular time period. We must be able to show sales orders, net value and invoce number.

2. All Sales orders that have not been invoiced but are setup to be delivered within the specified time period.

Have been struggling with this one any help would be appreciated.

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

andrea_olivieri
Contributor
0 Kudos

Dear Clifton,

In my opinion, the ABAP query is not the tool that meets your requirements for the following reasons:

1. The tables to consider are too many :

Query1 VBUK, VBUP, LIPS, VBFA, VBAK, VBAP, VBRK, VBRP

Query2: VEPVG (Trigger Delivery), VBUK, VBUP, VBAK, VBAP

2. You must also consider the customization of your system, because in some cases, the blocked orders (delivery block) and the unconfirmed orders (confirmed qty = 0 in availability check) not appear as entries in VEPVG table.

3. Join of all these tables using ABAP Query or quick viewer, has low performance, in other words kneel the system.

I think that you should seriously consider the possibility of developing 2 new ABAP programs ($$$) without underestimating the aspect of performance which is crucial in this case.

Thanks.

Kind regards.

Andrea

Answers (2)

Answers (2)

r_d15
Participant
0 Kudos

Pls note few differences..

SQVI-Qucik viewer

Is suppose to use to create reports in SAP without doing any programming.

note- reports can only get in ALV format

SQ02-SAP/ABAP query

is also designed to create reports by users with little programming skills.It gives u more flexibility in generating reports.

note- reports can be generate in different format i.e ALV, Spread sheets, Word.

Hope that helps,

Cheers!

former_member217082
Active Contributor
0 Kudos

Hi

Your 1st and 2nd queries can be solved through VA05 report only

In your 1st query , in VA05 you can see the customer sales orders , the sales order Net Value , and if any sales order has been invoiced you can see the Invoice Number

Coming to your 2nd query , in VA05 only you can see the customers status wheather the sales order has been Fully / Partially delivered in one feild and in another feild you can see wheather that order has been invoiced or not with Invoice number

Regards

Srinath

Former Member
0 Kudos

Thank you for your prompt response.

I have tried VA05 , i do not see the Invoice number displayed.

Please let me know if i'am missing something

Lakshmipathi
Active Contributor
0 Kudos

Since your requirement has to be fetched from multiple tables, you have to use SQVI to table join

- VBAP (for sale order reference, order quantity),

- VBBE (for open order quantity) and

- VBRP (for invoice reference and billed quantity)

thanks

G. Lakshmipathi

former_member217082
Active Contributor
0 Kudos

Hi clifton

Anyways as your requirement is to combine tables and feilds Use SQVI and combine tables and feilds so that you can see in the data as per your requirement

So use VBAK , VBEP , VBRK VBRP tables and from these tables retrieve the feilds as per your requirement

Regards

Srinath

Former Member
0 Kudos

Thank Sri & Lakshmipathi

Can you please explain the difference between using SQ01 and SQV1.

I have never used SQV1.

Thank You

Former Member
0 Kudos

It is SQVi (I) i like icecream :)¨

this transaction just takes you directly into the Quick Viewer!

Lakshmipathi
Active Contributor
0 Kudos

The basic difference is

- you have to create a query depending upon the requirement in SQ01

- just if you select the respective tables in SQVi, system will take care of the report you require

thanks

G. Lakshmipathi

Former Member
0 Kudos

Is this the sequence in which the tables are to be joined? I am getting message that 'No data is selected' when I execute the query? Is there any sequence to select fields e.g. VBAP --> VBBE --> VBRP?

Former Member
0 Kudos

Suraj,

????  VBBE shows requirements.  VBRP shows billings.  Don't you think it is unlikely for any single order/item to have both requirements and billings at the same time?  In most SD implementation, VBBE entries disappear once the order is issued and billed.  Unless you have some very special business requirement, joining these three tables would be illogical.

Best Regards,

DB49