{"audience":"Maintenance storeroom leads, maintenance planners and warehouse teams that pick spare parts with handheld terminals.","authorization_objects":[{"note":"Post goods movements by movement type","object":"M_MSEG_BWA"},{"note":"Post goods movements by plant","object":"M_MSEG_WWA"}],"components":[],"countries":[],"effort_days_max":7,"effort_days_min":5,"effort_size":"M","faq":[{"a":"In storage locations with warehouse management, the issue is completed by confirming the transfer order or warehouse task; the interface is then adapted to confirm the warehouse task instead of posting the pick confirmation directly through the BAPI.","q":"How does it work in systems that use warehouse management (WM/EWM)?"},{"a":"The base version only accepts issues with a reservation reference, so every issue is tied to a planned requirement. For unplanned issues, a 261 posting with the order number can be added under a separate approval rule.","q":"Are unplanned issues without a reservation processed?"},{"a":"Yes. BAPI_GOODSMVT_CREATE is supported on S/4HANA; the material document is written to the MATDOC table in S/4HANA, and MKPF and MSEG can still be read as compatibility views.","q":"Does the program work on S/4HANA?"}],"features":[{"code":"test_run","label":"Test mode (check without posting)","note":""},{"code":"log","label":"Line-by-line result and error log","note":""},{"code":"error_file","label":"Download failed lines as a separate file","note":"Failed and held rows are written to a separate file and retried in the next run."},{"code":"background","label":"Runs as a background job","note":"The program is scheduled as a background job running every 10–15 minutes."}],"functions":[{"name":"BAPI_GOODSMVT_CREATE","role":"Posts the 261 goods issue with reservation reference"},{"name":"BAPI_TRANSACTION_COMMIT","role":"Saves successful documents permanently"},{"name":"BAPI_TRANSACTION_ROLLBACK","role":"Rolls back in test mode and for failed groups"}],"gap":"Goods issue to a maintenance order is done by hand in MIGO by entering the reservation number. Although the warehouse picks the part and hands it to the technician, the issue is entered late or not at all; order costs remain incomplete, stock looks wrong and reservations stay open. The standard has no step that turns a pick confirmation into an order goods issue automatically. The custom interface closes this gap.","id":"pm-spare-parts-issue-from-pick-confirmation","industries":[],"input_columns":[{"derived":false,"label":"Reservation","required":true,"rule":"","target_field":"RSNUM","target_table":"MSEG"},{"derived":false,"label":"Reservation item","required":true,"rule":"","target_field":"RSPOS","target_table":"MSEG"},{"derived":false,"label":"Maintenance order","required":false,"rule":"","target_field":"AUFNR","target_table":"MSEG"},{"derived":false,"label":"Material","required":true,"rule":"","target_field":"MATNR","target_table":"MSEG"},{"derived":false,"label":"Picked quantity","required":true,"rule":"","target_field":"MENGE","target_table":"MSEG"},{"derived":false,"label":"Plant","required":false,"rule":"","target_field":"WERKS","target_table":"MSEG"},{"derived":false,"label":"Storage location","required":true,"rule":"","target_field":"LGORT","target_table":"MSEG"},{"derived":false,"label":"Batch","required":false,"rule":"","target_field":"CHARG","target_table":"MSEG"}],"kind":"program","language":"en","lastmod":"2026-11-17","logic":"1. Pick confirmations are read as CSV from a folder on the application server or from a staging table/service; each row contains reservation, item, material, quantity, storage location and batch.\n2. RESB confirms the reservation item exists, is not deleted and has no final issue flag (XLOEK and KZEAR blank), and that the material matches the row; AFIH confirms the reservation belongs to a maintenance order, and the AUFK-OBJNR status that the order is released and not TECO.\n3. Open quantity = BDMNG − ENMNG; if the picked quantity exceeds it, the row fails as 'over-pick'. If unrestricted stock (LABST) in MARD for the storage location is not sufficient, the row is put on hold.\n4. Valid rows are grouped by order and posted with BAPI_GOODSMVT_CREATE using movement code '03', movement type 261 and the reservation reference; if the pick covers the open quantity, the final issue flag is set.\n5. In test mode the call is rolled back with BAPI_TRANSACTION_ROLLBACK; in a real run each order group is committed separately and the new MKPF/MSEG document number is written to the row.\n6. The processed file is moved to an archive folder; failed rows are written to an error file and can be retried in the next run.","module":"PM","object_type":"interface","output_columns":[{"calculated":true,"formula":"Row number in the file","label":"Row","source_field":null,"source_table":null},{"calculated":false,"formula":"","label":"Maintenance order","source_field":"AUFNR","source_table":"MSEG"},{"calculated":false,"formula":"","label":"Reservation","source_field":"RSNUM","source_table":"RESB"},{"calculated":false,"formula":"","label":"Material","source_field":"MATNR","source_table":"RESB"},{"calculated":false,"formula":"","label":"Picked quantity","source_field":"MENGE","source_table":"MSEG"},{"calculated":true,"formula":"RESB-BDMNG − RESB-ENMNG − picked quantity","label":"Open after posting","source_field":null,"source_table":null},{"calculated":false,"formula":"","label":"Material document","source_field":"MBLNR","source_table":"MSEG"},{"calculated":true,"formula":"Posted, test passed, on hold (no stock) or error","label":"Status","source_field":null,"source_table":null},{"calculated":true,"formula":"BAPI return message or check error","label":"Message","source_field":null,"source_table":null}],"parameters":[{"example":"/interface/pm/pick_in/","kind":"parameter","label":"Inbound file folder (application server)","name":"P_PATH","ref_field":"","required":true},{"example":"","kind":"parameter","label":"Posting date (blank = today)","name":"P_BUDAT","ref_field":"MKPF-BUDAT","required":false},{"example":"261","kind":"parameter","label":"Movement type","name":"P_BWART","ref_field":"MSEG-BWART","required":true},{"example":"X","kind":"checkbox","label":"Set final issue on full pick","name":"P_FINAL","ref_field":"","required":false},{"example":"","kind":"checkbox","label":"Test mode (check without posting)","name":"P_TEST","ref_field":"","required":false}],"part_of":["pm-notification-to-confirmation-pack"],"performance":"Run the program as a background job every 10–15 minutes; each run processes only new files. Do the RESB and MARD checks in one read with the reservation and material list from the file. To avoid lock errors on the same material, the job should run as a single instance.","quote_url":"https://nekuhub.com/en/request-a-quote/?report=pm-spare-parts-issue-from-pick-confirmation","related":["pm-orders-waiting-for-material","pm-spare-parts-consumption-by-equipment"],"releases":[],"source":"custom","standard_alternatives":[{"note":"Posts the goods issue against the reservation by hand on screen; does not process pick confirmations automatically.","tcode":"MIGO"},{"note":"Older goods issue transaction; requires entry one by one.","tcode":"MB1A"}],"summary":"A custom interface program that reads pick confirmations from a warehouse or handheld system and posts goods issues with movement type 261 against maintenance order reservations. It checks reservation, quantity and stock, keeps the reservation open for partial picks, sets the final issue for full picks and lists the material document or error of each row.","tables":[{"access":"read_write","join_on":"RESB-RSNUM = dosya rezervasyon AND RESB-RSPOS = dosya kalem","role":"Maintenance order reservations: open quantity and final issue (updated by the BAPI)","table":"RESB","variant":"both"},{"access":"read","join_on":"AFIH-AUFNR = RESB-AUFNR","role":"Reservation belongs to a maintenance order","table":"AFIH","variant":"both"},{"access":"read","join_on":"AUFK-AUFNR = RESB-AUFNR","role":"Order object number (released/TECO check)","table":"AUFK","variant":"both"},{"access":"read","join_on":"MARD-MATNR = RESB-MATNR AND MARD-WERKS = RESB-WERKS AND MARD-LGORT = dosya depo yeri","role":"Unrestricted stock in the storage location","table":"MARD","variant":"both"},{"access":"write","join_on":"MKPF-MBLNR = yeni belge","role":"Material document header","table":"MKPF","variant":"both"},{"access":"write","join_on":"MSEG-MBLNR = MKPF-MBLNR AND MSEG-MJAHR = MKPF-MJAHR","role":"Material document item: movement 261, order, reservation","table":"MSEG","variant":"both"}],"title":"Automatic Spare Parts Goods Issue to Maintenance Orders from Warehouse Pick Confirmation (Interface)","url":"https://nekuhub.com/en/programs/spare-parts-goods-issue-to-maintenance-order-from-pick-confirmation/","vendor_id":"nekudos"}