cancel
Showing results for 
Search instead for 
Did you mean: 

FM 'END_TIME_DETERMINE' not working

Former Member
0 Kudos

Hello Experts,

I am developing a report in CRM, where I am using function module 'END_TIME_DETERMINE' to add or subtracts days.

call function 'END_TIME_DETERMINE'
  exporting
        duration                        = 2
         unit                             = 'D'
         factory_calendar                 = 'IN'
  importing
         end_date                         = final_Date
         end_time                         = final_time
  changing
         start_date                       = sy-datum
         start_time                       = sy-uzeit
  exceptions
         factory_calendar_not_found       = 1
         date_out_of_calendar_range       = 2
         date_not_valid                   = 3
         unit_conversion_error            = 4
         si_unit_missing                  = 5
         parameters_no_valid              = 6
    others                           = 7
           .

When I pass duration = 0, I am getting sy-sybrc = 0.

but when I pass duration = 2 or any other value, then returning sy-subrc = 4.

When I execute the same case i.e. duration other than 0, in SE37, it is working perfectly.

Please help.

Regards,

Nikhil

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Nik,

Verify following two steps :

1. you factory calender is valid as on date.

2. The unit you are passing is direct value in quotes like 'D'. Avoid passing values like this. The import parameter Unit has conversion Routine CUNIT. Try to convert your unit 'D' or 'MIN' etc from FM CONVERSION_EXIT_CUNIT_INPUT and the pass the value in unit parameter.

I think Unit Conversion is not letting this FM to get result out.

Reward points , if this helps.

Regards,

Dipesh