Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

SQVI - not getting any result

Former Member
0 Kudos

Dear Experts,

When I join table VBAK and AUFK in SQVI, I am not getting any result. The join condition is proposed by the system. (field AUFNR in VBAK and AUFK).

I tried debugging SQVI, and I found these lines of codes:

open cursor with hold %dbcursor for

select VBAKVBELN AUFKAUFNR

from ( VBAK

inner join AUFK

on AUFKAUFNR = VBAKAUFNR )

where AUFK~AUFNR in SP$00001 .

It seems the system does not get any result from executing it. I tried to write a simple ABAP code similar to it like this:

select VBAK~VBELN

from ( VBAK

inner join AUFK

on AUFKAUFNR = VBAKAUFNR )

into corresponding fields of table it_aufk

where AUFK~AUFNR in S_AUFNR.

Again, I am not getting any result from it as well.

Would you please suggest how to make my query in SQVI works?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

AUFK stores process orders in PP-PI module. A process order may not always be linked to a Sales document in SD module. If it is linked then the linking is as follow

AUFK-KDAUF = VBAP-VBELN

AUFK-KDPOS = VBAP-POSNR

OR

AUFK-KDAUF = VBAK-VBELN

The join should be with AUFK as leading table and VBAK or VBAP as the second table, as KDAUF is not a key field in AUFK. If you keep VBAK or VBAP as leading table the query will be very slow

3 REPLIES 3

Former Member
0 Kudos

hi,

you have to select kufnr field also

Former Member
0 Kudos

AUFK stores process orders in PP-PI module. A process order may not always be linked to a Sales document in SD module. If it is linked then the linking is as follow

AUFK-KDAUF = VBAP-VBELN

AUFK-KDPOS = VBAP-POSNR

OR

AUFK-KDAUF = VBAK-VBELN

The join should be with AUFK as leading table and VBAK or VBAP as the second table, as KDAUF is not a key field in AUFK. If you keep VBAK or VBAP as leading table the query will be very slow

0 Kudos

Dear Vishnu Tallapragada,

Thank you for you reply.

In my case, this is a relationship between CS - Service Order and SD - Sales Order. I can see in SE11 or SE16 that VBAK-AUFNR = AUFK-AUFNR.; however, when using SQVI or inner join, I am not getting any result.

In addition, in my case, the field KDAUF and KDPOS are blank even though a sales order is created as a subsequent document.

---

Dear rakibuddala,

Would you please elaborate? like the field from which table? I cannot find it in both AUFK and VBAK.