Application Development and Automation 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: 
Read only

How is table VBFA populated?

Former Member
0 Likes
2,751

Hi Experts,

I will appreciate if someone can explain to me how is table VBFA populated. What is the logic for creating a record inside this table ?. Why are also some documents that only have 000000 as value in the POSNN field?

Thanks for your help.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,667

Hi

The system populates that table in order to create a link beetween the previous and next document:

The fields:

- VBELV and POSNV are the number of document and item of previuos document;

- VBELN and POSNN are the number of document and item of next document;

So if u have a document 1 and item 10, if u need to select the next documents u should get all records where VBELV and POSNV are 1 and 10, then u should select all next documents of the next documents of your first one (doc. 1 and item 10), and so....

U can see the fm RV_ORDER_FLOW_INFORMATION in ordert to understand how to read VBFA

Max

6 REPLIES 6
Read only

naimesh_patel
Active Contributor
0 Likes
1,667

VBFA is being populated based on the indicator "Set Document Flow" in the copy control configuration maintained for the SD documents.

E.g Sales Order SO1 (with 1 item) has delivery DEL1. Than VBFA has 1 entry.

SO1 ... DEL1

Than billing BIL1 has been created for DEL1 than VBFA will have total 3 entries:

SO1... DEL1

SO1.... BIL1

DEL1... BIL1

Entry with POSNN '000000' is being generated when you create a new document with reference to antoher document.

E.g. Sales Order 123 has been created as a copy of 120 than you will find an entry with 000000.

Regards,

Naimesh Patel

Read only

0 Likes
1,667

Hi Naimesh,

As I explained to you in my original question I have VBELN = 716838 and POSNN = 000000. How do I find then the subsequent documents for this combination in a select statement...?

When using SE16 you just put VBELV = 716838 ,POSNV = 0 and some records are being displayed but the values for POSNV are not zeroes. When using a select the program doesn't read any record because there are not occurrences for POSNV = 000000.

Please advise.

Thanks Luis.

Read only

0 Likes
1,667

As Max directed, you can use the FM RV_ORDER_FLOW_INFORMATION to get the document flow for one perticular document.

Regards,

Naimesh Patel

Read only

Former Member
0 Likes
1,668

Hi

The system populates that table in order to create a link beetween the previous and next document:

The fields:

- VBELV and POSNV are the number of document and item of previuos document;

- VBELN and POSNN are the number of document and item of next document;

So if u have a document 1 and item 10, if u need to select the next documents u should get all records where VBELV and POSNV are 1 and 10, then u should select all next documents of the next documents of your first one (doc. 1 and item 10), and so....

U can see the fm RV_ORDER_FLOW_INFORMATION in ordert to understand how to read VBFA

Max

Read only

0 Likes
1,667

Hi Max,

Could you or Naimesh point me into the documentation on how to use the FM module RV_ORDER_FLOW_INFORMATION ?

Thanks for your kind help.

Luis Leston

Read only

0 Likes
1,667

The easiest way to use it is like:


  DATA: BEGIN OF L_COMWA OCCURS 1.
          INCLUDE STRUCTURE VBCO6.
  DATA: END   OF L_COMWA.

  data: begin of it_vbfa occurs 1.
          include structure vbfa.
  data: end   of it_vbfa.


  L_COMWA-VBELN = P_VBELN.   " VBELN

  CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
    EXPORTING
*     AUFBEREITUNG        = '2'
*     BELEGTYP            = ' '
      COMWA               = L_COMWA
*     NACHFOLGER          = 'X'
*     N_STUFEN            = '50'
*     VORGAENGER          = 'X'
*     V_STUFEN            = '50'
*   IMPORTING
*     BELEGTYP_BACK       =
    TABLES
      VBFA_TAB            = IT_VBFA
    EXCEPTIONS
      NO_VBFA             = 1
      NO_VBUK_FOUND       = 2
      OTHERS              = 3

Regards,

Naimesh Patel