ZVF05- Descon Invoice Statement "Objective" The purpose of the report is to find out the list of invoices with

Project Detai ls, Revenue details, Tax details, Collection, Outstanding Details. "Selection Screen" There has been five Selection-screen options as follows: Sales Organization Project Code Sales Order No Customer Billing Date "Output" The output will be: Billing Document, Currenrt Proj no , Project description, Payer, Sales Order No, SO Value, Bill Date, Pay-Terms, Customer Name, PO number, PO Date, Sales Organization, Posting Status, Condition Value, Amount in Local Currency.

"Brief Logic" This logic is all about how to fetch data.... 1. READ Billing Document no(VBELN) from Billing:Header Table(VBRK), Where SD document category(VBTYP) is Invoice('M'), and 'Billing document is cancelled(FKSTO)' not equals to

X .

1.1. GET Sales Organization(VBRK-VKORG) of Correspond Billing document(V BRK-VBELN). 1.2. GET Billing date(VBRK-FKDAT),Payer(VBRK-KUNRG) from Billing documen t no(VBRK-VBELN). 1.3. Find Terms of Payment Key(VBRK-ZTERM) form Billing document no(VBRK -VBELN). 1.4. GET CUSTOMER(KNA1-NAME1). Where Customer Number(KNA1-KUNNR)=Payer(VBRK-KUNRG),

GET PROJECT DESCRIPTION(PROJ-POST1). READ Accounting Document Number(BKPF-BELNR).Find Number of the do cument condition(VBRK-KNUMV) of Correspond VBRK-VBELN.PO Date(VBAK-BSTDK) and SO Value(VBAK-NETWR). For Amount in Local Currency: GET AMOUNT IN LOCAL CURRENCY(BSEG-DMBTR).6. Find Correspond Sales Document(VBRP-AUBEL) of Billing Document(VBRP -VBELN). Get Condition type (KONV-KSCHL) with respect to Number of the document condition (KONV-KNUMV). Where Sales Document(VBAK-VBELN)=VBRP-AUBEL.7.8. GET Sales Order No(VBFA-VBELV). GET Customer PO No(VBAK-BSTNK) .] 1. and 'Document category of preceding SD document'(VBFA-V BTYP_V)='C'(Order). [N. Where 'Subsequent sales and distribution document'(VBFA -VBELN)=VBRK-VBELN.1. ENDIF.Where WBS Element(PRPS-PSPNR)= VBRP-PS_PSP_PNR. GET POSTING STATUS(VBRK-RFBSK) of Correspond Billing document(VBRKVBELN). End of Program.Fiscal Year(BSEG-GJAHR)=BKPF-GJAHR and Debit/Credit Indicator(BSEG-SHKZG)='S'(Debit ). Where WBS Element(PSPNR) of WBS Master Table(PRPS)= WBS Elemen t(PS_PSP_PNR) of Billing:Item Table(VBRP). . When Project definition(PROJ-PSPNR)= PRPS-PSPHI. For Condition Value: Read Billing document(VBRK-VBELN). Then Find 'Current number of the appropriate project'(PRPS-PSPHI ).ZCST etc). 2. ENDDO.-When 'KONV-KSCHL' will be 'ZPRO' then that will b e consider as Revenue(excluding taxes). 1. 3. GET CURRENT PROJECT NUMBER(PRPS-PSPHI). When Billing Document(VBELN) of Item Table(VBRP) equals to Billi ng Document(VBELN) of Header Table(VBRK). Where Accounting Document Number(BSEG-BELNR)=BKPF-BELN R. For project no & description: DO READ WBS Element from Billing:Item Table(VBRP -PS_PSP_PNR). 1.Company Code(BSEG-BUKRS)=BKPF-BUKRS. other cases generally considered as Taxe s(ZSER. IF Reference Transaction(BKPF-AWTYP)='VBRK' and Reference Key(BKPF-AWKEY)=VBRK-VBELN and Company Code(BKPF-BUKRS)=VBRK-BUKRS.Company Code(BKPF-BU KRS) and Fiscal Year(BKPF-GJAHR).B.5.