Долги кредиторов

ZHM_D_N_CH_PAYAB таблица для настройки номера графика в EGD
Project /ZHM/ACCOUNT_PAYABE
Description account_payabe

Объект полномочий в в NWD:
AUTHORITY-CHECK OBJECT ‘ZWEBREPORT
ID ‘ZWEBREPORT’ FIELD ‘PAYABLE‘.

Project Type
Generation Strategy
Package /ZHM/WEB_APP

Created By ZHMAILIK_VV Created On 07.12.2020
Last Changed By ZHMAILIK_VV Changed on 05.01.2021
Функция:

function z_zhm_rfc_get_credits_debt.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  TABLES
*"      ET_CR_HISTORY STRUCTURE  ZHM_S_CR_HISTORY
*"----------------------------------------------------------------------
  data:
         lt_cr_history  type table of zhm_d_cr_history,
         lt_skat type sorted table of skat with unique key saknr,
         lv_data type datum,
         lt_range_hkont type range of hkont,
         lv_data_sel_days_ago type i.

  field-symbols:
                  like line of et_cr_history,
                  like line of lt_skat.

  lv_data = sy-datum.
  lv_data_sel_days_ago = lv_data - 700.


  select *                                            "#EC CI_SGLSELECT
    into corresponding fields of table lt_skat
    from skat
    where spras = sy-langu and ktopl = '1000'.

  call function 'ROUND_DATE'
    exporting
      i_iprkz            = '2'
      i_rdmhd            = '-'
    changing
      c_date             = lv_data
    exceptions
      invalid_round_rule = 1
      others             = 2.

  select * from zhm_d_cr_history
    into corresponding fields of table et_cr_history
    where data < lv_data and data > lv_data_sel_days_ago.

  loop at et_cr_history assigning .
    -z_month = -data+4(2).
  endloop.

  sort et_cr_history by hkont data descending .
  delete adjacent duplicates from et_cr_history comparing hkont z_month.

  loop at et_cr_history assigning .
    call function 'ROUND_DATE'
      exporting
        i_iprkz            = '2'
        i_rdmhd            = '+'
      changing
        c_date             = -data
      exceptions
        invalid_round_rule = 1
        others             = 2.
  endloop.

  select * from zhm_d_cr_history
    appending corresponding fields of table et_cr_history
    where data >= lv_data and data > lv_data_sel_days_ago.

  loop at et_cr_history assigning .
    -z_month = -data+4(2).
  endloop.

  loop at et_cr_history assigning .
    if -hkont = zcl_zhm_mm_creditors_debt=>mv_overall.
      -txt20 = 'Общая'(002).
      -txt50 = 'Общая'(002).
    else.
      read table lt_skat assigning  with table key saknr = -hkont.
      if sy-subrc = 0.
        -txt20 = -txt20.
        -txt50 = -txt50.
      endif.
    endif.
  endloop.

  sort et_cr_history by  data hkont.

  loop at et_cr_history assigning .
    select single report_number
      into  -report_number
      from zhm_d_n_ch_payab
      where hkont =  -hkont.
  endloop.
endfunction.

Добавить комментарий