Question Help with ICSP.keyindex

Status
Not open for further replies.

LarryC

New Member
Our company recently upgraded from 10.0B to 11.1. In 10.0B I used the following code to create new records in the database:
Code:
PROCEDURE AddProd:
    DEFINE INPUT PARAMETER aprod LIKE icsp.prod.
    DEFINE INPUT PARAMETER adescrip1 LIKE icsp.descrip[1].
    DEFINE INPUT PARAMETER adescrip2 LIKE icsp.descrip[2].
    DEFINE INPUT PARAMETER adescrip3 LIKE icsp.user10.
    DEFINE INPUT PARAMETER alookupnm LIKE icsp.lookupnm.
    DEFINE INPUT PARAMETER aunitsell LIKE icsp.unitsell.
    DEFINE INPUT PARAMETER astempart LIKE icsp.user3.
    DEFINE INPUT PARAMETER acatpart LIKE icsp.user4.
    DEFINE INPUT PARAMETER asupplier LIKE icsp.user5.
    DEFINE INPUT PARAMETER akittype LIKE icsp.kittype.
    DEFINE INPUT PARAMETER akitroll LIKE icsp.kitrollty.
    DEFINE INPUT PARAMETER abodxfer LIKE icsp.bodtransferty.
    DEFINE INPUT PARAMETER atiecomp LIKE icsp.tiedcompprt.
    DEFINE INPUT PARAMETER strProdCat LIKE icsp.prodcat.
    DEFINE INPUT PARAMETER statustype LIKE icsp.statustype.
DEFINE VARIABLE strKeyIndex AS CHARACTER NO-UNDO.
DEFINE VARIABLE n AS INTEGER INITIAL 1 NO-UNDO.
DEFINE VARIABLE i AS INTEGER  NO-UNDO.
ASSIGN i = LENGTH(aprod).
If i >= 9 then
    assign i = 9.
    Do While n <= i:
        assign strKeyIndex = strKeyIndex + "p" + string(n) + "_" + substring(replace(replace(aprod,"-","_"),"/","_"),n,1,"CHARACTER") + " ".
        n = n + 1.
    end.
    CREATE ICSP.
    ASSIGN icsp.prod = aprod
           icsp.descrip[1] = adescrip1
           icsp.descrip[2] = adescrip2
           icsp.user10 = adescrip3
           icsp.lookupnm = aprod
           icsp.lookupnm = alookupnm
           icsp.unitsell = aunitsell
           icsp.unitstock = aunitsell
           icsp.unitcnt = aunitsell
           icsp.prodcat = strProdCat
           icsp.kittype = akittype
           icsp.kitrollty = akitroll
           icsp.bodtransferty = abodxfer
           icsp.tiedcompprt = atiecomp
           icsp.cono = 1
           icsp.enterdt = today
           icsp.statustype = statustype
           icsp.user3 = astempart
           icsp.user4 = acatpart
           icsp.user5 = asupplier
           icsp.priceonty = "L"
           icsp.ICSPECRECNO = 1
           icsp.keyindex = "sxcono_1 sxkt_ sxpcat_" + strProdCat + " sxlkup_" + replace(replace(aprod,"-","_"),"/","_") +
                           " sxprod_" + replace(replace(aprod,"-","_"),"/","_") + " " + replace(replace(aprod,"-","_"),"/","_") + " " + strKeyIndex + " " + replace(replace(aprod,"-","_"),"/","_") + " " +
                           strProdCat + " " + replace(replace(replace(adescrip1,"/","_"),",","_"),"-","_") +
                           replace(replace(replace(adescrip2,"/","_"),",","_"),"-","_") + " ".
         if  akittype = "b" then
             assign icsp.exponinvfl = yes.
I'm hoping someone can shed light on the code required for 11.1. I'm not the author of the code above and thus far I have been able to convert most of my other snippets to work with 11.1 but the keyindex fields for ICSP and ICSW have eluded me thus far. Can anyone shed some light or loan me their magic decoder ring? :)

Thanks,

Larry
 
Status
Not open for further replies.
Top