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: 

reg date difference ?

Former Member
0 Kudos

hi friends..

in my program i want to find the difference between two dates for that i try with following FM

ISHMED_CALC_DATE_TIME_DIFF

FI_PSO_DAYS_MONTHS_YEARS_GET

HR_99S_INTERVAL_BETWEEN_DATES

FIMA_DAYS_AND_MONTHS_AND_YEARS

all these FM are work proper for ( eg 30.09.2007 to 31.11.2007) in my testing client 100 and return 31 days as diffrence..

but in my quality client 400 all these functional modules return days above 7000(like 7945)....

i checked that thats import parameter days initialy 0..

is any external setting required for quality client 400 ?

plz help me to come out this issue?

4 REPLIES 4

Former Member
0 Kudos

chk refernece data type.

and chk sap assizn date.

REPORT ZDATEDIFF.

DATA: EDAYS LIKE VTBBEWE-ATAGE,

EMONTHS LIKE VTBBEWE-ATAGE,

EYEARS LIKE VTBBEWE-ATAGE.

PARAMETERS: FROMDATE LIKE VTBBEWE-DBERVON,

TODATE LIKE VTBBEWE-DBERBIS DEFAULT SY-DATUM.

call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'

exporting

i_date_from = FROMDATE

i_date_to = TODATE

  • I_FLG_SEPARATE = ' '

IMPORTING

E_DAYS = EDAYS

E_MONTHS = EMONTHS

E_YEARS = EYEARS.

WRITE:/ 'Difference in Days ', EDAYS.

WRITE:/ 'Difference in Months ', EMONTHS.

WRITE:/ 'Difference in Years ', EYEARS.

INITIALIZATION.

FROMDATE = SY-DATUM - 60.

0 Kudos

hi mr Karthikeyan ..

thanks for ur effort in my query..

i am using the same data type as u specified but in client 100 its working fine..

but in 400 se38(i.e in my program its not working)

abut in client 400 se37 is also working fine..

0 Kudos

hi,

Here iam giving 1 function module.Please try whether it resolves your issue.

DATA:v_day LIKE sy-datum.

DATA:v_cnt TYPE p,v_cnt1 TYPE c.

CALL FUNCTION '/SDF/CMO_DATETIME_DIFFERENCE'

EXPORTING

date1 = sy-datum

  • TIME1 = '000000'

date2 = v_day

  • TIME2 = '000000'

IMPORTING

datediff = v_cnt

  • TIMEDIFF =

EARLIEST = v_cnt1

EXCEPTIONS

invalid_datetime = 1

OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Please reward if needful.

pavel_parshenkov2
Participant
0 Kudos

hi, try looking at FM

'DURATION_DETERMINE'