cancel
Showing results for 
Search instead for 
Did you mean: 

invoice report

Former Member
0 Kudos

Dear Guru's

we are sharing daily invoice report to business on daily basis.now business asking only normal invoice excluding cancilled invoices along with original invoices.

example: user created invoice no 8000 with amount 1000 today and it will shared by end of day.after two days if user cancilled the original invoice then cancilled invoice number with different number 9000 is generated with same amount 1000.now while preparing the report i do not want to share both cancilled invoice no 9000 and along with orginal invoice no 8000.

i checked the Table VBFA by input as original invoice no 8000 or cancilled invoice no 9000 i am getting the output as sales order number only.

could anybody share any logic how to find the original invoice number by giving input as cancilled invoice number.or any other logic how to find both.

our current SAP version is 4.6B.

Thanks and Regards

Suribabu.

Accepted Solutions (1)

Accepted Solutions (1)

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

Look for the billing documents with field VBRK-SFAKN and VBRK-FKSTO. I don't know if you are using a customer report or the tcode VF05 enhanced. Please, revert if you have other questions.

I hope this helps you

Regards

Eduardo

Former Member
0 Kudos

Hi,

Thank you for you reply.

i can able to identify invoice is normal like F2 or cancilled one like S1 through billing type itself.

how to relate cancilled invoice S1 with orginal invoice F2.

my requirement is in report if any invoice is cancilled with S1 then i need to exclude both cancilled invoice no S1 and for that original invoice no F2.it means my input is cancilled invoice no S1 then how to find F2 invoice no.i checked Table VBFA.i am getting output as Sales order number only.

Thanks and Regards

suribabu.

eduardo_hinojosa
Active Contributor
0 Kudos

Hi

Two steps,

1. Check if the invoice is cancelled (VBRK-FKSTO = 'X').

2. If it's cancelled, then look for the invoice

The coding more or less here

DATA: lt_vbrk LIKE vbrk OCCURS 100 WITH HEADER LINE.  "data for the list/report

DATA: l_vbeln LIKE vbrk-vbeln.

IF lt_vbrk-kfsto = 'X'.

  CLEAR l_vbeln.

  l_vbeln = lt_vbrk-vbeln.

  READ TABLE lt_vbrk WITH KEY sfakn = l_vbeln.

   IF sy-subrc = 0.

     DELETE lt_vbrk INDEX sy-tabix.

   ENDIF.

ENDIF.

or if you must delete the cancelled save in a variable L_TABIX in the loop and delete the invoice l_vbeln. I am sorry by the possible mistakes, but I don't know the coding of your report.

I hope this helps you

Regards

Eduardo

Answers (2)

Answers (2)

bandal_amol
Explorer
0 Kudos

Hello Suribabu,

If you want to get cancelled invoice details , please see table VBRk-SFAKN. It will show cancelled invoice details.

krishna_k19
Contributor
0 Kudos

Hi,

   Pls check VBRK & VBRP Tables. In VBRK table vbeln Contains Original Invoice no as well as Cancel Invoice no. and Document Category is showing category of that document means whether that doc. is Canceled or original Invoice(Ex: m,n....) and SFAKN is contains Original inv.no if u canceled this inv.

so you have to check with that no.s is there any cancelled inv.s created or not if yes don;t consider those values.

Regards,

Krishna