cancel
Showing results for 
Search instead for 
Did you mean: 

Doubt

Former Member
0 Kudos

Hi All.

I need to populate invoice number from VBRK-VBELN based on VBFA-VBELV and VBFA-VBTYP_N. VBFA-VBTYP_N should be = u2018Mu2019. Always VBFA-VBELN is equal to VBRK-VBELN.

How to do if particular VBELV has two VBELN in VBFA (and both are VBTYP_N = u2018Mu2019)?

Please advice me.

Regards.

jay

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

thanks

former_member1345686
Active Participant
0 Kudos

Dear Jay,

VBFA is document flow table, and it requires us to input either the subsequent document number or preceeding document number .

For example, if you're about to get unique invoice number (VBRK-VBELN) based on Sls Order internal table it_VBAK, then you can use the following statement :

select * from VBFA

into table it_vbfa

for all entries in it_vbak

where vbelv = it_vbak-vbeln

and vbtyp_n = 'M'

and vbtyp_v = 'C'.

sort it_vbfa by vbeln posnn .

delete adjacent duplicates from it_vbfa

comparing vbeln posnn .

Rgds,

Tuwuh SW

Former Member
0 Kudos

You are trying to join a header level table(VBRK) with an item level table (VBFA).

You should try VBRP and VBFA.