This website is not affiliated with, sponsored by, or approved by SAP AG.

CRM_ORDER_MAINTAIN service confirmation

CRM related discussion only

Moderators: Snowy, thx4allthefish, Lost Identity

CRM_ORDER_MAINTAIN service confirmation

Postby vnick » Thu Mar 04, 2010 5:25 am

Hello,
I have task to create service confirmation (via CRM_ORDER_MAINTAIN) against service intervention but have following problem: service confirmation is created but without position from service intervention. Could you tell me what is problem?

Steps in transactions:
1. Launch service crmd_order transaction
2. Open transaction number (service intervention)
3. Create follow up transaction: service confirmation-> service confirmation
4. Copy selected Item
Thank you

CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
it_header_guid = it_header
it_item_guid = it_item
IMPORTING
et_orderadm_h = it_crmt_orderadm_h_wrkt
et_orderadm_i = it_crmt_orderadm_i_wrkt
et_doc_flow = it_crmt_doc_flow_wrkt
et_status = it_crmt_status_wrkt
et_partner = it_partner_order
EXCEPTIONS
document_not_found = 1
error_occurred = 2
document_locked = 3
no_change_authority = 4
no_display_authority = 5
no_change_allowed = 6
OTHERS = 7.

CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_16 = h_guid.

CLEAR wa_crmt_orderadm_h_com.
wa_crmt_orderadm_h_com-handle = '0000000001'.
wa_crmt_orderadm_h_com-guid = h_guid.
wa_crmt_orderadm_h_com-process_type = wa_zcr_ffa_1-par1.
wa_crmt_orderadm_h_com-mode = 'A'.

APPEND wa_crmt_orderadm_h_com TO it_crmt_orderadm_h_comt.

CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_16 = i_guid.

CLEAR wa_crmt_orderadm_i_com.
READ TABLE it_crmt_orderadm_i_wrkt INTO wa_crmt_orderadm_i_wrk INDEX 1.
MOVE-CORRESPONDING wa_crmt_orderadm_i_wrk TO wa_crmt_orderadm_i_com.
wa_crmt_orderadm_i_com-header = i_guid.

APPEND wa_crmt_orderadm_i_com TO it_crmt_orderadm_i_comt.

CLEAR: it_partner[], it_partner.
LOOP AT it_partner_order INTO wa_partner_order.
MOVE-CORRESPONDING wa_partner_order TO wa_partner.
IF wa_partner_order-ref_kind = 'A'.
wa_partner-ref_guid = h_guid.
ELSE.
wa_partner-ref_guid = i_guid.
ENDIF.
APPEND wa_partner TO it_partner.
ENDLOOP.

DATA: relation_id TYPE binrelid.
CALL FUNCTION 'CRM_DOC_FLOW_GET_RELATIONID_OB'
IMPORTING
ev_relationid = relation_id.

CLEAR: it_doc_flow[], wa_doc_flow.
CLEAR: it_link[], wa_link.

wa_link-objkey_a = wa_crmt_orderadm_h_wrk-guid.
wa_link-objtype_a = 'BUS2000116'.
wa_link-objkey_b = h_guid.
wa_link-objtype_b = 'BUS2000117'.
wa_link-vona_kind = 'A'.
wa_link-brel_kind = 'A'.
wa_link-brel_mode = 'A'.
wa_link-HANDLE_B = '0000000001'.
APPEND wa_link TO it_link.

wa_doc_flow-ref_guid = h_guid.
wa_doc_flow-ref_handle = '0000000001'.
wa_doc_flow-ref_kind = 'A'.
wa_doc_flow-doc_link = it_link.
APPEND wa_doc_flow TO it_doc_flow.

CLEAR: wa_doc_flow, wa_link, it_link[].

wa_link-objkey_a = wa_crmt_orderadm_i_wrk-guid.
wa_link-objtype_a = 'BUS2000140'.
wa_link-objkey_b = i_guid.
wa_link-objtype_b = 'BUS2000143'.
wa_link-vona_kind = 'A'.
wa_link-quantity = '1'.
wa_link-quantity_unit = 'NR'.
wa_link-brel_kind = 'B'.
wa_link-brel_mode = 'A'.
wa_link-reltype = 'VONA'.
wa_link-relationid = relation_id.
APPEND wa_link TO it_link.

wa_doc_flow-ref_guid = i_guid.
wa_doc_flow-ref_handle = '0000000000'.
wa_doc_flow-ref_kind = 'B'.
wa_doc_flow-doc_link = it_link.
APPEND wa_doc_flow TO it_doc_flow.


CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_16 = s_guid.

clear: it_SCHEDLINES[], wa_SCHEDLINES.
wa_SCHEDLINES-quantity = '1'.
wa_SCHEDLINES-GUID = s_guid.
wa_SCHEDLINES-item_guid = i_guid.
wa_SCHEDLINES-logical_key = s_guid. APPEND wa_SCHEDLINES to it_SCHEDLINES.
CLEAR: it_schedlin_i[], wa_schedlin_i.
wa_schedlin_i-ref_guid = i_guid.
wa_schedlin_i-SCHEDLINES = it_SCHEDLINES. APPEND wa_schedlin_i TO it_schedlin_i.

CLEAR: it_product_i[], wa_product_i.
wa_product_i-ref_guid = i_guid.
wa_product_i-PROCESS_QTY_UNIT = 'NR'. APPEND wa_product_i TO it_product_i.

