on 2006 Dec 20 1:09 PM
Has anyone successfully updated dates on a CRM transaction using function BAPI_BUSPROCESSND_CHANGEMULTI?
If so, would you mind posting some code, please?
Request clarification before answering.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I get two messages back in RETURN:
S |CRM_MESSAGES <006 |Start of processing 'Individual receipt' <
E |CRM_ORDER <037 |The document could not be saved <
The first message comes up from calling BAPI_BUSPROCESSND_CHANGEMULTI and the second one from BAPI_BUSPROCESSND_SAVE. Is there a way to get more information than that?
I am posting the code of my program, so maybe you can see what I am doing wrong:
tables: crmd_orderadm_h.
DATA: RETURN TYPE TABLE OF BAPIRET2 WITH HEADER LINE.
DATA: GUID TYPE TABLE OF BAPIBUS20001_GUID_DIS WITH HEADER LINE.
DATA: APPOINTMENT TYPE TABLE OF BAPIBUS20001_APPOINTMENT_INS WITH HEADER LINE.
DATA: INPUT_FIELDS TYPE TABLE OF BAPIBUS20001_INPUT_FIELDS WITH HEADER LINE.
data: saved type TABLE OF BAPIBUS20001_OBJECT_ID with header line.
Select header using doc number to get guid
select single * from crmd_orderadm_h
where object_id = '0050000172'.
Guid from selected record
guid-guid = crmd_orderadm_h-GUID.
APPEND GUID.
Update input fields
INPUT_FIELDS-ref_guid = crmd_orderadm_h-guid.
INPUT_FIELDS-ref_kind = 'A'.
INPUT_FIELDS-objectname = 'APPOINTMENT'.
Add individual fields
INPUT_FIELDS-fieldname = 'REF_GUID'.
APPEND INPUT_FIELDS .
INPUT_FIELDS-fieldname = 'REF_KIND'.
APPEND INPUT_FIELDS .
INPUT_FIELDS-fieldname = 'REF_HANDLE'.
append INPUT_FIELDS .
INPUT_FIELDS-fieldname = 'APPT_TYPE'.
APPEND INPUT_FIELDS .
INPUT_FIELDS-fieldname = 'DATE_FROM'.
APPEND INPUT_FIELDS .
INPUT_FIELDS-fieldname = 'DATE_TO'.
APPEND INPUT_FIELDS .
INPUT_FIELDS-fieldname = 'MODE'.
APPEND INPUT_FIELDS .
INPUT_FIELDS-fieldname = 'TIMEZONE_FROM'.
APPEND INPUT_FIELDS .
INPUT_FIELDS-fieldname = 'TIMEZONE_TO'.
APPEND INPUT_FIELDS .
Update appointment - change to an exising record
APPOINTMENT-ref_guid = crmd_orderadm_h-guid.
APPOINTMENT-appt_type = 'CONTSIGNON'.
APPOINTMENT-timezone_from = 'CET'.
APPOINTMENT-timezone_to = 'CET'.
APPOINTMENT-date_from = sy-datum.
APPOINTMENT-time_from = sy-uzeit.
APPOINTMENT-date_to = sy-datum.
APPOINTMENT-time_to = sy-uzeit.
APPOINTMENT-mode = 'B'. "<-- Appointment type already exists, so change
APPEND APPOINTMENT.
Update Document
CALL FUNCTION 'BAPI_BUSPROCESSND_CHANGEMULTI'
TABLES
APPOINTMENT = APPOINTMENT
INPUT_FIELDS = INPUT_FIELDS
RETURN = return.
Persist Changes
CALL FUNCTION 'BAPI_BUSPROCESSND_SAVE'
EXPORTING
UPDATE_TASK_LOCAL = 'X'
TABLES
OBJECTS_TO_SAVE = GUID
SAVED_OBJECTS = saved
RETURN = RETURN.
I thought I had found the problem when I changed this section:
Update appointment - change to an exising record
APPOINTMENT-ref_guid = crmd_orderadm_h-guid.
APPOINTMENT-ref_kind = 'A'. "<-- Added this line
APPOINTMENT-appt_type = 'CONTSIGNON'.
as it was looking for the ref_kind indicator.
However, I still get the error message, and now I am out of ideas.
User | Count |
---|---|
19 | |
17 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.