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: 

Bill No

Former Member
0 Kudos

Please use an informative subject in future

Hi all,

How to find bill no against invoice no..?

please help me..

Edited by: Matt on Mar 9, 2009 11:05 AM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi

check the reference number

5 REPLIES 5

Former Member
0 Kudos

hi

check the reference number

GauthamV
Active Contributor
0 Kudos

Use this.

[Diff between invoice and billing|https://forums.sdn.sap.com/click.jspa?searchID=23253536&messageID=3357751]

matt
Active Contributor
0 Kudos

Please use an informative subject in future

Former Member
0 Kudos

HI Ankita

tables for Bill :VBRK ,VBRP

For invoice :BKPF,BSEG

Explore both the tables .

s@chin

Former Member
0 Kudos

Hello Ankita,

Go for function module 'AC_DOCUMENT_RECORD'.

See this piece of code ,i also use for the same req in my report.

data it_accdoc type table of acc_doc.

loop at main_table. *table in which u capture Invoice No

call function 'AC_DOCUMENT_RECORD'

exporting

i_awtyp = 'VBRK'

i_awref = main_table-vbeln

  • i_aworg = wrk_aworg

i_bukrs = main_table-bukrs

x_dialog = ''

tables

t_documents = it_accdoc

exceptions

no_reference = 1

no_document = 2

others = 3.

if sy-subrc <> 0.

endif.

loop at it_accdoc into is_accdoc where awtyp = 'BKPF'.

select single bukrs belnr gjahr koart mwskz

into i_bseg from bseg

where bukrs = is_accdoc-bukrs and

belnr = is_accdoc-docnr and

gjahr = is_accdoc-ac_gjahr and koart = 'D'.

if sy-subrc = 0 .

main_table-ac_doc = is_accdoc-docnr.

modify main_table .

else.

select single bukrs belnr gjahr koart mwskz

into i_bseg from bseg

where bukrs = is_accdoc-bukrs and

belnr = is_accdoc-docnr and

gjahr = is_accdoc-ac_gjahr

and koart = 'S'.

if sy-subrc = 0.

main_table-belnr = is_accdoc-docnr.

modify main_table .

endif.

endif.

endloop.

free it_accdoc.

endif.

endloop.

Hope it helps.

In case of query revert back.

Aastha