ls_names-fieldname = 'PROCESS_TYPE'.
APPEND ls_names TO it_names.
ls_names-fieldname = 'GUID'. APPEND ls_names TO it_names.
ls_names-fieldname = 'MODE'.
APPEND ls_names TO it_names.
ls_names-fieldname = 'CREATED_BY'.
APPEND ls_names TO it_names
wa_input_fields-ref_handle = '0000000000'.
wa_input_fields-ref_kind = 'A'.
wa_input_fields-ref_guid = h_guid.
wa_input_fields-objectname = 'ORDERADM_H'.
wa_input_fields-field_names = it_names.
APPEND wa_input_fields TO it_input_fields.

CLEAR: wa_input_fields.
CLEAR: it_names[], ls_names.

ls_names-fieldname = 'DESCRIPTION'.
APPEND ls_names TO it_names.
ls_names-fieldname = 'ORDERED_PROD'.
APPEND ls_names TO it_names.
ls_names-fieldname = 'PRODUCT'.
APPEND ls_names TO it_names.
ls_names-fieldname = 'MODE'.
APPEND ls_names TO it_names.

wa_input_fields-ref_handle = '0000000000'.
wa_input_fields-objectname = 'ORDERADM_I'.
wa_input_fields-ref_guid = i_guid.
wa_input_fields-field_names = it_names.
APPEND wa_input_fields TO it_input_fields.

CLEAR: wa_input_fields.
CLEAR: it_names[], ls_names.

ls_names-fieldname = 'PROCESS_QTY_UNIT'.
APPEND ls_names to it_names.

wa_input_fields-ref_handle = '0000000000'.
wa_input_fields-objectname = 'PRODUCT_I'.
wa_input_fields-ref_guid = i_guid.
wa_input_fields-ref_kind = 'B'.
wa_input_fields-field_names = it_names.
APPEND wa_input_fields TO it_input_fields.

CLEAR: wa_input_fields.
CLEAR: it_names[], ls_names.

ls_names-fieldname = 'LOGICAL_KEY'.
APPEND ls_names to it_names.
ls_names-fieldname = 'QUANTITY'.
APPEND ls_names to it_names.

wa_input_fields-ref_handle = '0000000000'.
wa_input_fields-objectname = 'SCHEDLIN'.
wa_input_fields-LOGICAL_KEY = '00000000000000000000000000000000'.
wa_input_fields-ref_guid = i_guid.
wa_input_fields-ref_kind = 'B'.
wa_input_fields-field_names = it_names.
APPEND wa_input_fields TO it_input_fields.

CLEAR: wa_input_fields.
CLEAR: it_names[], ls_names.

ls_names-fieldname = 'DISPLAY_TYPE'.
APPEND ls_names TO it_names.
ls_names-fieldname = 'KIND_OF_ENTRY'.
APPEND ls_names TO it_names.
ls_names-fieldname = 'NO_TYPE'.
APPEND ls_names TO it_names.
ls_names-fieldname = 'PARTNER_FCT'.
APPEND ls_names TO it_names.
ls_names-fieldname = 'PARTNER_NO'.
APPEND ls_names TO it_names.

wa_input_fields-ref_handle = '0000000000'.
wa_input_fields-ref_guid = h_guid.
wa_input_fields-ref_kind = 'A'.
wa_input_fields-objectname = 'PARTNER'.
wa_input_fields-logical_key = '0001'.
wa_input_fields-field_names = it_names.
APPEND wa_input_fields TO it_input_fields.

CLEAR: wa_input_fields.
CLEAR: it_names[], ls_names.

ls_names-fieldname = 'QUANTITY'.
APPEND ls_names TO it_names.
ls_names-fieldname = 'QUANTITY_UNIT'.
APPEND ls_names TO it_names.
wa_input_fields-ref_guid = i_guid.
wa_input_fields-ref_kind = 'B'.
wa_input_fields-objectname = 'DOC_FLOW'.
wa_input_fields-field_names = it_names.
APPEND wa_input_fields TO it_input_fields.

REFRESH: it_input_fields_sorted, it_partner_sorted.
it_input_fields_sorted[] = it_input_fields[].
it_partner_sorted[] = it_partner[].

CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
it_schedlin_i = it_schedlin_i
it_product_i = it_product_i
it_partner = it_partner_sorted
CHANGING
ct_orderadm_h = it_crmt_orderadm_h_comt
ct_orderadm_i = it_crmt_orderadm_i_comt
ct_input_fields = it_input_fields_sorted
ct_doc_flow = it_doc_flow
EXCEPTIONS
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
OTHERS = 5.
vnick
 
Posts: 8
Joined: Wed Oct 07, 2009 4:17 am
Location: Russia

Re: CRM_ORDER_MAINTAIN service confirmation

Postby thx4allthefish » Thu Mar 04, 2010 7:45 am

Violation of Rule 2G

Topic locked.
curiousorange wrote:I give up. Humanity isn't worth saving. Why is there never a Vogon Constructor Fleet around when you really need one?
thx4allthefish
 
Posts: 5694
Joined: Sat Oct 26, 2002 6:18 pm
Location: barolo barrel


Return to CRM :: SAP CRM

Who is online

Users browsing this forum: No registered users and 2 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.