Files

2 lines
864 B
Markdown

Create executable program {{P}}STOCK_BAL. On the selection screen, require p_from and p_to as dates. Add s_plant as a select-option for the plant. Read movement data from {{P}}MOVMT. Include a movement when its movement date is on or after p_from and on or before p_to and its plant is in s_plant. A movement type '101' or '201' is a receipt. A movement type '261' or '262' is an issue. Ignore all other in-scope movements. For each material, RECEIPT_QTY is the sum of quantity of its receipts. ISSUE_QTY is the sum of quantity of its issues. BALANCE is RECEIPT_QTY minus ISSUE_QTY. Show one line for each material that has at least one receipt or issue. Do not show a material that has only ignored movements. Sort the lines by BALANCE, highest first. Show the result in an ALV list with CL_SALV_TABLE, with the columns MATERIAL, RECEIPT_QTY, ISSUE_QTY, BALANCE.