Skip to Content
author's profile photo Former Member
Former Member

Advanced Update Rules Routine

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!

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2005 at 01:16 PM

    I realize this may seem complicated at first glance so I just want to clarify;

    I just need to know how to write the code for step 3) and step 3a) for example.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 22, 2005 at 06:29 PM

    Define your temporary variable in the global area of the update routine and you should be good to go.

    I am assuming you are working within the same data package.

    Thanks

    Vineet

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2005 at 10:16 AM

    Hi Patrick,

    I am not sure what is in your ODS that you need as some kind of mapping table.

    One way of getting better performance for lookups during upload is to define a internal table (i.e. hash table) in the global part of the start routine. In the beginning you populate this table with the all possible required values from your mapping table (i.e. ODS). Now you can read the required value for each data record from this internal table (i.e. hashed table) by direct table key access. This is much faster than reading each time from the database.

    Regards

    Adios

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.