创建 会计凭证

FUNCTION zrfc_mm018.
*"----------------------------------------------------------------------
*"*"Local interface:
*"  IMPORTING
*"     VALUE(CALLNO) TYPE  ZCALLNO
*"     VALUE(ZFIS005) LIKE  ZFIS005 STRUCTURE  ZFIS005
*"  EXPORTING
*"     VALUE(BELNR) TYPE  BELNR_D
*"     VALUE(COMP_CODE) TYPE  BUKRS
*"     VALUE(GJAHR) TYPE  GJAHR
*"     VALUE(FLAG) LIKE  BAPIRET2-TYPE
*"     VALUE(MESSAGE) LIKE  BAPIRET2-MESSAGE
*"  TABLES
*"      ZFIS006 STRUCTURE  ZFIS006 OPTIONAL
*"      ZFIS007 STRUCTURE  ZFIS007 OPTIONAL
*"----------------------------------------------------------------------
DATA: ls_documentheader LIKE bapiache09,                   "凭证抬头数据
      lt_accountgl      LIKE TABLE OF bapiacgl09,          "总账科目项目
      lt_accountpayable LIKE TABLE OF bapiacap09,          "供应商科目项目
      lt_curren         LIKE TABLE OF bapiaccr09,          "金额项目
      lt_extension2        LIKE TABLE OF bapiparex,           "扩展字段项目
      lt_return         LIKE TABLE OF bapiret2,            "返回消息
      ls_return         LIKE bapiret2,
      lv_obj_type       LIKE bapiache09-obj_type,
      lv_obj_key        LIKE bapiache09-obj_key,
      lv_obj_sys        LIKE bapiache09-obj_sys,
      lt_zfis006        LIKE TABLE OF zfis006,
      lt_zfis007        LIKE TABLE OF zfis007,
      lv_bukrs          LIKE zfis005-bukrs,                "分公司
      lv_waers          LIKE zfis005-waers,                "货币码
      lv_message        LIKE bapiret2-message.

DATA: ls_zfis006        LIKE  zfis006,
      ls_zfis007        LIKE  zfis007,
      ls_accountgl      LIKE  bapiacgl09,
      ls_accountpayable LIKE  bapiacap09,
      ls_curren         LIKE  bapiaccr09,
      ls_extension2        LIKE  bapiparex,
      ls_zfis001        LIKE  zfis001.

*---预提凭证账期检查
*IF  zfis005-blart = ‘SA_W‘ OR zfis005-blart = ‘SA_R‘.
*PERFORM frm_check_post_date USING zfis005-blart zfis005-budat CHANGING flag message.
*ENDIF.
*CHECK flag IS INITIAL.

*---参数赋值
lt_zfis006  = zfis006[].
lt_zfis007  = zfis007[].
lv_waers    = zfis005-waers.
lv_bukrs    = zfis005-bukrs.

*---凭证抬头数据:
ls_documentheader-header_txt = zfis005-bktxt.              "抬头文本
ls_documentheader-comp_code  = zfis005-bukrs.              "公司代码
ls_documentheader-doc_date   = zfis005-bldat.              "凭证日期
ls_documentheader-pstng_date = zfis005-budat.              "过账日期
ls_documentheader-doc_type   = zfis005-blart.              "凭证类型
ls_documentheader-ref_doc_no = zfis005-xblnr.              "参考凭证编号
ls_documentheader-username   = sy-uname.                   "

*---凭证行项目:
*-----------------------------------------------------------------------------------
*                             借方项目
*-----------------------------------------------------------------------------------
LOOP AT lt_zfis006 INTO ls_zfis006.
*---总账科目项目
  ls_accountgl-itemno_acc    =  ls_zfis006-posnr.             "行项目编号
  ls_accountgl-gl_account    =  ls_zfis006-hkont.             "总账科目
  ls_accountgl-alloc_nmbr    =  ls_zfis006-zuonr.             "分配编号
  ls_accountgl-item_text     =  ls_zfis006-sgtxt.             "文本
  ls_accountgl-costcenter    =  ls_zfis006-kostl.             "成本中心
  ls_accountgl-value_date    =  ls_zfis006-valut.             "起息日
  ls_accountgl-ref_key_2     =  ls_zfis006-xref2.             "参考码2--预算号
  ls_accountgl-ref_key_3     =  ls_zfis006-xref3.             "参考码3--预算号
  APPEND ls_accountgl TO lt_accountgl.

