单层反查BOM
*&---------------------------------------------------------------------* *& Report YCX_001 *&---------------------------------------------------------------------* *& *&---------------------------------------------------------------------* REPORT ycx_001. DATA: datub LIKE rc29l-datub, datuv LIKE rc29l-datuv. DATA: lt_wultb TYPE TABLE OF stpov, lt_equicat TYPE TABLE OF cscequi, lt_kndcat TYPE TABLE OF cscknd, lt_matcat TYPE TABLE OF cscmat, lt_stdcat TYPE TABLE OF cscstd, lt_tplcat TYPE TABLE OF csctpl. SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME. PARAMETERS: p_werks LIKE marc-werks. PARAMETERS: p_matnr LIKE marc-matnr. SELECTION-SCREEN END OF BLOCK bk1. START-OF-SELECTION. "单层反查BOM CALL FUNCTION 'CS_WHERE_USED_MAT' EXPORTING datub = sy-datum datuv = sy-datum matnr = p_matnr " 物料 stlan = '1' " 物料清单用途 werks = p_werks " 工厂 TABLES wultb = lt_wultb equicat = lt_equicat kndcat = lt_kndcat matcat = lt_matcat stdcat = lt_stdcat tplcat = lt_tplcat EXCEPTIONS call_invalid = 1 material_not_found = 2 no_where_used_rec_found = 3 no_where_used_rec_selected = 4 no_where_used_rec_valid = 5 OTHERS = 6. READ TABLE lt_wultb INTO DATA(ls_wultb) INDEX 1. IF sy-subrc EQ 0. DATA(LV_MJ) = ls_wultb-matnr. ENDIF. WRITE:LV_MJ.
本人常年接收SAP运维和远程项目,ECC,S/4HANA,CRM,WDA.
远程人天可谈,终身售后,有活请联系V信:18925782767(问问题免费,欢迎交流!)
!!请关注本人技术分享公众号:SAP翔子(可扫头像二维码)
每天分享新知识,博客文章也会陆续整理并迁移至公众号,与您一起共同学习