Skip to Content
0
Former Member
Dec 17, 2008 at 07:47 AM

Problem in CRM_ORDER_MAINTAIN

55 Views

Dear Experts.

I am facing a problem with CRM_ORDER_MAINTAIN in this i want to change the date.

And i am using the below code it do not have any error but the dateu2019s are not changing.

I am send in the code please advice me.

Thanks

Pramod

--


FOR DATE CHANGEING--

LS_FIELD_NAMES-FIELDNAME = 'REF_KIND'.

LS_FIELD_NAMES-CHANGEABLE = 'X'.

INSERT LS_FIELD_NAMES INTO TABLE LS_INPUT_FIELDS1-FIELD_NAMES.

LS_FIELD_NAMES-FIELDNAME = 'APPT_TYPE'.

LS_FIELD_NAMES-CHANGEABLE = 'X'.

INSERT LS_FIELD_NAMES INTO TABLE LS_INPUT_FIELDS1-FIELD_NAMES.

LS_FIELD_NAMES-FIELDNAME = 'TIMESTAMP_FROM'.

LS_FIELD_NAMES-CHANGEABLE = 'X'.

INSERT LS_FIELD_NAMES INTO TABLE LS_INPUT_FIELDS1-FIELD_NAMES.

LS_FIELD_NAMES-FIELDNAME = 'TIMEZONE_FROM'.

LS_FIELD_NAMES-CHANGEABLE = 'X'.

INSERT LS_FIELD_NAMES INTO TABLE LS_INPUT_FIELDS1-FIELD_NAMES.

LS_FIELD_NAMES-FIELDNAME = 'TIMESTAMP_TO'.

LS_FIELD_NAMES-CHANGEABLE = 'X'.

INSERT LS_FIELD_NAMES INTO TABLE LS_INPUT_FIELDS1-FIELD_NAMES.

LS_FIELD_NAMES-FIELDNAME = 'TIMEZONE_TO'.

LS_FIELD_NAMES-CHANGEABLE = 'X'.

INSERT LS_FIELD_NAMES INTO TABLE LS_INPUT_FIELDS1-FIELD_NAMES.

*LS_FIELD_NAMES-fieldname = 'TIME_UNIT'.

*LS_FIELD_NAMES-CHANGEABLE = 'X'.

  • INSERT LS_FIELD_NAMES INTO TABLE LS_INPUT_FIELDS1-FIELD_NAMES.

LS_INPUT_FIELDS1-REF_HANDLE = '0000000000'.

LS_INPUT_FIELDS1-REF_GUID = GUID.

LS_INPUT_FIELDS1-OBJECTNAME = 'APPOINTMENT'.

LS_INPUT_FIELDS1-FIELD_NAMES = LS_INPUT_FIELDS1-FIELD_NAMES[].

INSERT LS_INPUT_FIELDS1 INTO TABLE GIT_INPUT_FIELDS.

*Set up the values for the fields to be updated.

WA_APPOINTMENT-REF_HANDLE = '0000000000'.

WA_APPOINTMENT-REF_GUID = GUID.

WA_APPOINTMENT-REF_KIND = 'A'.

WA_APPOINTMENT-APPT_TYPE = 'ORDERACTUAL'.

WA_APPOINTMENT-TIMESTAMP_FROM = 20091010101212.

WA_APPOINTMENT-TIMEZONE_FROM = TZONE.

WA_APPOINTMENT-TIMESTAMP_TO = 20091010101212.

WA_APPOINTMENT-TIMEZONE_TO = TZONE.

*WA_APPOINTMENT-time_unit = 20091010101212.

INSERT WA_APPOINTMENT INTO TABLE GIT_APPOINTMENT.

CALL FUNCTION 'CRM_ORDER_MAINTAIN'

EXPORTING

*IT_PARTNER = git_patner

*it_partner = lt_partner

IT_STATUS = GIT_MODIFY_STATUS

IT_APPOINTMENT = GIT_APPOINTMENT

IT_TEXT = LT_TEXTS

CHANGING

CT_INPUT_FIELDS = GIT_INPUT_FIELDS

EXCEPTIONS

ERROR_OCCURRED = 1

DOCUMENT_LOCKED = 2

NO_CHANGE_ALLOWED = 3

NO_AUTHORITY = 4

OTHERS = 5.

CHECK SY-SUBRC EQ 0.

CALL FUNCTION 'CRM_ORDER_SAVE'

EXPORTING

IT_OBJECTS_TO_SAVE = GIT_HEAD_TO_SAVE

EXCEPTIONS

DOCUMENT_NOT_SAVED = 1

OTHERS = 2.

*Commit the data in the buffer

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

WAIT = 'X'.