0% found this document useful (0 votes)
93 views6 pages

FI Billing Comparision

This document contains a program to compare payment advice amounts to billing document amounts. It selects payment advice line items that match the selected company code, account type, account number, and payment advice number. For matching items, it looks up the associated billing document and writes a report showing the payment advice details, billing document details, and any difference between the payment and billing amounts. It also calculates totals for the payment advice amounts, deductions, billing amounts, and differences.

Uploaded by

ssram1010
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
93 views6 pages

FI Billing Comparision

This document contains a program to compare payment advice amounts to billing document amounts. It selects payment advice line items that match the selected company code, account type, account number, and payment advice number. For matching items, it looks up the associated billing document and writes a report showing the payment advice details, billing document details, and any difference between the payment and billing amounts. It also calculates totals for the payment advice amounts, deductions, billing amounts, and differences.

Uploaded by

ssram1010
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

*&---------------------------------------------------------------------*

*& Report ZFI_PAYADV_TO_BILLING_COMPARE


*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZFI_PAYADV_TO_BILLING_COMPARE
LINE-COUNT (1)
LINE-SIZE 375
NO STANDARD PAGE HEADING
MESSAGE-ID fibl.

**--------------------------------------------------------------------**
** PROGRAM # ZFI_MAURY1 **
** DATE WRITTEN # May 16,2007 **
** TYPE # Report **
** AUTHOR # Maury Drutz **
** REQUESTED BY # Shirley Lam **
** TRANSPORT REQUEST # DEVK901982 **
** TRANSPORT REQUEST # DEVK901984 - Secondary Index for VBRK **
**--------------------------------------------------------------------**
** TITLE # Customer Payment Advice Comparison **
** PURPOSE # Program to compare payment advice amounts **
** to billing document amounts. **
** The report will be downloaded to excel **
** for the user to work with. **
** Created secondary index for database table **
** VBRK for fields MANDT KUNRG XBLNR ZUONR **
** and KIDNO. **
**--------------------------------------------------------------------**
** CHANGE HISTORY **
**--------------------------------------------------------------------**
************************************************************************
* T A B L E S *
************************************************************************
TABLES: vbrk, "Billing document header
vbrp, "Billing document item
avip. "Payment advice line item

*----------------------------------------------------------------------*
* Selection Screen *
*----------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF BLOCK main WITH FRAME TITLE text-t01.
PARAMETERS: p_bukrs LIKE avip-bukrs OBLIGATORY, "company code
p_koart LIKE avip-koart OBLIGATORY. "account type
SELECT-OPTIONS: s_konto FOR avip-konto, "account number
s_avsid FOR avip-avsid OBLIGATORY. "pay advice number
SELECTION-SCREEN END OF BLOCK main.

*----------------------------------------------------------------------*
* D A T A *
*----------------------------------------------------------------------*
DATA: w_vbeln LIKE vbrk-vbeln, "billing document
w_netwr LIKE vbrk-netwr, "billing amount
w_mwsbk LIKE vbrk-mwsbk, "tax amount
w_kidno LIKE vbrk-kidno, "payment reference
w_fkdat LIKE vbrk-fkdat, "billing date
w_total LIKE vbrk-netwr, "billing amt + tax
w_pdiff LIKE vbrk-netwr, "advice amt - bill amt
w_totadv LIKE vbrk-netwr, "total advice amount
w_totded LIKE vbrk-netwr, "total deduction amount
w_totbil LIKE vbrk-netwr, "total billing amount
w_totdif LIKE vbrk-netwr, "total differene amount
w_space1(18) TYPE c,
w_space2(195) TYPE c,
w_ctr TYPE p.

*----------------------------------------------------------------------*
* START-OF-SELECTION *
*----------------------------------------------------------------------*
START-OF-SELECTION.

PERFORM get_data.

*----------------------------------------------------------------------*
* END-OF-SELECTION *
*----------------------------------------------------------------------*
END-OF-SELECTION.

PERFORM process_totals.

*----------------------------------------------------------------------*
* Form get_data. *
*----------------------------------------------------------------------*
FORM get_data.

CLEAR: w_totadv,
w_totded,
w_totbil,
w_totdif.

PERFORM process_headings.

SELECT * FROM avip


WHERE bukrs = p_bukrs AND
koart = p_koart AND
konto IN s_konto AND
avsid IN s_avsid.
CLEAR: w_vbeln,
w_netwr,
w_mwsbk,
w_fkdat,
w_total,
w_pdiff,
w_kidno.
IF avip-sfeld = 'XBLNR'.
SELECT SINGLE vbeln netwr fkdat kidno mwsbk
FROM vbrk
INTO (w_vbeln, w_netwr, w_fkdat,
w_kidno, w_mwsbk)
WHERE xblnr = avip-swert AND
kunrg = avip-abwko AND
* Start - DEVK902028 mid/20070615
fksto = SPACE AND
( fkart = 'F1' OR
fkart = 'F2' OR
fkart = 'Y1' ).
* END - DEVK902028 mid/20070615
IF sy-subrc = 0.
PERFORM process_report.
* Start - DEVK901990 mid/20070525
ELSE.
PERFORM process_no_billing_doc.
* End - DEVK901990 mid/20070525
ENDIF.
ELSEIF avip-sfeld EQ 'KIDNO'.
SELECT SINGLE vbeln fkdat kidno netwr mwsbk
FROM vbrk
INTO (w_vbeln, w_fkdat,w_kidno,
w_netwr, w_mwsbk)
WHERE kidno = avip-swert AND
kunrg = avip-abwko AND
* Start - DEVK902028 mid/20070615
fksto = SPACE AND
( fkart = 'F1' OR
fkart = 'F2' OR
fkart = 'Y1' ).
* END - DEVK902028 mid/20070615
IF sy-subrc = 0.
PERFORM process_report.
* Start - DEVK901990 mid/20070525
ELSE.
PERFORM process_no_billing_doc.
* End - DEVK901990 mid/20070525
ENDIF.
ELSEIF avip-sfeld = 'ZUONR'.
SELECT SINGLE vbeln fkdat kidno netwr mwsbk
FROM vbrk
INTO (w_vbeln, w_fkdat, w_kidno,
w_netwr, w_mwsbk)
WHERE zuonr = avip-swert AND
kunrg = avip-abwko AND
* Start - DEVK902028 mid/20070615
fksto = SPACE AND
( fkart = 'F1' OR
fkart = 'F2' OR
fkart = 'Y1' ).
* END - DEVK902028 mid/20070615
IF sy-subrc = 0.
PERFORM process_report.
ELSE.
PERFORM process_no_billing_doc.
ENDIF.
ENDIF.
ENDSELECT.
ENDFORM. "get_data

*----------------------------------------------------------------------*
* Form process_report *
*----------------------------------------------------------------------*
FORM process_report.

IF avip-nebtr > 0.
w_total = w_netwr + w_mwsbk.
w_pdiff = avip-nebtr - w_total.
ENDIF.

SELECT * FROM vbrp


WHERE vbeln = w_vbeln.
ENDSELECT.

IF avip-kidno IS INITIAL.
avip-kidno = avip-xblnr.
ENDIF.

WRITE: / avip-avsid, "payment advice


19 avip-avspo, "payment advice line item
26 avip-konto, "account number
40 avip-kidno, "payment reference
70 avip-xblnr, "reference
89 avip-belnr, "document number
101 avip-xref1, "reference key 1
115 avip-sgtxt, "additional information
167 avip-redat, "invoice date
182 vbrp-matnr, "part number
* Start - DEVK901992 mid / 20070528
202 vbrp-fkimg, "quantity
* End - DEVK901992 mid / 20070528
219 avip-nebtr, "payment amount
239 avip-abbtr, "deduction amount
264 avip-abwko, "alternate account
280 w_vbeln, "billing document
295 w_fkdat, "billing date
310 w_total, "billing amt + tax
330 w_pdiff, "payment diference
354 w_kidno. "billing pay ref number
w_totadv = w_totadv + avip-nebtr.
w_totded = w_totded + avip-abbtr.
w_totbil = w_totbil + w_total.
w_totdif = w_totdif + w_pdiff.
ENDFORM. "process_report

*----------------------------------------------------------------------*
* Form process_no_billing_doc *
*----------------------------------------------------------------------*
FORM process_no_billing_doc.

IF avip-abbtr > 0.
avip-abbtr = avip-abbtr * -1.
ENDIF.

IF avip-kidno IS INITIAL.
avip-kidno = avip-xblnr.
ENDIF.

WRITE: / avip-avsid, "payment advice


19 avip-avspo, "payment advice line item
26 avip-konto, "account number
40 avip-kidno, "payment reference
70 avip-xblnr, "reference
89 avip-belnr, "document number
101 avip-xref1, "reference key 1
115 avip-sgtxt, "additional information
167 avip-redat, "invoice date
182 w_space1,
219 avip-nebtr, "payment amount
239 avip-abbtr, "deduction amount
264 avip-abwko. "alternate account
w_totadv = w_totadv + avip-nebtr.
w_totded = w_totded + avip-abbtr.

ENDFORM. "process no_billing_doc

*----------------------------------------------------------------------*
* Form process_totals *
*----------------------------------------------------------------------*
FORM process_totals.

WRITE: / w_space2,
216 w_totadv,
236 w_totded,
310 w_totbil,
330 w_totdif.

ENDFORM. "process_totals

*----------------------------------------------------------------------*
* Form process_headings *
*----------------------------------------------------------------------*
FORM process_headings.

FORMAT COLOR COL_HEADING INTENSIFIED.


WRITE: / 'Payment Advice',
19 'Item',
26 'Acct.Number',
40 'Pay Reference',
70 'Reference',
89 'Doc.Number',
101 'Ref.Key1',
115 'Additional Information',
167 'Invoice Date',
182 'Part Number',
* Start - DEVK901992 mid / 20070528
202 'Quantity',
* End - DEVK901992 mid / 20070528
219 'Pay.Amount',
239 'Ded.Amount',
264 'Alt.Account',
280 'Billing Doc.',
295 'Billing Date',
310 'Bill.Amount',
330 'Difference',
354 'Billing Pay Ref'.
FORMAT COLOR OFF.

ENDFORM. "process_headings

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy