cancel
Showing results for 
Search instead for 
Did you mean: 

Using sqvi for sales & billing doc report

Former Member
0 Kudos

Hello experts,

My requirement is to compare the report of sales date and billing date through Doc type as a input parameter.This am trying in SQVI,used inputs are:

VBAP - VBELN SALES DOC
VBAP - ERDATDOC DATE
VBAP-AUARTDOC TYPE
VBRK-FKARTBILLING TYPE
VBRK - VBELNDOCUMENT TYPE
VBRK - ERDATDOC DATE
VBRK -FKDAT_RLBILLING DATE

when i gave the join conditions for Doc No,Date,Doc Type its not working.But the output should be based on the Sales doc type and Billing doc type as a input parameter.

How to achieve this trough this transaction Pls help me.

Thanks in Advance

Accepted Solutions (0)

Answers (8)

Answers (8)

former_member209761
Active Contributor
0 Kudos

Dear Naveen,

You require to join 3 tables. VBAK, VBFA and VBRK.

Instead of VBAP, use VBAK-VBELN for sales doc, VBAK-ERDAT for doc date and VBAK-AUART for doc type.

VBAK - VBELN SALES DOC
VBAK - ERDATDOC DATE
VBAK-AUARTDOC TYPE

Your VBAK-AUART will be the selection field in Query.

You have to join VBAK-VBELN to VBFA-Preceding document

VBFA-subsequent document with subsequent document type invoice should be joined to VBRK-VBELN.

Thanks & Regards,

Hegal K Charles

od_manikandan
Active Contributor
0 Kudos

Hai Naveen,

In SQVI,

Start Table from last to first

VBRP - VBRK - VBAK-VBAP

then all desired input and output can be displayed.

By default if the item number connected between tables, then output may not get displayed.

To start with Use se16

List the VBRP invoice for a period

and take the sales document number from that

Enter the list of the sales document (sales order number) in VBAK

then filter it for your required order type.

In SQVI, similar links to be created, No extra links.

Regards,

Mani

od_manikandan
Active Contributor
0 Kudos

Hai Naveen,

In SQVI,

Start Table from last to first

VBRP - VBRK - VBAK-VBAP

then all desired input and output can be displayed.

By default if the item number connected between tables, then output may not get displayed.

To start with Use se16

List the VBRP invoice for a period

and take the sales document number from that

Enter the list of the sales document (sales order number) in VBAK

then filter it for your required order type.

In SQVI, similar links to be created, No extra links.

Regards,

Mani

Former Member
0 Kudos

Dear Naveen Kumar,

If you're purely talking about Sales/Billing document types then kindly pass

VBRK--> VBELN to VBFA--> VBELN

VBRP--> POSNR to VBFA--> POSNN

and VBFA --> VBTYP_N = 'M' and VBFA --> VBTYP_V  = 'C'

From VBFA --> VBELV and VBFA-POSNV pass the sale document number to VBAP and fetch desired data. Also, you can try by passing VBRP --> AUBEL and VBRP --> AUPOS to VBAK --> VBELN and VBAP --> POSNR in order to check out the desired data. Hope this will help you out. Thanks and have a good day.

Former Member
0 Kudos

Dear,

Note sure if you'll be okay with this solution but try this join by using VBRK, VBRP, VBAPand KNA1. You can get Sale document info in VBRP-AUBEL field. Try to take help with VBFA too.


VBRK (VBELN) --> VBRP (VBELN)

VBRK (KUNAG) --> KNA1 (KUNNR)

VBRP (AUBEL) --> VBAP (VBELN)

Try this too.

VBAK with VBAP (VBELN)

VBAP with VBRP [VBAP-VBELN = VBRP-AUBEL] and [ VBAP-POSNR = VBRP-AUPOS]

VBRP with VBRK (VBELN)

Lemme know if you need more help in this. Thanks and have a good day.



Former Member
0 Kudos

HI ammarah

I tried as u said but its not working

moazzam_ali
Active Contributor
0 Kudos

Hi

You can have all this information by using VBFA table. Make a join of VBFA, VBAK and VBRK. Use VBTYPE field to differentiate sales and billing document types.

Thank$

Former Member
0 Kudos

HI tejas thanks for ur reply,

Actually in some of the sale orders billing date is recorded as a future date.We had found and fix the issue that these occurred due to some settings in copy control settings and VOV8. But my user asking one report in future use to compare billing doc date & sales doc date by giving either billing & sale doc type Or both as an input parameter.How to achieve this in SQVI pls tell me in detail as am first time doing SQVI.

Thanks

Former Member
0 Kudos

hi,

I have tried in my system with SQVI tcode and its possible to by joining two views

WB2_V_VBAK_VBAP2(Data Selection from SO )

WB2_V_VBRK_VBRP2(Data Selection from Customer Billing Documents)

Join(Link these fields) this two views with below mentioned conditions

WB2_V_VBAK_VBAP2-VBELN join with WB2_V_VBRK_VBRP2-AUBEL_I

WB2_V_VBAK_VBAP2-POSNR join with WB2_V_VBRK_VBRP2-AUPOS_I

and remove all other links(Not Mandt).

1. List of fields in output display

2. input parameters

press execute(F8)

3. Selection screen

it will give you expected output.. but you will faced problem of transportation and tcode creation

So you create the same with new tcodes (SQ01/02/03).

please follow procedure given below

Or take help of technical person.

http://www.saptechnical.com/Tutorials/SAPQuery/SimpleQuery/SQ1.htm

http://jelajahsap.files.wordpress.com/2008/01/abap-query.pdf

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10eab7af-0e54-2c10-28a5-87b47adbe...

regards

Tejas

Former Member
0 Kudos

Hi,

For join those mentioned tables you have to VBFA table

Former Member
0 Kudos

Hi,

The table which you have taken VBRK and VBAP.. there are no common fields for to join..

can you tell me precisely what exactly you want to find. there are a fields

VBRP-AUBEL(sales doc)

VBRP-AUPOS(sales item) which are common between VBAP and VBRP

do you want report on item level or header level ?

regards

Tejas