cancel
Showing results for 
Search instead for 
Did you mean: 

Creating SQVI - SD - Query

former_member230675
Active Contributor
0 Kudos

Dear Experts,

I am trying to create a query.

The requirement is based on the sales order number a query should be generated which contains the details such as Sales order number , Sales order item, Material number, Qty in SO, Invoiced qty, Bill No. Bill Item No. etc.

I tried linking the tables : VBAK, VBAP, LIPS, VBRP and VBRK

But query not running.

Can you please help me to get the correct tables and joining order in the query.

Tnx.

Abdul.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI

Use the tables VBAK,VBAP and VBRK,VBRP

You have to join these tabales.

Join VBAK-VBELN to VBAP-VBELN VBAP-POSNR and then VBAK-VBELN to VBRP-AUBEL and VBRP-AUPOS

regards

Prashanth

former_member230675
Active Contributor
0 Kudos

Thanks prashanth..

I tried in SQVI by linking VBAK > VBAP > VBRP, and selection Sales order Number, List Display Sales order no, sales order item no. material no, cumulative sales qty, bill no, bill item no, actual invoice qty.

I got the message : "No data was selected, Message no. AQ260"

Tnx.

Abdul

Former Member
0 Kudos

The Query you are trying to create will be complex. I would also recommend getting an ABAP program created.

However, if you have to use Query, you are missing link is the table for Document flow. You would have to link your VBAP table with VBFA filling in the Preceding sales document and item values and the correct document category. (Keep in mind that if you could have multiple deliveries for an order line item.)

Then you would have to link the VBFA to the LIPS table to get the delivery line, then use the VBFA table again to get the VBRP billing item.

I would assume you might have to do some minor coding in the query to make all of this work.

Hope that helps.

Carol

former_member230675
Active Contributor
0 Kudos

It is possible to create the query in SQVI.

Insert Table VBAP and then Insert Table VBRP

Select the connections which automatically system proposes (there will be two connection) and delete it (one by one).

Now connect manually the tables

VBAP-VBELN = VBRP-AUBEL.

It works perfect..!!

Answers (3)

Answers (3)

madhu_vadlamani
Active Contributor
0 Kudos

Hi Abdul,

Some times if there is no link between tables you can not join.Check any standard report is there to suitable to your requirement if there is no standard Better to go for a Zreport. Give the requirement to your technical people and ask then to create a Zreport. Please tell if there is any help need in that.

Regards,

Madhu.

Edited by: madhurao123 on Feb 22, 2011 5:17 AM

former_member230675
Active Contributor
0 Kudos

tnx. madhu

All of you are telling it is not possible to create a query to get invoiced qty comparing with sales order qty based on the selection criteria as sales order no.

There is link between tables like:

VBAK > VBAP > LIPS > VBRP > VBRK

Can you please get me the tcode of std report which gives similar result (I am a PS Consultant)

Tnx.

Abdul

Manoj_Mahajan78
Active Contributor
0 Kudos

Hello Abdul,

Please see below links for list of std reports & tables.

http://www.sap-img.com/sap-sd/important-tables-for-sap-sd.htm

http://www.sap-img.com/sap-sd/standard-sap-sd-reports.htm

You need see if you can modify the existing standard report with the help of ABAP development.

Regards

MM

madhu_vadlamani
Active Contributor
0 Kudos

Hi Abdul,

I mean check when you are trying to join system will tell yo whether the join is legal or illegal. If is say illegal then you can not join.

Regards,

Madhu.

Former Member
0 Kudos

TABLES VBAK,VBAP,VBRK,VBRP.

FIELDS

VBAK-VBELN

VBAP-MATWA

VBAP-KWMENG

VBRP-VBELN

VBRP-POSNR

VBRP-AUBEL

VBRP-FKIMG

former_member230675
Active Contributor
0 Kudos

Hi Suresh,

I tried it earlier but the query is not running with the combination:-

VBAK > VBAP > VBRK > VBRP

Tnx.

Abdul.

Former Member
0 Kudos

Tell your abaper to create Zreport rather creating Query..

former_member230675
Active Contributor
0 Kudos

>

> Tell your abaper to create Zreport rather creating Query..

Tnx. for the suggestion