Skip to Content
author's profile photo Former Member
Former Member

Update Status for Service Request in Inbox Result

Hi All,

I have a requirement where I have to update the status of the Service Request. In the implementation class of the view, I am trying to do that by updating the attribute ACT_STATUS of the BtStatus for a Service Request. But here the Set_Property( ) method is not updating the value. I checked using the method 'is_property_readonly which return 'X' i.e the property for that attribute is Read Only. The method 'is_changeable( )' also returns false. What would be the correct approach to achieve that.

Regards,

Radhika

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 05, 2010 at 02:14 PM

    Hi,

    here the coding of a own function module to update the opportunity status. I guess it will work the same way for servicerequests:

    FUNCTION Z_CHANGE_OPP_STATUS.

    *"----


    ""Lokale Schnittstelle:

    *" IMPORTING

    *" VALUE(IV_OPP_ID) TYPE CRMT_OBJECT_ID_DB

    *" VALUE(IV_STATUS) TYPE STRING

    *"----


    DATA: core TYPE REF TO cl_crm_bol_core.

    core = cl_crm_bol_core=>get_instance( ).

    core->start_up( 'ALL' ).

    DATA: ent TYPE REF TO cl_crm_bol_entity,

    ent_opp TYPE REF TO cl_crm_bol_entity,

    ent_par TYPE REF TO cl_crm_bol_entity,

    query TYPE REF TO CL_CRM_BOL_QUERY_SERVICE,

    result TYPE REF TO if_bol_bo_col.

    query = CL_CRM_BOL_QUERY_SERVICE=>get_instance( 'BTQuery1O' ).

    query->set_property( iv_attr_name = 'OBJECT_ID'

    iv_value = iv_opp_id ).

    result ?= query->get_query_result( ).

    ent ?= result->get_first( ).

    ent = ent->get_related_entity( 'BTOrderHeader' ).

    • get opportunity details

    ent = ent->get_related_entity( iv_relation_name ='BTHeaderStatusSet' ).

    ent = ent->get_related_entity( iv_relation_name = 'BTStatusHCurrent' ).

    ent->switch_to_change_mode( ).

    ent->set_property( iv_attr_name = 'ACT_STATUS'

    iv_value = iv_status ).

    core->modify( ).

    DATA: tx TYPE REF TO if_bol_transaction_context.

    tx = ent->get_transaction( ).

    IF tx->save( ) = abap_true.

    tx->commit( ).

    ELSE.

    tx->rollback( ).

    ENDIF.

    ENDFUNCTION.

    ************************

    Kind regards

    Manfred

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.