*---金额项目
  ls_curren-itemno_acc       =  ls_zfis006-posnr.             "项目
  ls_curren-currency         =  lv_waers.                     "币种
  ls_curren-amt_doccur       =  ls_zfis006-bapiwrbtr.         "金额
  APPEND ls_curren TO lt_curren.

*---扩展字段项目
  ls_zfis001-posnr           =  ls_zfis006-posnr.
  ls_zfis001-bschl           =  ls_zfis006-bschl.             "借方记账码40
  ls_zfis001-rstgr           =  ls_zfis006-rstgr.             "付款原因代码
  ls_zfis001-shkzg           =  ls_zfis006-shkzg.             "借贷标识
  ls_zfis001-zumsk           =  ls_zfis006-zumsk.             "目标特别总帐标志
  ls_extension2-structure    = ‘ZFIS001‘.
  ls_extension2-valuepart1   = ls_zfis001.
  APPEND ls_extension2 TO lt_extension2.
  CLEAR:ls_zfis006,ls_accountgl,ls_extension2,ls_zfis001,ls_curren.
ENDLOOP.

*-----------------------------------------------------------------------------------
*                             贷方项目(员工借款借贷都在供应商行项目上)
*-----------------------------------------------------------------------------------
*---供应商科目项目
LOOP AT  lt_zfis007 INTO ls_zfis007.

CALL FUNCTION ‘CONVERSION_EXIT_ALPHA_INPUT‘
  EXPORTING
    input         = ls_zfis007-lifnr
 IMPORTING
   output        =  ls_zfis007-lifnr.

ls_accountpayable-itemno_acc = ls_zfis007-posnr.              "行项目编号
ls_accountpayable-vendor_no  = ls_zfis007-lifnr.              "员工供应商账号
ls_accountpayable-alloc_nmbr = ls_zfis007-zuonr.              "分配编号
ls_accountpayable-item_text  = ls_zfis007-sgtxt.              "文本
ls_accountpayable-comp_code  = lv_bukrs.                      "公司代码
ls_accountpayable-ref_key_2  = ls_zfis007-xref2.              "参考码2--预算号
ls_accountpayable-ref_key_3  = ls_zfis007-xref3.              "参考码3(预付款申请凭证)
ls_accountpayable-sp_gl_ind  = ls_zfis007-sp_gl_ind.          "特别总账标识(预付款申请凭证: F 原借款:I )
ls_accountpayable-bline_date = ls_zfis007-bline_date.         "到期日计算的基限日期(员工借款)
ls_accountpayable-tax_code   = ls_zfis007-mwskz.              "销售税代码(预付款申请凭证)
APPEND ls_accountpayable TO lt_accountpayable.

*---金额项目
ls_curren-itemno_acc         = ls_zfis007-posnr.
ls_curren-currency           = lv_waers.
IF zfis005-blart = ‘KR‘.
  ls_curren-amt_doccur       = ls_zfis007-bapiwrbtr.
  AT LAST.
  ls_curren-amt_doccur       = ls_curren-amt_doccur * -1.
  ENDAT.
ELSE.
ls_curren-amt_doccur         = ls_zfis007-bapiwrbtr * -1.
ENDIF.
APPEND ls_curren TO lt_curren.

*---扩展字段项目
ls_zfis001-posnr             =  ls_zfis007-posnr.             "项目编号
ls_zfis001-bschl             =  ls_zfis007-bschl.             "借方记账码
ls_zfis001-rstgr             =  ls_zfis007-rstgr.             "付款原因代码
ls_zfis001-zumsk             =  ls_zfis007-zumsk.             "目标特别总帐标志.(预付款申请凭证 N )
ls_zfis001-zfbdt             =  ls_zfis007-zfbdt.             "用于到期日计算的基准日期(预付款申请凭证)
ls_zfis001-wmwst             =  ls_zfis007-wmwst.             "税额(预付款申请凭证)

IF zfis005-blart = ‘KA‘.                                      "(预付款申请凭证类型)
    ls_zfis001-bstat         = ‘S‘.                           "凭证状态 S(预付款申请凭证)
    ls_zfis001-glvor         = ‘RFST‘.                        "交易(预付款申请凭证)
ENDIF.
ls_extension2-structure      = ‘ZFIS001‘.
ls_extension2-valuepart1     = ls_zfis001.
APPEND ls_extension2 TO lt_extension2.
CLEAR:ls_zfis007,ls_accountgl,ls_extension2,ls_zfis001,ls_curren.
ENDLOOP.

*-----------------------------------------------------------------------------------
*                             调用BAPI生成凭证
*-----------------------------------------------------------------------------------
CALL FUNCTION ‘BAPI_ACC_DOCUMENT_POST‘
  EXPORTING
    documentheader         = ls_documentheader
 IMPORTING
   obj_type                = lv_obj_type
   obj_key                 = lv_obj_key
   obj_sys                 = lv_obj_sys
  TABLES
   accountgl               = lt_accountgl
   accountpayable          = lt_accountpayable
   currencyamount          = lt_curren
   return                  = gt_return
   extension2              = lt_extension2.

  READ TABLE gt_return INTO gs_return WITH KEY type = ‘E‘.
  IF sy-subrc NE 0.
    belnr = lv_obj_key+0(10).          "会计凭证
    comp_code = lv_obj_key+10(4).      "公司代码
    gjahr     = lv_obj_key+14(4).      "会计年度
    flag = ‘S‘.
    CALL FUNCTION ‘BAPI_TRANSACTION_COMMIT‘
      EXPORTING
        wait = ‘X‘.
  ELSE.
    CALL FUNCTION ‘BAPI_TRANSACTION_ROLLBACK‘.

    LOOP AT gt_return INTO gs_return WHERE type CA ‘AEX‘.
        MESSAGE ID     gs_return-id
                TYPE   gs_return-type
                NUMBER gs_return-number
                WITH   gs_return-message_v1 gs_return-message_v2
                       gs_return-message_v3 gs_return-message_v4
                       INTO lv_message.
        CONCATENATE message lv_message INTO message SEPARATED BY ‘|‘.
    ENDLOOP.
    SHIFT message LEFT DELETING LEADING  ‘|‘.
    flag = ‘E‘.
  ENDIF.

*-----------------------------------------------------------------------------------
*                             日志记录
*-----------------------------------------------------------------------------------
PERFORM frm_in_log USING     callno
                             flag
                             message
                             zfis005
                             lt_zfis006
                             lt_zfis007.
*-----------------------------------------------------------------------------------
*                             凭证记录
**-----------------------------------------------------------------------------------
IF flag = ‘S‘.
PERFORM frm_insert_zmmt002 USING belnr comp_code gjahr zfis005-blart.
ENDIF.

*-----------------------------------------------------------------------------------
*                          做预提凭证的冲销
*-----------------------------------------------------------------------------------
IF zfis005-blart+0(2) = ‘SA‘ AND flag = ‘S‘.
  PERFORM frm_rev_post USING lv_obj_type  lv_obj_key lv_obj_sys zfis005-budat.
ENDIF.

ENDFUNCTION.
FORM frm_in_log  USING   callno     TYPE zcallno
                          flag       LIKE bapiret2-type
                          message       LIKE    bapiret2-message
                          p_zfis005  LIKE zfis005
                          pt_zfis006 LIKE gt_zfis006
                          pt_zfis007 LIKE gt_zfis007.

  DATA: ls_zfis006 TYPE zfis006,
        ls_zfis007 TYPE zfis007,
        lt_in_log  TYPE TABLE OF zrfc_mm01in_log,
        ls_in_log  TYPE zrfc_mm01in_log,
        lv_datano  TYPE zdatano,
        bapiwrbtr(15),
        wmwst(15).

*---抬头项目
    lv_datano        = lv_datano + 1.
    bapiwrbtr        = ls_zfis006-bapiwrbtr.
    ls_in_log-name   = ‘ZRFC_MM018‘.
    ls_in_log-cdate  = sy-datum.
    GET TIME.
    ls_in_log-ctime  = sy-uzeit.
    ls_in_log-callno = callno.
    ls_in_log-datano = lv_datano.
    ls_in_log-flag   = flag.
    ls_in_log-log    = message.
    CONCATENATE p_zfis005-bukrs  p_zfis005-blart   p_zfis005-bldat   p_zfis005-budat
                p_zfis005-bktxt  p_zfis005-waers   p_zfis005-xblnr
                INTO ls_in_log-content SEPARATED BY ‘|‘.
    CONDENSE ls_in_log-content NO-GAPS.
    ls_in_log-length = STRLEN( ls_in_log-content ).
    APPEND ls_in_log TO lt_in_log.

