cancel
Showing results for 
Search instead for 
Did you mean: 

How to use CRM_ORDER_CHANGE_STATUS

Former Member
0 Kudos

Hi,

i need to change the status of CRM servicecontract from open to released using ABAP.

I found the function module CRM_ORDER_CHANGE_STATUS.

I called it like this but nothing happens:

CALL FUNCTION 'CRM_ORDER_CHANGE_STATUS'
    EXPORTING
      iv_ref_guid           = lv_guid
      iv_status             = 'I1004'
*     IV_ACTIVATE           = TRUE
*     IV_REF_KIND           = 'A'
*     IV_ALL_ITEMS          = TRUE
*     IV_ONLY_ITEMS         = FALSE
*     IV_TRACE_LOG          =
   EXCEPTIONS
     PARAMETER_ERROR       = 1
     NOT_ALLOWED           = 2
     ERROR_OCCURRED        = 3
     OTHERS                = 4
            .

SY-SUBRC = 0 after the call.

I also tried to call CRM_ORDER_SAVE afterwards, also with SY-SUBRC = 0.

But the status is not changed.

Could one of you experts please assist.

Thank you

Kind regards

Manfred

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Are you calling BAPI_TRANSACTION_COMMIT after chanign the status?

Regds,

Raghu

Former Member
0 Kudos

Thank you.

I tried it with BAPI_TRANSACTION_COMMIT now.

Still no effect at all.

Kind regards

Manfred

robert_kunstelj
Active Contributor
0 Kudos

Uncomment line IV_REF_KIND = 'A'

If stil doesn't work uncomet also IV_ACTIVATE = TRUE and change TRUE with 'X'.

And as mentioned you have to use also BAPI_TRANSACTION_COMMIT or CRM_ORDER_SAVE.

You can also use one of my examples...

CALL FUNCTION 'CRM_ORDER_CHANGE_STATUS'

EXPORTING

iv_ref_guid = <lf_order_data>-guid

iv_status = <lf_order_data>-ustatbn

EXCEPTIONS

parameter_error = 1

not_allowed = 2

error_occurred = 3

OTHERS = 4.

IF sy-subrc = 0.

  • podatki za save

ls_save-guid = <lf_order_data>-guid.

ls_save-object_type = 'BUS2000115'.

APPEND ls_save TO lt_save.

  • shrani

CALL FUNCTION 'BAPI_BUSPROCESSND_SAVE'

TABLES

objects_to_save = lt_save

saved_objects = lt_saved

return = lt_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

Answers (0)