**1.获取抬头参数, documentheader **2.项目参数 accountgl = lt_acgl"G/L account item accountreceivable = lt_acar"Customer Item accountpayable = lt_acap"Vendor Item currencyamount = lt_aamt"货币金额 *返回参数 return = lt_retn. **3.BAPI 凭证过账,, **凭证数据检查-防止跳号 CLEAR: ls_retn,lt_retn[]. CALL FUNCTION ‘BAPI_ACC_DOCUMENT_CHECK‘ EXPORTING documentheader = ls_ache TABLES accountgl = lt_acgl accountreceivable = lt_acar accountpayable = lt_acap return = lt_retn. READ TABLE lt_retn INTO ls_retn WITH KEY type = ‘E‘. IF SY-SUBRC = 0. LOOP AT lt_retn INTO ls_retn WHERE type = gc_e OR type = gc_a. CHECK ls_retn-id <> ‘RW‘. MESSAGE ID ls_retn-id TYPE ls_retn-type NUMBER ls_retn-number WITH ls_retn-message_v1 ls_retn-message_v2 ls_retn-message_v3 ls_retn-message_v4 INTO gs_out-message. EXIT. ENDLOOP. ELSE. CLEAR: ls_retn,lt_retn[]. CALL FUNCTION ‘BAPI_ACC_DOCUMENT_POST‘ EXPORTING documentheader = ls_ache IMPORTING obj_key = lv_key TABLES accountgl = lt_acgl"G/L account item accountreceivable = lt_acar"Customer Item accountpayable = lt_acap"Vendor Item currencyamount = lt_aamt"货币金额 return = lt_retn. READ TABLE lt_retn INTO ls_retn WITH KEY type = E. IF SY-SUBRC EQ 0. CALL FUNCTION ‘BAPI_TRANSACTION_COMMIT‘. MESSAGE = 处理成功 BELNR = lv_key+0(10). 抓取返回字段. ELSE. CALL FUNCTION ‘BAPI_TRANSACTION_ROLLBACK‘. MESSAGE = 处理出错 BELNR = 抓取错误消息. ENDIF. ENDIF. BAPI_ACC_DOCUMENT_POST FG:ACC9 Accounting:bapis short text Accounting posting import- 输入参数 短文本 DOCUMENTHEADER LIKE BAPIACHE09 Header CUSTOMERCPD LIKE BAPIACPA09 One-time customer CONTRACTHEADER LIKE BAPIACCAHD 、、、 TABLES: ACCOUNTGL LIKE BAPIACGL09 G/L account item ACCOUNTRECEIVABLE LIKE BAPIACAR09 Customer Item ACCOUNTPAYABLE LIKE BAPIACAP09 Vendor Item ACCOUNTTAX LIKE BAPIACTX09 Tax item CURRENCYAMOUNT LIKE BAPIACCR09 Currency Items CRITERIA LIKE BAPIACKEC9 CO-PA Account Assignment Characteristics VALUEFIELD LIKE BAPIACKEV9 CO-PA Account Assignment Value Fields EXTENSION1 LIKE BAPIACEXTC Container for ‘Customer Exit‘ Parameter RETURN LIKE BAPIRET2 Return parameter PAYMENTCARD LIKE BAPIACPC09 Payment Card Information CONTRACTITEM LIKE BAPIACCAIT Additional Contract Accounts Recieviable and Payable Document Line Item EXTENSION2 LIKE BAPIPAREX Reference Structure for BAPI Parameters EXTENSIONIN/EXTENSIONOUT REALESTATE LIKE BAPIACRE09 Real Estate Account Assignment Data ACCOUNTWT LIKE BAPIACWT09 Withholding tax information for FI Interface gs_out-sqdno e_awtyp = ‘BKPFF‘. e_awkey = ‘$‘. CALL FUNCTION ‘OWN_LOGICAL_SYSTEM_GET‘ IMPORTING own_logical_system = log_sys EXCEPTIONS own_logical_system_not_defined = 1 OTHERS = 2. IF sy-subrc IS INITIAL. e_awsys = log_sys. ENDIF. LOGICAL_SYSTEM_GET. LOG_SYS CDRCLNT710 DOCUMENT_HEADER-BUS_ACT RFBU * OBJ_TYPE, OBJ_KEY und USERNAME GS_AW-AWTYP BKPFF GS_AW-AWREF $ GS_BAPI_ACCHD-USERNAME C_XIANGC
相关文章
- 【从0到1,搭建Spring Boot+RESTful API+Shiro+Mybatis+SQLServer权限系统】02、创建新的SpringBoot项目
- IDEA02 利用Maven创建Web项目、为Web应用添加Spring框架支持、bean的创建于获取、利用注解配置Bean、自动装配Bean、MVC配置
- cxf的使用及安全校验-02创建简单的客户端接口
- VMD_EI_API=>MAINTAIN_BAPI 去创建供应商主数据
- SpringBoot+Vue豆宝社区前后端分离项目手把手实战系列教程02---创建后端工程
- ASP.NET MVC异步验证是如何工作的02,异步验证表单元素的创建
- DEMO: MIRO 根据物料创建贷项凭证BAPI_INCOMINGINVOICE_CREATE
- 大数据学习day19-----spark02-------0 零碎知识点(分区,分区和分区器的区别) 1. RDD的使用(RDD的概念,特点,创建rdd的方式以及常见rdd的算子) 2.Spark中的一些重要概念
- 创建预留BAPI:BAPI_RESERVATION_CREATE1
- python并发编程-进程间通信-Queue队列使用-生产者消费者模型-线程理论-创建及对象属性方法-线程互斥锁-守护线程-02