Skip to Content
0
Former Member
Mar 05, 2009 at 02:02 PM

Problemas with function crm_order_maintain

24 Views

Good Morning,

I am creating activities throughout a Z* development using the function CRM_ORDER_MAINTAIN.

The thing is that when creating the BPs the system also includes the user who is executing the transaction in the Role "Employee Responsible"(00000014).

After saving the activity, I have tried to delete the BP using the same function but I can´t. I have debugged the function and I put the same parameters shown in the standard code.

I have seen in many forums that the problem may be in the Logical Key field but I have set it as explained everywhere. I am sending you part of the code I followed:

e_partner_c-ref_guid = e_orderadm_h-guid.

e_partner_c-ref_handle = e_orderadm_h-handle.

e_partner_c-ref_kind = 'A'.

e_partner_c-ref_partner_fct = '00000014'.

e_partner_c-ref_partner_handle = '0000'.

e_partner_c-ref_partner_no = sy-uname.

e_partner_c-ref_no_type = 'US'.

e_partner_c-ref_display_type = 'US'.

e_partner_c-kind_of_entry = 'C'.

e_partner_c-partner_fct = '00000014'.

e_partner_c-no_type = 'US'.

e_partner_c-display_type = 'US'.

e_partner_c-partner_no = sy-uname.

INSERT e_partner_c INTO TABLE t_partner_c.

e_input_field-ref_guid = e_orderadm_h-guid.

e_input_field-ref_handle = e_orderadm_h-handle.

e_input_field-ref_kind = 'A'.

e_input_field-objectname = 'PARTNER'.

CONCATENATE '0000' e_partner_c-partner_fct e_partner_c-partner_no INTO e_input_field-logical_key.

CONCATENATE e_partner_c-ref_no_type e_partner_c-ref_no_type INTO vl_id.

WRITE vl_id TO e_input_field-logical_key+28.

CLEAR e_partner_c.

e_input_field_names-fieldname = 'PARTNER_FCT'.

INSERT e_input_field_names INTO TABLE e_input_field-field_names.

INSERT e_input_field INTO TABLE t_input_fields.

REFRESH : e_input_field-field_names.

CALL FUNCTION 'CRM_ORDER_MAINTAIN'

EXPORTING

it_partner = t_partner_c

CHANGING

ct_input_fields = t_input_fields

EXCEPTIONS

error_occurred = 1

document_locked = 2

no_change_allowed = 3

no_authority = 4

OTHERS = 5.

Many thanks in advanced.

Regards

Mariano