ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 查找对象所在Request

查找对象所在Request

原创 Linux操作系统 作者:hzq2010 时间:2011-05-07 13:49:13 0 删除 编辑
REPORT  z_barry_check_cr.
 
TABLES: sscrfields.
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 ,
        line(20) ,
      END OF itab.
DATA: BEGIN OF up_file OCCURS 0 ,
        pgmid           LIKE e071-pgmid,
        object          LIKE e071-object,
        obj_name        LIKE e071-obj_name,
      END OF up_file.
 
PARAMETERS mode LIKE ctu_params-dismode DEFAULT 'E'  .
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20)   T1.
SELECTION-SCREEN POSITION 24.
PARAMETERS  status1 AS CHECKBOX.
SELECTION-SCREEN COMMENT 26(12)   T2.
PARAMETERS  status2 DEFAULT 'X' AS CHECKBOX.
SELECTION-SCREEN COMMENT 41(12)  T3.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN FUNCTION KEY 1.
 
INITIALIZATION.
  sscrfields-functxt_01 = '限制Request值'.
  t1 = 'Request Status'.
  t2 = 'Modifiable'.
  t3 = 'Released'.
 
AT SELECTION-SCREEN.
  CHECK sy-ucomm = 'FC01'.
  EDITOR-CALL FOR itab TITLE '输入Request值'.
  DELETE itab WHERE LINE = ''.
 
START-OF-SELECTION.
  PERFORM. upfile.
  PERFORM. bdc.
 
*&---------------------------------------------------------------------*
*&      Form  upfile
*&---------------------------------------------------------------------*
FORM. upfile.
  CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
      filename            = 'C:\checkcr.txt'
      has_field_separator = 'X'
    TABLES
      data_tab            = up_file
    EXCEPTIONS
      OTHERS              = 17.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
 
  DELETE up_file WHERE  pgmid = '' AND bject ='' AND obj_name = '' .
 
  LOOP AT up_file WHERE pgmid = '' OR bject ='' OR obj_name = '' .
    MESSAGE e000(oo) WITH '文件有错,存在空字段'.
  ENDLOOP.
ENDFORM.                    "upfile
*&---------------------------------------------------------------------*
*&      Form  bdc
*&---------------------------------------------------------------------*
FORM. bdc.
  CLEAR: bdcdata,bdcdata[].
  PERFORM. bdc_dynpro  USING 'SAPLWBABAP'         '0100'.
  PERFORM. bdc_field   USING 'BDC_OKCODE'         '=STRT'.
  PERFORM. bdc_field   USING 'RS38M-PROGRAMM'     'RSWBO040'.
  PERFORM. bdc_field   USING 'RS38M-FUNC_EDIT'    'X'.
 
  IF itab[] IS NOT INITIAL.
    PERFORM. bdc_dynpro  USING 'RSWBO040'         '1000'.
    PERFORM. bdc_field   USING 'BDC_OKCODE'       '=%104'.
    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-line .
    ENDLOOP.
    PERFORM. bdc_dynpro  USING 'SAPLALDB'       '3000'.
    PERFORM. bdc_field   USING 'BDC_OKCODE'     '=ACPT'.
  ENDIF.
 
  LOOP AT up_file.
    PERFORM. bdc_dynpro  USING 'RSWBO040'     '1000'.
    PERFORM. bdc_field   USING 'BDC_OKCODE'   '=ONLI'.
    PERFORM. bdc_field   USING 'CHECKA'       'X'.
    PERFORM. bdc_field   USING 'OBJECTA'      up_file-object .
    PERFORM. bdc_field   USING 'OBJNAMEA'     up_file-obj_name .
    PERFORM. bdc_field   USING 'STATUS1'      status1.
    PERFORM. bdc_field   USING 'STATUS2'      status2 .
  ENDLOOP.
 
  PERFORM. bdc_dynpro  USING 'RSWBO040'     '1000'.
  PERFORM. bdc_field   USING 'BDC_OKCODE'   '/EE'.
  PERFORM. bdc_dynpro  USING 'SAPLWBABAP'   '0100'.
  PERFORM. bdc_field   USING 'BDC_OKCODE'   '=BACK'.
  CALL TRANSACTION 'SE38' USING bdcdata MODE mode  .
ENDFORM.                    "bdc
 
*----------------------------------------------------------------------*
*        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

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23495244/viewspace-694689/,如需转载,请注明出处,否则将追究法律责任。

上一篇: 月份加减
请登录后发表评论 登录
全部评论

注册时间:2010-03-11

  • 博文量
    196
  • 访问量
    168079