# 1. Goal Show the stock balance for each material in a warehouse. The warehouse team uses the list to compare the receipts and the issues of a period. # 2. Open questions None. # 3. Context - Table {{P}}MOVMT exists in package $TMP. It contains data. Fields: MOVE_ID (INT4, key), MATERIAL (CHAR 10), PLANT (CHAR 4), MOVE_DATE (DATS), MOVE_TYPE (CHAR 3), QUANTITY (INT4). # 4. Contract - Create the executable program {{P}}STOCK_BAL in package $TMP. - Selection screen: - Parameter P_FROM, type DATS, mandatory: the first movement date to include. - Parameter P_TO, type DATS, mandatory: the last movement date to include. - Select-option S_PLANT for the plant. - Show the result with CL_SALV_TABLE. The output table has these columns, with these names: MATERIAL, RECEIPT_QTY, ISSUE_QTY, BALANCE. # 5. Business rules 1. A movement is in scope if MOVE_DATE is on or after P_FROM and on or before P_TO, and PLANT is in S_PLANT. 2. An in-scope movement is a receipt if MOVE_TYPE is '101' or '201'. It is an issue if MOVE_TYPE is '261' or '262'. All other in-scope movements are ignored. 3. RECEIPT_QTY is the sum of QUANTITY of all receipts of the material. ISSUE_QTY is the sum of QUANTITY of all issues of the material. BALANCE is RECEIPT_QTY minus ISSUE_QTY. 4. Show one line for each material that has at least one receipt or issue. A material with only ignored movements does not appear. 5. Sort the lines by BALANCE, the highest balance first. # 6. Constraints - Release target: 7.58. - Coding standards: Clean ABAP. Read the movement data with one database access. - Out of scope: do not change {{P}}MOVMT. # 7. Acceptance - The program is active and has no syntax error. - The hidden tests pass. - Write ABAP Unit tests as local test classes in the program.