CRM CICO - Automatically complete follow on activities

Hi all,
In tcode CIC0 to automatically complete the activities I am trying to use BAPI BAPI_ACTIVITYCRM_CHANGEMULTI. I am forwarding the whole program too. Can anyone please tell me why the progrm si not working ?
REPORT  z_crmorderread.
DATA : lt_header_guid TYPE crmt_object_guid_tab,
       wa_header_guid TYPE crmt_object_guid,
       wac TYPE  crmt_object_guid,
       lt_doc_flow TYPE crmt_doc_flow_wrkt,
       wa_doc_flow TYPE crmt_doc_flow_wrk,
       lt_status TYPE crmt_status_wrkt,
       lt_save TYPE TABLE OF bapibus20001_guid_dis,
       wa_save TYPE bapibus20001_guid_dis,
       h_header TYPE TABLE OF bapibus2000110_header_ins,
       wah_header TYPE bapibus2000110_header_ins, " work area
       hx_header TYPE TABLE OF bapibus2000110_header_insx,
       wahx_header TYPE bapibus2000110_header_insx, " work area
       s_status TYPE TABLE OF bapibus20001_status_ins,
       was_status TYPE bapibus20001_status_ins, " work area
       lt_input_fields type table of BAPIBUS20001_INPUT_FIELDS,
       wa_input_fields type  BAPIBUS20001_INPUT_FIELDS,
       sx_status TYPE TABLE OF bapibus20001_status_insx,
       wasx_status TYPE bapibus20001_status_insx. " work area
DATA : return TYPE TABLE OF bapiret2,
       vc_log_handle TYPE balloghndl, " log_handle
       saved_objects TYPE TABLE OF bapibus20001_object_id,
       return2 TYPE TABLE OF bapiret2.
*---- Here I am hardcoding the GUID of the complaint.
wa_header_guid = '44401B7FCBF1016C00000000888DE646'.
APPEND wa_header_guid TO lt_header_guid.
CALL FUNCTION 'CRM_ORDER_READ'
EXPORTING
    it_header_guid                = lt_header_guid
IMPORTING
    et_status                     = lt_status
    et_doc_flow                   = lt_doc_flow
  CHANGING
    cv_log_handle                 = vc_log_handle
     EXCEPTIONS
       DOCUMENT_NOT_FOUND            = 1
       ERROR_OCCURRED                = 2
       DOCUMENT_LOCKED               = 3
       NO_CHANGE_AUTHORITY           = 4
       NO_DISPLAY_AUTHORITY          = 5
       NO_CHANGE_ALLOWED             = 6
       OTHERS                        = 7
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
READ TABLE lt_doc_flow INTO wa_doc_flow INDEX 1.
wah_header-guid = wa_doc_flow-objkey_b.
wa_input_fields-REF_GUID = wa_doc_flow-objkey_b.
append wa_input_fields to lt_input_fields.
was_status-ref_guid = wa_doc_flow-objkey_b.
wac = wa_doc_flow-objkey_a.
wa_save-guid = wa_doc_flow-objkey_b.
APPEND wah_header TO h_header.
wahx_header-guid = 'X'.
APPEND wahx_header TO hx_header.
was_status-status = 'E0005'.
APPEND was_status TO s_status.
wasx_status-ref_guid = 'X'.
wasx_status-status = 'X'.
APPEND wasx_status TO sx_status.
CALL FUNCTION 'BAPI_ACTIVITYCRM_CHANGEMULTI'
TABLES
   header              = h_header
   headerx             = hx_header
   status              = s_status
   statusx             = sx_status
  input_fields        = lt_input_fields
   return              = return.
APPEND wa_save TO lt_save.
**commit work.
CALL FUNCTION 'BAPI_ACTIVITYCRM_SAVE'
                EXPORTING
                  UPDATE_TASK_LOCAL       = 'X'  "update_task_local
                  SAVE_FRAME_LOG          = 'X'  "save_frame_log
IMPORTING
   log_handle              = vc_log_handle
TABLES
   objects_to_save         = lt_save
   saved_objects           = saved_objects
   return                  = return2.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
    wait = 'X'.
COMMIT WORK.
break-point.
The contents of both return tables are :
                                                         Return :
