判断有没有真正点击打印

DATABEGIN OF lt_dycs OCCURS 0,"关联单号和打印次数存储表
          refid TYPE ztjsd_confirm_dy-refid,
           dycs TYPE ztjsd_confirm_dy-dycs,
      END OF lt_dycs.
DATA: lt_dycs1 LIKE TABLE OF ztjsd_confirm_dy WITH HEADER LINE.
DATA: ls_output_info TYPE ssfcrescl."Smart Forms: 表格打印结束时返回值

DATA: lv_dycs TYPE ztjsd_confirm_dy-dycs.
 
CALL FUNCTION 'SSF_CLOSE'
    IMPORTING
      job_output_info  = ls_output_info
    EXCEPTIONS
      formatting_error = 1
      internal_error   = 2
      send_error       = 3
      OTHERS           = 4.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ELSE.
    IF ls_output_info-spoolids IS NOT INITIAL.
      LOOP AT gt_data_print.
        READ TABLE lt_dycs WITH KEY refid = gt_data_print-refid.
        IF sy-subrc = 0.
          CLEAR: lv_dycs.
          lv_dycs = lt_dycs-dycs + 1.
          UPDATE ztjsd_confirm_dy SET dycs = lv_dycs WHERE refid = gt_data_print-refid.
        ELSE.
          CLEAR: lt_dycs1,lt_dycs1[].
          lt_dycs1-refid = gt_data_print-refid.
          lt_dycs1-dycs = 1.
          APPEND lt_dycs1.
          INSERT ztjsd_confirm_dy FROM lt_dycs1.
        ENDIF.
      ENDLOOP.
  ENDIF.

posted on 2016-06-29 09:09  TorranceZhao  阅读(341)  评论(0编辑  收藏  举报

导航