Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7184965
  • 博文数量: 655
  • 博客积分: 10264
  • 博客等级: 上将
  • 技术积分: 8278
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-04 17:47
个人简介

ABAP顾问

文章分类

全部博文(655)

文章存档

2017年(2)

2014年(8)

2013年(3)

2012年(2)

2011年(18)

2010年(102)

2009年(137)

2008年(274)

2007年(134)

分类:

2008-02-21 12:21:16

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
阅读(4993) | 评论(3) | 转发(2) |
给主人留下些什么吧!~~

chinaunix网友2008-04-01 07:30:12

解决了我的大问题,谢谢谢谢!!

chinaunix网友2008-02-29 16:25:52

前些天正遇到这个问题呢,巧

chinaunix网友2008-02-28 13:25:27

妙哉!!