W   |CRM_ORDER           |004   |Referenced object type (STATUS) not allowed
S   |CRM_MESSAGES        |006   |Start of processing 'Individual receipt'
Return2
E   |CRM_ORDER           |037   |The document could not be saved
Regards and thanks in advance,
Varun.

Hi
You should set a break-point in function module crm_order_maintain and manually close a follow on.  By doing this you will see exactly what values you need to pass to the function module.  You will also see that this function module will get fired a few times, depending on what processing you do to the follow up.
Here is the code I use for closing an interaction record, I hope it helps...
  DATA:
  ls_input_field   TYPE crmt_input_field,
  lt_input_field   TYPE crmt_input_field_tab,
  ls_input_names   TYPE crmt_input_field_names,
  lt_input_names   TYPE crmt_input_field_names_tab,
  lt_orderadm_h      TYPE crmt_orderadm_h_wrkt,
  ls_orderadm_h      TYPE crmt_orderadm_h_wrk,
  et_status TYPE crmt_status_comt,
  es_status TYPE crmt_status_com,
  wa_status type crmt_status_wrk.
      es_status-ref_guid       =  iv_guid.
          es_status-ref_kind       = 'A'.
          es_status-status         = 'E0003'.
          if ls_orderadm_h-process_type = 'Z001'.
            es_status-user_stat_proc = 'ZINTREC'.
          else.
            es_status-user_stat_proc = 'ZCALLIST'.
          endif.
          es_status-activate       = 'X'.
          append es_status to et_status.
          ls_input_field-REF_GUID    = iv_guid.
          ls_input_field-REF_KIND    = 'A'.
          ls_input_field-OBJECTNAME  = 'STATUS'.
          if ls_orderadm_h-process_type = 'Z001'.
            ls_input_field-LOGICAL_KEY = 'E0003ZINTREC'.
          else.
            ls_input_field-LOGICAL_KEY = 'E0003ZCALLIST'.
          endif.
          clear ls_input_names.
          ls_input_names-FIELDNAME = 'ACTIVATE'.
          append ls_input_names to gt_field_names.
          ls_input_field-field_names = gt_field_names[].
          append ls_input_field to lt_input_field.
          CALL FUNCTION 'CRM_ORDER_MAINTAIN'
            EXPORTING
              it_status         = et_status
            CHANGING
              ct_orderadm_h     = it_orderadm_h
              ct_input_fields   = lt_input_field
            EXCEPTIONS
              error_occurred    = 1
              document_locked   = 2
              no_change_allowed = 3
              no_authority      = 4
              OTHERS            = 5.
    CALL FUNCTION 'CRM_ORDER_MAINTAIN'
            EXPORTING
              it_status         = et_status
            CHANGING
              ct_orderadm_h     = it_orderadm_h
              ct_input_fields   = lt_input_field
            EXCEPTIONS
              error_occurred    = 1
              document_locked   = 2
              no_change_allowed = 3
              no_authority      = 4
              OTHERS            = 5.
CALL FUNCTION 'BAPI_ACTIVITYCRM_SAVE'
  TABLES
  objects_to_save = lt_save
  saved_objects = saved_objects
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
  EXPORTING
  wait = 'X'.
  COMMIT WORK.

