Hi.
I´m having a bad time trying to create a ticket on SAP CRM.
I am using CRM_ORDER_MAINTAIN, it creates the order, but the reason is coming empty.
I tryed make some changing in program according to some other posts, but nothing...
Can somebody help me?
The code where I am creating de SERVICE_OS data is here:
* Registro Subject com os motivos, causa,
w_subject-codegruppe = <fs_zrjr_depara_mtv>-codegruppe.
w_subject-code = <fs_zrjr_depara_mtv>-code.
w_subject-defquantity = '1'.
* w_subject-sort = '1'.
w_subject-ref_guid = '1'.
* w_subject-catalog_type = 'C'.
w_subject-codeprofile = lv_subject_profile. "'ZRECLZVT5'.
w_subject-katalogart = <fs_zrjr_depara_mtv>-katalogart.
IF v_chamado_crm IS NOT INITIAL.
* Modificar ticket
w_subject-mode = 'B'."' '.
ELSE.
* Criar
w_subject-mode = 'A'."'X'.
ENDIF.
* w_subject-ref_handle = '0000000001'.
INSERT w_subject INTO TABLE t_subject.
IF NOT v_chamado_crm IS INITIAL.
* Modificar ticket
* Registro OSSET
w_osset-ref_guid = v_guid. "lv_osset_ref_guid.
ELSE.
* Gerar guid para registro OSSET
CALL FUNCTION 'CRM_GUID_CREATE'
IMPORTING
ev_guid = v_guid2.
* Registro OSSET
w_osset-ref_guid = v_guid2.
ENDIF.
w_osset-ref_handle = '0000000002'.
w_osset-subject_profile = lv_subject_profile.
w_osset-profile_type = 'F'.
w_osset-subject = t_subject.
INSERT w_osset INTO TABLE t_osset.
* Registro OS
w_service_os-ref_guid = v_guid.
w_service_os-ref_kind = 'A'.
w_service_os-osset = t_osset.
INSERT w_service_os INTO TABLE t_service_os.
* Input Fields
CLEAR w_input_fields.
w_input_fields-ref_guid = v_guid.
w_input_fields-objectname = 'SERVICE_OS'.
w_input_fields-ref_kind = 'A'.
REFRESH t_field_names.
w_field_names-fieldname = 'CODE'.
INSERT w_field_names INTO TABLE t_field_names.
w_field_names-fieldname = 'CODEGRUPPE'.
INSERT w_field_names INTO TABLE t_field_names.
w_field_names-fieldname = 'DEFECTCLASS'.
INSERT w_field_names INTO TABLE t_field_names.
w_field_names-fieldname = 'DEFQUANTITY'.
INSERT w_field_names INTO TABLE t_field_names.
w_field_names-fieldname = 'KATALOGART'.
INSERT w_field_names INTO TABLE t_field_names.
w_field_names-fieldname = 'LISTCODE'.
INSERT w_field_names INTO TABLE t_field_names.
w_field_names-fieldname = 'QUALITY'.
INSERT w_field_names INTO TABLE t_field_names.
* w_field_names-fieldname = 'SUBJECT_PROFILE'.
* INSERT w_field_names INTO TABLE t_field_names.
w_input_fields-field_names = t_field_names.
INSERT w_input_fields INTO TABLE t_input_fields.
TKS