Showing results for 
Search instead for 
Did you mean: 

Problemas with function crm_order_maintain

Former Member
0 Kudos

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.



it_partner = t_partner_c


ct_input_fields = t_input_fields


error_occurred = 1

document_locked = 2

no_change_allowed = 3

no_authority = 4


Many thanks in advanced.



Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos


The logical key should match exactly what is in the order already. Hence you have to read it using CRM_ORDER_READ or CRM_PARTNER_READ_OW and set it and then it will work.

Former Member
0 Kudos

Hi Babu,

Sorry for the delay in answering but I was not at the customers' office so I could not make the corresponding tests.

When running function CRM_ORDER_READ the logical key is also in '0000' and when executing the test it didn´t work either.

For what I have seen the logical key has to be the concatenation of the REF_PARTNER_HANDLE + REF_PARTNER_FCT + PARTNER_NO and then in position 28 of partner type.

Any suggestions?

Thank you very much.