‎2009 Apr 09 8:13 AM
Is there any table which links the invoice document number and the accounting document number?I have a accounting document number using that have to update the contents of bseg table.How to do it?
‎2009 Apr 09 8:23 AM
Hello Rajalakshmi,
See the below query, hope its help you to find out the both billing document and accounting document.
*--- Data are fetched from table RSEG
SELECT belnr "Accounting Document Number
gjahr "Fiscal Year
buzei "Document item in invoice document
ebeln "Purchasing Document Number
matnr "Material Number
bukrs "Company Code
werks "Plant
FROM rseg
INTO TABLE it_rseg
FOR ALL ENTRIES IN it_mseg <internal table filled from MSEG table>
WHERE matnr = it_mseg-matnr
AND bukrs = it_mseg-bukrs
AND werks = it_mseg-werks
AND ebeln = it_mseg-ebeln.
*--- Data are fetched from table RBKP
SELECT belnr "Document number of an invoice document
gjahr "Fiscal Year
xblnr "Reference Document Number
FROM rbkp
INTO TABLE it_rbkp
FOR ALL ENTRIES IN it_rseg
WHERE belnr = it_rseg-belnr
AND gjahr = it_rseg-gjahr.Regards,
Sayak
‎2009 Apr 09 8:15 AM
‎2009 Apr 09 8:23 AM
Hello Rajalakshmi,
See the below query, hope its help you to find out the both billing document and accounting document.
*--- Data are fetched from table RSEG
SELECT belnr "Accounting Document Number
gjahr "Fiscal Year
buzei "Document item in invoice document
ebeln "Purchasing Document Number
matnr "Material Number
bukrs "Company Code
werks "Plant
FROM rseg
INTO TABLE it_rseg
FOR ALL ENTRIES IN it_mseg <internal table filled from MSEG table>
WHERE matnr = it_mseg-matnr
AND bukrs = it_mseg-bukrs
AND werks = it_mseg-werks
AND ebeln = it_mseg-ebeln.
*--- Data are fetched from table RBKP
SELECT belnr "Document number of an invoice document
gjahr "Fiscal Year
xblnr "Reference Document Number
FROM rbkp
INTO TABLE it_rbkp
FOR ALL ENTRIES IN it_rseg
WHERE belnr = it_rseg-belnr
AND gjahr = it_rseg-gjahr.Regards,
Sayak
‎2009 Apr 09 8:29 AM
Sorry am not still clear with this.I have a invoice document number in an internal table using that i want to update the status of bseg table.Plz help to do it.
‎2009 Apr 09 8:37 AM
Hi
Get billing document number from VBFA ref to invoice number..
Kiran
‎2009 Apr 09 8:37 AM
Hi
Get billing document number from VBFA ref to invoice number..
Kiran
‎2009 Apr 09 9:00 AM
Hi Lakshmi,
Table VBRL-VBELN has Invoice Document No. and the same table has VBRL-VBELN_VF as the Billing document No.
take the billing document No. and
VBRL-VBELN_VF = VBRK-VBELN = BSEG-VBELN.
Or go in a reverse way--- BSEG > VBRK-> VBRL
Hope this solves your problem.
Thanks & regards,
Dileep .C
‎2009 Apr 09 8:23 AM
Hello Rajalakshmi,
You can find this in the table VBFA.
Give the invoice number in Preceeding document field and get the entries.
You will get the subsequent entries of the invoice. i.e. after invoce what ever the document generated for the invoice wil be displayed. Using subsequnet doc. type you can find the required document.
Best Regards,
Sasidhar Reddy Matli.
‎2009 Apr 09 8:24 AM
hi,
try with table : BKPF OR VBFA
RAHUL
Edited by: RAHUL SHARMA on Apr 9, 2009 3:24 AM
‎2009 Apr 09 10:34 AM
if u have accounting number. bkpf-xblnr.
if s
then
SELECT * FROM BKPF INTO TABLE GT_BKPF
WHERE AWTYP = 'VBRK' .
u will get gt_bkpf-AWKEY.
'0' + VBRK-VBELN = GT_BKPF-AWKEY.
IN THIS WAY U WILL GET VBRK-VBELN .
that is invoice no.
HOPE THIS HELP.
‎2009 Apr 09 10:40 AM
hi,
RESG and RBKP are the two table..
RESG contains accounting document number
RBKP conatins invoice document number
hope this helps
Regards
RItesh J