Академический Документы
Профессиональный Документы
Культура Документы
Technical Design
Project: Priority:
Common Medium
Team: WBS Ref.:
Fulfill Demand Reports
Designed by:* Status:*
Kristin E. Salm 01 Draft in Progress
Signed-Off By: Sign-Off Date:
Title:
Short Orders Within Tolerance
Functional Description:
This report will list open sales order lines meeting the
selection criteria for which goods have been issued, and the
total issued quantity is less than but within specified
tolerance of the ordered quantity. (See batch specification
for same gap.)
This report may be run stand alone. It will also be run as part
of the batch job, Close Completed Sales Order Lines.
Estimated Hours:
27
Actual Hours:
To be confirmed
Comments
None
Report
ZFRD**** is
executed
Select-Options
and Parameters
Print order
to screen
Audit/Checks:
N/A
Selection Criteria:
Sales Organization: From XXXX to XXXX
Sales Orders number: From 9999999999 to 9999999999
Close Short Order Tolerance: 99%
Report Layout(s):
The type of this report is ALV, to be generated via function module ‘REUSE ALV GRID
DISPLAY’.
Header:
Title: Report Sales Orders short Order tolerance
System Date (SY-DATUM)
Execution User (SY-USER)
Items Mapping:
Items (Example)
Sorted by fields:
Document Category, Sales Order Number and Sales Order Line Item.
Interactive Capabilities:
N/A
User-Exits:
N/A
SAP Transaction(s):
VA03 (Sales Orders), VL03 (Deliveries)
Operating Specifications
Frequency:
Daily
Dependencies:
Should be produced before MRP is run.
Restart/Recover Instructions:
N/A
Expected Duration:
3 Minutes
Responsible Contact:
Salvatore A. Schirripa
Test Conditions:
N/A
Follow-up
Issues:
Design
Program Description/Pseudocode:
Know when to use SELECT... INTO CORRESPONDING FIELDS OF TABLE, SELECT SINGLE,
SELECT... FOR ALL ENTRIES IN TABLE itab, UP to 1 ROWS, etc.
When using SELECT... FOR ALL ENTRIES IN TABLE itab, ensure that itab is
not empty.
Declare internal tables to hold the values from each of your SELECT statements. Be sure
that each of these internal tables has at least one field the same as another of your
internal tables so as to be sure that there is some link between all your internal table
data.
Create subroutines encompassing major sections of your code (for example, you could
put all your initial table selections into a subroutine called GET_DATA) in order to
modularize program. Ideally, the main body of your program will be seen on one printed
page.
If you are calculating totals in your output loop and executing the output loop
write statements inside an ON CHANGE OF ... ENDON, make sure not to write
the first record to the screen (as the first record will always trigger the ON
CHANGE OF since the variable is going from no value to a value), use holding
variables for subtotals as well as any other output fields in order to write the
correct data to the screen.
- SELECTION SCREEN –
- START OF SELECTION -
Obtain the data from the Sales Document: Header Data table (VBAK) for all
sales documents in Sales organization and Sales Document selected by the
user
The following pseudo-code is how you would enter the syntax for the select described
above.
FROM VBAK
IF SY-SUBRC <> 0
ENDIF
Put together a list of all the documents selected above that have a
'Partially processed' (LFSTK='B') or 'Not Processed' (LFSTK= 'A') status by
doing a select on the Sales Document: Header Status table (VBUK) for all
entries in your Sales
Before you go ahead and select your data using the FOR ALL ENTRIES command, you
must check if there are any entries in the internal table you are doing a FOR ALL ENTRIES
on (I_VBAK). This can be accomplished by checking the I_VBAK table with an IF
statement along with the initial command.
SELECT...
Fields: VBUK-VBELN Sales document #
ENDIF.
Since this report will only be dealing with sales documents that have not
been processed completely, we only need line item data from the Sales
Document: Item Data table (VBAP) for the sales documents just selected
from VBUK (accomplished by doing a select from VBAP for all entries in
I_VBUK)
To find the 'Issued Quantity' for each of these items, we need to find any
deliveries they may have been on. These delivery numbers can be found
via the Sales Document Flow table (VBFA) using a select from VBFA for all
entries in the SD: Item
Data internal table with the additional stipulation that the VBFA-VBTYP_N
field (Document category of subsequent document) is a delivery (VBFA-
VBTYP_N = 'I' or J').
Item Number)
lbs. From that sales order two deliveries were created: one
delivery with 500 lbs and another delivery for the remaining 500 lbs.
If you didn't select the subsequent SD document # and the
subsequent SD document item # the FOR ALL ENTRIES command
would only select one of the line items from vbfa. The delivery
number and line item number make the key unique. See your
reviewer for any questions or issues about this select.
VBELV = I_VBAP-VBELN
and POSNV = I_VBAP-
POSNR and VBTYP_N =
'I' or 'J'.
For each of the vbap records, loop at the Document flow internal table,
I_VBFA to get all the deliveries for this item. Each time through the loop,
add the quantity delivered (v_vbfa-rfmng) to v_cumqty.
* When sales document number or line item change get item and
header data.
ON CHANGE OF...
Read I_VBAP and I_VBAK using your hold variable you store vbfa
info in at the bottum of the loop.
If this short percentage is less than or equal to the close short tolerance
parameter, place it in an output structure to be printed later. Otherwise,
clear the work areas and continue.
-Clear v_cumqty
ENDON.
* Move the contents of I_VBFA from the current loop pass, so you can use
it for the reads on I_VBAP and I_VBAK in your on change of logic.
ENDLOOP.
- END OF SELECTION -
First of all, fill out the internal table I_FIELDCAT with the different ALV layout and
configuration parameters required by the function REUSE_ALV_GRID_DISPLAY
Fill out the internal table I_OUTPUT with the records selected from the data base (VBAK,
VBAP, VBFA, VBUK).
Nowadays, you will never need to create from scratch a ‘WRITE’ report,
since it is always used the ALV reports as this reports have more
functionality, are easier and faster to develop, and user friendly.
In any case, it is worth to know at least about its basic structure as you
might need to modify an already existing ‘WRITE’ report.
AT NEW field.
NEW-PAGE
* If no values for header data have changed, write next line item info
PERFORM WRITE_ITEM_INFO. ‘Form that will write out all detail information
without the headers
AT END OF field
PERFORM WRITE_SUBTOTALS
ENDAT
AT LAST
PERFORM WRITE_TOTALS.
END LAST
ENDLOOP.
Event TOP-OF-PAGE
PERFORM WRITE_NEW_PAGE_HEADER