dbc实例

*&---------------------------------------------------------------------*
*& Report  ZDM_RE0004_TEST
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

report ZDM_RE0004_TEST
       no standard page heading line-size 255.



include bdcrecx1.

start-of-selection.

perform open_group.
*************************************************************************************
*第一屏数据
*************************************************************************************
perform bdc_dynpro      using 'SAPLMGMM' '0060'.

perform bdc_field       using 'BDC_OKCODE'
                              '/00'.

perform bdc_field       using 'RMMG1-MBRSH'
                              'C'.
perform bdc_field       using 'RMMG1-MTART'
                              'ERSA'.
*************************************************************************************
*创建三个视图
*************************************************************************************
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' '4004'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'MAKT-MAKTX'
                              '物料描述'.
perform bdc_field       using 'MARA-MEINS'
                              'EA'.
perform bdc_field       using 'MARA-MATKL'
                              '03020101'.
perform bdc_field       using 'MARA-BISMT'
                              'hg0001'.
perform bdc_field       using 'MARA-BEGRU'
                              '2'.
perform bdc_field       using 'BDC_CURSOR'
                              'MARA-BEGRU'.
*************************************************************************************
*基本视图二的数据
*************************************************************************************
perform bdc_dynpro      using 'SAPLMGMM' '4004'.
perform bdc_field       using 'BDC_OKCODE'
                              '=ZU01'.
perform bdc_field       using 'MAKT-MAKTX'
                              '物料描述'.
*************************************************************************************
*英文描述
*************************************************************************************

   PERFORM bdc_dynpro      USING 'SAPLMGMM' '4300'.

  PERFORM bdc_field       USING 'BDC_OKCODE'
                                '=MAIN'.
    PERFORM bdc_field       USING 'SKTEXT-SPRAS(02)'
                                'EN'.
    PERFORM bdc_field       USING 'SKTEXT-MAKTX(02)'
                                '=ENGLISH'.

*************************************************************************************
*回到基本视图二
*************************************************************************************
perform bdc_dynpro      using 'SAPLMGMM' '4004'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'MAKT-MAKTX'
                              '物料描述'.
*************************************************************************************
*分类视图-类别
*************************************************************************************
perform bdc_dynpro      using 'SAPLCLCA' '0602'.
perform bdc_field       using 'RMCLF-KLART'
                              '001'.
perform bdc_field       using 'BDC_OKCODE'
                              '=ENTE'.
*************************************************************************************
*分类视图-class type
*************************************************************************************
perform bdc_dynpro      using 'SAPLCLFM' '0500'.
perform bdc_field       using 'RMCLF-CLASS(01)'
                              '03020101'.
perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
*************************************************************************************
*分类视图-特性值
*************************************************************************************
perform bdc_dynpro      using 'SAPLCTMS' '0109'.

perform bdc_field       using 'BDC_OKCODE'
                              '/00'.
perform bdc_field       using 'RCTMS-MNAME(01)'
                              'AA-03020101'.
perform bdc_field       using 'RCTMS-MNAME(02)'
                              'AB-03020101'.
perform bdc_field       using 'RCTMS-MNAME(03)'
                              'AD-03020101'.
perform bdc_field       using 'RCTMS-MNAME(04)'
                              'AP-03020101'.
perform bdc_field       using 'RCTMS-MNAME(05)'
                              'AT-03020101'.
perform bdc_field       using 'RCTMS-MNAME(06)'
                              'AY-03020101'.

perform bdc_field       using 'RCTMS-MWERT(01)'
                              'H148×100×6×9'.
perform bdc_field       using 'RCTMS-MWERT(02)'
                              'GB/T 700-1988 Q235A'.
perform bdc_field       using 'RCTMS-MWERT(03)'
                              'GB/T 11263-1998'.
*perform bdc_field       using 'RCTMS-MWERT(01)'
*                              'H148×100×6×9'.
perform bdc_field       using 'RCTMS-MWERT(05)'
                              '1540'.
*perform bdc_field       using 'RCTMS-MWERT(01)'
*                              'H148×100×6×9'.

perform bdc_dynpro      using 'SAPLCTMS' '0109'.

perform bdc_field       using 'BDC_OKCODE'
                              '=BACK'.

*********************************************************************
perform bdc_dynpro      using 'SAPLCLFM' '0500'.

perform bdc_field       using 'BDC_OKCODE'
                              '=SAVE'.
perform bdc_transaction using 'MM01'.

perform close_group.




"----------------------------------------------------------
步骤:
1、用SHDB录制屏幕
2、保存,选择自己的录制,点击“生成程序”
3、在生成的程序上,进行改动。 
4、BDC程序遇上WARNING消息会直接跳过,遇上ERROR消息会停止运行。
BDC程序实例(生成物料主数据MM01)

------------引用自http://my.donews.com/xiaocong117/2006/03/29/bdc%E7%A8%8B%E5%BA%8F%E5%AE%9E%E4%BE%8B%EF%BC%88%E7%94%9F%E6%88%90%E7%89%A9%E6%96%99%E4%B8%BB%E6%95%B0%E6%8D%AEmm01%EF%BC%89/


文章来自: 本站原创
引用通告地址: http://www.is21.cn/trackback.asp?tbID=702
Tags:
评论: 0 | 引用: 0 | 查看次数: 3976
发表评论
你没有权限发表留言!