标签:记录 nbsp lin else 活动 字段 插入 auth tables
https://blog.csdn.net/z_x_xing_/article/details/90514715
GL_ACCT_MASTER_SAVE 创建总账科目
前台事务代码:FS00
函数功能描述
创建、修改、删除总账科目,且可测试运行
DATA: LS_ACCOUNT_COA TYPE GLACCOUNT_COA,
LS_ACCOUNT_COA_KEYY TYPE GLACCOUNT_COA_KEY,
LS_ACCOUNT_COA_DATA TYPE GLACCOUNT_COA_DATA,
LS_ACCOUNT_COA_INFO TYPE GLACCOUNT_COA_INFO,
LT_ACCOUNT_NAMES TYPE GLACCOUNT_NAME_TABLE,
LS_ACCOUNT_NAMES TYPE GLACCOUNT_NAME,
LS_ACCOUNT_NAMES_KEYY TYPE GLACCOUNT_NAME_KEY,
LS_ACCOUNT_NAMES_DATA TYPE GLACCOUNT_NAME_DATA,
LT_ACCOUNT_CCODES TYPE GLACCOUNT_CCODE_TABLE,
LS_ACCOUNT_CCODES TYPE GLACCOUNT_CCODE,
LS_ACCOUNT_CCODES_KEYY TYPE GLACCOUNT_CCODE_KEY,
LS_ACCOUNT_CCODES_DATA TYPE GLACCOUNT_CCODE_DATA,
LS_ACCOUNT_CCODES_INFO TYPE GLACCOUNT_CCODE_INFO,
LT_RETURN TYPE TABLE OF BAPIRET2 WITH HEADER LINE.
*--------------------------------------------------------------------*
LS_ACCOUNT_COA_KEYY-KTOPL = P_KTOPL."帐目表
LS_ACCOUNT_COA_KEYY-SAKNR = P_SAKNR."总账科目
LS_ACCOUNT_COA_DATA-KTOKS = P_KTOKS."总帐科目组
LS_ACCOUNT_COA_DATA-GVTYP = ‘X‘. "损益报表科目类型
LS_ACCOUNT_COA_INFO-ERDAT = SY-DATUM."记录创建日期
LS_ACCOUNT_COA_INFO-ERNAM = SY-UNAME."创建对象的人员名称
LS_ACCOUNT_COA_INFO-SAKAN = P_SAKNR. "总账科目
LS_ACCOUNT_COA-ACTION = ‘I‘."数据记录活动:I/插入;U/修改;D/删除
LS_ACCOUNT_COA-KEYY = LS_ACCOUNT_COA_KEYY.
LS_ACCOUNT_COA-DATA = LS_ACCOUNT_COA_DATA.
LS_ACCOUNT_COA-INFO = LS_ACCOUNT_COA_INFO.
*--------------------------------------------------------------------*
LS_ACCOUNT_NAMES_KEYY-KTOPL = P_KTOPL. "帐目表
LS_ACCOUNT_NAMES_KEYY-SAKNR = P_SAKNR. "总账科目
LS_ACCOUNT_NAMES_KEYY-SPRAS = SY-LANGU. "语言代码
LS_ACCOUNT_NAMES_DATA-TXT20 = P_SAKNR && ‘测试‘. "总帐科目名称
LS_ACCOUNT_NAMES_DATA-TXT50 = P_SAKNR && ‘测试长文本‘."总账科目长文本
LS_ACCOUNT_NAMES-ACTION = ‘I‘. "数据记录活动:I/插入;U/修改;D/删除
LS_ACCOUNT_NAMES-KEYY = LS_ACCOUNT_NAMES_KEYY.
LS_ACCOUNT_NAMES-DATA = LS_ACCOUNT_NAMES_DATA.
APPEND LS_ACCOUNT_NAMES TO LT_ACCOUNT_NAMES.
*--------------------------------------------------------------------*
LS_ACCOUNT_CCODES_KEYY-BUKRS = ‘1000‘. "公司代码
LS_ACCOUNT_CCODES_KEYY-SAKNR = P_SAKNR."总账科目
LS_ACCOUNT_CCODES_DATA-WAERS = ‘CNY‘. "货币
LS_ACCOUNT_CCODES_DATA-FSTAG = ‘1000‘."字段状态组
LS_ACCOUNT_CCODES_INFO-ERDAT = SY-DATUM."记录创建日期
LS_ACCOUNT_CCODES_INFO-ERNAM = SY-UNAME."创建对象的人员名称
LS_ACCOUNT_CCODES-ACTION = ‘I‘. "数据记录活动:I/插入;U/修改;D/删除
LS_ACCOUNT_CCODES-KEYY = LS_ACCOUNT_CCODES_KEYY.
LS_ACCOUNT_CCODES-DATA = LS_ACCOUNT_CCODES_DATA.
LS_ACCOUNT_CCODES-INFO = LS_ACCOUNT_CCODES_INFO.
APPEND LS_ACCOUNT_CCODES TO LT_ACCOUNT_CCODES.
CALL FUNCTION ‘GL_ACCT_MASTER_SAVE‘
EXPORTING
TESTMODE = ‘‘
NO_SAVE_AT_WARNING = ‘X‘
* NO_AUTHORITY_CHECK =
* STORE_DATA_ONLY =
TABLES
ACCOUNT_NAMES = LT_ACCOUNT_NAMES
* ACCOUNT_KEYWORDS =
ACCOUNT_CCODES = LT_ACCOUNT_CCODES
RETURN = LT_RETURN
CHANGING
ACCOUNT_COA = LS_ACCOUNT_COA.
READ TABLE LT_RETURN WITH KEY TYPE = ‘E‘.
IF SY-SUBRC = 0.
MESSAGE E000(ZFI) WITH LT_RETURN-MESSAGE.
ELSE.
CALL FUNCTION ‘BAPI_TRANSACTION_COMMIT‘
EXPORTING
WAIT = ‘X‘.
ENDIF.
原文:https://blog.csdn.net/z_x_xing_/article/details/90514715
TR-FS00会计科目创建GL_ACCT_MASTER_SAVE
标签:记录 nbsp lin else 活动 字段 插入 auth tables
原文地址:https://www.cnblogs.com/ricoo/p/11167885.html