Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

e_monate result in FM "Months_between_two_dates"

Former Member
0 Kudos

Hi,

i have a problem with the result of FM Months_between_two_dates. I call these function in my SAP BW transformation in form of a key figure routine. My dates have the type f.e. 20090101. The result of executing the transformation is, that I get the value 0.00 in this Key Figure. If I'm using the ABAB debuger the following values are displayed:

DATUM_VON : 20060101

DATUM_BIS: 20080201

DATUM_BIS-JJJJ: 2008

DATUM_VON-JJJJ: 2006

DATUM_BIS-MM: 02

DATUM_VON-MM: 01

E_MONATE: *

--> This is the Problem. Any Idea why the formula result displays no number?

Thanks& Greetings,

Sebastian

Edited by: Sebastian on Jan 19, 2010 9:44 AM

9 REPLIES 9

kesavadas_thekkillath
Active Contributor
0 Kudos

Just a guess.

E_MONATE is a reference type variable, may be because of that.

You can also check MONTHS_BETWEEN_TWO_DATES_NEW

0 Kudos

Thanks for your answer, unfortunately I doesn't find FM "MONTHS_BETWEEN_TWO_DATES_NEW" in SE37... So I used the other FM.

0 Kudos

Sebastien,

did you by any chance, search the forum (or SCN in general) first? Date questions have been posted and answered in the past (a lot). I'm sure that you can find your answer on SCN by doing a search.

One more thing: E_MONATE is not a reference type variable.

And I guess that is where you are going wrong. Check the definition of your variable E_MONATE and cross check that with what you find on SCN.

BEWARE: Threads like these, will be locked by moderators. More questions like this from one and the same user, and the user will be locked.

0 Kudos

Yeah Micky,

you are right and i was wrong.

0 Kudos

Keshav,

(in this case) it is not about who is right or wrong, it is more about the OP that he/she should do a search first.

And of course, and that's where a lot of us are are going wrong, no one should even answer these questions anymore.

0 Kudos

I found the problem:

For the dates I had no data declaration, but i got no syntax error in the editor.. Now the date declartion is sy-datum and it works.

Thanks a lot

0 Kudos

I found the problem:

For the dates I had no data declaration, but i got no syntax error in the editor.. Now the date declartion is sy-datum and it works.

Thanks a lot

kesavadas_thekkillath
Active Contributor
0 Kudos

Use HR_HK_DIFF_BT_2_DATES

Former Member
0 Kudos

hi,

Please search sdn ..

Declare variables as below and then use it in FM

DATA: v_DATE1 type sy-datum

v_DATE2 TYPE SY-DATUM,

v_MONTH TYPE I.

Thanks