Reading Time Dependent Master Data using 'Read Master Data'

本文介绍如何利用SAP Business Warehouse中的ReadMasterData功能读取时间依赖的主数据属性。通过实例演示了如何根据凭证日期查找成本中心对应的利润中心,包括配置步骤与测试验证。

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.

 
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值