*---总账科目项目
  LOOP AT pt_zfis006 INTO ls_zfis006.
    lv_datano        = lv_datano + 1.
    bapiwrbtr        = ls_zfis006-bapiwrbtr.
    ls_in_log-name   = ‘ZRFC_MM018‘.
    ls_in_log-cdate  = sy-datum.
    GET TIME.
    ls_in_log-ctime  = sy-uzeit.
    ls_in_log-callno = callno.
    ls_in_log-datano = lv_datano.
    ls_in_log-flag   = flag.
    ls_in_log-log    = message.
    CONCATENATE ‘ZFIS006‘         ls_zfis006-posnr  ls_zfis006-hkont  ls_zfis006-kostl  ls_zfis006-valut
                ls_zfis006-zuonr  ls_zfis006-sgtxt  bapiwrbtr         ls_zfis006-bschl  ls_zfis006-rstgr
                ls_zfis006-shkzg  ls_zfis006-zumsk  ls_zfis006-xref2  ls_zfis006-xref3
                INTO ls_in_log-content SEPARATED BY ‘|‘.
    SHIFT message LEFT DELETING LEADING  ‘|‘.
    CONDENSE ls_in_log-content NO-GAPS.
    ls_in_log-length = STRLEN( ls_in_log-content ).
    APPEND ls_in_log TO lt_in_log.
    CLEAR bapiwrbtr.
  ENDLOOP.

*----供应商项目
  LOOP AT pt_zfis007 INTO ls_zfis007.
    lv_datano = lv_datano + 1.
    bapiwrbtr = ls_zfis007-bapiwrbtr.
    wmwst     = ls_zfis007-wmwst.
    ls_in_log-name   = ‘ZRFC_MM018‘.
    ls_in_log-cdate  = sy-datum.
    GET TIME.
    ls_in_log-ctime  = sy-uzeit.
    ls_in_log-callno = callno.
    ls_in_log-datano = lv_datano.
    ls_in_log-flag   = flag.
    ls_in_log-log    = message.
    CONCATENATE ‘ZFIS007‘            ls_zfis007-posnr  ls_zfis007-lifnr  ls_zfis007-bline_date  ls_zfis007-sp_gl_ind
                ls_zfis007-pmnttrms  ls_zfis007-zuonr  ls_zfis007-sgtxt  bapiwrbtr              ls_zfis007-bschl
                ls_zfis007-rstgr     ls_zfis007-shkzg  ls_zfis006-zumsk  ls_zfis007-xref2       ls_zfis007-xref3
                wmwst                ls_zfis007-zfbdt  ls_zfis007-mwskz
                INTO ls_in_log-content SEPARATED BY ‘|‘.
    SHIFT message LEFT DELETING LEADING  ‘|‘.
    CONDENSE ls_in_log-content NO-GAPS.
    ls_in_log-length = STRLEN( ls_in_log-content ).
    APPEND ls_in_log TO lt_in_log.
    CLEAR: bapiwrbtr,wmwst.
  ENDLOOP.

IF lt_in_log IS NOT INITIAL.
     INSERT zrfc_mm01in_log FROM TABLE lt_in_log.
ENDIF.

ENDFORM.                    " FRM_IN_LOG
FORM frm_insert_zmmt002  USING    p_belnr      TYPE bseg-belnr
                                  p_bukrs      TYPE bseg-bukrs
                                  p_gjahr      TYPE bseg-gjahr
                                  p_blart      TYPE zfis005-blart.

DATA: lt_zmmt002 TYPE TABLE OF zmmt002,
      ls_zmmt002  TYPE zmmt002.

*---会计凭证信息
SELECT  bukrs belnr gjahr buzei zuonr sgtxt xref1 xref2 xref3
  INTO CORRESPONDING FIELDS OF TABLE lt_zmmt002
  FROM bseg
  WHERE bukrs  = p_bukrs
  AND   belnr  = p_belnr
  AND   gjahr  = p_gjahr.

  ls_zmmt002-blart = p_blart.  "凭证类型
  MODIFY lt_zmmt002 FROM  ls_zmmt002 TRANSPORTING blart WHERE blart IS INITIAL .

INSERT zmmt002 FROM TABLE lt_zmmt002.
  IF sy-subrc = 0.
     COMMIT WORK AND WAIT.
  ELSE.
     ROLLBACK WORK.
  ENDIF.

ENDFORM.                    " FRM_INSERT_ZMMT002
FORM frm_rev_post  USING    p_obj_type TYPE bapiache09-obj_type
                            p_obj_key  TYPE bapiache09-obj_key
                            p_obj_sys  TYPE bapiache09-obj_sys
                            p_budat    TYPE d.

