简体   繁体   中英

How to create LONGTEXTS with BAPI_QUALNOT_CREATE in SAP?

I am using BAPI_QUALNOT_CREATE in JCo to create a quality notification and it works. The only thing that does not work is the creation of LONGTEXTS.

I am using the following code:

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)
} 

But the text never appears in the quality notification. What is wrong with my code?

Objtyp and objkey are not populated in the code which are mandatory therefore try below corrected code.

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)
}  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM