Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Hour differences with CRM_ORDER_MAINTAIN

Hi guys, I´m having troubles with some hour differences in some FM, all you know that the et_appointments dates can be set with the CRM_ORDER_MAINTAIN . . .

I set the dates/hours ok in the timestamp_from, timestamp_to fields. The problem is that field TIME_FROM is the field that are show in the GUI and UI with some hour differences (Viewed with CRM_ORDER_READ), the system calculates in some way this field in combnation with the timezone.

If I set the date manually in the GUI, the dates are set correctly. This is my code, note that is a local report only to test this issue with harcode .

ls_appointment_t-ref_guid = 'E07692724B07E2F1886B005056960012'.

ls_appointment_t-ref_kind = 'A'.

ls_appointment_t-ref_handle = '0'.

ls_appointment_t-timestamp_from = '20140317110000'.

ls_appointment_t-timezone_from = 'CST'.

ls_appointment_t-timestamp_to = '20140317110000'.

ls_appointment_t-timezone_to = 'CST'.

ls_appointment_t-appt_type = 'Z00000000036'.

ls_appointment_t-duration = '0'.

ls_appointment_t-rule_name = ''.

INSERT ls_appointment_t INTO TABLE lt_appointment_t.

CLEAR : lt_field_names[].

ls_input_fields-ref_guid = 'E07692724B07E2F1886B005056960012'.

ls_input_fields-ref_kind = 'A'.

ls_input_fields-logical_key = 'Z00000000036'.

ls_input_fields-ref_handle = '0'.

ls_input_fields-objectname = 'APPOINTMENT'.

ls_field_names-fieldname = 'DOMINANT'.

INSERT ls_field_names INTO TABLE lt_field_names.

ls_field_names-fieldname = 'DURATION'.

INSERT ls_field_names INTO TABLE lt_field_names.

ls_field_names-fieldname = 'RULE_NAME'.

INSERT ls_field_names INTO TABLE lt_field_names.

ls_field_names-fieldname = 'SHOW_LOCAL'.

INSERT ls_field_names INTO TABLE lt_field_names.

ls_field_names-fieldname = 'TIMESTAMP_FROM'.

INSERT ls_field_names INTO TABLE lt_field_names.

ls_field_names-fieldname = 'TIMESTAMP_TO'.

INSERT ls_field_names INTO TABLE lt_field_names.

ls_field_names-fieldname = 'TIMEZONE_FROM'.

INSERT ls_field_names INTO TABLE lt_field_names.

ls_field_names-fieldname = 'TIMEZONE_TO'.

INSERT ls_field_names INTO TABLE lt_field_names.

ls_field_names-fieldname = 'TIME_UNIT'.

INSERT ls_field_names INTO TABLE lt_field_names.

ls_input_fields-field_names = lt_field_names.

INSERT ls_input_fields INTO TABLE lt_input_fields.

ls_orderadm_h_t-guid = 'E07692724B07E2F1886B005056960012'.

INSERT ls_orderadm_h_t INTO TABLE lt_orderadm_h_t.

CALL FUNCTION 'CRM_ORDER_MAINTAIN'

EXPORTING

it_appointment = lt_appointment_t

IMPORTING

et_exception = lt_exception

CHANGING

ct_input_fields = lt_input_fields

EXCEPTIONS

error_occurred = 1

document_locked = 2

no_change_allowed = 3

no_authority = 4

OTHERS = 5.

with this code the hours are shown with some differences, if I set "ls_appointment_t-timestamp_from = '20140317110000'" in the GUI and UI the hour is set to 5:00

Any clue about this !? or how can I resolve this with some code !?

thanks

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question