cancel
Showing results for 
Search instead for 
Did you mean: 

Formula variable to get Month/year variable in BEX

former_member522325
Participant
0 Kudos

Hi All,

I have a requirement to show previous month/current year based on system date e.g. today date is 01.10.2014, my variable should show 09.2014.

To achive above, I have created formula variable with customer exit as processing type and choose date under curreny/unit dimension, output shows 0/0/000. If choose time it is showing time format

Pleae give some inputs.

Regards

Naani

Accepted Solutions (0)

Answers (6)

Answers (6)

anshu_lilhori
Active Contributor
0 Kudos

Naani,In my eyes you can get the month and year from date using formula variable with replacement path but the format will not be like this 09.2014 it will be in number format.

Reason we do not have month dimension under currency/unit tab in formula variable.

Hope this helps.

Regards,

AL

former_member522325
Participant
0 Kudos

Hi All, Thanks for your feedback.

My requirements is to create formula variable to use in columns, the problem is

If I choose date under curreny/unit dimension, output shows 0/0/000. If choose time it is showing time format 

Please give some inputs.

Regards

Naani.


Former Member
0 Kudos

Hi Naani,

Donot consider any value from Currency/Unit Dimension. Try and let us know the result.

KodandaPani_KV
Active Contributor
0 Kudos

Hi,

under the currency/unit dimension use the number then check it out the results.

Former Member
0 Kudos

Hi, As our friends suggested, this can be achieved without using customer exit. Create Formula variable on month with replacement path. In replacement Tab, select replace variable with and provide your input variable name there and set offset start as '0' and offset length as '6' ,since system considers date as 20141001. Your result will be 10.2014 and offset -1 will give 09.2014. Hope this helps.

Regards,

Dinkar Adem

KodandaPani_KV
Active Contributor
0 Kudos

Hi,

otherwise use the 0CMLMON standard variable.

if not there activate the form BI content.

OR createt the varibale on 0calmont use the offset vatiable give the -30 value.

please look at the doc for standard variables.

Thanks,

Phani.

KodandaPani_KV
Active Contributor
0 Kudos

Hi,

above requirment not required customer exit,

you can easely acheive the creating formula variabls and using the offset functions in formula variables.

please look at above document.

Thanks,

Phani.

former_member209606
Participant
0 Kudos

Hi Naani,

create the variable for 0CALMONTH field, & include the below code in your  customer exit and  get the required output format.

date = sy-datum.

year = date+0(4).

  month = idate+4(2).

if month = 1.

      month  = 12.

      year = year - 1.


else.

month = month - 1.

endif.

CONCATENATE year month '1' INTO l_s_var_range-high.

Regards

Sureshkumar C.

Former Member
0 Kudos

This article solves your requirement

Check it out