Hi Experts,
I have issue in updating net value and status of Order items.
there is a report program for change the status to complete (I1005).
I am getting this error at the time of commit work.
IF not gs_upload-net_val is initial.
* loop at ls_pridoc-pric_cond into ls_pric_cond where stunr = '010'
* and zaehk ='001' and kposn = gv_item_guid.
is_pridoc-ref_guid = gv_item_guid.
is_pridoc-ref_kind = 'B'.
is_pridoc-pricing_type = 'C'.
ls_pricond_change-stunr = ls_pric_cond-stunr.
ls_pricond_change-zaehk = ls_pric_cond-zaehk.
ls_pricond_change-kbetr = gs_upload-net_val.
ls_pricond_change-waers = 'NZD'.
ls_pricond_change-kpein = ls_pric_cond-kpein.
ls_pricond_change-kmein = ls_pric_cond-kmein.
insert ls_pricond_change into table is_pridoc-cond_change.
ls_input_field-ref_guid = gv_item_guid.
ls_input_field-ref_kind = 'B'.
* ENDLOOP.
INSERT is_pridoc INTO TABLE gt_pridoc.
gs_alv-NET_VAL = ls_pricond_change-kbetr.
ls_input_field-objectname = 'PRIDOC'.
ls_input_field_names-fieldname = 'REF_GUID'.
INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
ls_input_field_names-fieldname = 'REF_KIND'.
INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
ls_input_field_names-fieldname = 'PRICING_TYPE'.
INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
ls_input_field_names-fieldname = 'KSCHL'.
INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
ls_input_field_names-fieldname = 'KBETR'.
INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
ls_input_field_names-fieldname = 'WAERS'.
INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
ls_input_field_names-fieldname = 'KPEIN'.
INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
ls_input_field_names-fieldname = 'KMEIN'.
INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
INSERT ls_input_field INTO TABLE lt_input_fields.
ENDIF.
CALL FUNCTION 'CRM_ORDER_MAINTAIN'
EXPORTING
IT_PRIDOC = gt_pridoc
CHANGING
CT_ORDERADM_I = lt_orderadm_i
CT_INPUT_FIELDS = lt_input_fields
EXCEPTIONS
ERROR_OCCURRED = 1
DOCUMENT_LOCKED = 2
NO_CHANGE_ALLOWED = 3
NO_AUTHORITY = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
** Change the status if internal table status is initialised.
If not gs_upload-status is initial.
clear lv_item_guid.
lv_item_guid = gv_item_guid.
CALL FUNCTION 'CRM_ORDER_CHANGE_STATUS'
EXPORTING
IV_REF_GUID = lv_item_guid
IV_STATUS = 'I1005'
IV_ACTIVATE = 'X'
IV_REF_KIND = 'B'
IV_ALL_ITEMS = ' '
IV_ONLY_ITEMS = ' '
EXCEPTIONS
PARAMETER_ERROR = 1
NOT_ALLOWED = 2
ERROR_OCCURRED = 3
OTHERS = 4.
IF SY-SUBRC = 0.
gs_alv-STATUS = text-002.
Endif.
Endif.
Thanks in advance.
Thanks and Regards
Alok