Skip to Content
0
Former Member
Sep 02, 2008 at 09:36 AM

'Contract end date' updation for service contract.

420 Views

Hi Guys,

I used a FM: 'CRM_APPT_MAINTAIN_SINGLE_OW' to update the 'contract end date' value in my BADI. But at the final stage i don't see the value got updated, but the sy-subrc is coming '0'. Can any one explain what is the mistake i did.

Can i use the above FM for this kind of updation.

Please find my code here:

LOOP at i_guid into i_wa_guid.

v_guid = i_wa_guid-guid.

i_wa_appointment-REF_GUID = v_guid.

i_wa_appointment-REF_KIND = 'A'.

i_wa_appointment-APPT_TYPE = 'CONTEND'.

v_end_date = i_wa_guid-end_date.

  • Convert Date to Timestamp

CALL FUNCTION 'ADDR_CONVERT_DATE_TO_TIMESTAMP'

EXPORTING

IV_DATE = v_end_date

IMPORTING

EV_TIMESTAMP = v_timestamp.

i_wa_appointment-TIMESTAMP_TO = v_timestamp.

i_wa_appointment-TIMEZONE_TO = 'CET'.

i_wa_appointment-mode = 'B'.

CLEAR: i_wa_field_names,

i_field_names.

i_wa_field_names-fieldname = 'TIMESTAMP_TO'.

i_wa_field_names-CHANGEABLE = ' '.

APPEND i_wa_field_names TO i_field_names.

CLEAR: i_wa_input_fields,

i_input_fields.

i_wa_input_fields-ref_guid = i_wa_guid-guid.

i_wa_input_fields-ref_kind = 'A'.

i_wa_input_fields-logical_key = 'CONTEND'.

i_wa_input_fields-objectname = 'APPOINTMENT'.

i_wa_input_fields-field_names = i_field_names.

APPEND i_wa_input_fields TO i_input_fields.

  • Call FM: CRM_APPT_MAINTAIN_SINGLE_OW to update the Date

CALL FUNCTION 'CRM_APPT_MAINTAIN_SINGLE_OW'

EXPORTING

IS_APPOINTMENT_COM = i_wa_appointment

CHANGING

CT_INPUT_FIELDS = i_input_fields.

CLEAR: i_wa_appointment,

i_wa_guid,

v_guid,

v_end_date,

i_wa_field_names,

v_end_date,

v_timestamp.

Refresh: i_input_fields.

ENDLOOP.

Regards.

Sunil