Hi,
I'm creating a custom application, i want to add values to respoded by and sold to party.
I have attached my code here please tell me any mistakes in that. im not getting any error while creating when i checked in crmd_order ,it is not created. please help......
Thanks.
call function 'CRM_ORDER_MAINTAIN'
exporting
it_activity_h = lt_activity_h
it_status = lt_status_h
it_partner = lt_partner_h
changing
ct_orderadm_h = lt_orderadm_h
ct_input_fields = lt_input_fields
exceptions
error_occurred = 1
document_locked = 2
no_change_allowed = 3
no_authority = 4
others = 5.
* Read the table that has been changed and get the GUID that was created.
if sy-subrc eq 0.
read table lt_orderadm_h into ls_orderadm_h index 1.
if sy-subrc eq 0.
ls_save_guid = ls_orderadm_h-guid.
append ls_save_guid to lt_save_guid.
endif.
endif.
* SAVE the changes (all creations must be saved and committed before they exist in CRM)
call function 'CRM_ORDER_SAVE'
exporting
it_objects_to_save = lt_save_guid
importing
et_saved_objects = lt_saved_objects
exceptions
document_not_saved = 1
others = 2.
if sy-subrc eq 0.
" pull back object id created
read table lt_saved_objects into ls_saved_object index 1.
if sy-subrc eq 0.
er_entity-id = ls_saved_object-object_id.
endif.
call function 'BAPI_TRANSACTION_COMMIT'.
else.
raise exception type /iwbep/cx_mgw_busi_exception
exporting
textid = /iwbep/cx_mgw_busi_exception=>resource_duplicate
message_unlimited = c_error_msg.
endif.
Message was edited by: Narendra Hegde