cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert DEC value to Date

Former Member
0 Kudos

Hello experts,

In BPS, I wanted to accept Date value with Layout settings 'From Transaction Data' so I created one 'Key figure - ZPOSTDT' of type 'DATE' with DEC as Data type.

When user enters value, ZPOSTDT field accepts it as a Date and stores in the Transactional cube as DECIMAL value.

But I want to use ZPOSTDT value as Date in my report.

I have searched in Forum to convert Decimal to Date but no direct CODE SNIPPET or FUNCTION MODULE is available.

I tried to convert DEC to STRING and then to DATE but it is also not giving me desired result.

Please tell me how to do it in ABAP code?

Regards,

Priyanka Joshi

Accepted Solutions (1)

Accepted Solutions (1)

former_member93896
Active Contributor

Hi Priyanka,

it's simpler than you think.


data: l_date_dec(9) type p decimals 2, l_date type d.
l_date_dec = '733373.00'.
l_date = l_date_dec. 
* now l_date = '20081126'.

Regards,

Marc

SAP NetWeaver RIG

Former Member
0 Kudos

Hello Sir,

Thank you so much for solution.

Regards,

Priyanka Joshi

Former Member
0 Kudos

Hi Marc :

I have quick question for you. We have connected the Shopping Cart cube in BW to Tableau using the Tableau connector.  The date is stored as a Key figure in the cube.  In Tableau I see the date January, 17, 2014 as 735,251 as it is stored in the cube. How do I convert it back into a date format outside of SAP ?  I need the logic so that I can do the same in SQL within Tableau.

For example:  How do I convert 735,251 to 20140117 (January 17,2014) ?

Your help is greatly appreciated.

Best,

Jay

Answers (0)