Skip to Content
Author's profile photo Shalaka Golde

Reading Time Dependent Master Data using ‘Read Master Data’

Many a times we use the Rule Type ‘Read Master Data’ to perform a lookup on the master data infoobject to derive the value of one of its attribute.

However what if the attribute that we want to read from the Master data infoobject is time dependent? In such cases we can use the Time Dependent feature of Read master data.

So this is how it goes:

Suppose we have a scenario in which we want to read the Profit Center of a COPA document based on its posting date.The target does not contain the posting date field.

Now profit center (0PROFIT_CTR) is an attribute of 0COSTCENTER and it is time dependent.

What then can be done in this case? We can obviously write a start routine and store the values of the source table in an internal table declared globally and then read these values of posting date in the end routine from the internal table and compare them with the Valid To and Valid From fields from the Q table of the master data infoobject and get the corresponding profit center..

Field routines should not be preferred in such cases because they hit the database for every data record and that affects performance.

Now coming back to our read master data:

First we will map cost center to profit center .

Then under ‘Rule Type’ we will select Read Master data:

Capture.PNG

In From Attr.of we will insert 0COSTCENTER

Then we will click on the clock next to it which is Key date Determination.

And under Time Dependency Reading Master Data we will select Start

Capture.PNG

We will select Start and over there under from we will select the Time characteristic which in our case is Posting date.

Capture.PNG

Once this is done we will do the following changes in IO Assignment:

Capture.PNG

Once this is done we will check whether our ‘Read master data’ is really working.

Below is our Cost Center master data:

For Cost Center 99991234 the Profit Center is D7209 from 01.01.2007-30.06.2013

and it is E7209 from 01.07.2013-31.12.9999

Capture.PNG

Now we will test whether our rule is working.For that we will click on Test Rule and enter the following values:

Capture.PNG

And Voila! this works.As you can see above I added Posting date as 01.07.2007 which falls in the range 01.01.2007-30.06.2013 and its corresponding profit center is D7209.

So go ahead and give this a try.

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Sreelatha kokkanti
      Sreelatha kokkanti

      Hi Shalaka,

      I have a doubt here which may be very basic. Should the master data be in sorted order?

      If E7209 profit center data record precedes the D7209 record, then  for Cost Center 99991234 E7209 record is picked up instead of D7209.

      Does it pull the record based only on Start Date i.e., = Start Date or > Start date?