*&---------------------------------------------------------------------*
*& Report Z_PRINT_LEND *
*& *
*&---------------------------------------------------------------------*
*&developer : liuxy
*&date : 2015.04.23
*& *
*&---------------------------------------------------------------------*
REPORT Z_PRINT_LEND NO STANDARD PAGE HEADING."借还物台帐
TABLES : ZLEND_MAIN,ZLEND_DETAIL,ZRETURN_INFOR,ZRENEW_INFOR,ZLEND_LL.
TABLES : SSCRFIELDS , ZT016T."用于按钮的]字段属性
DATA : FLAG TYPE C.
DATA : LEND_MAIN LIKE ZLEND_MAIN OCCURS 0 WITH HEADER LINE.
DATA : LEND_DETAIL LIKE ZLEND_DETAIL OCCURS 0 WITH HEADER LINE.
DATA : RETURN_DATA LIKE ZRETURN_INFOR OCCURS 0 WITH HEADER LINE.
DATA : LEND_LL LIKE ZLEND_LL OCCURS 0 WITH HEADER LINE.
DATA : LEND_LL2 LIKE ZLEND_LL OCCURS 0 WITH HEADER LINE.
DATA : ITAB(72) OCCURS 0 WITH HEADER LINE.
DATA : P_PRO(10) ,LLD_NO(10) , HLD_NO(10) ,TT TYPE C,P_PRY(10).
DATA : NUM,NUM2(20),P_NUM ,NUM3(20) TYPE I.
DATA : APPLY_NUM , GET_NUM ,RET_NUM LIKE ZLEND_DETAIL-APPLY_NUM .
DATA : P_NO LIKE ZRETURN_INFOR-RETURN_NO ."用于记录还物单号
DATA : S_STORE(10) ,NAME(20) ,NAME2(20) TYPE C.
TYPE-POOLS: SLIS.
DATA: FIELDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
DATA: BEGIN OF INFOR_ALL OCCURS 0,"用于记录所有信息
* MANDT like zlend_detail-mandt,"集团
* line_no like zlend_detail-line_no ,"行号
LEND_NO LIKE ZLEND_DETAIL-LEND_NO ,"借料单号码
MATNR LIKE ZLEND_DETAIL-MATNR,"物料号
STORE_TYPE LIKE ZLEND_DETAIL-STORE_TYPE,"库类别
PROPERTY LIKE ZLEND_DETAIL-PROPERTY,"属性
MEINS LIKE ZLEND_DETAIL-MEINS,"计量单位
APPLY_NUM LIKE ZLEND_DETAIL-APPLY_NUM,"申请数量
PRICE LIKE ZLEND_DETAIL-PRICE,"单价
* total like zlend_detail-price,"总金额
TOTAL TYPE I,"总计显示
APPLY_NO LIKE ZLEND_DETAIL-APPLY_NO,"申请单号
NUM LIKE ZLEND_DETAIL-APPLY_NUM,"拖欠数量
GET_NUM LIKE ZLEND_DETAIL-GET_NUM,"得到数量
SENDER LIKE ZLEND_DETAIL-SENDER,"发货人
STORER LIKE ZLEND_DETAIL-SOTRER,"库管人员 输入用
MACHI_SERIES LIKE ZLEND_DETAIL-MACHI_SERIES ,"机器序列号
RETURN_NUM LIKE ZLEND_DETAIL-RETURN_NUM,"归还数量
LAST_DATE LIKE ZLEND_DETAIL-LAST_DATE,"最后一次的操作日期
STATUS LIKE ZLEND_DETAIL-STATUS,"状态
MAKTX LIKE ZLEND_DETAIL-MAKTX,"物料描述
SERIES LIKE ZLEND_DETAIL-SERIES,"规格型号
ZTBS LIKE ZLEND_DETAIL-ZTBS,"在途标示
CHECKS TYPE C,"detail information
LEND_DEPART LIKE ZLEND_MAIN-LEND_DEPART,"nomber
LEND_DEP LIKE ZLEND_MAIN-DEP_DETAIL,
DEP_DETAIL LIKE ZLEND_MAIN-DEP_DETAIL,"部门详述
LEND_DATE LIKE ZLEND_MAIN-LEND_DATE,
RETURN_DATE LIKE ZLEND_MAIN-RETURN_DATE,
PURPOSE LIKE ZLEND_MAIN-PURPOSE,
PUR_DETAIL LIKE ZLEND_MAIN-PUR_DETAIL,
MANAGER1 LIKE ZLEND_MAIN-MANAGER1,
* manager2 like zlend_main-manager2,
* storer like zlend_main-storer,
OPERATOR LIKE ZLEND_MAIN-OPERATOR,
LENDER LIKE ZLEND_MAIN-LENDER,
OVER_DAY TYPE I,
RETURN_NO LIKE ZLEND_DETAIL-LEND_NO,
* have_date like zreturn_infor-return_date,
" 用于记录超期天数
END OF INFOR_ALL.
DATA : RETURN_DAT LIKE ZRETURN_INFOR OCCURS 0 WITH HEADER LINE.
DATA : LEND_NUM(16) TYPE I .
DATA:S TYPE I,
S2 TYPE I.
SELECTION-SCREEN BEGIN OF BLOCK RAD1 WITH FRAME TITLE T1."ADD group
SELECTION-SCREEN BEGIN OF LINE."添加选项 借物台帐
SELECTION-SCREEN COMMENT 1(20) T11.
PARAMETERS LEND RADIOBUTTON GROUP RAD1 .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE."还物台帐
SELECTION-SCREEN COMMENT 1(20) T12.
PARAMETERS RETURN RADIOBUTTON GROUP RAD1 .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK RAD1. " end of group
*selection-screen begin of block che1 with frame title T7." add checbox
SELECTION-SCREEN BEGIN OF BLOCK RAD2 WITH FRAME TITLE T5."ADD GROUP 2
SELECTION-SCREEN BEGIN OF LINE."逾期未还借物的用途分类统计表
SELECTION-SCREEN COMMENT 1(20) T52."已还借物信息lend_main,
"lend_detail
PARAMETERS OVER_PUR RADIOBUTTON GROUP RAD2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE."已还物库信息统计
SELECTION-SCREEN COMMENT 1(20) T54."
PARAMETERS RETU_DAT RADIOBUTTON GROUP RAD2 .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE."按照归还日期统计
SELECTION-SCREEN COMMENT 1(20) T55."
PARAMETERS P_DATE RADIOBUTTON GROUP RAD2 .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE."各月借物统计表
SELECTION-SCREEN COMMENT 1(20) T53."未还信息
PARAMETERS MON_DAT RADIOBUTTON GROUP RAD2 DEFAULT ‘X‘.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK RAD2." END OF GROUP 2
SELECTION-SCREEN BEGIN OF BLOCK RAD3 WITH FRAME TITLE T7.
" begin of print
SELECTION-SCREEN BEGIN OF LINE."借物单打印
SELECTION-SCREEN COMMENT 1(20) T14.
* parameters c_lend as checkbox.
PARAMETERS C_LEND RADIOBUTTON GROUP RAD3.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE."还料单打印
SELECTION-SCREEN COMMENT 1(20) T15.
* parameters c_retu as checkbox .
PARAMETERS C_RETU RADIOBUTTON GROUP RAD3.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE."领料单打印
SELECTION-SCREEN COMMENT 1(20) T16.
PARAMETERS C_LLD RADIOBUTTON GROUP RAD3.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK RAD3.
SELECTION-SCREEN BEGIN OF LINE."借物日期选项
SELECTION-SCREEN COMMENT 1(20) T2.
SELECT-OPTIONS L_DATE FOR ZLEND_MAIN-LEND_DATE.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE."归还日期选项
SELECTION-SCREEN COMMENT 1(20) T6.
SELECT-OPTIONS R_DATE FOR ZLEND_MAIN-RETURN_DATE.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE."部门选项
SELECTION-SCREEN COMMENT 1(20) T3.
* PARAMETERS DEPART(20) TYPE C.
* PARAMETERS : DEPART LIKE T016T-BRSCH .
SELECT-OPTIONS DEPART FOR ZT016T-BRSCH .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(23) T4.
PARAMETERS PERMIT(8) ."审批人
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) T8.
* PARAMETERS NO(10) ."借料单号
SELECT-OPTIONS NO FOR ZLEND_DETAIL-LEND_NO .
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(20) T9.
* PARAMETERS R_NO(10) ."还料单好
SELECT-OPTIONS R_NO FOR ZRETURN_INFOR-RETURN_NO.
SELECTION-SCREEN END OF LINE.
INITIALIZATION.
T1 = ‘台帐选项‘.
T11 = ‘借物台帐‘.
T12 = ‘单据打印‘.
T14 = ‘借料单打印‘.
T15 = ‘还料单打印‘.
T16 = ‘领料单打印‘.
T2 = ‘请选择借料日期:‘.
T3 = ‘部门选项:‘.
T4 = ‘审批人:‘.
T5 = ‘具体分类信息‘.
T52 = ‘已还借物统计表‘.
T54 = ‘已还批次统计表‘.
T55 = ‘按归还日期统计‘.
T53 = ‘未还借物统计表‘.
T6 = ‘请选择还物日期:‘.
T7 = ‘单据种类选项:‘.
T8 = ‘借料单号:‘.
T9 = ‘还料单号:‘.
AT SELECTION-SCREEN.
CLEAR ITAB[].
IF PERMIT <> ‘‘.
IF ITAB IS INITIAL.
CONCATENATE ‘manager1 = ‘ ‘ permit ‘ INTO ITAB.
ELSE.
CONCATENATE ‘ and manager1 = ‘ ‘ permit ‘ INTO ITAB.
ENDIF.
APPEND ITAB.
ENDIF.
* if NO <> ‘‘ .
* if itab is initial.
* concatenate ‘lend_no = ‘ ‘ NO ‘ into itab .
* else.
* concatenate ‘ and lend_no = ‘ ‘ NO ‘ into itab.
* endif.
* append itab.
* endif.
* if SY-UNAME = ‘LIUSHENG‘ .
* if itab is initial.
* concatenate ‘operator = ‘ ‘ sy-uname ‘ into itab.
* else.
* concatenate ‘ and operator = ‘ ‘ sy-uname ‘ into itab.
* endif.
* append itab.
* endif.
* if SY-UNAME = ‘NIEJIAN‘ .
* if itab is initial.
* concatenate ‘operator = ‘ ‘ sy-uname ‘ into itab.
* else.
* concatenate ‘ and operator = ‘ ‘ sy-uname ‘ into itab.
* endif.
* append itab.
* endif.
IF SY-UNAME = ‘LIUQJ‘.
IF ITAB IS INITIAL.
CONCATENATE ‘operator = ‘ ‘ sy-uname ‘ INTO ITAB.
ELSE.
CONCATENATE ‘ and operator = ‘ ‘ sy-uname ‘ INTO ITAB.
ENDIF.
APPEND ITAB.
ENDIF.
START-OF-SELECTION.
* set pf-status ‘LEND01‘.
END-OF-SELECTION.
IF LEND = ‘X‘.
IF MON_DAT = ‘X‘.
PERFORM LEND_DATA."未还信息
ELSEIF RETU_DAT = ‘X‘.
PERFORM RETURN_DATA."已还批次
ELSEIF P_DATE = ‘X‘."按归还时间统计
PERFORM TIME_DATA.
ELSEIF OVER_PUR = ‘X‘.
PERFORM PUR_DATA."已还信息
ENDIF.
ENDIF.
IF RETURN = ‘X‘.
PERFORM RETU_DAT.
ENDIF.
*&--------------------------------------------------------------------*
*& Form LEND_DATA
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM LEND_DATA."借物台帐未还信息
IF SY-UNAME = ‘YINGZHAO‘ OR SY-UNAME = ‘ZHANGSHP‘ OR SY-UNAME =
‘YAOLJ‘.
NAME = ‘2000‘.
IF ITAB IS INITIAL.
CONCATENATE ‘LEND_DEPART = ‘ ‘ NAME ‘INTO ITAB.
ELSE.
CONCATENATE ‘ AND LEND_DEPART = ‘ ‘ NAME ‘INTO ITAB.
ENDIF.
APPEND ITAB.
CLEAR DEPART.
ENDIF.
* if depart <> ‘‘ .
* if itab is initial.
* concatenate ‘lend_depart = ‘ ‘ depart ‘ into itab.
* else.
* concatenate ‘ and lend_depart = ‘ ‘ depart ‘ into itab.
* endif.
* append itab.
* endif.
CLEAR LEND_MAIN[].
CLEAR LEND_DETAIL[].
CLEAR INFOR_ALL[].
SELECT * INTO TABLE LEND_MAIN FROM ZLEND_MAIN WHERE LEND_DEPART
IN DEPART AND LEND_NO IN NO AND LEND_DATE IN L_DATE AND
RETURN_DATE IN R_DATE AND (ITAB).
LOOP AT LEND_MAIN.
CLEAR INFOR_ALL.
INFOR_ALL-LEND_NO = LEND_MAIN-LEND_NO.
INFOR_ALL-LEND_DEPART = LEND_MAIN-LEND_DEPART.
CLEAR INFOR_ALL-LEND_DEP.
SELECT BRTXT INTO INFOR_ALL-LEND_DEP FROM ZT016T WHERE BRSCH =
INFOR_ALL-LEND_DEPART AND SPRAS = ‘1‘ .
ENDSELECT.
INFOR_ALL-DEP_DETAIL = LEND_MAIN-DEP_DETAIL.
INFOR_ALL-LEND_DATE = LEND_MAIN-LEND_DATE.
INFOR_ALL-RETURN_DATE = LEND_MAIN-RETURN_DATE.
* infor_all-purpose = lend_main-purpose.
CASE LEND_MAIN-PURPOSE.
WHEN ‘1‘.
INFOR_ALL-PURPOSE = ‘项目测试‘.
WHEN ‘2‘.
INFOR_ALL-PURPOSE = ‘项目备机‘.
WHEN ‘3‘.
INFOR_ALL-PURPOSE = ‘缺货使用‘.
WHEN ‘4‘.
INFOR_ALL-PURPOSE = ‘开发测试‘.
WHEN ‘5‘.
INFOR_ALL-PURPOSE = ‘例行试验‘.
WHEN ‘6‘.
INFOR_ALL-PURPOSE = ‘新品测试‘.
WHEN ‘7‘.
INFOR_ALL-PURPOSE = ‘各类认证‘.
WHEN ‘8‘.
INFOR_ALL-PURPOSE = ‘媒体评测‘.
WHEN ‘9‘.
INFOR_ALL-PURPOSE = ‘办公暂借‘.
WHEN ‘10‘.
INFOR_ALL-PURPOSE = ‘销售‘.
WHEN ‘11‘.
INFOR_ALL-PURPOSE = ‘展览‘.
WHEN ‘12‘.
INFOR_ALL-PURPOSE = ‘更换‘.
WHEN ‘13‘.
INFOR_ALL-PURPOSE = ‘培训‘.
WHEN ‘14‘.
INFOR_ALL-PURPOSE = ‘DOA‘.
ENDCASE.
INFOR_ALL-PUR_DETAIL = LEND_MAIN-PUR_DETAIL.
INFOR_ALL-MANAGER1 = LEND_MAIN-MANAGER1.
INFOR_ALL-LENDER = LEND_MAIN-LENDER.
INFOR_ALL-OPERATOR = LEND_MAIN-OPERATOR.
* infor_all-over_day = sy-datum - lend_main-return_date.
SELECT * INTO TABLE LEND_DETAIL FROM ZLEND_DETAIL WHERE
LEND_NO = LEND_MAIN-LEND_NO .
LOOP AT LEND_DETAIL .
"加入if 判断已还物信息
IF LEND_DETAIL-GET_NUM <> LEND_DETAIL-RETURN_NUM.
INFOR_ALL-MATNR = LEND_DETAIL-MATNR.
INFOR_ALL-MAKTX = LEND_DETAIL-MAKTX.
INFOR_ALL-ZTBS = LEND_DETAIL-ZTBS.
* infor_all-store_type = lend_detail-store_type.
CASE LEND_DETAIL-STORE_TYPE.
WHEN ‘1‘.
INFOR_ALL-STORE_TYPE = ‘SER整机库‘.
WHEN ‘2‘.
INFOR_ALL-STORE_TYPE = ‘SER散件库‘.
WHEN ‘3‘.
INFOR_ALL-STORE_TYPE = ‘PC整机库‘.
WHEN ‘4‘.
INFOR_ALL-STORE_TYPE = ‘PC散件库‘.
WHEN ‘5‘.
INFOR_ALL-STORE_TYPE = ‘PC显示器‘.
WHEN ‘6‘.
INFOR_ALL-STORE_TYPE = ‘SER显示器‘.
ENDCASE.
CASE LEND_DETAIL-PROPERTY.
WHEN ‘1‘.
INFOR_ALL-PROPERTY = ‘A‘.
WHEN ‘2‘.
INFOR_ALL-PROPERTY = ‘C‘.
WHEN ‘3‘.
INFOR_ALL-PROPERTY = ‘D‘.
WHEN ‘4‘.
INFOR_ALL-PROPERTY = ‘B‘.
WHEN ‘5‘.
INFOR_ALL-PROPERTY = ‘E‘.
WHEN ‘6‘.
INFOR_ALL-PROPERTY = ‘过保‘.
ENDCASE.
CASE LEND_DETAIL-STATUS.
WHEN ‘1‘.
INFOR_ALL-STATUS = ‘未发货‘.
WHEN ‘2‘.
INFOR_ALL-STATUS = ‘部分发货‘.
WHEN ‘3‘.
INFOR_ALL-STATUS = ‘全部发货‘.
ENDCASE.
INFOR_ALL-APPLY_NUM = LEND_DETAIL-APPLY_NUM.
INFOR_ALL-GET_NUM = LEND_DETAIL-GET_NUM.
INFOR_ALL-RETURN_NUM = LEND_DETAIL-RETURN_NUM.
INFOR_ALL-OVER_DAY = SY-DATUM - LEND_DETAIL-LAST_DATE.
INFOR_ALL-LAST_DATE = LEND_DETAIL-LAST_DATE.
INFOR_ALL-NUM = INFOR_ALL-GET_NUM - INFOR_ALL-RETURN_NUM .
INFOR_ALL-APPLY_NO = LEND_DETAIL-APPLY_NO.
INFOR_ALL-MEINS = LEND_DETAIL-MEINS.
INFOR_ALL-PRICE = LEND_DETAIL-PRICE.
INFOR_ALL-TOTAL = INFOR_ALL-PRICE * INFOR_ALL-APPLY_NUM .
INFOR_ALL-SENDER = LEND_DETAIL-SENDER.
INFOR_ALL-STORER = LEND_DETAIL-SOTRER.
INFOR_ALL-MACHI_SERIES = LEND_DETAIL-MACHI_SERIES.
APPEND INFOR_ALL.
CLEAR LEND_DETAIL.
ENDIF.
ENDLOOP.
ENDLOOP.
SORT INFOR_ALL BY PURPOSE.
CLEAR FIELDCAT[].
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘LEND_NO‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘借料单号‘.
FIELDCAT-SELTEXT_M = ‘借料单号‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘LEND_DEPART‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘部门编号‘.
FIELDCAT-SELTEXT_M = ‘部门编号‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘LEND_DEP‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘借料部门‘.
FIELDCAT-SELTEXT_M = ‘借料部门‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘DEP_DETAIL‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘部门详述‘.
FIELDCAT-SELTEXT_M = ‘部门详述‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘ZTBS‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘在途数量‘.
FIELDCAT-SELTEXT_M = ‘在途数量‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘LEND_DATE‘.
FIELDCAT-TABNAME = ‘LEND_MAIN‘.
FIELDCAT-SELTEXT_S = ‘借料日期‘.
FIELDCAT-SELTEXT_M = ‘借料日期‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘RETURN_DATE‘.
FIELDCAT-TABNAME = ‘LEND_MAIN‘.
FIELDCAT-SELTEXT_S = ‘预计归还日期‘.
FIELDCAT-SELTEXT_M = ‘预计归还日期‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘LAST_DATE‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘续借日期‘.
FIELDCAT-SELTEXT_M = ‘续借日期‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘STATUS‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘发货状态‘.
FIELDCAT-SELTEXT_M = ‘发货状态‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘PURPOSE‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘用途‘.
FIELDCAT-SELTEXT_M = ‘用途‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘PUR_DETAIL‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘用途详细‘.
FIELDCAT-SELTEXT_M = ‘用途详细‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘MANAGER1‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘审批经理‘.
FIELDCAT-SELTEXT_M = ‘审批经理‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘OPERATOR‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘操作人‘.
FIELDCAT-SELTEXT_M = ‘操作人‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘MATNR‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘物料号‘.
FIELDCAT-SELTEXT_M = ‘物料号‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘MAKTX‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘物料描述‘.
FIELDCAT-SELTEXT_M = ‘物料描述‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘MEINS‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘单位‘.
FIELDCAT-SELTEXT_M = ‘单位‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘STORE_TYPE‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘库类别‘.
FIELDCAT-SELTEXT_M = ‘库类别‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘PROPERTY‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘物料属性‘.
FIELDCAT-SELTEXT_M = ‘物料属性‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘APPLY_NUM‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘申请数量‘.
FIELDCAT-SELTEXT_M = ‘申请数量‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘GET_NUM‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘发货数量‘.
FIELDCAT-SELTEXT_M = ‘发货数量‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘RETURN_NUM‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘归还数量‘.
FIELDCAT-SELTEXT_M = ‘归还数量‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘NUM‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘余额‘.
FIELDCAT-SELTEXT_M = ‘余额‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘LENDER‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘借物人‘.
FIELDCAT-SELTEXT_M = ‘借物人‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘PRICE‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘单价‘.
FIELDCAT-SELTEXT_M = ‘单价‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘TOTAL‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘金额‘.
FIELDCAT-SELTEXT_M = ‘金额‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘APPLY_NO‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘申请单号‘.
FIELDCAT-SELTEXT_M = ‘申请单号‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘MACHI_SERIES‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘机器序列号‘.
FIELDCAT-SELTEXT_M = ‘机器序列号‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘OVER_DAY‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘超期天数‘.
FIELDCAT-SELTEXT_M = ‘超期天数‘.
APPEND FIELDCAT.
CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY‘
EXPORTING
IT_FIELDCAT = FIELDCAT[]
I_DEFAULT = ‘X‘
I_SAVE = ‘A‘
TABLES
T_OUTTAB = INFOR_ALL
EXCEPTIONS
OTHERS = 2.
ENDFORM. "LEND_DATA
*&--------------------------------------------------------------------*
*& Form RETU_dat
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM RETU_DAT."单据打印
IF C_LEND = ‘X‘."借料单打印
PERFORM PRINT_LEND.
ENDIF.
IF C_RETU = ‘X‘.
PERFORM PRINT_RETURN."还料单打印
ENDIF.
IF C_LLD = ‘X‘."领料单打印
PERFORM PRINT_LLD.
ENDIF.
ENDFORM. "RETU_dat
*&--------------------------------------------------------------------*
*& Form print_lend
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM PRINT_LEND."
CLEAR LEND_MAIN[]."借物单据打印
CLEAR LEND_DETAIL[].
CLEAR NUM3 .
NUM2 = 0 .
NUM = 1 .
SELECT * INTO TABLE LEND_MAIN FROM ZLEND_MAIN WHERE LEND_DEPART IN
DEPART AND LEND_NO IN NO AND LEND_DATE IN L_DATE AND RETURN_DATE IN
R_DATE AND (ITAB).
LOOP AT LEND_MAIN.
SELECT * INTO TABLE LEND_DETAIL FROM ZLEND_DETAIL WHERE LEND_NO =
LEND_MAIN-LEND_NO.
NUM3 = SY-DBCNT.
LOOP AT LEND_DETAIL."查找所有的发货数量不等于申请数量的数据
IF LEND_DETAIL-APPLY_NUM > LEND_DETAIL-GET_NUM.
IF NUM2 = 0 .
WRITE / .
WRITE / .
WRITE / .
WRITE 30 ‘浪潮信息公司借物单‘.
WRITE : 60 ‘单号:‘ , LEND_MAIN-LEND_NO.
* write 58 num."用于输出单子树木
WRITE /26(30) SY-ULINE .
CLEAR INFOR_ALL-LEND_DEP.
SELECT BRTXT INTO INFOR_ALL-LEND_DEP FROM ZT016T WHERE BRSCH =
LEND_MAIN-LEND_DEPART AND SPRAS = ‘1‘ .
ENDSELECT.
* write : /2 ‘借料部门:‘ , lend_main-lend_depart.
WRITE : /2 ‘借料部门:‘ , INFOR_ALL-LEND_DEP.
WRITE : ‘借料日期:‘ , LEND_MAIN-LEND_DATE.
WRITE : ‘应还日期:‘ , LEND_MAIN-RETURN_DATE.
* write : ‘单号:‘ , lend_main-lend_no.
WRITE /0(80) SY-ULINE.
WRITE /0 SY-VLINE.
WRITE 80 SY-VLINE.
WRITE : 5 ‘产品编码‘.
WRITE 19 SY-VLINE.
WRITE : 30 ‘物料描述 ‘ .
* write 59 sy-vline.
* write : 60 ‘SN/QN‘ .
* write : 60 ‘单位‘ .
WRITE 64 SY-VLINE.
WRITE : 65 ‘单位‘.
WRITE 80 SY-VLINE.
WRITE 69 SY-VLINE.
WRITE : 74 ‘数量‘.
WRITE : /0(80) SY-ULINE.
ENDIF.
NUM2 = NUM2 + 1 .
"add lend_detial infromation
WRITE /0 SY-VLINE.
WRITE : LEND_DETAIL-MATNR.
WRITE 19 SY-VLINE.
WRITE : 20 LEND_DETAIL-MAKTX.
* write 59 sy-vline.
* write : 74 lend_detail-apply_num .
* write 64 lend_detail-apply_num .
CLEAR S.
S = LEND_DETAIL-APPLY_NUM.
WRITE 71(10) S .
WRITE 64 SY-VLINE.
WRITE : 65 LEND_DETAIL-MEINS.
WRITE SY-VLINE.
WRITE 80 SY-VLINE.
WRITE /0(80) SY-ULINE.
WRITE /0 SY-VLINE.
WRITE 2 ‘SN/QN‘.
WRITE 19 SY-VLINE.
WRITE 80 SY-VLINE.
WRITE /0(80) SY-ULINE.
CASE LEND_DETAIL-STORE_TYPE.
WHEN ‘1‘.
S_STORE = ‘SER整机库‘.
WHEN ‘2‘.
S_STORE = ‘SER散件库‘.
WHEN ‘3‘.
S_STORE = ‘PC整机库‘.
WHEN ‘4‘.
S_STORE = ‘PC散件库‘.
WHEN ‘5‘.
S_STORE = ‘PC显示器‘.
WHEN ‘6‘.
S_STORE = ‘SER显示器‘.
WHEN ‘7‘.
S_STORE = ‘存储整机‘.
WHEN ‘8‘.
S_STORE = ‘存储散件‘.
WHEN ‘9‘.
S_STORE = ‘高性能整机‘.
WHEN ‘10‘.
S_STORE = ‘高性能散件‘.
WHEN ‘11‘.
S_STORE = ‘VIT整机‘.
WHEN ‘12‘.
S_STORE = ‘VIT散件‘.
WHEN ‘13‘.
S_STORE = ‘高端整机‘.
WHEN ‘14‘.
S_STORE = ‘高端散件‘.
ENDCASE.
CASE LEND_DETAIL-PROPERTY.
WHEN ‘1‘.
P_PRO = ‘A‘.
WHEN ‘2‘.
P_PRO = ‘C‘.
WHEN ‘3‘.
P_PRO = ‘D‘.
WHEN ‘4‘.
P_PRO = ‘B‘.
WHEN ‘5‘.
P_PRO = ‘E‘.
WHEN ‘6‘.
P_PRO = ‘过保‘.
WHEN ‘7‘.
P_PRO = ‘C1‘.
ENDCASE.
* if num2 = sy-dbcnt ."打印完详细
IF NUM2 = NUM3 ."打印完详细
WRITE /0 SY-VLINE .
WRITE 2 ‘用途说明:‘.
WRITE LEND_MAIN-PUR_DETAIL.
WRITE 59 SY-VLINE.
WRITE 80 SY-VLINE.
WRITE /0 SY-VLINE.
WRITE 59 SY-VLINE.
WRITE 80 SY-VLINE.
WRITE /0 SY-VLINE.
WRITE ‘备注:‘.
WRITE 59 SY-VLINE.
WRITE 80 SY-VLINE .
**********************************add by dingyang 091217**********************************
* 使输出字段拐弯,判断最后一个字符是否正常显示
DATA : B1(55),B2(55) TYPE C.
IF STRLEN( LEND_MAIN-BZ ) > 56.
CLEAR B1.
CLEAR B2.
PERFORM WRITE_STRING USING LEND_MAIN-BZ B1 B2 .
WRITE /0 SY-VLINE .
WRITE B1.
WRITE 59 SY-VLINE.
WRITE 80 SY-VLINE .
WRITE /0 SY-VLINE.
WRITE B2.
WRITE 59 SY-VLINE.
WRITE 80 SY-VLINE .
ELSE.
WRITE LEND_MAIN-BZ.
WRITE 59 SY-VLINE.
WRITE 80 SY-VLINE .
ENDIF.
**********************************end by dingyang 091217**********************************
WRITE 60 ‘库别:‘.
WRITE S_STORE.
WRITE 80 SY-VLINE .
WRITE /0 SY-VLINE.
* WRITE ‘打印人:‘.
* WRITE SY-UNAME.
* WRITE ‘提货人:‘.
WRITE 80 SY-VLINE.
WRITE 59 SY-VLINE.
* write 60 ‘属性:‘ .
* write p_pro.
WRITE /0 SY-VLINE.
WRITE ‘打印人:‘.
WRITE SY-UNAME.
WRITE ‘提货人:‘.
WRITE 59 SY-VLINE.
WRITE 60 ‘属性:‘ .
WRITE P_PRO.
WRITE 80 SY-VLINE.
WRITE /0(80) SY-ULINE .
"add other information
WRITE : /2 ‘批准人:‘ .
IF ( LEND_MAIN-LEND_DEPART = ‘2600‘ AND ( LEND_MAIN-OPERATOR <>
‘GUOYH‘ OR LEND_MAIN-OPERATOR <> ‘LIUYL‘) ).
* if lend_detail-property <> ‘1‘.
* write lend_main-manager1.
* endif. 注释与2005.12.26
ELSEIF ( LEND_MAIN-LEND_DEPART = ‘2600‘ AND (
LEND_MAIN-OPERATOR <>
‘GUOYH‘ OR LEND_MAIN-OPERATOR <> ‘LIUYL‘ ) ).
* WRITE LEND_MAIN-MANAGER1 .
ELSE.
WRITE LEND_MAIN-MANAGER1.
ENDIF.
WRITE : 22 ‘保管员:‘, LEND_MAIN-STORER.
WRITE : 37 ‘制单人:‘, LEND_MAIN-OPERATOR.
WRITE : 55 ‘借料人:‘ , LEND_MAIN-LENDER.
WRITE / .
WRITE / .
* num2 = 1 .
ENDIF. "num2 end
ENDIF.
ENDLOOP.
* num = num + 1 .
NEW-PAGE.
NUM2 = 0 .
ENDLOOP.
ENDFORM. "print_lend
*&--------------------------------------------------------------------*
*& Form print_return
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM PRINT_RETURN."还物单打印
NUM2 = 0 .
CLEAR RETURN_DATA[].
CLEAR RETURN_DAT[]."存储临时数据用于检索
CLEAR RETURN_DAT.
CLEAR NUM3.
SELECT DISTINCT RETURN_NO INTO CORRESPONDING FIELDS OF
RETURN_DAT FROM ZRETURN_INFOR
WHERE MANAGER2 <> ‘1‘ AND RETURN_DEPART IN DEPART AND
LEND_NO IN NO AND RETURN_NO IN R_NO AND (ITAB).
APPEND RETURN_DAT.
ENDSELECT.
LOOP AT RETURN_DAT.
SELECT * INTO TABLE RETURN_DATA FROM ZRETURN_INFOR WHERE RETURN_NO =
RETURN_DAT-RETURN_NO .
NUM3 = SY-DBCNT.
LOOP AT RETURN_DATA .
IF NUM2 = 0 .
WRITE / .
WRITE / .
WRITE 30 ‘还 料 单‘.
WRITE 58 NUM.
WRITE /26(30) SY-ULINE .
CLEAR INFOR_ALL-LEND_DEP.
SELECT BRTXT INTO INFOR_ALL-LEND_DEP FROM ZT016T WHERE BRSCH =
RETURN_DATA-RETURN_DEPART AND SPRAS = ‘1‘.
ENDSELECT.
*************************ADD BY DINGYANG 091210*************************
* 增加原物料属性
CLEAR P_PRY.
SELECT SINGLE PROPERTY INTO P_PRY FROM ZLEND_DETAIL WHERE LEND_NO = RETURN_DATA-LEND_NO AND MATNR = RETURN_DATA-MATNR.
CASE P_PRY.
WHEN ‘1‘.
P_PRY = ‘A‘.
WHEN ‘2‘.
P_PRY = ‘C‘.
WHEN ‘3‘.
P_PRY = ‘D‘.
WHEN ‘4‘.
P_PRY = ‘B‘.
WHEN ‘5‘.
P_PRY = ‘E‘.
WHEN ‘6‘.
P_PRY = ‘过保‘.
WHEN ‘7‘.
P_PRY = ‘C1‘.
ENDCASE.
*************************END BY DINGYANG 091210*************************
* write : /2 ‘还料部门:‘ , return_data-return_depart.
WRITE : /2 ‘还料部门:‘ , INFOR_ALL-LEND_DEP.
WRITE : ‘ 日 期 :‘ , SY-DATUM.
WRITE : 58 ‘还料单号:‘.
"以下原有是还料单流水号码的生成
* PERFORM GET_HLD_NO.
* CONCATENATE ‘H‘ HLD_NO INTO HLD_NO.
* WRITE HLD_NO .
"流水号码生成结束
WRITE RETURN_DATA-RETURN_NO .
"将zreturn_infor的manager2更改为 1 --〉已经打印过
WRITE /0(84) SY-ULINE.
WRITE /0 SY-VLINE.
WRITE 84 SY-VLINE.
WRITE : 5 ‘产品编码‘.
WRITE : 19 SY-VLINE.
WRITE : 30 ‘物料描述 ‘ .
WRITE 59 SY-VLINE.
WRITE : 63 ‘数量‘.
WRITE 70 SY-VLINE.
WRITE : 72 ‘借料单号‘.
WRITE SY-VLINE.
WRITE : 82 ‘原‘.
ENDIF. " num2 end
NUM2 = NUM2 + 1 .
"and lend_detail information
WRITE : /0(84) SY-ULINE.
WRITE /0 SY-VLINE.
WRITE : RETURN_DATA-MATNR.
WRITE 19 SY-VLINE.
WRITE : 20 RETURN_DATA-MAKTX.
* write 77 sy-vline.return_num 为13位显示不开
* write 63 sy-vline.
* write : 57 return_data-return_num .
CLEAR S.
S = RETURN_DATA-RETURN_NUM.
WRITE : 61(9) S .
WRITE 59 SY-VLINE."那到这儿显示
WRITE 70 SY-VLINE.
WRITE : 71 RETURN_DATA-LEND_NO .
WRITE 81 SY-VLINE.
WRITE : 83 P_PRY .
WRITE 84 SY-VLINE.
WRITE /0(84) SY-ULINE.
WRITE /0 SY-VLINE.
WRITE ‘SN/QN : ‘ .
WRITE RETURN_DATA-MACHI_SERIES.
WRITE 84 SY-VLINE.
* write /0 sy-uline.
CASE RETURN_DATA-STORE_TYPE.
WHEN ‘1‘.
S_STORE = ‘SER整机库‘.
WHEN ‘2‘.
S_STORE = ‘SER散件库‘.
WHEN ‘3‘.
S_STORE = ‘PC整机库‘.
WHEN ‘4‘.
S_STORE = ‘PC散件库‘.
WHEN ‘5‘.
S_STORE = ‘PC显示器‘.
WHEN ‘6‘.
S_STORE = ‘SER显示器‘.
WHEN ‘7‘.
S_STORE = ‘存储整机‘.
WHEN ‘8‘.
S_STORE = ‘存储散件‘.
WHEN ‘9‘.
S_STORE = ‘高性能整机‘.
WHEN ‘10‘.
S_STORE = ‘高性能散件‘.
WHEN ‘11‘.
S_STORE = ‘VIT整机‘.
WHEN ‘12‘.
S_STORE = ‘VIT散件‘.
WHEN ‘13‘.
S_STORE = ‘高端整机‘.
WHEN ‘14‘.
S_STORE = ‘高端散件‘.
ENDCASE.
CASE RETURN_DATA-PROPERTY.
WHEN ‘1‘.
P_PRO = ‘A‘.
WHEN ‘2‘.
P_PRO = ‘C‘.
WHEN ‘3‘.
P_PRO = ‘D‘.
WHEN ‘4‘.
P_PRO = ‘B‘.
WHEN ‘5‘.
P_PRO = ‘E‘.
WHEN ‘6‘.
P_PRO = ‘过保‘.
WHEN ‘7‘.
P_PRO = ‘C1‘.
ENDCASE.
IF NUM2 = NUM3 .
WRITE /0(84) SY-ULINE.
WRITE /0 SY-VLINE .
WRITE 2 ‘检验结果:‘.
WRITE 53 SY-VLINE.
WRITE 54 ‘库别:‘.
WRITE S_STORE.
WRITE 84 SY-VLINE .
*************************ADD BY DINGYANG 091210*************************
* WRITE /0 SY-VLINE.
* WRITE 53 SY-VLINE.
* WRITE 54 ‘原借物属性:‘ .
* WRITE P_PRY.
* WRITE 80 SY-VLINE .
*************************END BY DINGYANG 091210*************************
WRITE /0 SY-VLINE.
WRITE 84 SY-VLINE.
WRITE 53 SY-VLINE.
WRITE 54 ‘属性:‘ .
WRITE P_PRO.
WRITE /0(84) SY-ULINE .
WRITE /0 SY-VLINE.
WRITE 2 ‘备注:‘.
WRITE 10 RETURN_DATA-DETAIL.
WRITE : 40 ‘打印人:‘.
WRITE SY-UNAME.
WRITE ‘提货人:‘.
WRITE 84 SY-VLINE.
WRITE /0(84) SY-ULINE.
"add other information
WRITE : /4 ‘批准人:‘ .
IF RETURN_DATA-RETURN_DEPART = ‘2600‘.
ELSE.
WRITE RETURN_DATA-MANAGER1.
ENDIF.
WRITE : 25 ‘保管员:‘, RETURN_DATA-STORER.
WRITE : 38 ‘制单人:‘, RETURN_DATA-OPERATOR.
WRITE : 55 ‘借料人:‘ , RETURN_DATA-RETURNER.
WRITE / .
WRITE / .
NUM2 = 0 .
NEW-PAGE.
ENDIF."num2 = sy-dbcnt end
ENDLOOP.
ENDLOOP.
ENDFORM. "print_return
*&--------------------------------------------------------------------*
*& Form print_lld
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM PRINT_LLD."领料单打印
CLEAR NUM2 .
NUM3 = 1 .
CLEAR LEND_LL[].
CLEAR LEND_LL.
SELECT * INTO TABLE LEND_LL FROM ZLEND_LL WHERE
DEP_NO IN DEPART AND TYP = ‘+‘
AND LEND_NO IN NO AND RETURN_NO IN R_NO AND (ITAB).
LOOP AT LEND_LL.
IF NUM3 = 1 .
NUM3 = NUM3 + 1 .
SELECT COUNT(*) INTO NUM2 FROM ZLEND_LL WHERE
LING_NO = LEND_LL-LING_NO .
NUM2 = NUM2 + 1 .
WRITE / .
WRITE / .
WRITE 30 ‘借还物调帐专用领料单 ‘.
WRITE /26(30) SY-ULINE.
WRITE / .
WRITE / .
CLEAR INFOR_ALL-LEND_DEP.
SELECT BRTXT INTO INFOR_ALL-LEND_DEP FROM ZT016T WHERE BRSCH =
LEND_LL-DEP_NO AND SPRAS = ‘1‘.
ENDSELECT.
WRITE : /2 ‘领料部门:‘ , INFOR_ALL-LEND_DEP.
WRITE : ‘日期 : ‘.
WRITE SY-DATUM.
WRITE 54 ‘领料单号:‘.
WRITE LEND_LL-LING_NO.
WRITE /0(80) SY-ULINE.
WRITE /0 SY-VLINE.
WRITE 80 SY-VLINE.
WRITE : 5 ‘产品编码‘.
WRITE : 19 SY-VLINE.
WRITE : 30 ‘物料描述‘.
WRITE : 63 SY-VLINE.
WRITE : 64 ‘单位‘.
WRITE : 68 SY-VLINE.
WRITE : 74 ‘数量‘.
WRITE 80 SY-VLINE.
WRITE 0(80) SY-ULINE.
WRITE /0 SY-VLINE.
WRITE LEND_LL-MATNR.
WRITE : 19 SY-VLINE.
WRITE LEND_LL-MAKTX.
WRITE 63 SY-VLINE.
CLEAR S.
S = LEND_LL-RETURN_NUM.
WRITE : 70 S.
WRITE : 68 SY-VLINE.
WRITE LEND_LL-TYP.
WRITE 64 LEND_LL-MEINS.
WRITE 80 SY-VLINE.
WRITE 0(80) SY-ULINE.
WRITE /0 SY-VLINE .
WRITE ‘SN/QN : ‘.
WRITE LEND_LL-MACHI_SERIES.
WRITE 80 SY-VLINE .
ELSEIF NUM3 > 1 .
NUM3 = NUM3 + 1.
WRITE 0(80) SY-ULINE.
WRITE /0 SY-VLINE.
WRITE LEND_LL-MATNR.
WRITE : 19 SY-VLINE.
WRITE LEND_LL-MAKTX.
WRITE 63 SY-VLINE.
CLEAR S2.
S2 = LEND_LL-RETURN_NUM.
WRITE : 70 S2.
WRITE 64 LEND_LL-MEINS.
WRITE : 68 SY-VLINE.
WRITE LEND_LL-TYP.
WRITE 80 SY-VLINE.
WRITE 0(80) SY-ULINE.
WRITE /0 SY-VLINE .
WRITE ‘SN/QN : ‘.
WRITE LEND_LL-MACHI_SERIES.
WRITE 80 SY-VLINE .
ENDIF.
IF NUM3 = NUM2 .
NUM3 = 1 .
CLEAR NUM2 .
WRITE 0(80) SY-ULINE.
WRITE /0 SY-VLINE.
WRITE ‘用途说明‘.
* write sy-vline.
WRITE 54 SY-VLINE.
WRITE 55 ‘库 类 别:‘.
CASE LEND_LL-STORE.
WHEN ‘1‘.
S_STORE = ‘SER整机库‘.
WHEN ‘2‘.
S_STORE = ‘SER散件库‘.
WHEN ‘3‘.
S_STORE = ‘PC整机库‘.
WHEN ‘4‘.
S_STORE = ‘PC散件库‘.
WHEN ‘5‘.
S_STORE = ‘PC显示器‘.
WHEN ‘6‘.
S_STORE = ‘SER显示器‘.
WHEN ‘7‘.
S_STORE = ‘存储整机‘.
WHEN ‘8‘.
S_STORE = ‘存储散件‘.
WHEN ‘9‘.
S_STORE = ‘高性能整机‘.
WHEN ‘10‘.
S_STORE = ‘高性能散件‘.
WHEN ‘11‘.
S_STORE = ‘VIT整机‘.
WHEN ‘12‘.
S_STORE = ‘VIT散件‘.
WHEN ‘13‘.
S_STORE = ‘高端整机‘.
WHEN ‘14‘.
S_STORE = ‘高端散件‘.
ENDCASE.
WRITE S_STORE .
WRITE 80 SY-VLINE.
WRITE /0 SY-VLINE.
* write 12 sy-vline.
WRITE ‘打印人:‘.
WRITE SY-UNAME.
WRITE ‘提货人:‘.
WRITE 54 SY-VLINE.
WRITE 55 ‘物料属性:‘.
CLEAR P_PRO .
CASE LEND_LL-PROPERTY.
WHEN ‘1‘.
P_PRO = ‘A‘.
WHEN ‘2‘.
P_PRO = ‘C‘.
WHEN ‘3‘.
P_PRO = ‘D‘.
WHEN ‘4‘.
P_PRO = ‘B‘.
WHEN ‘5‘.
P_PRO = ‘E‘.
WHEN ‘6‘.
P_PRO = ‘过保‘.
WHEN ‘7‘.
P_PRO = ‘C1‘.
ENDCASE.
WRITE P_PRO .
WRITE 80 SY-VLINE.
WRITE /0(80) SY-ULINE.
WRITE /3 ‘批准人‘.
IF LEND_LL-DEP_NO <> ‘2000‘.
* write return_data-manager1.
WRITE LEND_LL-MANAGER1.
ENDIF.
WRITE 25 ‘保管员:‘.
* write return_data-storer.
WRITE 38 ‘制单人:‘.
WRITE LEND_LL-OPERATOR.
WRITE 55 ‘领料人:‘.
WRITE LEND_LL-RETURNER.
WRITE /.
WRITE /.
NEW-PAGE.
ENDIF.
ENDLOOP.
* 打印负领料单
CLEAR NUM2 .
NUM3 = 1 .
CLEAR LEND_LL[].
CLEAR LEND_LL.
SELECT * INTO TABLE LEND_LL FROM ZLEND_LL WHERE
DEP_NO IN DEPART AND TYP = ‘-‘
AND LEND_NO IN NO AND RETURN_NO IN R_NO AND (ITAB).
LOOP AT LEND_LL.
IF NUM3 = 1 .
NUM3 = NUM3 + 1 .
SELECT COUNT(*) INTO NUM2 FROM ZLEND_LL WHERE
LING_NO = LEND_LL-LING_NO .
NUM2 = NUM2 + 1 .
WRITE / .
WRITE / .
WRITE 30 ‘借还物调帐专用领料单 ‘.
WRITE /26(30) SY-ULINE.
WRITE / .
WRITE / .
CLEAR INFOR_ALL-LEND_DEP.
SELECT BRTXT INTO INFOR_ALL-LEND_DEP FROM ZT016T WHERE BRSCH =
LEND_LL-DEP_NO AND SPRAS = ‘1‘.
ENDSELECT.
WRITE : /2 ‘领料部门:‘ , INFOR_ALL-LEND_DEP.
WRITE : ‘日期 : ‘.
WRITE SY-DATUM.
WRITE 54 ‘领料单号:‘.
WRITE LEND_LL-LING_NO.
WRITE /0(80) SY-ULINE.
WRITE /0 SY-VLINE.
WRITE 80 SY-VLINE.
WRITE : 5 ‘产品编码‘.
WRITE : 19 SY-VLINE.
WRITE : 30 ‘物料描述‘.
WRITE : 63 SY-VLINE.
WRITE : 64 ‘单位‘.
WRITE : 68 SY-VLINE.
WRITE : 74 ‘数量‘.
WRITE 80 SY-VLINE.
WRITE 0(80) SY-ULINE.
WRITE /0 SY-VLINE.
WRITE LEND_LL-MATNR.
WRITE : 19 SY-VLINE.
WRITE LEND_LL-MAKTX.
WRITE 63 SY-VLINE.
CLEAR S.
S = LEND_LL-RETURN_NUM.
WRITE : 70 S.
WRITE : 68 SY-VLINE.
WRITE LEND_LL-TYP.
WRITE 64 LEND_LL-MEINS.
WRITE 80 SY-VLINE.
WRITE 0(80) SY-ULINE.
WRITE /0 SY-VLINE .
WRITE ‘SN/QN : ‘.
* write lend_ll-machi_series.
WRITE LEND_LL-SERIES .
WRITE 80 SY-VLINE .
ELSEIF NUM3 > 1 .
NUM3 = NUM3 + 1.
WRITE 0(80) SY-ULINE.
WRITE /0 SY-VLINE.
WRITE LEND_LL-MATNR.
WRITE : 19 SY-VLINE.
WRITE LEND_LL-MAKTX.
WRITE 63 SY-VLINE.
CLEAR S2.
S2 = LEND_LL-RETURN_NUM.
WRITE : 70 S2.
WRITE : 68 SY-VLINE.
WRITE LEND_LL-TYP.
WRITE 64 LEND_LL-MEINS.
WRITE 80 SY-VLINE.
WRITE 0(80) SY-ULINE.
WRITE /0 SY-VLINE .
WRITE ‘SN/QN : ‘.
WRITE LEND_LL-MACHI_SERIES.
WRITE 80 SY-VLINE .
ENDIF.
IF NUM3 = NUM2 .
NUM3 = 1 .
CLEAR NUM2 .
WRITE 0(80) SY-ULINE.
WRITE /0 SY-VLINE.
WRITE ‘用途说明‘.
* write sy-vline.
WRITE 54 SY-VLINE.
WRITE 55 ‘库 类 别:‘.
CASE LEND_LL-STORE.
WHEN ‘1‘.
S_STORE = ‘SER整机库‘.
WHEN ‘2‘.
S_STORE = ‘SER散件库‘.
WHEN ‘3‘.
S_STORE = ‘PC整机库‘.
WHEN ‘4‘.
S_STORE = ‘PC散件库‘.
WHEN ‘5‘.
S_STORE = ‘PC显示器‘.
WHEN ‘6‘.
S_STORE = ‘SER显示器‘.
WHEN ‘7‘.
S_STORE = ‘存储整机‘.
WHEN ‘8‘.
S_STORE = ‘存储散件‘.
WHEN ‘9‘.
S_STORE = ‘高性能整机‘.
WHEN ‘10‘.
S_STORE = ‘高性能散件‘.
WHEN ‘11‘.
S_STORE = ‘VIT整机‘.
WHEN ‘12‘.
S_STORE = ‘VIT散件‘.
WHEN ‘13‘.
S_STORE = ‘高端整机‘.
WHEN ‘14‘.
S_STORE = ‘高端散件‘.
ENDCASE.
WRITE S_STORE .
WRITE 80 SY-VLINE.
WRITE /0 SY-VLINE.
* write 12 sy-vline.
WRITE ‘打印人:‘.
WRITE SY-UNAME.
WRITE ‘提货人:‘.
WRITE 54 SY-VLINE.
WRITE 55 ‘物料属性:‘.
CLEAR P_PRO .
CASE LEND_LL-PROPERTY.
WHEN ‘1‘.
P_PRO = ‘A‘.
WHEN ‘2‘.
P_PRO = ‘C‘.
WHEN ‘3‘.
P_PRO = ‘D‘.
WHEN ‘4‘.
P_PRO = ‘B‘.
WHEN ‘5‘.
P_PRO = ‘E‘.
WHEN ‘6‘.
P_PRO = ‘过保‘.
WHEN ‘7‘.
P_PRO = ‘C1‘.
ENDCASE.
WRITE P_PRO .
WRITE 80 SY-VLINE.
WRITE /0(80) SY-ULINE.
WRITE /3 ‘批准人‘.
IF LEND_LL-DEP_NO <> ‘2000‘.
* write return_data-manager1.
WRITE LEND_LL-MANAGER1.
ENDIF.
WRITE 25 ‘保管员:‘.
* write return_data-storer.
WRITE 38 ‘制单人:‘.
WRITE LEND_LL-OPERATOR.
WRITE 55 ‘领料人:‘.
WRITE LEND_LL-RETURNER.
WRITE /.
WRITE /.
NEW-PAGE.
ENDIF.
ENDLOOP.
ENDFORM. "print_lld
*&--------------------------------------------------------------------*
*& Form pur_data
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM PUR_DATA."用途分析已还信息
IF SY-UNAME = ‘YINGZHAO‘ OR SY-UNAME = ‘ZHANGSHP‘ OR SY-UNAME =
‘YAOLJ‘.
NAME = ‘2000‘.
IF ITAB IS INITIAL.
CONCATENATE ‘LEND_DEPART = ‘ ‘ NAME ‘INTO ITAB.
ELSE.
CONCATENATE ‘ AND LEND_DEPART = ‘ ‘ NAME ‘INTO ITAB.
ENDIF.
APPEND ITAB.
CLEAR DEPART.
ENDIF.
CLEAR LEND_MAIN[].
CLEAR LEND_DETAIL[].
CLEAR INFOR_ALL[].
SELECT * INTO TABLE LEND_MAIN FROM ZLEND_MAIN WHERE
LEND_DEPART IN DEPART AND LEND_NO IN NO AND RETURN_DATE IN R_NO AND
LEND_DATE IN L_DATE AND (ITAB).
LOOP AT LEND_MAIN.
CLEAR INFOR_ALL.
INFOR_ALL-LEND_NO = LEND_MAIN-LEND_NO.
INFOR_ALL-LEND_DEPART = LEND_MAIN-LEND_DEPART.
CLEAR INFOR_ALL-LEND_DEP .
SELECT BRTXT INTO INFOR_ALL-LEND_DEP FROM ZT016T WHERE BRSCH =
INFOR_ALL-LEND_DEPART AND SPRAS = ‘1‘ .
ENDSELECT.
INFOR_ALL-DEP_DETAIL = LEND_MAIN-DEP_DETAIL.
INFOR_ALL-LEND_DATE = LEND_MAIN-LEND_DATE.
INFOR_ALL-RETURN_DATE = LEND_MAIN-RETURN_DATE.
* infor_all-purpose = lend_main-purpose.
CASE LEND_MAIN-PURPOSE.
WHEN ‘1‘.
INFOR_ALL-PURPOSE = ‘项目测试‘.
WHEN ‘2‘.
INFOR_ALL-PURPOSE = ‘项目备机‘.
WHEN ‘3‘.
INFOR_ALL-PURPOSE = ‘缺货使用‘.
WHEN ‘4‘.
INFOR_ALL-PURPOSE = ‘开发测试‘.
WHEN ‘5‘.
INFOR_ALL-PURPOSE = ‘例行试验‘.
WHEN ‘6‘.
INFOR_ALL-PURPOSE = ‘新品测试‘.
WHEN ‘7‘.
INFOR_ALL-PURPOSE = ‘各类认证‘.
WHEN ‘8‘.
INFOR_ALL-PURPOSE = ‘媒体评测‘.
WHEN ‘9‘.
INFOR_ALL-PURPOSE = ‘办公暂借‘.
WHEN ‘10‘.
INFOR_ALL-PURPOSE = ‘销售‘.
WHEN ‘11‘.
INFOR_ALL-PURPOSE = ‘展览‘.
WHEN ‘12‘.
INFOR_ALL-PURPOSE = ‘更换‘.
WHEN ‘13‘.
INFOR_ALL-PURPOSE = ‘培训‘.
WHEN ‘14‘.
INFOR_ALL-PURPOSE = ‘DOA‘.
ENDCASE.
INFOR_ALL-PUR_DETAIL = LEND_MAIN-PUR_DETAIL.
INFOR_ALL-MANAGER1 = LEND_MAIN-MANAGER1.
INFOR_ALL-LENDER = LEND_MAIN-LENDER.
INFOR_ALL-OPERATOR = LEND_MAIN-OPERATOR.
SELECT * INTO TABLE LEND_DETAIL FROM ZLEND_DETAIL WHERE
LEND_NO = LEND_MAIN-LEND_NO .
LOOP AT LEND_DETAIL .
"加入if 判断已还物信息
IF LEND_DETAIL-GET_NUM = LEND_DETAIL-RETURN_NUM
AND LEND_DETAIL-GET_NUM > 0 .
INFOR_ALL-MATNR = LEND_DETAIL-MATNR.
INFOR_ALL-MAKTX = LEND_DETAIL-MAKTX.
"infor_all-ztbs = lend_detail-ztbs .不必有在途标示
* infor_all-store_type = lend_detail-store_type.
* infor_all-property = lend_detail-property.
CASE LEND_DETAIL-STORE_TYPE.
WHEN ‘1‘.
INFOR_ALL-STORE_TYPE = ‘SER整机库‘.
WHEN ‘2‘.
INFOR_ALL-STORE_TYPE = ‘SER散件库‘.
WHEN ‘3‘.
INFOR_ALL-STORE_TYPE = ‘PC整机库‘.
WHEN ‘4‘.
INFOR_ALL-STORE_TYPE = ‘PC散件库‘.
WHEN ‘5‘.
INFOR_ALL-STORE_TYPE = ‘PC显示器‘.
WHEN ‘6‘.
INFOR_ALL-STORE_TYPE = ‘SER显示器‘.
ENDCASE.
CASE LEND_DETAIL-PROPERTY.
WHEN ‘1‘.
INFOR_ALL-PROPERTY = ‘A‘.
WHEN ‘2‘.
INFOR_ALL-PROPERTY = ‘C‘.
WHEN ‘3‘.
INFOR_ALL-PROPERTY = ‘D‘.
WHEN ‘4‘.
INFOR_ALL-PROPERTY = ‘B‘.
WHEN ‘5‘.
INFOR_ALL-PROPERTY = ‘E‘.
WHEN ‘6‘.
INFOR_ALL-PROPERTY = ‘过保‘.
ENDCASE.
INFOR_ALL-APPLY_NUM = LEND_DETAIL-APPLY_NUM.
INFOR_ALL-GET_NUM = LEND_DETAIL-GET_NUM.
INFOR_ALL-RETURN_NUM = LEND_DETAIL-RETURN_NUM.
INFOR_ALL-NUM = INFOR_ALL-GET_NUM - INFOR_ALL-RETURN_NUM .
INFOR_ALL-APPLY_NO = LEND_DETAIL-APPLY_NO.
INFOR_ALL-MEINS = LEND_DETAIL-MEINS.
INFOR_ALL-PRICE = LEND_DETAIL-PRICE.
INFOR_ALL-TOTAL = INFOR_ALL-PRICE * INFOR_ALL-APPLY_NUM .
INFOR_ALL-SENDER = LEND_DETAIL-SENDER.
INFOR_ALL-STORER = LEND_DETAIL-SOTRER.
INFOR_ALL-MACHI_SERIES = LEND_DETAIL-MACHI_SERIES.
CLEAR INFOR_ALL-RETURN_NO .
SELECT RETURN_NO
INTO INFOR_ALL-RETURN_NO FROM ZRETURN_INFOR
WHERE LEND_NO = LEND_DETAIL-LEND_NO AND MATNR = LEND_DETAIL-MATNR .
ENDSELECT.
APPEND INFOR_ALL.
ENDIF.
ENDLOOP.
ENDLOOP.
SORT INFOR_ALL BY PURPOSE.
CLEAR FIELDCAT[].
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘LEND_NO‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘借料单号‘.
FIELDCAT-SELTEXT_M = ‘借料单号‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘LEND_DEPART‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘部门代码‘.
FIELDCAT-SELTEXT_M = ‘部门代码‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘LEND_DEP‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘借料部门‘.
FIELDCAT-SELTEXT_M = ‘借料部门‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘LEND_DATE‘.
FIELDCAT-TABNAME = ‘LEND_MAIN‘.
FIELDCAT-SELTEXT_S = ‘借料日期‘.
FIELDCAT-SELTEXT_M = ‘借料日期‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘RETURN_DATE‘.
FIELDCAT-TABNAME = ‘LEND_MAIN‘.
FIELDCAT-SELTEXT_S = ‘预计归还日期‘.
FIELDCAT-SELTEXT_M = ‘预计归还日期‘.
APPEND FIELDCAT.
* fieldcat-fieldname = ‘RETURN_DATE‘.
* fieldcat-tabname = ‘EXT_ITAB‘.
* fieldcat-seltext_s = ‘已还日期‘.
* fieldcat-seltext_m = ‘已还日期‘.
* append fieldcat.
FIELDCAT-FIELDNAME = ‘PURPOSE‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘用途‘.
FIELDCAT-SELTEXT_M = ‘用途‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘PUR_DETAIL‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘用途详细‘.
FIELDCAT-SELTEXT_M = ‘用途详细‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘MANAGER1‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘审批经理‘.
FIELDCAT-SELTEXT_M = ‘审批经理‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘OPERATOR‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘操作人‘.
FIELDCAT-SELTEXT_M = ‘操作人‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘MATNR‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘物料号‘.
FIELDCAT-SELTEXT_M = ‘物料号‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘MAKTX‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘物料描述‘.
FIELDCAT-SELTEXT_M = ‘物料描述‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘MEINS‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘单位‘.
FIELDCAT-SELTEXT_M = ‘单位‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘STORE_TYPE‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘库类别‘.
FIELDCAT-SELTEXT_M = ‘库类别‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘PROPERTY‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘物料属性‘.
FIELDCAT-SELTEXT_M = ‘物料属性‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘APPLY_NUM‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘申请数量‘.
FIELDCAT-SELTEXT_M = ‘申请数量‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘GET_NUM‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘发货数量‘.
FIELDCAT-SELTEXT_M = ‘发货数量‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘RETURN_NUM‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘归还数量‘.
FIELDCAT-SELTEXT_M = ‘归还数量‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘NUM‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘余额‘.
FIELDCAT-SELTEXT_M = ‘余额‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘LENDER‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘借物人‘.
FIELDCAT-SELTEXT_M = ‘借物人‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘PRICE‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘单价‘.
FIELDCAT-SELTEXT_M = ‘单价‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘TOTAL‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘金额‘.
FIELDCAT-SELTEXT_M = ‘金额‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘APPLY_NO‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘申请单号‘.
FIELDCAT-SELTEXT_M = ‘申请单号‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘MACHI_SERIES‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘机器序列号‘.
FIELDCAT-SELTEXT_M = ‘机器序列号‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘RETURN_NO‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘还物单号‘.
FIELDCAT-SELTEXT_M = ‘还物单号‘.
APPEND FIELDCAT.
CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY‘
EXPORTING
IT_FIELDCAT = FIELDCAT[]
I_DEFAULT = ‘X‘
I_SAVE = ‘A‘
TABLES
T_OUTTAB = INFOR_ALL
EXCEPTIONS
OTHERS = 2.
ENDFORM. "pur_data
*&--------------------------------------------------------------------*
*& Form get_line_no
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM GET_LINE_NO .
CALL FUNCTION ‘NUMBER_GET_NEXT‘
EXPORTING
NR_RANGE_NR = ‘1‘
OBJECT = ‘ZJHW_LLD2‘
IMPORTING
NUMBER = LLD_NO
EXCEPTIONS
INTERVAL_NOT_FOUND = 1
NUMBER_RANGE_NOT_INTERN = 2
OBJECT_NOT_FOUND = 3
QUANTITY_IS_0 = 4
QUANTITY_IS_NOT_1 = 5
INTERVAL_OVERFLOW = 6
BUFFER_OVERFLOW = 7
OTHERS = 8.
ENDFORM. "get_line_no
*&--------------------------------------------------------------------*
*& Form GET_HLD_NO
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM GET_HLD_NO .
CALL FUNCTION ‘NUMBER_GET_NEXT‘
EXPORTING
NR_RANGE_NR = ‘1‘
OBJECT = ‘ZJHW_HLD2‘
IMPORTING
NUMBER = HLD_NO
EXCEPTIONS
INTERVAL_NOT_FOUND = 1
NUMBER_RANGE_NOT_INTERN = 2
OBJECT_NOT_FOUND = 3
QUANTITY_IS_0 = 4
QUANTITY_IS_NOT_1 = 5
INTERVAL_OVERFLOW = 6
BUFFER_OVERFLOW = 7
OTHERS = 8.
ENDFORM. "GET_HLD_NO
*&--------------------------------------------------------------------*
*& Form return_data
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM RETURN_DATA."从已还物库RETURN_INFOR统计信息
* if r_date-low <> 0 and r_date-high <> 0 .
* if itab is initial .
* concatenate ‘return_date between ‘ ‘ r_date-low ‘ ‘
* and ‘ ‘ r_date-high ‘ into itab.
* else.
* concatenate ‘ and return_date between ‘ ‘ r_date-low ‘ ‘
* and ‘ ‘ r_date-high ‘ into itab.
* endif.
* append itab.
* endif.
IF SY-UNAME = ‘YAOJL‘ OR SY-UNAME = ‘ZHANGSHP‘ OR SY-UNAME =
‘YINGZHAO‘.
NAME = ‘2000‘.
IF ITAB IS INITIAL.
CONCATENATE ‘RETURN_DEPART = ‘ ‘ NAME ‘INTO ITAB.
ELSE.
CONCATENATE ‘ AND RETURN_DEPART = ‘ ‘ NAME ‘INTO ITAB.
ENDIF.
APPEND ITAB.
CLEAR DEPART.
ENDIF.
* if depart <> ‘‘ .
* if itab is initial.
* concatenate ‘return_depart = ‘ ‘ depart ‘ into itab.
* else.
* concatenate ‘ and return_depart = ‘ ‘ depart ‘ into itab.
* endif.
* append itab.
* endif.
* if R_NO <> ‘‘ .
* if itab is initial.
* concatenate ‘return_no = ‘ ‘ R_NO ‘ into itab.
* else.
* concatenate ‘ and return_no = ‘ ‘ R_NO ‘ into itab.
* endif.
* append itab.
* endif.
CLEAR RETURN_DAT[].
SELECT * INTO TABLE RETURN_DAT FROM
ZRETURN_INFOR WHERE RETURN_DEPART IN DEPART AND LEND_NO IN NO
AND RETURN_NO IN R_NO AND RETURN_DATE IN R_DATE AND (ITAB).
SORT RETURN_DAT BY RETURN_NO .
CLEAR INFOR_ALL[].
CLEAR INFOR_ALL.
LOOP AT RETURN_DAT.
CLEAR INFOR_ALL-TOTAL.
CLEAR INFOR_ALL-LEND_DEP.
INFOR_ALL-LEND_NO = RETURN_DAT-LEND_NO .
INFOR_ALL-TOTAL = RETURN_DAT-RETURN_NUM * RETURN_DAT-PRICE .
* select brtxt into infor_all-lend_dep from t016t where brsch =
*return_dat-RETURN_depart .
* endselect.
SELECT BRTXT INTO RETURN_DATA-BN3 FROM ZT016T WHERE BRSCH =
RETURN_DAT-RETURN_DEPART AND SPRAS = ‘1‘.
ENDSELECT.
* append infor_all.
CASE RETURN_DAT-STORE_TYPE.
WHEN ‘1‘.
RETURN_DAT-STORE_TYPE = ‘SER整机库‘.
WHEN ‘2‘.
RETURN_DAT-STORE_TYPE = ‘SER散件库‘.
WHEN ‘3‘.
RETURN_DAT-STORE_TYPE = ‘PC整机库‘.
WHEN ‘4‘.
RETURN_DAT-STORE_TYPE = ‘PC散件库‘.
WHEN ‘5‘.
RETURN_DAT-STORE_TYPE = ‘PC显示器‘.
WHEN ‘6‘.
RETURN_DAT-STORE_TYPE = ‘SER显示器‘.
ENDCASE.
CASE RETURN_DAT-PROPERTY.
WHEN ‘1‘.
RETURN_DAT-PROPERTY = ‘A‘.
WHEN ‘2‘.
RETURN_DAT-PROPERTY = ‘C‘.
WHEN ‘3‘.
RETURN_DAT-PROPERTY = ‘D‘.
WHEN ‘4‘.
RETURN_DAT-PROPERTY = ‘B‘.
WHEN ‘5‘.
RETURN_DAT-PROPERTY = ‘E‘.
WHEN ‘6‘.
RETURN_DAT-PROPERTY = ‘过保‘.
ENDCASE.
MODIFY RETURN_DAT .
ENDLOOP.
CLEAR FIELDCAT[].
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘LEND_NO‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘借料单号‘.
FIELDCAT-SELTEXT_M = ‘借料单号‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘RETURN_DEPART‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘部门代码‘.
FIELDCAT-SELTEXT_M = ‘部门代码‘.
APPEND FIELDCAT.
* fieldcat-fieldname = ‘LEND_DEP‘.
* fieldcat-tabname = ‘INFOR_ALL‘.
* fieldcat-seltext_s = ‘借料部门‘.
* fieldcat-seltext_m = ‘借料部门‘.
* append fieldcat.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘BN3‘.
FIELDCAT-TABNAME = ‘RETURN_DATA‘.
FIELDCAT-SELTEXT_S = ‘借料部门‘.
FIELDCAT-SELTEXT_M = ‘借料部门‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘DEP_DETAIL‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘部门明细‘.
FIELDCAT-SELTEXT_M = ‘部门明细‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘RETURN_DATE‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘还物日期‘.
FIELDCAT-SELTEXT_M = ‘还物日期‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘STORE_TYPE‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘库类别‘.
FIELDCAT-SELTEXT_M = ‘库类别‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘PROPERTY‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘物料属性‘.
FIELDCAT-SELTEXT_M = ‘物料属性‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘MANAGER1‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘审批经理‘.
FIELDCAT-SELTEXT_M = ‘审批经理‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘OPERATOR‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘操作人‘.
FIELDCAT-SELTEXT_M = ‘操作人‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘MATNR‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘物料号‘.
FIELDCAT-SELTEXT_M = ‘物料号‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘MAKTX‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘物料描述‘.
FIELDCAT-SELTEXT_M = ‘物料描述‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘MEINS‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘单位‘.
FIELDCAT-SELTEXT_M = ‘单位‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘RETURN_NUM‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘归还数量‘.
FIELDCAT-SELTEXT_M = ‘归还数量‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘RETURNER‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘借物人‘.
FIELDCAT-SELTEXT_M = ‘借物人‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘PRICE‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘单价‘.
FIELDCAT-SELTEXT_M = ‘单价‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘TOTAL‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘金额‘.
FIELDCAT-SELTEXT_M = ‘金额‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘APPLY_NO‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘申请单号‘.
FIELDCAT-SELTEXT_M = ‘申请单号‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘MACHI_SERIES‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘机器序列号‘.
FIELDCAT-SELTEXT_M = ‘机器序列号‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘CHECKER‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘检验人员‘.
FIELDCAT-SELTEXT_M = ‘检验人员‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘DETAIL‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘检验明细‘.
FIELDCAT-SELTEXT_M = ‘检验明细‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘CHECK_DETAIL‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘检验结果‘.
FIELDCAT-SELTEXT_M = ‘检验结果‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘NEW_CPBM‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘新产品编码‘.
FIELDCAT-SELTEXT_M = ‘新产品编码‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘NEW_WLMS‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘新物料描述‘.
FIELDCAT-SELTEXT_M = ‘新物料描述‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘NEW_WLSX‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘新物料属性‘.
FIELDCAT-SELTEXT_M = ‘新物料属性‘.
APPEND FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘RETURN_NO‘.
FIELDCAT-TABNAME = ‘RETURN_DAT‘.
FIELDCAT-SELTEXT_S = ‘还物单号‘.
FIELDCAT-SELTEXT_M = ‘还物单号‘.
APPEND FIELDCAT.
CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY‘
EXPORTING
IT_FIELDCAT = FIELDCAT[]
I_DEFAULT = ‘X‘
I_SAVE = ‘A‘
TABLES
T_OUTTAB = RETURN_DAT
EXCEPTIONS
OTHERS = 2.
ENDFORM. "return_data
*&--------------------------------------------------------------------*
*& Form time_data
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
FORM TIME_DATA ."按照还物日期统计
IF SY-UNAME = ‘YINGZHAO‘ OR SY-UNAME = ‘ZHANGSHP‘ OR SY-UNAME =
‘YAOLJ‘.
NAME = ‘2000‘.
IF ITAB IS INITIAL.
CONCATENATE ‘RETURN_DEPART = ‘ ‘ NAME ‘INTO ITAB.
ELSE.
CONCATENATE ‘ AND RETURN_DEPART = ‘ ‘ NAME ‘INTO ITAB.
ENDIF.
APPEND ITAB.
CLEAR DEPART.
ENDIF.
REFRESH RETURN_DAT.
CLEAR RETURN_DAT.
REFRESH INFOR_ALL.
CLEAR INFOR_ALL.
SELECT * INTO TABLE RETURN_DAT FROM
ZRETURN_INFOR WHERE RETURN_DEPART IN DEPART AND LEND_NO IN NO
AND RETURN_NO IN R_NO AND RETURN_DATE IN R_DATE AND (ITAB).
SORT RETURN_DAT BY LEND_NO .
LOOP AT RETURN_DAT.
INFOR_ALL-RETURN_NO = RETURN_DAT-RETURN_NO.
INFOR_ALL-LEND_DEPART = RETURN_DAT-RETURN_DEPART.
CLEAR INFOR_ALL-LEND_DEP.
SELECT BRTXT INTO INFOR_ALL-LEND_DEP FROM ZT016T WHERE BRSCH =
RETURN_DAT-RETURN_DEPART AND SPRAS = ‘1‘ .
ENDSELECT.
INFOR_ALL-DEP_DETAIL = RETURN_DAT-DEP_DETAIL.
INFOR_ALL-RETURN_DATE = RETURN_DAT-RETURN_DATE.
CASE RETURN_DAT-STORE_TYPE.
WHEN ‘1‘.
INFOR_ALL-STORE_TYPE = ‘SER整机库‘.
WHEN ‘2‘.
INFOR_ALL-STORE_TYPE = ‘SER散件库‘.
WHEN ‘3‘.
INFOR_ALL-STORE_TYPE = ‘PC整机库‘.
WHEN ‘4‘.
INFOR_ALL-STORE_TYPE = ‘PC散件库‘.
WHEN ‘5‘.
INFOR_ALL-STORE_TYPE = ‘PC显示器‘.
WHEN ‘6‘.
INFOR_ALL-STORE_TYPE = ‘SER显示器‘.
ENDCASE.
CASE RETURN_DAT-PROPERTY.
WHEN ‘1‘.
INFOR_ALL-PROPERTY = ‘A‘.
WHEN ‘2‘.
INFOR_ALL-PROPERTY = ‘C‘.
WHEN ‘3‘.
INFOR_ALL-PROPERTY = ‘D‘.
WHEN ‘4‘.
INFOR_ALL-PROPERTY = ‘B‘.
WHEN ‘5‘.
INFOR_ALL-PROPERTY = ‘E‘.
WHEN ‘6‘.
INFOR_ALL-PROPERTY = ‘过保‘.
ENDCASE.
INFOR_ALL-MANAGER1 = RETURN_DAT-MANAGER1.
INFOR_ALL-LENDER = RETURN_DAT-CHECKER.
INFOR_ALL-OPERATOR = RETURN_DAT-OPERATOR.
INFOR_ALL-MATNR = RETURN_DAT-MATNR.
INFOR_ALL-MAKTX = RETURN_DAT-MAKTX.
INFOR_ALL-ZTBS = RETURN_DAT-ZTBS.
* infor_all-apply_num = lend_detail-apply_num.
* infor_all-get_num = lend_detail-get_num.
INFOR_ALL-RETURN_NUM = RETURN_DAT-RETURN_NUM.
IF INFOR_ALL-LEND_NO = RETURN_DAT-LEND_NO .
CLEAR INFOR_ALL-GET_NUM.
CLEAR INFOR_ALL-NUM.
ELSE.
SELECT GET_NUM INTO INFOR_ALL-GET_NUM FROM ZLEND_DETAIL
WHERE LEND_NO = RETURN_DAT-LEND_NO AND
MATNR = RETURN_DAT-MATNR.
ENDSELECT."发或数量
SELECT RETURN_NUM INTO INFOR_ALL-APPLY_NUM FROM
ZLEND_DETAIL WHERE LEND_NO = RETURN_DAT-LEND_NO AND
MATNR = RETURN_DAT-MATNR.
ENDSELECT."归还数量
INFOR_ALL-NUM = INFOR_ALL-GET_NUM - INFOR_ALL-APPLY_NUM .
ENDIF.
INFOR_ALL-LEND_NO = RETURN_DAT-LEND_NO.
INFOR_ALL-APPLY_NO = RETURN_DAT-APPLY_NO.
INFOR_ALL-MEINS = RETURN_DAT-MEINS.
INFOR_ALL-PRICE = RETURN_DAT-PRICE.
INFOR_ALL-TOTAL = INFOR_ALL-PRICE * INFOR_ALL-GET_NUM .
INFOR_ALL-STORER = RETURN_DAT-STORER.
INFOR_ALL-MACHI_SERIES = RETURN_DAT-MACHI_SERIES.
APPEND INFOR_ALL.
ENDLOOP.
SORT INFOR_ALL BY LEND_NO.
REFRESH FIELDCAT.
CLEAR FIELDCAT.
FIELDCAT-FIELDNAME = ‘RETURN_NO‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘还物单号‘.
FIELDCAT-SELTEXT_M = ‘还物单号‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘LEND_NO‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘借料单号‘.
FIELDCAT-SELTEXT_M = ‘借料单号‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘LEND_DEPART‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘部门代码‘.
FIELDCAT-SELTEXT_M = ‘部门代码‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘LEND_DEP‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘部门名称‘.
FIELDCAT-SELTEXT_M = ‘部门名称‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘DEP_DETAIL‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘部门明细‘.
FIELDCAT-SELTEXT_M = ‘部门明细‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘RETURN_DATE‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘还物日期‘.
FIELDCAT-SELTEXT_M = ‘还物日期‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘STORE_TYPE‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘库类别‘.
FIELDCAT-SELTEXT_M = ‘库类别‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘PROPERTY‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘物料属性‘.
FIELDCAT-SELTEXT_M = ‘物料属性‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘MANAGER1‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘审批经理‘.
FIELDCAT-SELTEXT_M = ‘审批经理‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘OPERATOR‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘操作人‘.
FIELDCAT-SELTEXT_M = ‘操作人‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘MATNR‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘物料号‘.
FIELDCAT-SELTEXT_M = ‘物料号‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘MAKTX‘.
FIELDCAT-TABNAME = ‘INFRO_ALL‘.
FIELDCAT-SELTEXT_S = ‘物料描述‘.
FIELDCAT-SELTEXT_M = ‘物料描述‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘MEINS‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘单位‘.
FIELDCAT-SELTEXT_M = ‘单位‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘NUM‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘剩余数量‘.
FIELDCAT-SELTEXT_M = ‘剩余数量‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘RETURN_NUM‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘归还数量‘.
FIELDCAT-SELTEXT_M = ‘归还数量‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘LENDER‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘借物人‘.
FIELDCAT-SELTEXT_M = ‘借物人‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘PRICE‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘单价‘.
FIELDCAT-SELTEXT_M = ‘单价‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘TOTAL‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘金额‘.
FIELDCAT-SELTEXT_M = ‘金额‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘APPLY_NO‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘申请单号‘.
FIELDCAT-SELTEXT_M = ‘申请单号‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘MACHI_SERIES‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘机器序列号‘.
FIELDCAT-SELTEXT_M = ‘机器序列号‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘CHECKER‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘检验人员‘.
FIELDCAT-SELTEXT_M = ‘检验人员‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘DETAIL‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘检验明细‘.
FIELDCAT-SELTEXT_M = ‘检验明细‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘CHECK_DETAIL‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘检验结果‘.
FIELDCAT-SELTEXT_M = ‘检验结果‘.
APPEND FIELDCAT.
FIELDCAT-FIELDNAME = ‘STORER‘.
FIELDCAT-TABNAME = ‘INFOR_ALL‘.
FIELDCAT-SELTEXT_S = ‘库管人员‘.
FIELDCAT-SELTEXT_M = ‘库管人员‘.
APPEND FIELDCAT.
* fieldcat-fieldname = ‘NEW_CPBM‘.
* fieldcat-tabname = ‘RETURN_DAT‘.
* fieldcat-seltext_s = ‘新产品编码‘.
* fieldcat-seltext_m = ‘新产品编码‘.
* append fieldcat.
* fieldcat-fieldname = ‘NEW_WLMS‘.
* fieldcat-tabname = ‘RETURN_DAT‘.
* fieldcat-seltext_s = ‘新物料描述‘.
* fieldcat-seltext_m = ‘新物料描述‘.
* append fieldcat.
* fieldcat-fieldname = ‘NEW_WLSX‘.
* fieldcat-tabname = ‘RETURN_DAT‘.
* fieldcat-seltext_s = ‘新物料属性‘.
* fieldcat-seltext_m = ‘新物料属性‘.
* append fieldcat.
CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY‘
EXPORTING
IT_FIELDCAT = FIELDCAT[]
I_DEFAULT = ‘X‘
I_SAVE = ‘A‘
TABLES
T_OUTTAB = INFOR_ALL
EXCEPTIONS
OTHERS = 2.
ENDFORM. "time_dat
*&--------------------------------------------------------------------*
*& Form WRITE_STRING
*&--------------------------------------------------------------------*
* text
*---------------------------------------------------------------------*
* -->LEND_MAIN-Btext
* -->B1 text
* -->B2 text
*---------------------------------------------------------------------*
FORM WRITE_STRING USING LEND_MAIN-BZ
CHANGING B1
B2.
CONSTANTS: V_A2 TYPE X VALUE ‘7F‘.
DATA: V_A3 TYPE X .
DATA: J TYPE I, COUNT01 TYPE I.
DO 56 TIMES.
V_A3 = LEND_MAIN-BZ+J(1).
FIELD-SYMBOLS: <DUMMY>.
ASSIGN LEND_MAIN-BZ+J(1) TO <DUMMY> TYPE ‘X‘.
IF <DUMMY> > V_A2.
COUNT01 = COUNT01 + 1.
ENDIF.
J = J + 1.
ENDDO.
COUNT01 = COUNT01 MOD 2.
IF COUNT01 EQ 0.
B1 = LEND_MAIN-BZ+0(56).
B2 = LEND_MAIN-BZ+56(54).
ELSE.
B1 = LEND_MAIN-BZ+0(55).
B2 = LEND_MAIN-BZ+55(55).
ENDIF.
ENDFORM. "WRITE_STRING