当前位置:网站首页>ABAP 代码中读取会计科目的字段状态(隐藏、可选、必输)
ABAP 代码中读取会计科目的字段状态(隐藏、可选、必输)
2022-07-25 23:30:00 【rogerix4】
1. 问题
- 使用BAPI POSTING_INTERFACE_CLEARING 进行清账的时候,由于标准程序使用BDC清账,而且不同科目ZFBDT字段状态不一致会导致清账失败
- 字段隐藏时,不能赋值BDC字段ZFBDT,否则抛出异常

2. 解决方案(ABAP中判断科目字段状态,动态赋值)
FM:FI_FIELD_SELECTION_DETERMINE 可读取对应会计科目字段的状态

DATA: l_faus1 TYPE tbsl-faus1, l_faus2 TYPE tbsl-faus2. "Determine G/L Account Field status CALL FUNCTION 'FI_FIELD_SELECTION_DETERMINE' EXPORTING i_bschl = <fs_oa001>-bschl i_bukrs = <fs_oa001>-bukrs i_saknr = <fs_oa001>-hkont IMPORTING e_faus1 = l_faus1 e_faus2 = l_faus2 EXCEPTIONS customizing = 1 OTHERS = 2. IF l_faus1+4(1) NE '-'. populate_ftpost 'P' acc_item 'BSEG-ZFBDT' <fs_oa001>-budat. ""到期日计算的基限日期 = 凭证中的记账日期 ENDIF.FI_FIELD_SELECTION_DETERMINE函数 返回 E_FAUS1 参数存放字段状态;每一个字符代表一个字段状态
- “+” 代表必输
- “-” 代表隐藏
- “.” 代表可选

字段状态维护通过OBC4->表T004F OB41->表TBSL;共同作用

由于 FI_FIELD_SELECTION_DETERMINE 函数读取出来的是状态标识;可在表 TMODU TMODP 中查到对应关系
- 会计科目字段排序:FAUNA = “SKB1-FAUS1” "KOART = “S”
- 查到的TMODU-MODIF的值表示当前字段(TMODU-FELDN)在 E_FAUS1的位置引用;例如:
- E_FAUS1+0(1) =“.” 表示字段ZUONR的字段状态为可选
- E_FAUS1+4(1) =“-” 表示字段ZFBDT的字段状态为隐藏



边栏推荐
- The VM session was closed before any attempt to power it on
- Summary of built-in instructions and custom instructions
- How does PHP remove an element from an array based on the key value
- Anaconda installation tutorial environment variables (how to configure environment variables)
- This point inside the function / change this point inside the function
- Source code of YY music wechat applet imitating Netease cloud music
- 学习探索-3d轮播卡片
- initializer_list工具库学习
- Which securities firm is the best and safest for beginners to open an account
- Implementation of mesh parameterized least squares conformal maps (3D mesh mapping to 2D plane)
猜你喜欢

General paging function

How to set pseudo static for WordPress fixed links

Take away applet with main version of traffic / repair to add main access function of traffic

多模态——Deep Multi-Modal Sets

POI special effects Market Research

动态内存管理

Network Security Learning notes-1 file upload

学习探索-3d轮播卡片

Several commonly used traversal methods

Dynamic memory management
随机推荐
【MUDUO】Thread封装
1913. Maximum product difference between two number pairs - no sorting required
[code case] blog page design (with complete source code)
Serialize operator
POI特效 市场调研
从哪些维度评判代码质量的好坏?如何具备写出高质量代码的能力?
762. Prime number calculation setting in binary representation
Kotlin 常用知识点汇总
Promise asynchronous callback function
[QNX hypervisor 2.2 user manual]9.7 generate
Several commonly used traversal methods
PHP wechat scan code, follow official account and authorize login source code
Recursion of function (use recursion to find the factorial of 1-N) (use recursion to find Fibonacci sequence) (use recursion to traverse data)
ASP date function (what if the disk function is incorrect)
numeric学习之iota,accumulate
What is a physical firewall? What's the effect?
【MUDUO】EventLoop事件循环
Learning exploration-3d rotation card
【MUDUO】EventLoopThreadPool
XxE & XML external entity injection utilization and bypass