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

CRM Activity Status change BAPI / BADI

Hi,

The requirement I have as of now is like this:

An Activity which has been 'Completed' needs to be changed back to the 'Open' Status for the user to make some change and then again change it back to 'Completed' status. I am looking for a BAPI to do the same. Can anyone help me if I can get a BAPI / BADI to do the same ?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 12, 2010 at 12:47 PM

    HI,

    Try to search on SDN.

    You can find more decision.

    Example:

    Status change for Quotation

    Denis.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 12, 2010 at 01:14 PM

    Hi,

    Try to implement this code in badi order_save.

    DATA: gt_crmd_orderadm_h TYPE TABLE OF  crmd_orderadm_h,
            gs_crmd_orderadm_h TYPE crmd_orderadm_h.
    
      DATA: et_objects_to_save TYPE crmt_object_guid_tab,
            es_objects_to_save TYPE crmt_object_guid.
    
      DATA: it_saved_objects TYPE crmt_return_objects.
    
      DATA: gt_field_names TYPE crmt_input_field_names_tab,
            gs_field_names TYPE crmt_input_field_names.
    
      DATA: cv_log_handle TYPE  balloghndl.
    
    
      DATA: p_act TYPE crmd_orderadm_h-object_id ,
            p_guid TYPE crmd_orderadm_h-guid ,
            p_proty TYPE crmd_orderadm_h-process_type ,
            p_stat TYPE crmt_status_com-status .
    
    
            p_guid = ACTIVITY GUID
            p_stat = STATUS
            p_proty = STATUS SCHEMA 
    
            IF p_guid IS NOT INITIAL.
              SELECT SINGLE * FROM crmd_orderadm_h INTO gs_crmd_orderadm_h
           WHERE guid = p_guid.
            ENDIF.
    
            es_objects_to_save  = gs_crmd_orderadm_h-guid.
            APPEND es_objects_to_save  TO et_objects_to_save .
    
            es_status-ref_guid       = gs_crmd_orderadm_h-guid.
            es_status-ref_kind       = 'A'.
            es_status-status         = p_stat.
            es_status-user_stat_proc = p_proty.
            es_status-activate       = 'X'.
            APPEND es_status TO et_status.
    
    
            cs_input_fields-ref_guid    = gs_crmd_orderadm_h-guid.
            cs_input_fields-ref_kind    = 'A'.
            cs_input_fields-objectname  = 'STATUS'.
    
    
            CONCATENATE es_status-status es_status-user_stat_proc INTO  cs_input_fields-logical_key.
    
            gs_field_names-fieldname = 'ACTIVATE'.
            APPEND gs_field_names TO gt_field_names.
    
            cs_input_fields-field_names = gt_field_names[].
            APPEND cs_input_fields TO ct_input_fields.
    
            CALL FUNCTION 'CRM_ORDER_MAINTAIN'
              EXPORTING
                it_status         = et_status
              IMPORTING
                et_exception      = it_exception
              CHANGING
                ct_orderadm_h     = ct_orderadm_h
                ct_orderadm_i     = ct_orderadm_i
                ct_input_fields   = ct_input_fields
              EXCEPTIONS
                error_occurred    = 1
                document_locked   = 2
                no_change_allowed = 3
                no_authority      = 4
                OTHERS            = 5.
    

    Best regards,

    Caíque Escaler

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 03, 2012 at 01:32 PM

    hi all,

    what ive done is to create an entity. Then i was able to set the property of the attribut ACT_STATUS. everything works fine!

    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.