DATA: l_datum1     TYPE d,
      fis_period   TYPE bapiacrev-fis_period,
      reason_rev   TYPE bapiacrev-reason_rev VALUE ‘04‘,
      ls_bkpf      TYPE bkpf,
      l_period     TYPE t009b-poper,
      l_reversal   TYPE bapiacrev,
      l_bus_act    TYPE bapiache09-bus_act,
      lt_return    TYPE TABLE OF bapiret2,
      ls_return    TYPE bapiret2.

DATA: l_obj_type   TYPE bapiache09-obj_type,
      l_obj_key    TYPE bapiache09-obj_key,
      l_obj_sys    TYPE bapiache09-obj_sys,
      belnr        TYPE bseg-belnr,
      comp_code    TYPE bseg-bukrs,
      gjahr        TYPE bseg-gjahr,
      flag            LIKE    bapiret2-type,
      message         LIKE    bapiret2-message,
      lv_message   LIKE bapiret2-message.

SELECT SINGLE * INTO ls_bkpf FROM bkpf
  WHERE awtyp = p_obj_type
   AND  awkey = p_obj_key.

*取得冲销凭证的账期
l_datum1 = p_budat.

*---得到当前过账日期的下一个月日期
CALL FUNCTION ‘MONTH_PLUS_DETERMINE‘
  EXPORTING
    months        = ‘1‘
    olddate       = p_budat
 IMPORTING
   newdate        = l_datum1.

CONCATENATE l_datum1+0(6) ‘01‘ INTO l_datum1.

*---取下个月账期
CALL FUNCTION ‘G_PERIOD_GET‘
 EXPORTING
   company                              = ls_bkpf-bukrs
   date                                 = l_datum1
   ledger                               = ‘0L‘
 IMPORTING
   period                               = l_period.

*-----冲销凭证
l_reversal-obj_type   = ls_bkpf-awtyp.
l_reversal-obj_key    = ls_bkpf-awkey.
l_reversal-obj_key_r  = ls_bkpf-awkey.
l_reversal-pstng_date = l_datum1.
l_reversal-fis_period = l_period.
l_reversal-comp_code  = ls_bkpf-bukrs.
l_reversal-reason_rev = reason_rev.
l_reversal-ac_doc_no  = ls_bkpf-belnr.
l_bus_act             = ls_bkpf-glvor.

CALL FUNCTION ‘BAPI_ACC_DOCUMENT_REV_POST‘
  EXPORTING
    reversal       = l_reversal
    bus_act        = l_bus_act
 IMPORTING
   obj_type        = l_obj_type
   obj_key         = l_obj_key
   obj_sys         = l_obj_sys
  TABLES
    return         = lt_return.

  READ TABLE lt_return INTO ls_return WITH KEY type = ‘E‘.
  IF sy-subrc NE 0.
    belnr     = l_obj_key+0(10).      "会计凭证
    comp_code = l_obj_key+10(4).      "公司代码
    gjahr     = l_obj_key+14(4).      "会计年度
    flag = ‘S‘.
    CALL FUNCTION ‘BAPI_TRANSACTION_COMMIT‘
      EXPORTING
        wait = ‘X‘.
  ELSE.
    CALL FUNCTION ‘BAPI_TRANSACTION_ROLLBACK‘.

    LOOP AT lt_return INTO ls_return WHERE type CA ‘AEX‘.
        MESSAGE ID     ls_return-id
                TYPE   ls_return-type
                NUMBER ls_return-number
                WITH   ls_return-message_v1 ls_return-message_v2
                       ls_return-message_v3 ls_return-message_v4
                       INTO lv_message.
        CONCATENATE message lv_message INTO message SEPARATED BY ‘|‘.
    ENDLOOP.
    SHIFT message LEFT DELETING LEADING  ‘|‘.
    flag = ‘E‘.
  ENDIF.

IF flag = ‘S‘.
PERFORM frm_insert_zmmt002 USING belnr comp_code gjahr ‘SA‘.
ENDIF.
ENDFORM.                    " FRM_REV_POST
时间: 2024-10-11 08:49:18

创建 会计凭证的相关文章

使用BAPI_ACC_DOCUMENT_POST,创建会计凭证 增强

