此博客为原创博客,都是个人工作经历所得,转载请注明出处

过账期间搜索帮助

 




*
&---------------------------------------------------------------------* *& 包含 ZFIR0061_TOP *&---------------------------------------------------------------------* TABLES: acdoca, zfit0091, sscrfields. TYPES:BEGIN OF ty_alv, sel TYPE sy-tabix, "序号 rbukrs TYPE acdoca-rbukrs, "公司代码 lifnr TYPE acdoca-lifnr, "供应商代码 name1 TYPE lfa1-name1, "供应商名称 zjszq TYPE zfit0091-zjszq, "结算账期 sum_rkhsl TYPE acdoca-hsl, "累计入库金额 sum_fkhsl TYPE acdoca-hsl, "累计付款额 yfye TYPE acdoca-hsl, "应付余额 【=累计入库金额-累计付款额】 dqyf TYPE acdoca-hsl, "到账期应付金额 wsfp TYPE acdoca-hsl, "未收发票金额 ysfp TYPE acdoca-hsl, "已收发票金额 ysfp_wf TYPE acdoca-hsl, "已收发票未付金额 hsl TYPE acdoca-hsl, rkhsl_1 TYPE acdoca-hsl, rkhsl_2 TYPE acdoca-hsl, rkhsl_3 TYPE acdoca-hsl, fkhsl_1 TYPE acdoca-hsl, fkhsl_2 TYPE acdoca-hsl, fkhsl_3 TYPE acdoca-hsl, END OF ty_alv. DATA: gt_alv TYPE STANDARD TABLE OF ty_alv, gs_alv TYPE ty_alv. FIELD-SYMBOLS: <fs_alv> LIKE LINE OF gt_alv. **全局变量 DATA: g_err(1), g_lines TYPE sy-tabix, g_tabix TYPE sy-tabix. **ALV参数定义 DATA: gt_fcat TYPE lvc_t_fcat, gs_fcat TYPE lvc_s_fcat. DATA: g_repid TYPE sy-repid, gs_layout TYPE lvc_s_layo. *&---------------------------------------------------------------------* * SELECTION SCREEN *&---------------------------------------------------------------------* SELECTION-SCREEN:BEGIN OF BLOCK a1 WITH FRAME TITLE TEXT-001. SELECT-OPTIONS:s_rbukrs FOR acdoca-rbukrs OBLIGATORY NO INTERVALS NO-EXTENSION, "公司代码 s_lifnr FOR acdoca-lifnr, "供应商代码 s_ryear FOR acdoca-gjahr OBLIGATORY NO INTERVALS NO-EXTENSION,"年度 s_month FOR acdoca-poper. "期间 SELECTION-SCREEN FUNCTION KEY 1. SELECTION-SCREEN:END OF BLOCK a1.
REPORT zfir0061 MESSAGE-ID zmm001.

*&---------------------------------------------------------------------*
* INCLUDE
*&---------------------------------------------------------------------*
INCLUDE zfir0061_top.
INCLUDE zfir0061_from.

*&---------------------------------------------------------------------*
* INITIALIZATION
*&---------------------------------------------------------------------*
INITIALIZATION.
  "数据初始化
  PERFORM frm_init_data.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_month-low.
  PERFORM set_s_month_help.

*&---------------------------------------------------------------------*
*&   Event AT SELECTION-SCREEN OUTPUT
*&---------------------------------------------------------------------*
AT SELECTION-SCREEN OUTPUT.
  "修改屏幕
*  PERFORM frm_modify_screen.

*&---------------------------------------------------------------------*
*&   Event AT SELECTION-SCREEN
*&---------------------------------------------------------------------*
AT SELECTION-SCREEN.
  "权限检查
  PERFORM frm_authority_check.
  IF sscrfields-ucomm = 'FC01'.
    PERFORM frm_config_zfit0091.
  ENDIF.
*&---------------------------------------------------------------------*
*
*        MAIN PROGRAM
*
*----------------------------------------------------------------------*
START-OF-SELECTION.
  "获取数据
  PERFORM frm_get_data.
  "显示ALV
  PERFORM frm_display_alv.
*&---------------------------------------------------------------------*
*& Form SET_S_MONTH_HELP
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& -->  p1        text
*& <--  p2        text
*&---------------------------------------------------------------------*
FORM set_s_month_help .

  DATA:BEGIN OF ls_month,
         monat TYPE bkpf-monat,
       END OF ls_month,
       lt_month LIKE TABLE OF ls_month.

  CLEAR:lt_month.
  lt_month = VALUE #(
                      ( monat = '01' )
                      ( monat = '02' )
                      ( monat = '03' )
                      ( monat = '04' )
                      ( monat = '05' )
                      ( monat = '06' )
                      ( monat = '07' )
                      ( monat = '08' )
                      ( monat = '09' )
                      ( monat = '10' )
                      ( monat = '11' )
                      ( monat = '12' )
                      ( monat = '13' )
                      ( monat = '14' )
                      ( monat = '15' )
                      ( monat = '16' )
                     ).

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield         = 'MONAT'            "内表里面的字段
      dynpprog         = sy-repid
      dynpnr           = sy-dynnr
      dynprofield      = 'S_MONTH'            "画面上绑定字段
      value_org        = 'S'
      callback_program = sy-repid
    TABLES
      value_tab        = lt_month          "需要显示帮助的值内表
    EXCEPTIONS
      parameter_error  = 1
      no_values_found  = 2
      OTHERS           = 3.

ENDFORM.

 

posted @ 2019-05-17 17:16  Rainystuday  阅读(216)  评论(0编辑  收藏  举报