*&---------------------------------------------------------------------* *& Report ZBDC5 *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT ZBDC5. TYPE-POOLS:SLIS. INCLUDE ZHQ_01_12TOP. INCLUDE ZHQ_01_12FORM. START-OF-SELECTION. END-OF-SELECTION. PERFORM APPEND_BDCDATA. *&---------------------------------------------------------------------* *& Form APPEND_BDCDATA *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-- p2 text *----------------------------------------------------------------------* FORM APPEND_BDCDATA . DATA MAKTX type char50. MAKTX = '英特尔(Intel) i7-13700K 13代 酷睿 处理器 16核24线程'. PERFORM APPEND_SCREEN USING 'SAPLMGMM' '0060'. PERFORM APPEND_FIELDS USING 'BDC_CURSOR' 'RMMG1-MATNR'. PERFORM APPEND_FIELDS USING 'BDC_OKCODE' '=ENTR'. PERFORM APPEND_FIELDS USING 'RMMG1-MATNR' 'A01'. PERFORM APPEND_SCREEN USING 'SAPLMGMM' '0070'. PERFORM APPEND_FIELDS USING 'BDC_CURSOR' 'MSICHTAUSW-DYTXT(02)'. PERFORM APPEND_FIELDS USING 'BDC_OKCODE' '=ENTR'. PERFORM APPEND_FIELDS USING 'MSICHTAUSW-KZSEL(01)' 'X'. PERFORM APPEND_FIELDS USING 'MSICHTAUSW-KZSEL(02)' 'X'. PERFORM APPEND_SCREEN USING 'SAPLMGMM' '4004'. PERFORM APPEND_FIELDS USING 'BDC_OKCODE' '=SP02'. PERFORM APPEND_FIELDS USING 'MAKT-MAKTX' MAKTX. PERFORM APPEND_FIELDS USING 'MARA-MEINS' 'EA'. PERFORM APPEND_FIELDS USING 'MARA-MATKL' '01'. PERFORM APPEND_FIELDS USING 'MARA-BISMT' 'NC00111'. PERFORM APPEND_FIELDS USING 'MARA-BRGEW' '2'. PERFORM APPEND_FIELDS USING 'MARA-GEWEI' 'KG'. PERFORM APPEND_FIELDS USING 'MARA-NTGEW' '3'. PERFORM APPEND_SCREEN USING 'SAPLMGMM' '4004'. PERFORM APPEND_FIELDS USING 'BDC_OKCODE' '=SP02'. PERFORM APPEND_FIELDS USING 'MAKT-MAKTX' MAKTX. PERFORM APPEND_FIELDS USING 'MARA-MEINS' 'EA'. PERFORM APPEND_FIELDS USING 'MARA-MATKL' '01'. PERFORM APPEND_FIELDS USING 'MARA-BISMT' 'NC00111'. PERFORM APPEND_FIELDS USING 'MARA-BRGEW' '2'. PERFORM APPEND_FIELDS USING 'MARA-GEWEI' 'KG'. PERFORM APPEND_FIELDS USING 'MARA-NTGEW' '3'. PERFORM APPEND_SCREEN USING 'SAPLMGMM' '4004'. PERFORM APPEND_FIELDS USING 'BDC_OKCODE' '=BU'. PERFORM APPEND_FIELDS USING 'BDC_CURSOR' 'MAKT-MAKTX'. PERFORM APPEND_FIELDS USING 'MAKT-MAKTX' MAKTX. CALL TRANSACTION 'MM02' USING BDCDATA MODE 'N'. "前台-A 后台-N 只显示错误-E IF sy-subrc = 0. WRITE 'BDC更新成功'. ENDIF. ENDFORM. " APPEND_BDCDATA FORM APPEND_SCREEN USING VALUE(PROGRAM) VALUE(DYNPRO). CLEAR BDCDATA. BDCDATA-PROGRAM = PROGRAM. BDCDATA-DYNPRO = DYNPRO. BDCDATA-DYNBEGIN = 'X'. BDCDATA-FNAM = ''. BDCDATA-FVAL = ''. APPEND BDCDATA. ENDFORM. FORM APPEND_FIELDS USING VALUE(FNAM) VALUE(FVAL). CLEAR BDCDATA. BDCDATA-PROGRAM = ''. BDCDATA-DYNPRO = ''. BDCDATA-DYNBEGIN = ''. BDCDATA-FNAM = FNAM. BDCDATA-FVAL = FVAL. APPEND BDCDATA. ENDFORM. *&---------------------------------------------------------------------* *& 包含 ZHQ_01_12TOP *&---------------------------------------------------------------------* TYPES:BEGIN OF GTY_MATERIAL, MATNR TYPE C LENGTH 18,"物料号 MAKTX TYPE C LENGTH 40,"物料描述 BRGEW TYPE C LENGTH 20,"毛重量 NTGEW TYPE C LENGTH 20,"净重量 GEWEI TYPE C LENGTH 3, "单位 END OF GTY_MATERIAL. DATA GS_MATERIAL TYPE GTY_MATERIAL. DATA GT_MATERIAL TYPE TABLE OF GTY_MATERIAL. DATA BDCDATA TYPE TABLE OF BDCDATA WITH HEADER LINE.
标签:ZHQ,&---------------------------------------------------------------------,B From: https://www.cnblogs.com/hua900822/p/17384618.html