cancel
Showing results for 
Search instead for 
Did you mean: 

Aging calculation in report

Former Member
0 Kudos

Hi Friends,

I have a field 'CREATION_DATE' in the data provider.

I have to populate the 'Aging' field as follows...

AGING = Days between Current Date and Creation date.

can anyone please help me on this.

Thanks in Advance.

Regards,

Ravish

Accepted Solutions (1)

Accepted Solutions (1)

former_member209702
Active Participant
0 Kudos

Hi,

You ca do this at 2 levels:

1. At transformation level:

Create a formula in transformation for field "Aging" as shown below:

(sy-datum ) - 'CREATION_DATE'

Note : You can get field SY-DATUM (Current System Date) in the the list of available fields in the formula editor.

If you create formula at transformation level, this will show the aging based on the data loading date.

2. At Query Level

Create a formula in rows/columns for field "Aging" as shown below:

0F_ADAY - 'CREATION_DATE'

Note: 0F_ADAY is a SAP delivered formula variable which gives current calendar day at query level.

You will need to activate this business content before use,

Regards,

Geetanjali

Former Member
0 Kudos

Hi Geethanjali,

Does 0F_ADAY we need to take into our whole dataflow (ODS > CUBE-> Multiprovider) or else we can directly call 0F_ADAY at the report level.

Regards,

Ravish

former_member209702
Active Participant
0 Kudos

Hi,

0F_ADAY is a formula variable which is available at query level in formula editor under "Forumla Variables" in available fields for formula creation.

We do not need to add 0F_ADAY in data flow.

Regards,

Geetanjali

Former Member
0 Kudos

HI Geetanjali,

I am using SAP_BW 701 with Support pack SAPKW70108 and BI_CONT 704 with Support pack SAPK-70408INBICONT.

Thank you, But i didn't find 0F_ADAY either in Formula variable list at query level.

Neither in the bussiness Content , Query Components. is it service pack issue. please let me know.

can we create our own variable as same as 0F_ADAY, please let me know for steps in creating it.

Thank you for your kind support.

former_member209702
Active Participant
0 Kudos

Hi Ravish,

The 0F_ADAY is available in BI Contents under Query Elements > Variables.

Please check if its available in your system if not then we will need to create a custom exit variable for this.

Regards,

Geetanjali

former_member209702
Active Participant
0 Kudos

Hi Ravish,

Better to go with SAP delivered variable.

If its not available here is the code that we can use for customer exit:

WHEN <Variable for calday>.
 
DATA: ZLOW(8) TYPE C,

CLEAR L_S_RANGE.

L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
L_S_RANGE-LOW = SY-DATUM.

APPEND L_S_RANGE TO E_T_RANGE.

Regards,

Geetanjali

Former Member
0 Kudos

HI Geetanjali,

I have checked in Query Elements --> Variables, but i didnt find it.

Please let me know the steps for creating the custom variable.

regards,

Ravish

former_member209702
Active Participant
0 Kudos

Hi Ravish,

Refer following document for the process along with detailed screenshots of creating customer exit variables:

[http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f002c608-2533-2c10-25a1-d0e7f7b5b662?QuickLink=index&overridelayout=true|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f002c608-2533-2c10-25a1-d0e7f7b5b662?QuickLink=index&overridelayout=true]

You can also refer following SAP help document for further details regarding Customer Exits:

[http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a56f5e09411d2acb90000e829fbfe/frameset.htm|http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a56f5e09411d2acb90000e829fbfe/frameset.htm]

Note:

In the code you can use the code given in my earlier posts.

Regards,

Geetanjali

ravi_chandra3
Active Contributor
0 Kudos

HI Ravichandra ,

It's better to use formula variable than using the customer exit. just create the CKF using the formula todays' date - creation date.

because i too created the same report. i solved that issue using the CKF as said above.

Hope it helps,

Thanx & Regards,

RaviChandra

Former Member
0 Kudos

Hi Geetanjali,

Thank you for the kind support, But i am having some issue in using it.. please help me this.

I have created the customer exit varable for today's date (YTDY_DAT). CREATED_DATE is characteristic.

If i create the formula, i am unable to add CREATED_DATE in the formula. If i create the CKF also i have same issue.

Is there any way to sort it out

former_member209702
Active Participant
0 Kudos

Hi,

Create a formula for Aging as:

YTDY_DAT - FV_CREATED_DATE

Here,

FV_CREATED_DATE -> Formula variable

To create this formula variable, in the Formula Editor, in the list where all availabe KFs are listed you can see a node for "Formula Variable".

Right click on it and create a formula variable for CREATED_DATE as FV_CREATED_DATE.

Use replacement path for this formula variable and in details for the replacement path provide replace with key and infoObject as CREATED_DATE.

Regards,

Geetanjali

Former Member
0 Kudos

Thank you very much geetanjali.

Problem is solved

Answers (1)

Answers (1)

former_member360228
Contributor
0 Kudos

Hi,

You can create a CKF in which the system date can be calculated using a formula variable by processing mode - customer exit, and subtract the creation date from that in the CKF to get the aging. You can use replacement path on creation date or have it as a key-figure present in the back-end, the choice is yours.

Regards,

Arminder Singh

Former Member
0 Kudos

Hi Arminder,

Thank you, But can you please help in the creation of CKF using customer exit........Any steps will be very helpful.

i am new to BI, need help.

Thanks & Regards,

Ravish