• BDC1


     

     MM02要处理的事务码

     

     

     

     


    源代码:


    *include bdcrecx1.
    DATA:   BDCDATA LIKE BDCDATA    OCCURS WITH HEADER LINE.
    *       messages of call transaction
    DATA:   MESSTAB LIKE BDCMSGCOLL OCCURS WITH HEADER LINE.
    *       error session opened (' ' or 'X')





    TYPES :BEGIN OF TYP_01,
      MATNR TYPE MAKT-MATNR,
      MAKTX TYPE MAKT-MAKTX,
      END OF TYP_01.
      DATA GT_01 TYPE STANDARD TABLE OF TYP_01.
      DATA GS_01 TYPE TYP_01.
      start-of-selection.
      GS_01-MATNR '1527'.
      GS_01-MAKTX '大白兔'.
      APPEND GS_01 TO GT_01.



    LOOP AT GT_01 INTO GS_01.
    if sy-subrc <> 0exitendif.


    perform bdc_dynpro      using 'SAPLMGMM' '0060'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMMG1-MATNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=AUSW'.
    perform bdc_field       using 'RMMG1-MATNR'
                                  GS_01-MATNR.
    perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSICHTAUSW-DYTXT(03)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'
                                  'X'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(02)'
                                  'X'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(03)'
                                  'X'.
    perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSICHTAUSW-DYTXT(06)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(03)'
                                  'X'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(04)'
                                  'X'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(05)'
                                  'X'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(06)'
                                  'X'.
    perform bdc_dynpro      using 'SAPLMGMM' '0070'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSICHTAUSW-DYTXT(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SCHL'.
    perform bdc_dynpro      using 'SAPLMGMM' '0080'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RMMG1-LGORT'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTR'.
    perform bdc_field       using 'RMMG1-WERKS'
                                  '2010'.
    perform bdc_field       using 'RMMG1-LGORT'
                                  '3000'.
    perform bdc_dynpro      using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MAKT-MAKTX'.
    perform bdc_field       using 'MAKT-MAKTX'
                                  GS_01-MAKTX.
    perform bdc_field       using 'MARA-MEINS'
                                  'PC'.
    perform bdc_field       using 'MARA-MATKL'
                                  '0001'.
    perform bdc_field       using 'MARA-MTPOS_MARA'
                                  'NORM'.
    *perform bdc_transaction using 'MM02'.
    REFRESH MESSTAB.
        CALL TRANSACTION 'MM02' USING BDCDATA
                         MODE   'A'
                         UPDATE 'A'
                         MESSAGES INTO MESSTAB.
    ENDLOOP.
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
      CLEAR BDCDATA.
      BDCDATA-PROGRAM  PROGRAM.
      BDCDATA-DYNPRO   DYNPRO.
      BDCDATA-DYNBEGIN 'X'.
      APPEND BDCDATA.
    ENDFORM.

    *----------------------------------------------------------------------*
    *        Insert field                                                  *
    *----------------------------------------------------------------------*
    FORM BDC_FIELD USING FNAM FVAL.
    * IF FVAL <> NODATA.
        CLEAR BDCDATA.
        BDCDATA-FNAM = FNAM.
        BDCDATA-FVAL = FVAL.
        APPEND BDCDATA.
    *  ENDIF.
      ENDFORM.

  • 相关阅读:
    数据库的三大范式
    mysql中变量的定义
    java实现用两个栈实现队列
    java实现替换空格
    java实现二维数组中查找
    struts2核心配置之Action
    struts2核心配置之struts.xml
    初识struts2
    $.ajax()参数详解
    百度Map-JSAPI-覆盖物范围查询标记
  • 原文地址:https://www.cnblogs.com/salah/p/11929361.html
Copyright © 2020-2023  润新知