2007 Nov 28 8:26 AM
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?
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?
2007 Nov 28 8:29 AM
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.
2007 Nov 28 9:02 AM
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..
2007 Nov 28 10:04 AM
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.
2007 Nov 28 8:33 AM
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |