数据库基础作业1

银河舰队 1人参与 0 次点击

源代码

*&---------------------------------------------------------------------*
 *& Report Z_LJH_0808
 *&---------------------------------------------------------------------*
 *&
 *&---------------------------------------------------------------------*
 REPORT Z_LJH_0808.
 
 TABLES ZLJH0808.
 
 DATA GT_01 TYPE TABLE OF ZLJH0808.
 DATA GS_01 TYPE ZLJH0808.
 
 SELECT * FROM ZLJH0808 INTO TABLE GT_01.
 
 write: AT 1(127) SY-ULINE.
 write: AT /1(1) SY-VLINE.
 write: AT 2(10'姓名'.
 write: AT 12(1) SY-VLINE.
 write: AT 13(20'ID'.
 write: AT 33(1) SY-VLINE.
 write: AT 34(10'员工编号'.
 write: AT 44(1) SY-VLINE.
 write: AT 45(10'部门'.
 write: AT 55(1) SY-VLINE.
 write: AT 56(10'入职日期'.
 write: AT 66(1) SY-VLINE.
 write: AT 67(10'离职日期'.
 write: AT 77(1) SY-VLINE.
 write: AT 78(15'当月应结薪酬'.
 write: AT 93(1) SY-VLINE.
 write: AT 94(10'相关数量'.
 write: AT 104(1) SY-VLINE.
 write: AT 105(10'相关比率'.
 write: AT 115(1) SY-VLINE.
 write: AT 116(10'日薪酬'.
 write: AT 127(1) SY-VLINE.
 write: AT /1(127) SY-ULINE.
 
 DATA XGSL TYPE CHAR10.
 DATA ZZSJ TYPE CHAR10.
 DATA XGBL TYPE CHAR10.
 DATA RXC  TYPE CHAR10.
 DATA SCXSB  TYPE CHAR10.
 DATA YFSCB  TYPE CHAR10.
 LOOP AT GT_01 INTO GS_01.
 ZZSJ = GS_01-LZRQ - GS_01-RZRQ.
 RXC = GS_01-XC / 22.
 CASE GS_01-BM.
  WHEN '销售部门'.
    XGSL = GS_01-XL.
    XGBL = GS_01-XL / ZZSJ.
  WHEN '生产部'.
    XGSL = GS_01-CL.
    XGBL = GS_01-CL / ZZSJ.
  WHEN '研发部'.
    XGSL = GS_01-YFL.
    XGBL = GS_01-YFL / ZZSJ.
 ENDCASE.
 write: AT /1(1) SY-VLINE.
 write: AT 2(10) GS_01-NAME.
 write: AT 12(1) SY-VLINE.
 write: AT 13(20) GS_01-ID.
 write: AT 33(1) SY-VLINE.
 write: AT 34(10) GS_01-NUM.
 write: AT 44(1) SY-VLINE.
 write: AT 45(10) GS_01-BM.
 write: AT 55(1) SY-VLINE.
 write: AT 56(10) GS_01-RZRQ.
 write: AT 66(1) SY-VLINE.
 write: AT 67(10) GS_01-LZRQ.
 write: AT 77(1) SY-VLINE.
 write: AT 78(15) GS_01-XC.
 write: AT 93(1) SY-VLINE.
 write: AT 94(10) XGSL.
 write: AT 104(1) SY-VLINE.
 write: AT 105(10) XGBL.
 write: AT 115(1) SY-VLINE.
 write: AT 116(10) RXC.
 write: AT 127(1) SY-VLINE.
 write: AT /1(127) SY-ULINE.
 
 ENDLOOP.
 
 DATA SCBM TYPE CHAR10.
 DATA XSBM TYPE CHAR10.
 DATA YFBM TYPE CHAR10.
 LOOP AT GT_01 INTO GS_01.
 CASE GS_01-BM.
  WHEN '销售部门'.
   XSBM = XSBM + GS_01-XL .
  WHEN '生产部'.
    SCBM = SCBM + GS_01-CL.
  WHEN '研发部'.
    YFBM = YFBM + GS_01-YFL.
 ENDCASE.
 ENDLOOP.
 
 SCXSB = SCBM / XSBM.
 YFSCB = YFBM / SCBM.
 write: AT /1(12'生产销售比:'.
 write: AT 12(10) SCXSB.
 write: AT 94(12'研发生产比:'.
 write: AT 106(10) YFSCB.


运行结果