当前位置:编程学习 > 网站相关 >>

BAPI for FB50 成本中心总帐批导

*&---------------------------------------------------------------------*
*& Report  Z_FI_080
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  Z_FI_080.

 

DATA: BEGIN OF ITAB OCCURS 0,
   BLDAT LIKE BKPF-BLDAT,  "凭证日期
   BUKRS LIKE BKPF-BUKRS,  "公司代码
   WAERS LIKE BKPF-WAERS,  "币别 1000/2000
   BUDAT LIKE BKPF-BUDAT,  "过帐日期
   XBLNR LIKE BKPF-XBLNR,  "参照
   BKTXT LIKE BKPF-BKTXT,  "抬头文本
   BVORG LIKE BKPF-BVORG,  "往来凭证号
   HKONT LIKE BSEG-HKONT,  "科目
   SHKZG LIKE BSEG-SHKZG,  "借/贷 H/S
   WRBTR LIKE BSEG-WRBTR,  "金额
   MWSKZ like BSEG-MWSKZ,  "税金
   ZUONR LIKE BSEG-ZUONR,  "项目分配编号
   SGTXT LIKE BSEG-SGTXT,  "项目文本
   KOSTL LIKE BSEG-KOSTL,  "成本中心
   PRCTR LIKE BSEG-PRCTR,  "利润中心
  END OF ITAB.

 

**********BAPI WAY*********************************
DATA:
  gd_documentheader    LIKE bapiache09,
  gd_customercpd       LIKE bapiacpa09,
  gd_fica_hd           LIKE bapiaccahd,
  it_accountreceivable LIKE TABLE OF bapiacar09 WITH HEADER LINE,
  it_accountgl         LIKE TABLE OF bapiacgl09 WITH HEADER LINE,
  it_accounttax        LIKE TABLE OF bapiactx09 WITH HEADER LINE,
  it_criteria          LIKE TABLE OF bapiackec9 WITH HEADER LINE,
  it_valuefield        LIKE TABLE OF bapiackev9 WITH HEADER LINE,
  it_currencyamount    LIKE TABLE OF bapiaccr09 WITH HEADER LINE,
  it_return            LIKE TABLE OF bapiret2   WITH HEADER LINE,
  it_receivers         LIKE TABLE OF bdi_logsys WITH HEADER LINE,
  it_fica_it           LIKE TABLE OF bapiaccait WITH HEADER LINE,
  it_accountpayable    LIKE TABLE OF bapiacap09 WITH HEADER LINE,
  it_paymentcard       LIKE TABLE OF bapiacpc09 WITH HEADER LINE,
  it_ext               LIKE TABLE OF bapiacextc WITH HEADER LINE,
  it_re                LIKE TABLE OF bapiacre09 WITH HEADER LINE,
  it_ext2              LIKE TABLE OF bapiparex  WITH HEADER LINE.
********************************************************
TYPE-POOLS: slis.
DATA: i_fieldcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,     "slis_t_fieldcat_alv WITH HEADER LINE,slis_t_fieldcat_alv
      i_fieldcat_alv TYPE slis_t_fieldcat_alv WITH HEADER LINE,
      i_events TYPE slis_t_event,              "alv事件
      w_events LIKE LINE OF i_events,
      gd_tab_group TYPE slis_t_sp_group_alv,
*      gd_layout    TYPE lvc_s_layo,     "slis_layout_alv,
      gd_layout    TYPE  slis_layout_alv,
      usercommand TYPE slis_fieldname VALUE 'USERCOMMAND',
      gd_repid     LIKE sy-repid.

CONSTANTS:
  c_begin_row TYPE i VALUE 1,       "Beginning row of excel file
  c_begin_col TYPE i VALUE 1,       "Beginning column of excel file
  c_end_row   TYPE i VALUE 9999,    "Ending row of excel file
  c_end_col   TYPE i VALUE 55.      "Ending column of excel file

PARAMETERS: BDCTYPE(1) TYPE C DEFAULT 'B' NO-DISPLAY,
*            BDCMODE    LIKE BDCRUN-BDC_AMODUS DEFAULT 'A' NO-DISPLAY.
            BDCMODE    LIKE BDCRUN-BDC_AMODUS DEFAULT 'N' NO-DISPLAY.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE t2.
PARAMETERS:cc AS CHECKBOX DEFAULT 'X'.
PARAMETERS: pc_file(80).
SELECTION-SCREEN END OF BLOCK b2.

INITIALIZATION.
*  t1 = '查询条件'.
  t2 = '文件上传'.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR pc_file.
  PERFORM sub_find USING pc_file.

*&---------------------------------------------------------------------*
*&      Form  sub_find
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*      -->PC_FILE    text
*----------------------------------------------------------------------*
FORM sub_find USING pc_file.
* Data for open dialog
  DATA: l_filetab   TYPE filetable,
        l_rc        TYPE i.
  CLEAR l_filetab.
  REFRESH l_filetab.
* Open dialog
  CALL METHOD cl_gui_frontend_services=>file_open_dialog
    EXPORTING
*      WINDOW_TITLE            = 'SAP Custom - Open File'
*      DEFAULT_EXTENSION       =
      default_filename        = '*.xls'
*      FILE_FILTER             = '*.xls'
      initial_directory       = 'd:\'
      multiselection          = ''
    CHANGING
      file_table              = l_filetab
      rc                      = l_rc
    EXCEPTIONS
      cntl_error              = 1
      error_no_gui            = 2
      not_supported_by_gui    =

补充:综合编程 , 其他综合 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,