
REPORT crms4_status_check.
PARAMETERS: o_guid TYPE crmt_object_guid OBLIGATORY DEFAULT '6C0B84B754971ED78DB64E5AB75211A8',
process TYPE tj01-vrgng OBLIGATORY DEFAULT 'INPR'.
DATA: lv_not_allowed TYPE abap_bool,
lv_error TYPE abap_bool,
lv_obj_not_found TYPE abap_bool,
lv_status_inconsistent TYPE abap_bool,
lv_status_not_allowed TYPE abap_bool,
lv_warning TYPE abap_bool.
CALL FUNCTION 'CRM_STATUS_CHANGE_FOR_ACTIVITY'
EXPORTING
check_only = 'X'
objnr = o_guid
vrgng = process
xnoauto = 'X'
IMPORTING
activity_not_allowed = lv_not_allowed
error_occurred = lv_error
object_not_found = lv_obj_not_found
status_inconsistent = lv_status_inconsistent
status_not_allowed = lv_status_not_allowed
warning_occurred = lv_warning
EXCEPTIONS
activity_not_allowed = 1
object_not_found = 2
status_inconsistent = 3
status_not_allowed = 4
wrong_input = 5
warning_occured = 6.
CASE sy-subrc.
WHEN 1.
WRITE:/ 'activity not allowed'.
WHEN 2.
WRITE:/ 'order not found'.
WHEN 3.
WRITE:/ 'status inconsistent'.
WHEN 4.
WRITE:/ 'status not allowed'.
WHEN 5.
WRITE:/ 'wrong input'.
WHEN 6.
WRITE:/ 'warning occurred'.
WHEN 0.
WRITE:/ 'this business process could be successfully carried out' COLOR COL_GROUP.
ENDCASE.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
2 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |