The purpose of this program is to highlight goods receipts (GR) that have no corresponding invoice receipts (IR). Either the invoice has not been received, or it has not been keyed in, or it was keyed in incorrectly.
The program is written as an interface for an ABAP Query. The output should be like that of ME2L (Purchasing IS), except that the format is different, and only those items with different quantities for GR and IR are listed. The code is not very optimized. The only advantage of using it as an ABAP Query is being able to quickly change the online format, sorting, etc.
Outstanding IRs from PO
*&---------------------------------------------------------------------*
*& Report ZGR-IR *
*& *
*&---------------------------------------------------------------------*
*& Used for ABAP Query to list goods received that have not been *
*& fully invoiced *
*&---------------------------------------------------------------------*
REPORT ZGR-IR.
TABLES: EKBE. "Define Dictionary structure
* Conditions to limit search
SELECT-OPTIONS: PO_DOC FOR EKBE-EBELN, "Purchase order
PO_ITEM FOR EKBE-EBELP, "Purchase order item
POSTDATE FOR EKBE-BUDAT, "GR Posting Date
MAT_NR FOR EKBE-MATNR. "Material number
DATA: GOODSRCVD LIKE EKBE-MENGE, "goods received in units
GOODSINVOICED LIKE EKBE-MENGE, "goods invoiced in units
LAST_EBELN LIKE EKBE-EBELN, "to keep track of already processed POs
LAST_EBELP LIKE EKBE-EBELP, " and PO items
BEGIN OF SUMS OCCURS 4,
BEWTP LIKE EKBE-BEWTP,
MENGE LIKE EKBE-MENGE,
SHKZG LIKE EKBE-SHKZG, "Debt/Credit indicator
END OF SUMS.
*
* check header GR documents for un-invoiced inventory
SELECT * FROM EKBE
WHERE BWART = '101' AND " GR document
EBELN IN PO_DOC AND
EBELP IN PO_ITEM AND
BUDAT IN POSTDATE AND
MATNR IN MAT_NR
ORDER BY EBELN EBELP BELNR.
CHECK " only get the header one
NOT ( EKBE-EBELN = LAST_EBELN AND EKBE-EBELP = LAST_EBELP ).
LAST_EBELN = EKBE-EBELN.
LAST_EBELP = EKBE-EBELP.
CLEAR SUMS. CLEAR SUMS[].
SELECT BEWTP MENGE SHKZG FROM EKBE INTO SUMS
WHERE EBELN = EKBE-EBELN AND EBELP = EKBE-EBELP.
COLLECT SUMS.
ENDSELECT.
GOODSRCVD = 0. GOODSINVOICED = 0.
LOOP AT SUMS. "sums table should now have 4 totals
IF SUMS-SHKZG = 'S'. "positive value
IF SUMS-BEWTP = 'E'. "goods received
GOODSRCVD = GOODSRCVD + SUMS-MENGE.
ELSE. "goods invoiced
GOODSINVOICED = GOODSINVOICED + SUMS-MENGE.
ENDIF.
ELSE. " negative value
IF SUMS-BEWTP = 'E'. "goods received
GOODSRCVD = GOODSRCVD - SUMS-MENGE.
ELSE. "goods invoiced
GOODSINVOICED = GOODSINVOICED - SUMS-MENGE.
ENDIF.
ENDIF.
ENDLOOP.
IF GOODSRCVD = GOODSINVOICED. "amount received = amount invoiced
CONTINUE.
ELSE.
EKBE-BPMNG = GOODSRCVD - GOODSINVOICED. "missing invoice amount
ENDIF.
*
ENDSELECT.
*&---------------------------------------------------------------------*
*& End of Report ZGR-IR *
*& *
*&---------------------------------------------------------------------*
Friday, November 23, 2007
ABAP/4 Program: Find GRs without IRs
Labels:
Find GRs without IRs
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2007
(952)
-
▼
November
(716)
- SAP Paper Documents
- SAP Repository
- SAP R/3 Implementation and Maintenance Tips
- ABAP/4 programming language overview
- The interactive eLearning system for ABAP™
- Helpful System Administration ABAPS
- free download abap programmin pdf book
- examples of real time objects in sap abap(1)
- examples of real time objects in sap abap
- work flow example2
- Workflow tips
- Miscellaneous sap abap faq
- BDC , LSMW, Conversions faq in abap
- Sap Scripts & Smart forms faqs in abap
- performance tuning in abap faqs
- Real Time BDC & LSMW faqs
- Real Time ABAP Internal Tables faqs
- Real Time ABAP Reports faqs
- Real Time questions ..in sap ABAP
- SAP ABAP FAQ (Technical)
- ABAP and Unicode
- ABAP and JavaScript
- ABAP Objects
- ABAP Database Access
- Running ABAP Programs
- ABAP User Dialogs
- The ABAP Programming Language
- Creating and Changing ABAP Programs
- Overview of the Components of Application Programs
- Introduction to ABAP
- ABAP Programming Documentation
- FREE DOWNLOAD ALE, EDI & IDOCS
- Conversion of IDOCs to XML.pdf
- FREE DOWNLOAD IDOC Interface Technology
- FREE DOWNLOAD EDI, IDOC Interface
- FREE DOWNLOAD IDOC BOOK
- FREE DOWNLOAD LSMW - Idoc Inbound Processing
- FREE DOWNLOAD SAP ABAP Idoc Interface
- FREE DOWNLOAD Java for SAP
- FREE DOWNLOAD Java for ABAP Programmers
- FREE DOWNLOAD Java and BAPI technology for EP
- free download Building Web Services with Java and ...
- free download Enable SAP with the power of Javascript
- FREE DOWNLOAD ABAP Training Simulator
- FREE DOWNLOAD SAP Accounting Training Simulators
- free download SAPScripts Made Easy
- CONDENSE
- CONSTANTS
- ABAP Quick Viewer
- sap abap XXL (EXtended Export of Lists)
- Some ABAP/4 Query header line variable
- Understanding SAP Query
- ABAP/4 Query
- ABAP/4 Query Hints and Tips
- SAP Website Links Exchange for ABAP, Basis or Cons...
- sap abap Program for Generate IDoc
- sap abap program for Reads an existing Idoc and di...
- List of ABAP Function modules
- sap abap FTP programming
- sap abap program for Issuing an Unix Command from ...
- sap abap program for RFC call to get Server List
- sap abap program for A SAP Pop-out Calculator
- sap ABAP program for Timers and Auto-refresh
- sap abap program for WS_EXECUTE to called External...
- sap abap programming Execute DOS Command from ABAP...
- To execute a dos command from ABAP
- sap abap program for Make your SAPGUI Disappear an...
- sap abap program for Using Function Modules F4_FIL...
- abp program for How to Restrict the Select Options
- sap abap program for Take Values from Selection-Sc...
- sap abap program for Change Text Into Password
- sap abap program for Function Module for Encryptio...
- sap abap program for FM VRM_SET_VALUE To List Box
- sap abap program for Value Request For Parameter
- sap abap program for Pop a Message to specific SAP...
- ABAP Pop-out box for user confirmation
- sap ABAP program for POP-UP Window
- sap abap program Sample XML Source Code For SAP
- sap abap XML file to word document through SAP
- sap abap program for How to Write Web Reports in SAP
- sap abap conversion Program to Test Line Selection...
- sap abap program for String Handling in ABAP - Rem...
- sap abap program for Split String into two parts a...
- sap abap conversion Program For Printing Prime Number
- sap abap program for How can I get Ascii value of ...
- sap abap program for Figure to Words for India but...
- sap abap conversion program for Print Number Value...
- sap abap conversion program for Insert a special T...
- sap abap program for String Handling in ABAP - Rem...
- sap abap program for Split String into two parts a...
- sap abap conversion Program For Printing Prime Number
- sap abap program for How can I get Ascii value of ...
- sap abap program for Figure to Words for India but...
- sap abap conversion program for Print Number Value...
- sap abap conversion program for Insert a special T...
- sap abap program for Convert SAP Spool List to HTML
- sap program for Convert Month to Word in ABAP
- ABAP function to convert Number to Words
- sap abap program for How to Create Tree Control
- sap abap A sample Tree Programming
-
▼
November
(716)
No comments:
Post a Comment