Chinaunix首页 | 论坛 | 博客
  • 博客访问: 484151
  • 博文数量: 199
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1902
  • 用 户 组: 普通用户
  • 注册时间: 2020-05-14 13:25
个人简介

代码5S

文章分类

全部博文(199)

文章存档

2021年(5)

2020年(194)

我的朋友

分类:

2020-05-20 16:45:56

原文地址:SELECT-OPTIONS录制BDC 作者:qdbarry

REPORT z_barry_select_options_bdc .
 
DATA:   bdcdata LIKE bdcdata    OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF messtab OCCURS 0.
        INCLUDE STRUCTURE bdcmsgcoll.
DATA: END OF messtab.
DATA: BEGIN OF itab OCCURS 0 ,
        lifnr LIKE lfa1-lifnr ,
      END OF itab.
 
START-OF-SELECTION.
  APPEND '1' TO itab.
  APPEND '2' TO itab.
  APPEND '3' TO itab.
  APPEND '4' TO itab.
  APPEND '5' TO itab.
  APPEND '6' TO itab.
  APPEND '7' TO itab.
  APPEND '8' TO itab.
  APPEND '9' TO itab.
  APPEND '10' TO itab.
  APPEND '11' TO itab.
  APPEND '12' TO itab.
 
  REFRESH bdcdata .
  CLEAR bdcdata .
  PERFORM bdc_dynpro  USING 'RFITEMAP'   '1000'.
  PERFORM bdc_field   USING 'BDC_OKCODE' '=%004'.
  PERFORM bdc_field   USING 'BDC_CURSOR' 'KD_LIFNR-LOW'.
  LOOP AT itab.
    PERFORM bdc_dynpro  USING 'SAPLALDB'   '3000'.
    PERFORM bdc_field   USING 'BDC_OKCODE' '=P+'.
    PERFORM bdc_field   USING 'BDC_CURSOR' 'RSCSEL-SLOW_I(02)'.
    PERFORM bdc_field   USING 'RSCSEL-SLOW_I(02)' itab-lifnr .
  ENDLOOP.
  PERFORM bdc_dynpro  USING 'SAPLALDB'   '3000'.
  PERFORM bdc_field   USING 'BDC_OKCODE' '=ACPT'.
  CALL TRANSACTION 'FBL1N' USING bdcdata MODE 'A' UPDATE 'S'
                                        MESSAGES INTO messtab.
*----------------------------------------------------------------------*
*        Start new screen                                              *
*----------------------------------------------------------------------*
FORM bdc_dynpro USING program dynpro.
  CLEAR bdcdata.
  bdcdata-program  = program.
  bdcdata-dynpro   = dynpro.
  bdcdata-dynbegin = 'X'.
  APPEND bdcdata.
ENDFORM.                    "BDC_DYNPRO
*----------------------------------------------------------------------*
*        Insert field                                                  *
*----------------------------------------------------------------------*
FORM bdc_field USING fnam fval.
  CLEAR bdcdata.
  bdcdata-fnam = fnam.
  bdcdata-fval = fval.
  CONDENSE bdcdata-fval.
  APPEND bdcdata.
ENDFORM.                    "BDC_FIELD
阅读(675) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~