|| 您当前的位置:首页 > SAP HR资源网

下载所有程序

来源:  作者:saplogon  (查看评论)
pA0001: HR主数据 
  p 0001和PS0001都是structure  其中P0001相当于PA0001的work area
*&---------------------------------------------------------------------*
*& Report  ZWUFEIDOWNLOAD
*&
*&---------------------------------------------------------------------*
*&
*&     wufei
*&---------------------------------------------------------------------*
REPORT  ZWUFEIDOWNLOAD.
*
*REPORT ZREPORTDOWN .
TABLES:TRDIR,TEXTPOOL.
DATA: BEGIN OF TTAB OCCURS 50.
       INCLUDE STRUCTURE TEXTPOOL.
DATA: END OF TTAB.
DATA CODE(255) OCCURS 10.
DATA:PGNAME LIKE RLGRAP-FILENAME,LNCNT TYPE I,SLGTH TYPE I,PFNAME(80),
    COMMENT(40).
DATA:BEGIN OF PGTAB OCCURS 100.
       INCLUDE STRUCTURE TRDIR.
DATA:END OF PGTAB.
DATA:BEGIN OF FILELIST OCCURS 0,
    PGNAME LIKE RLGRAP-FILENAME,
    DESCTXT(80),
    CNAM LIKE TRDIR-CNAM,
    CDAT LIKE SY-DATUM,
    END OF FILELIST.
SELECT-OPTIONS IPGNAME FOR TRDIR-NAME.
PARAMETERS:PATHNAME LIKE RLGRAP-FILENAME.
DATA  SS(1).
DATA  TOTAL_COUNTER TYPE I.
DATA: PERCENT TYPE P DECIMALS 2.
DATA  MSGTXT(60).
DATA  PPERCENT_S(10).
DESCRIBE TABLE IPGNAME LINES LNCNT.
IF LNCNT = 0.
 SELECT * FROM TRDIR INTO TABLE PGTAB WHERE NAME LIKE 'Z%      '.
ELSE.
 SELECT * FROM TRDIR INTO TABLE PGTAB WHERE NAME IN IPGNAME.
ENDIF.
*SLGTH = STRLEN( PATHNAME ) - 1.
*SS = PATHNAME+SLGTH(1).
*IF SS NE '\'.
  SLGTH = SLGTH + 1.
  WRITE '\' TO PATHNAME+SLGTH.
*ENDIF.
*SLGTH = SLGTH + 1.
DESCRIBE TABLE PGTAB LINES TOTAL_COUNTER.

LOOP AT PGTAB.
 PERCENT = SY-TABIX * 100 / TOTAL_COUNTER.
 PPERCENT_S = PERCENT.
 CONDENSE PPERCENT_S.
 CONCATENATE PPERCENT_S '%' INTO PPERCENT_S.
 CONCATENATE '正下载文件' PPERCENT_S '完成' INTO MSGTXT.
 PERFORM CALL_INDICATOR.
 READ TEXTPOOL PGTAB-NAME INTO TTAB LANGUAGE SY-LANGU.
 READ TABLE TTAB WITH KEY ID = 'R'.
 CONCATENATE '*****' '&&&&&' TTAB-ENTRY '&&&&&' '*****' INTO COMMENT.
 READ REPORT PGTAB-NAME INTO CODE.
 APPEND COMMENT TO CODE.
 CLEAR PGNAME.
 CONCATENATE PATHNAME PGTAB-NAME '.TXT' INTO PGNAME.
 FILELIST-PGNAME = PGTAB-NAME.
 FILELIST-DESCTXT = TTAB-ENTRY.
 FILELIST-CDAT = PGTAB-CDAT.
 FILELIST-CNAM = PGTAB-CNAM.
 APPEND FILELIST.
 CALL FUNCTION 'WS_DOWNLOAD'
      EXPORTING
           FILENAME            = PGNAME
           FILETYPE            = 'ASC'
      TABLES
           DATA_TAB            = CODE
      EXCEPTIONS
           FILE_OPEN_ERROR     = 1
           FILE_WRITE_ERROR    = 2
           INVALID_FILESIZE    = 3
           INVALID_TABLE_WIDTH = 4
           INVALID_TYPE        = 5.
 
ENDLOOP.
CLEAR PGNAME.
CONCATENATE PATHNAME 'FILELIST.TXT' INTO PGNAME.
 CALL FUNCTION 'WS_DOWNLOAD'
      EXPORTING
           FILENAME            = PGNAME
           FILETYPE            = 'DAT'
      TABLES
           DATA_TAB            = FILELIST
      EXCEPTIONS
           FILE_OPEN_ERROR     = 1
           FILE_WRITE_ERROR    = 2
           INVALID_FILESIZE    = 3
           INVALID_TABLE_WIDTH = 4
           INVALID_TYPE        = 5.
 

*****&&&&&DELETE TABLE VALUE&&&&&*****
*&-------------------------------------------------------------------- -*
*&      Form  CALL_INDICATOR
*&-------------------------------------------------------------------- -*
      text
*--------------------------------------------------------------------- -*
-->  p1        text
<--  p2        text
*--------------------------------------------------------------------- -*
FORM CALL_INDICATOR.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
      EXPORTING
           PERCENTAGE = PERCENT
           TEXT       = MSGTXT
      EXCEPTIONS
           OTHERS     = 1.
ENDFORM.

考试辅导
最近更新内容
Google广告