设为首页 收藏本站
查看: 1011|回复: 0

[经验分享] SAP BW: Replacement Path Variables

[复制链接]

尚未签到

发表于 2015-9-21 13:14:21 | 显示全部楼层 |阅读模式
How to use Replacement Path Variables to perform Date Calculations
  A Step-by-Step guide
  Have you ever wanted to perform calculations using dates defined as characteristics but have never worked out how it can be done? Replacement Path Variables are the key.
  Using Replacement Path in your Text and Formula variables, replace values held in a characteristic. The Characteristic value variables are replaced by the results of a query at run-time.
  The steps detailed below show a technique to enable a BEx query user to determine the number of days between two dates.
  Scenario:
The group HR administrator wants a detailed line item report that lists all employee absences in a given period. The report is to show the employee number, the absence start date, together with the end date of the absence and show the number of calendar days the employee was absent.
  The good thing about using this technique is that no redesign work is needed from your technical BW team, no ABAP is involved and best of all, it quick and easy.
  Solution:
For this example I created an ODS object called Absence that holds basic employee information along with individual absence record data.
  Follow the steps below:

  • Open the BEx Query Designer and create a new report on your chosen InfoProvider.
  • Drag the Employee, Valid from and Valid to characteristics into the Rows section of the screen. If needed, apply data selection restrictions to the characteristics as shown in Figure 1.
  • Right click on the Key Figures structure and select New Formula (Figure 1).

    DSC0000.jpg Figure 1
  • In the new formula window right click on Formula Variable and choose New Variable ( Figure 2 ).

    DSC0001.jpg Figure 2
  • The Variables Wizard will launch and will require you to specify the variable details.
    ( Click the NEXT button if the Introduction screen appears )
  • Enter the variable details on the General Information as shown in Figure 3 .
    Enter the Variable Name , Description and select Replacement Path in the Processing by field.
    Click the Next Button.

    DSC0002.jpg Figure 3
  • In the Characteristic screen (Figure 4) select the date characteristic that represents the first date to use in the calculation (From Date).
    Click the Next Button.

    DSC0003.jpg Figure 4
  • In the Replacement Path screen (Figure 5) select Key in the Replace Variable with field. Leave all the other options as they are (The offset values will be set automatically).
    Click the Next Button.

    DSC0004.jpg Figure 5
  • In the Currencies and Units screen (Figure 6) select Date as the Dimension ID.
    Click the Next button.

    DSC0005.jpg Figure 6
  • The Save Variable screen (Figure 7) displays a summary of the new variable.
    Click on the Finish button to save the variable.

    DSC0006.jpg Figure 7
  • Repeat steps 4 to 11 to create a second variable for the second date to be used in the calculation. In the example shown, the characteristic 0DATETO is used to create the variable ABSEND (Absence End Date).
Define the Calculation
  We can now use our two new replacement variables to define our new calculated key figure that generates the number of absence days for each record.

  • You will now be back at the New Formula screen (Figure 8). Drag and drop the two new variables into the formula section of the screen and insert the subtract sign (“-“) between the two.
  • Give the new formula a description and click the formula syntax check button DSC0007.jpg to ensure the formula is valid.

    DSC0008.jpg Figure 8
  • The new calculated key figure will now show in the columns section of the BEx query designer (Figure 9).

    DSC0009.jpg Figure 9
  • Save the query and execute it.
  In the example shown the Number of Calendar Days Absent is calculated correctly. See the table of results below.
  
EmployeeValid FromValid ToNumber of Calendar
Days Absent5000000117/04/200421/04/200445000000216/07/200429/09/2004135000000307/01/200409/02/2004335000000404/08/200405/08/20041

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-116782-1-1.html 上篇帖子: SAP Organization Structure 下篇帖子: SAP BPC最佳实践-在BPC NW中何时使用Shared Query Engine BADI
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表