Skip to Content
-2

VBAP and VBFA Relationships..?

Hi Experts,

I'm new to ECC tables and its relationships..

I just want to know how the table is related...

For my Scenario, In my VBAP table having 15000 records. whenever i joining the VBAP with VBFA with the condition VBAP.VBELN = VBFA.VBELN AND VBAP.POSNR = VBFA.POSNN... my result set contains more than 15000 records ...

I DONT KNOW WHY THE RESULT SETS LIKE THIS....

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    May 17 at 12:37 PM

    Basically it means that your VBFA document flow table has for the same document and item number of the follow on document multiple records in this table.

    I quickly checked the number of record in my system and we have currently 101 million records in this table. It is quite likely that the same number is multiple times in this table, most likely because the many document categories might use the same numbers in their interval. E.g. sales orders and deliveries have both their own number ranges, but the number interval could be defined using the same numbers. Eventually a bad design but possible.

    You might need to restrict the result on the subsequent documents category VBFA.VBTYP_N

    List just the duplicates in a test and then check what document category they have and what their preceding document is and then have a look at the document flow for those preceding documents from VA03 to know what it is.

    Add comment
    10|10000 characters needed characters exceeded

  • May 18 at 06:26 PM

    It's not the matter of relationship between the tables, it's the matter of what exactly are you selecting. You can see the primary key of VBFA table in SE11 transaction and you can see all the foreign key relationships there as well.

    If you put it like this:

    SELECT ... FROM VBFA JOIN VBAP ON VBAP~VBELN = VBFA~VBELV                                        
    AND VBAP~POSNR = VBFA~POSNV
    WHERE VBAP~VBELN = <x>
    AND VBAP~POSNR = <y>.

    then you'll get the full document flow for the document X line Y. But if you omit WHERE part you'll get a very large chunk of VBFA table.

    So the question is not what the relationship is but what exactly are you selecting. And you haven't shared that information. Post your exact SQL statement and then this can be answered intelligently.

    Add comment
    10|10000 characters needed characters exceeded