Similar Messages

  • Automatically complete pending interactive activities within a process

    What is the best approach for automatically completing pending interactive activities within a process?
    Scenario: If you have two or more threads within a split-join and one thread completes all the defined activities whilst the other thread is still waiting for an interactive step to be completed, is there a programmatic way of completing outstanding tasks i.e remove them from the workspace task list and move then onto the next task
    At the moment we have just configured the join activity to only wait for one process to complete but I was wondering if there was a way using the java api.
    Thanks in advance

    What I think you're asking is how to complete activities in the split so the instance can go onto the next activity after the join. If so then use just use
    Action = RELEASE;
    in the join. You'll need to surround this statement with appropriate conditional statements since the code in the join runs each time an instance copy (from one of the branches) reaches the join. You'll need to test to see if the instance is ready to proceed then do the action=release.
    If this is not what you want then you may need to involve something more complex, like placing a Notification Interrupt in your process. By interrupting the interactive in a split/join, you can perform these activities from within the interrupt process flow:
    OK / NONE      Indicates that PBL-Method execution was successful. This is the default value.
    FAIL                Indicates that the PBL-Method has failed its execution. The PBL-Method must be executed again, if it is so required.
    CANCEL           PBL-Method execution is aborted.
    REPEAT           Indicates that the PBL-Method execution is successful, but not recorded as completed.
    RELEASE           Ends the PBL-Method execution and releases the instance from this activity.
    ABORT           Ends PBL-Method execution and aborts the entire process instance.
    BACK           Ends PBL-Method execution and sends the instance back to the activity where the exception (or interruption) occurred.
    SKIP                Ends PBL-Method execution and sends the instance back to the activity where the exception (or interruption) occurred and skips it.
    Note the last one allows you to skip the interactive upon return and go to the next activity. Sorry I can't help any further. You may want to describe you're problem some more and perhaps we can help you better.
    Mark

  • Automatic release of network activities

    We are currently completing the configuration/implementation of the
    Project System module.
    We want SAP to automatically release the following network activities
    upon final confirmation of an activity.
    As an example, letu2019s say we have a simple network of 3 activities:
    Activity 10 (Predecessor of activity 30, type of relationship
    is FS with activity 30)
    Activity 20 (Also predecessor of activity 30, type of
    relationship is FS with activity 30)
    Activity 30 (Successor of activities 10 and 20u2026therefore,
    activities 10 and 20 are predecessors of activity 30)
    Based on these relationships, before activity 30 may begin (or may be
    released), both activities 10 and 20 must have been completed.
    If a u201Cfinal confirmationu201D is set on activity 10, we want SAP to
    automatically set the u201Creleaseu201D status on activity 30 if, and only if
    activity 20 is also final confirmed.
    We are trying to accomplish this using the milestone function
    If we put a milestone on activity 10u2026
    In the milestone, we:
    Set the u201Cfunctionsu201D indicator
    Select the function u201C Release following activitiesu201D
    Enter the status CNF for confirmed in the u201CSyst.STS u201Cfield.
    Set the u201CChange statusu201D indicator to +
    Letu2019s say we now have the following statuses on the network activities:
    Activity 10 = REL
    Activity 20 = REL
    Activity 30 = CRTD
    Then, if we final confirm (status CNF) on activity 10, SAP triggers the
    milestone function and release activity 30, even if activity 20 is not
    confirmed yet!!!
    After final confirmation of activity 10, the statuses on the network
    activities are:
    Activity 10 = CNF
    Activity 20 = REL
    Activity 30 = REL
    Why is it releasing activity 30, even if activity 20 is not confirmed?
    Activity 20 must be completed also before activity 30 may be
    released!!??
    Therefore, in this situation described, when the milestone on activity
    10 was triggered by the final confirmation of activity 10, activity 30
    should not have been released.
    Activity 30 should be released only when activity 10 and 20 would have
    the status CNF.
    What am I missing?
    How can I setup the milestone so it reacts properly, taking into
    account the relationships between the activities?
    I look forward to your inputs.
    Thanks
    Frederick

    Hello Frederick,
    unfortunately scenario described will not work. I. e. milestone function does not consider status of the other activity and will release the directly linked activity.
    One may check whether required logic can be implmenented in customer exit CNEX0028 (not CNEX0029).
    As an alternative one may try to implement the logic in a substitution exit to trigger status change via ABAP internal function calls. However this requires a deep understanding of ABAP and of PS code.
    Kind regards
    Peter
    Edited by: Peter Kratz  on Apr 22, 2009 2:46 PM

  • Follow-up Activities from Leads/Opportunities

    HI,
    We have configured the follow-up Activities from Leads/Opportunities in CRM. We created a standalone PCUI BSP iView for Activities and assigned ACTIVITYCRM object type to our Role.
    Leads to follow-up Opportunities is working but from Leads/Opportunities to follow-up Activities is NOT working. Standalone Activities is working though directly from the menu.
    Any input/thought will be appreciated.
    Thanks,
    Jas

    Please check the follow the below points.
    1. SPRO -> CRM -> Layout of user Interface -> Navigation (URL generation) -> Assign Object Method to Role. (Check your role and object with Portal Role)
    2. Add "CRM_URL_BUFFER_OFF" = "X" Parameter in SU01 for the user.
    3. If you assigned many roles to the user in CRM check the Priority.
    I hope it will work.
    Regards,
    Bala.c

  • Upgrade to 4.0 - asking for 'follow-up activities for middleware'?!??!!

    HI,
    My upgrade from 3.1 to 4.0 has been going smoothly up to now.
    It stopped in phase REQ_BBWPCRM now asking me to perform the actions in the chapter 'Follow-up activities for the Middleware' in the documentation 'Upgrade Guide - CRM 5.0'.
    No mention of this is made in the Solution Manager 4.0 upgrade guide. I had a look at the CRM upgrade guide and those steps have nothing to do at all with Solution Manager and seem very CRM specific.
    Anyone has any advice on what to do at this point?
    I am tempted to just ignore this and to say Continue in the Upgrade Assistant, but I dont want to miss something important and then have to restore.

    See:
    * http://kb.mozillazine.org/Software_Update (Software Update not working properly)
    Remove the files in the updates and updates\0 folder.
    You may need to delete active-update.xml and updates.xml as well if present.
    You can probably find the updates folder in the Firefox program folder.

  • Need to assign follow up activities to Service Quotations

    Hi All,
    can any one give me soluton on
    Need to assign follow up activities to Service Quotations (Create Service Quotation type "ZAV"...transaction code VA21. Need quotes to print out 90 days before service is due again in the following year.
    Thanks in advance.

    Have you already customized Copy Control for your Service Order? If you want to add other transaction types the setting is necessary.
    The customizing path is shown as below.
    SPRO
    -> CRM
      -> Transactions
        -> Basic Settings
          -> Copying Control for Business Transactions
            -> Define Copying Control for Transaction Types
    Regards,
    Web

  • Visibility of follow up activities

    Hi All,
    within the webgui of CRM 2007, we can't figure out how to distinguish follow up activities within the account overview.
    All activities are visible, but the user can't see or an activity is a follow up activity from an other activity or not. This was possible in the old GUI (transaction CIC0), it was possible to expand an activity and see the follow up activities.
    Anybody got an idea how to solve this?
    Kind regards
    Immanuel

    Hi,
    To get the followup transactions in WEB UI do the customise setting suggest as below..
    STEP1:
    Path:
    Customer Relationship Management>Transactions->Basic Setting>Define Transaction Types.
    Select the required transaction types and assign CRM WEB UI at the CHANNEL level to the transactions as per the requirement.
    STEP2:
    Maintain Copying Control for Business Transactions what ever you required as a followup transactions.
    I think with the STEP 1 you can resolve the issue which you are facing.
    Let me know if you are facing any challenge in COPY CONTROLES.
    Regards,
    Sathyadev Kanagala.
    Edited by: Kanagala Sathyadev on May 28, 2009 5:02 PM
    Edited by: Kanagala Sathyadev on May 28, 2009 5:03 PM

  • Follow-up Activities for ERP Order (ERP_H)

    Hello,
    is it possible to create follow-up activities for documents which are in ERP (not CRM).
    For example for the quotations and sales orders which are visible in CRM using component ERP_H?
    Is anybody using such a scenario of CRM activities for ERP quotations / orders?
    Thanks a lot
    best regards
    Manfred

    Hi Manfred,
    It is possible to create follow-up activities for documents which are in ERP (not CRM) like the ERP Sales Order as a Standard functionality, meaning the Activities in CRM can be created as a follow up document to ERP sales order.
    Assign the Channel Interaction Center WebClient to the transaction type (Activities) in SPRO and you will see the follow up activity to the ERP Sales order
    Is anybody using such a scenario of CRM activities for ERP quotations / orders?
    --> We have a scenario to create an activity from ERP order. I assigned the channel as mentioned above and I can see the follow up activity to ERP sales Order.
    Hope this helps.
    Regards,
    Chandrakant

  • Follow-up Activities in Recruitment...

    Hi Experts,
    I have a query regarding 'Recruitment-PB60'. When I try to do 'Follow-up Activities', it is not working & giving me an error- 'Activity
    type 007 not maintained (Choose another Entry) & likewise Activity Type 018 & 016 not ..............'
    How would it be sorted out? Kindly explain.
    Thanks & Regards,
    Geeta Chaudhary.

    Hi,
    If you are hiring the applicant after completing  the Bulk processing PBA3.
    1. In PB60 you first select the Hire date from the planned activities and click on  Follow-up activities then from the pop p screen tick the completed activity as interview inv.
    In the next pop up complete activity select the activity type 016 interim reply.
    2. Next again select the hire date from the planned activity and go to edit and select created completed activity and select the activity type 014 Hiring date.
    Try to execute this and see.

  • Follow up Activities in CRM2007

    Hi Folks ,
    I m trying to creat a follow up activities for Lead , Opportunity - Activities is generating but im not able to open the Activity - The following is the Warning messages which is displayed.
    CRM_UI_FRAME/WorkAreaViewSet - Details for Diagnosis
    An exception occurred during request processing. This was handled centrally. It changed the program flow and the result of the request probably contains errors.
    Procedure
    Contact your system administrator.
    Procedure for System Administration
    Activate checkpoint group BSP_WD_EXCEPTION_DISPLAY. To do this, use transaction SAAB. If the error recurs, further details are displayed.
    I have maintained the steps as mentioned above - but also i could not able to view the activites . If i cross check in the GUI - I able to open & create the activities .
    If any body has faced same problem - Please provide your valueable inputs.
    Regards,
    Amrita

    Hi Amrita,
    you said you activated checkpoint group BSP_WD_EXCEPTION_DISPLAY for your user in TX SAAB.
    What is the extended error message that is shown on the UI now?
    As everything is working fine in SAP GUI it will most likely be an error related to the WebClient component.
    cheers Carsten

  • Delete all entries from the following tables - Follow-up Activities (oracle)

    Hello,
    I performed a homogeneous system copy of our development BW system with the database (oracle 11.2.0.3) from the BW production system!
    I already start the oracle database and the SAP system in the target system/server (development BW system) and I´m doing some follow-up activities. One of this activities is (at the system copy guide 6.2.3.2 Activities at Database Level) is to delete all entries from the following tables:
    DBSTATHORA, DBSTAIHORA, DBSTATIORA, DBSTATTORA
    I tried to delete them using SQL Plus:
    sqlplus /nolog
    SQL> connect /as sysdba
    SQL> delete from DBSTATTORA;
    delete from DBSTATTORA
    ERROR at line 1:
    ORA-00942: table or view does not exist
    ... and it show me that error message.
    This is strange because when I go to transaction SE14 and check the DBSTATTORA I see that table exist and contain a lot of entries!
    Why this is happened in SQL Plus!? I´m running the correct SQL statement for doing this type of task or not?
    How can I delete the entries of that tables? Can I do that using the transaction SE14?
    Can you help me please?
    Thank you,
    samid raif

    Hello
    sqlplus /nolog
    SQL> connect /as sysdba
    SQL> delete from DBSTATTORA;
    delete from DBSTATTORA
    ERROR at line 1:
    ORA-00942: table or view does not exist
    It doesn't surprise me as you are not mentioning the schema name here. Instead it should be
    delete from SAPSR3.DBSTATTORA;
    Assuming the schema owner is SAPSR3. if the owner is different then replace that with the correct one.
    Regards
    RB

  • Interaction records,Service tickets,Follow-up activities

    hi all!
    I need objects (FM, BDoc’s...Etc...) that related to interaction records, service tickets, follow-up activities of the business partners.
    can anybody help me out.
    regards
    sachin

    My question was answered by Experts.
    1.I tried with the code to retirve GUID,HEADER/ITEM Guid's related to the BPnumber from CRMF_ORDER_INDEX table.
    2.I have stored header/item GUID's in different internal tables and append all the values that fetched above with in the loop.
    3. Clear header/item guid's,that they can have next value in the loop.(Important)
    4.Next step call the FM CRM_ORDER_READ with in the loop and assign import/export parameters.
    4.Display the records.
    Thanks for Everything.........

  • !How to find out follow up activities created during creation of an Order??

    Hi Gurus,
    I want to find out the number of follow up activities created during creation of an Order??
    Is there any BAPI or Function Module which can detrmine the number of follow up activities after creation / saving an Order..
    Please Reply fast.
    Thanks
    Pranay

    Hi Pranav,
    I am confident this will solve your problem:
    <b>Step 1.</b>
    Enter the guid of the current order into function module
    CRM_DOC_FLOW_READ_DB.
    Code:
    DATA : t_doc_links TYPE crmt_doc_flow_db_wrkt,
               v_guid TYPE crmt_object_guid.
    v_guid = <guid of the order from table crmd_orderadm_h>
    CALL FUNCTION 'CRM_DOC_FLOW_READ_DB'
                  EXPORTING
                    iv_header_guid = v_guid
                  IMPORTING
                    et_doc_links   = t_doc_links
                  EXCEPTIONS
                    error_occurred = 1
                    OTHERS         = 2.
    <b>Step2.</b>
    Now loop through the returned table ie t_doc_links.
    Records which fulfill the following criteria are
    the follow up records.
      reltype    = 'VONA'
      objtype_b  = 'BUS2000126'
      objkey_b   =  v_temp
      roletype_b = 'NACHFOLGER'
      roletype_a = 'VORGAENGER'.
    <b>Step:3</b>
    Now Count the records which fulfill the above creteria.
    This count represent the number of followups created.
    <b>REWARD THE ANSWER WITH FULL 10 POINTS IF UR PROBLEM IS SOLVED.</b>
    thanks,
    ashish.

  • Treasury - Contract Expired - Any follow-up activities

    We had our first treasury contract mature in SAP since we went live and I'm not sure if any follow-up activities need to be done.  The contract is in status 'settlement.'  Is there a way to get the contract into an expired/matured type status?

    HI
    The settlement stage is the last  stage of a transaction based on it's  processing  category.
    You can define your  own processing steps (  unfortunately )) 
    Malolan R
      SAP  Treasury

  • Talent Review Meeting - Follow-up activities

    Hello Experts,
    We are on ERP 6.0 - EHP6.
    I have created a talent review meeting, but when I go to do the Follow-up Activities, the button is disabled. There is a Badi to enable this button?
    After creating this talent review metting, the value of performance and Potential was saved in infotype 7409 and 7408, but in my opinion it should be also saved in the appraisal documents and it doesn´t happen.
    Could you help me?
    Thank You
    Clemilda

    Hi Luke,
    Yes, I configurated look the prints bellow.
    The status off apraissal is
    The botton UPDATE_POST_TRM I create, because in the sistem don´t existe.
    I configurate the button in Talent Management and Talent Development --> Assessment of Employees -> Employee Assessment with Flexible Appraisal Processes-> Define Data Retrieval for Flexible Appraisal Processes->Assign Status Change to Appraisal Templates.
    Best regards,
    Clemilda

