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

VBFA

Former Member
0 Likes
681

hello,

just want to ask help how to get the following records from the table VBFA

main records:

VBELV POSNV VBELN POSNN VBTYP_N

00001 00010 12345 00001 J

00001 00010 23456 00002 J

00001 00010 34567 00010 J

12345 00010 xxxxx nnnnn R

23456 00010 xxxxx nnnnn R

how to get the following without looping from VBFA:

A:

12345 00010 xxxxx nnnnn R

23456 00010 xxxxx nnnnn R

B:

00001 00010 34567 00010 J

thank you.

donna

2 REPLIES 2
Read only

Former Member
0 Likes
507

1)st fetch all main record....

main records:

VBELV POSNV VBELN POSNN VBTYP_N

00001 00010 12345 00001 J

00001 00010 23456 00002 J

00001 00010 34567 00010 J

12345 00010 xxxxx nnnnn R

23456 00010 xxxxx nnnnn R

2)

mow declare two internal table for difrent recored...

3)ex--

main recored in itab.

two another internal tables are itab1 and itab2.

loop at itab1.

read table itab binary search with key vbeln = itab1-vbeln

VBTYP_N = 'J'.

append itab to itab1.

endloop.

Read only

Former Member
0 Likes
507

Hi,

To get the document flow from VBFA, you could use function module: RV_ORDER_FLOW_INFORMATION

l_comwa-mandt = sy-mandt.

l_comwa-vbeln = g_order.

CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'

EXPORTING

belegtyp = g_vbtyp

comwa = l_comwa

IMPORTING

belegtyp_back = l_belegtyp_back

TABLES

vbfa_tab = gitab_vbfa

EXCEPTIONS

no_vbfa = 1

no_vbuk_found = 2

OTHERS = 3.

Relevant document records can be found in GITAB_VBFA.

Then use the normal Loop at ITAB / ENDLOOP and collect the relevant records.

Hope this helps.

Rgds,

HR