java - 如何在 SAP 中使用 BAPI_QUALNOT_CREATE 创建 LONGTEXTS?
问题描述
我在 JCo 中使用 BAPI_QUALNOT_CREATE 来创建质量通知并且它有效。唯一不起作用的是 LONGTEXTS 的创建。
我正在使用以下代码:
JCoTable tblText = function.getTableParameterList().getTable("LONGTEXTS")
if (tblText == null) {
throw new Exception("...")
}
def rowNo = 0
tblText.appendRows(meldungsTextLang.size())
for (String text : meldungsTextLang) {
if (text != null && text.length() > 132) text = text.substring(0, 132)
tblText.setRow(rowNo++)
tblText.setValue("FORMAT_COL", "*")
tblText.setValue("TEXT_LINE", text)
}
但是文本永远不会出现在质量通知中。我的代码有什么问题?
解决方案
Objtyp 和 objkey 未填充在强制的代码中,因此请尝试以下更正的代码。
JCoTable tblText = function.getTableParameterList().getTable("LONGTEXTS")
if (tblText == null) {
throw new Exception("...")
}
def rowNo = 0
tblText.appendRows(meldungsTextLang.size())
for (String text : meldungsTextLang) {
if (text != null && text.length() > 132) text = text.substring(0, 132)
tblText.setRow(rowNo++)
tblText.setValue("OBJTYP","QMSM")
tblText.setValue("OBJKEY","1")
tblText.setValue("FORMAT_COL", "*")
tblText.setValue("TEXT_LINE", text)
}
推荐阅读
- mysql - 访问和刷新令牌存储在后端的什么位置?
- docker - Docker 使用已经创建的卷启动一个容器
- python - Python:找到可以作为多集和的最大数?
- java - 菜单在Java中不断重复
- javascript - 获取请求导致双重获取请求?
- python - Google Vision API - 使用 URL 运行显式内容检测(安全搜索)
- reactjs - 在反应功能组件中使用相同代码时缺少按钮
- python - Python:如何通过一些字符串连接将每个字符串拆分为新行
- excel - 将整个 Excel 工作表更改为“文本”单元格格式 XLRD
- json - Logstash:如何在不知道键名的情况下提取对象