Skip to Content
0
Aug 08, 2011 at 08:48 AM

Create a Preceeding doucument using CRM_ORDER_MAINTAIN

46 Views

Dear Experts,

Iam trying to create the a document flow for a contract using CRM_ORDER_MAINTAIN.

But it actually creates a next follow up document , but i would like to create a preceeding document .

Please let me know your pointer on teh same.

Here is my logic of creating document Flow.

ls_doc_link-objkey_a = iv_guid_a.

ls_doc_link-objtype_a = 'BUS2000121'.

ls_doc_link-objkey_b = iv_guid_b.

ls_doc_link-objtype_b = 'BUS2000121'.

ls_doc_link-vona_kind = 'A'.

ls_doc_link-reltype = 'VONA'.

ls_doc_link-brel_kind = 'A'.

APPEND ls_doc_link TO lt_doc_link.

CLEAR: ls_doc_flow_comt.

ls_doc_flow_comt-ref_guid = iv_guid_a.

ls_doc_flow_comt-ref_kind = 'A'.

ls_doc_flow_comt-doc_link[] = lt_doc_link.

APPEND ls_doc_flow_comt TO lt_doc_flow.

ls_input_field_names-fieldname = 'OBJKEY_A'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

ls_input_field_names-fieldname = 'OBJTYPE_A'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

ls_input_field_names-fieldname = 'OBJKEY_B'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

ls_input_field_names-fieldname = 'OBJTYPE_B'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

ls_input_field_names-fieldname = 'VONA_KIND'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

ls_input_field_names-fieldname = 'RELTYPE'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

ls_input_field_names-fieldname = 'BREL_KIND'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

ls_input_field_names-fieldname = 'BREL_MODE'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

ls_input_field_names-fieldname = 'RELATIONID'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

ls_input_field_names-fieldname = 'RELATION_HANDLE'.

INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.

ls_input_field-objectname = 'DOC_FLOW'.

ls_input_field-ref_guid = iv_guid_a.

ls_input_field-ref_kind = 'A'.

INSERT ls_input_field INTO TABLE lt_input_fields.

CALL FUNCTION 'CRM_ORDER_MAINTAIN'

CHANGING

ct_input_fields = lt_input_fields

ct_doc_flow = lt_doc_flow

EXCEPTIONS

error_occurred = 1

document_locked = 2

no_change_allowed = 3

no_authority = 4

OTHERS = 5.

Regards,

Ratna Rajesh.