业务需求:和银行做一个接口,要通过银行流水产生会计凭证,会计凭证的事务码是F-02,查到了BAPI方法 BAPI_ACC_DOCUMENT_POST. 昨天测试发现,有一些参数在BAPI_ACC_DOCUMENT_POST的输入和表参数中根本没有, 如 记账码Posting Key.原因代码Reason Code,那怎么把这些字段的值传进去呢? 在SDN查了一下相关问题的解决办法,发现遇到这个问题的朋友还挺多, 总结了一下,解决办法大体如下: 1.se11创建结构,必须包含行项目号POSNR字段

201704 F-02创建财务凭证

一.F-02 创建财务凭证-BDC 期初余额导入程序 程序:ZFIU_LDV_F_02_UPLOAD 创建F-02 凭证: *&---------------------------------------------------------------------------------------------------- CALL TRANSACTION 'F-02' USING it_bdcdata MODE mode_f UPDATE 'S' MESSAGES INTO it_bdcm

会计凭证BAPI_ACC_DOCUMENT_POST

*&---------------------------------------------------------------------* *& Report ZFIFB107 *& Description 薪酬计提批导开发 *&---------------------------------------------------------------------* *& 开发人员 时间 更改类型 描述 *& CR信息 *&---------

会计凭证原因代码增强

使用BAPI_ACC_DOCUMENT_POST 创建会计凭证,用BADI扩展 业务需求:和银行做一个接口,要通过银行流水产生会计凭证,会计凭证的事务码是F-02,查到了BAPI方法BAPI_ACC_DOCUMENT_POST.昨天测试发现,有一些参数在BAPI_ACC_DOCUMENT_POST的输入和表参数中根本没有,如记账码Posting Key.原因代码Reason Code,那怎么把这些字段的值传进去呢?在SDN查了一下相关问题的解决办法,发现遇到这个问题的朋友还挺多,总结了一下,解决

SD从零开始41-44

[原创] SD从零开始41 科目确定(Account determination) 使用科目确定Using Account Determination 你将需要在几个不同的领域确定将要记账的科目: 用于记账销售收入,销售扣除和增值税的总账科目在数据从billing document传输到FI时自动地确定: 当处理现金销售时,必须在凭证中设置一个总账科目用于现金结算(不会记账到客户账户): 到4.0版本时,可以确定一个不同于付款方客户主数据中输入的科目的统御科目: 当使用payment cards

模块 BAPI

MM模块1. BAPI_MATERIAL_SAVEDATA 创建物料主数据注意参数EXTENSIONIN的使用,可以创建自定义字段例如WA_BAPI_TE_MARA-MATERIAL = ITAB_UP-MATNR.T_EXTENSIONIN-STRUCTURE = 'BAPI_TE_MARA'.T_EXTENSIONIN-VALUEPART1 = WA_BAPI_TE_MARA.APPEND T_EXTENSIONIN.WA_BAPI_TE_MARAX-MATERIAL = ITAB_UP-M

BAPI

MM模块 1. BAPI_MATERIAL_SAVEDATA 创建物料主数据 注意参数EXTENSIONIN的使用,可以创建自定义字段 例如:WA_BAPI_TE_MARA-MATERIAL = ITAB_UP-MATNR. T_EXTENSIONIN-STRUCTURE = 'BAPI_TE_MARA'. T_EXTENSIONIN-VALUEPART1 = WA_BAPI_TE_MARA. APPEND T_EXTENSIONIN. WA_BAPI_TE_MARAX-MATERIAL = I

[SAP ABAP开发技术总结]业务对象和BAPI

目录导航 声明:原创作品,转载时请注明文章来自SAP师太博客,并以超链接形式标明文章原始出处,否则将追究法律责任!原文出自: 18.3.         业务对象和BAPI 184 18.3.1.     SAP业务对象(SWO1)... 184 18.3.1.1.           业务对象类型的组成... 185 18.3.1.2.           业务对象(BO)设计... 185 18.3.1.2.1.       创建业务表... 185 18.3.1.2.2.       创建

SAP 客户信贷重建一则

前段时间接到业务的一个需求,需要将标准和定制业务的信贷分开.原来目前公司是将标准和定制的客户信贷金额整在一起,共用一个信贷范围.而定制业务特殊性决定了公司要收到客户全款才会接单生产并发货,而客户打预收款的时候是不分标准和定制的. 为了解决这个问题,我这边给出的方案是新建定制的信贷范围,将标准和定制分开.在前端创建定制信息并传到SAP创建订单的时候通过创建会计凭证的方式将标准的预收款转移到定制的预收款.等于变相将定制业务的应收风险转嫁到标准业务上了. 首先在SAP后台配置一个新的信贷范围,并分配相