Maybe you are looking for

  • Crazy crazy crazy! Airport loses internet when second monitor attached!

    Can this really be happening? I decided to try using a second monitor attaching via a mini dvi -dvi converter. Several attempts to get it recognised by the iMac without any success. Scoured the internet groups to see that very many (and I mean very m

  • Shared Review - Network Drive - Acrobat X PRO problem [Urgent]

    Hello, We have a licensed genuine product of Adobe Acrobat X PRO in a company. When user is using shared review pdf on network drive ; sending as attachment works normally, sending as message (with a path to the network drive) it says an error (profi

  • Error in JMS adapter MQ to PI

    Hi, We are connecting to Websphere MQ using the JMS adapter. The message coming from MQ is a flat structure. So we have configured the Message Transform Bean to do the conversion from plain to xml structure according to http://wiki.sdn.sap.com/wiki/d

  • I/O error 21 when opening software...(windows xp)

    what happen to my macbook pro... just keep pop up the I/O error 21 when I open the software, but others pc open with no problem. :S any way to solve this problem?

  • Seacrh not working for "entire message", Help!

    Worked once but not anymore on my new MacPro. Search works for "To", "From" and "Subject" but not for "Entire Message". Really annoying as I use email to conduct most of my business. Does anyone have a solution please? Thanks!