I have a routine in my update rule that performs a lookup to another ODS. To improve my performance I would like to try writing a temporary variable to memory that can then be referenced when loading each record. For example here's some pseudo code:
1) if vendor already exists then do nothing
2) set AP key and set Purchasing key for performing lookups
(ie: AP key = Company Code + FiscalYearPeriod + AccountingDocumentNumber)
(ie: Purchasing key = Company Code + FiscalYearPeriod + PurchasingDocumentNumber)
3) does temporary AP variable exist and does it match AP key?
3a) if yes then EXIT and return temporary AP variable
3b) if no then perform ap lookup based on AP key
3c) was lookup successful - was vendor found?
if yes then set temporary AP variable and EXIT and return value
if no then continue
4) does temporary Purchasing variable exist and does it match Purchasing key?
4a) if yes then EXIT and return temporary Purchasing variable
4b) if no then perform purchasing lookup based on Purchasing key
4c) was lookup successful - was vendor found?
if yes then set temporary Purchasing variable and EXIT and return value
if no then EXIT (Do nothing - essentially leave blank)
My question is 1) Whether it's indeed possible to pass this temporary variable and 2) can you give me a sample of code that I would use to read/write the variable?
Thanks so much!