1

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?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
SipCat
  • 47
  • 1
  • 8

1 Answers1

0

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)
}  
Umar Abdullah
  • 1,282
  • 1
  • 19
  • 37
  • It's `OBJTYPE` with a final `E` (not `OBJTYP`/the documentation has a typo). `QMSM` is only for a notification "task", it could be other values depending on the parameter NOTIF_TYPE. Currently, we don't know what type of notification SipCat wants to create. – Sandra Rossi Feb 18 '19 at 07:59