Creating Activities Programmatically in CRM

Hi,
I am trying to use BAPI_ACTIVITYCRM_CREATEMULTI.
This is called within a BAdI when a contact responds to a survey.
I am evaluating the survey results and them trying to set the appropriate status.
I am successfully screating the activity document. However I am failing to set the status.
This is my code where I set the values of the Status tables to be passed in. I am only setting the status e.g. E0002 (Accepted) or E0004 (Declined) and the Activate flag.
Am I missing something?
  CALL METHOD ir_survey_values->values_get
    EXPORTING
      i_question_id = 'q1'
      i_answer_id   = 'id_answer'
    IMPORTING
      et_values     = et_result.
  READ TABLE et_result INTO es_result INDEX 1.
  IF es_result EQ 'id_yes'.
    MOVE 'E0002' TO es_status-status.
    MOVE 'X' TO es_statusx-activate.
    APPEND es_status TO et_status.
    MOVE 'X' TO es_statusx-status.
    MOVE 'X' TO es_statusx-activate.
    APPEND es_statusx TO et_statusx.
  ELSE.
    MOVE 'E0004' TO es_status-status.
    MOVE 'X' TO es_statusx-activate.
    APPEND es_status TO et_status.
    MOVE 'X' TO es_statusx-status.
    MOVE 'X' TO es_statusx-activate.
    APPEND es_statusx TO et_statusx.
  ENDIF.
* call function module BAPI_ACTIVITYCRM_CREATEMULTI
  REFRESH lt_return.
  CALL FUNCTION 'BAPI_ACTIVITYCRM_CREATEMULTI'
    TABLES
      header          = lt_header
      headerx         = lt_headerx
      partner         = lt_partner
      partnerx        = lt_partnerx
      date            = lt_date
      datex           = lt_datex
      status          = et_status
      statusx         = et_statusx
      created_process = lt_created_process.
Thanks
David

Thanks. It appears my problem was that I was using coding relevant to CRM 4 rather than CRM 5.
It seems all I needed was:
  CALL METHOD ir_survey_values->values_get
    EXPORTING
      i_question_id = 'q1'
      i_answer_id   = 'id_answer'
    IMPORTING
      et_values     = et_result.
  READ TABLE et_result INTO es_result INDEX 1.
  IF es_result EQ 'id_yes'.
    lv_act_status              = 'E0002'.      " In process
  ELSEif es_result eq 'id_no'.
    lv_act_status              = 'E0004'.      " Declined
    else.
    lv_act_status              = 'E0001'.      " Response
  ENDIF.

Similar Messages

  • Which function creates an activity in CRM?

    Hi,
    We would like to create activities in CRM through a BAPI-like function but we can't seem to find a suitable one. Do you know which function / class method is used to create new activities in CRM ?
    Thanks in advance,
    George

    Hi,
    Please have Look into  the below LInk
    Using BAPI_ACTIVITYCRM_CREATEMULTI.
    [Link|Re: Creating Activities Programmatically in CRM]
    Hope it will be HelpFul
    Thanks
    kalyan

  • Creating Activities in CRM using Word Templates and Web Services??

    Hi,
    This functionality can be achieved through Adobe Interactive Forms from what I have learnt through demos etc. We are checking the feasibility of using with Word Templates instead.
    This thread has multiple questions:
    We are trying to set up the activity creation as mentioned in the CRM70 system.
    1) At this point, finished the retrieval of information from the CRM Activity into a Word Template using a READ Web Service. Subsequently synchronized this with outlook and can see the Word document in the outlook item. Not able to open the same in Outlook, since it comes over as a XML document type. "Cannot open as there is a problem with the contents. ">" expected, line so and so...is the message
    2) I created a Web Service that writes as well into CRM and would like to use this from the Word Template to create the activity in CRM
    2a) Can the word template be incorporated with buttons that can trigger creation in CRM, similar to Adobe "Execute" etc
    2b) If yes, and If there are some custom fields that I add to the activity transaction, in the UI, can I populate these with input from the Word Template, as well
    Regards,
    Ashwin

    Hell Wregs,
    You can create the Product in CRM GUI,by using Transaction:COMMPR01,not mandatory to have WebUI..,
    but b4 that you need to set up Product Hierarchy and Product category under which the Products can be created.
    Use Transaction:COMM_HIERARCHY Transaction to do this.
    Hope this helps
    let me know if any further questions
    Thanks & Regards
    Arshad

  • Error while creating activities from Account application (Activity tab page

    Hi Experts,
                       We are using CRM 5.0 with PCUI ( EP 7.0 version). We are getting  below error when try to create activities from Account application in PCUI ( from activity tab page):
    Error : Activity contains error.
    Diagnosis
    This transaction has errors.
    Procedure
    To correct the errors, go to the maintenance interface of the transaction.
    To navigate to there, use the link to the account application
    Pls suggest how to proceed with this error & helpful solutions would be rewrded generously.
    Regards,
    Basavaraj Patil

    Hi Experts,
    We are getting this error when try to create Activity from Account application in PCUI. But the same thing is working fine in at GUI level & actions profile assigned to Activity transaction is also working fine at GUI level. But in PCUIit is throwing this below error.
    Diagnosis
    You have attempted to create a follow-up transaction for an incorrect transction 2000764. This is not possible. You can only create follow-up transactions for error-free transactions.
    System Response
    The follow-up transaction is not created.
    Procedure
    Correct the errors in the source transaction 2000764. The error messages resulting from processing the error can be read in the application log in the source transaction.
    Pls suggest solution for this.
    Thanks in Advance.
    Regards,
    Basavaraj Patil

  • Create Free Goods in CRM Standalone

    This question is for Paul.
    Thanks Paul for your reply to my other question yesterday and I did award points. However, since I am using a standalone CRM there is no way for me to replicate any free goods condition type from from ECC.
    My question is, if I have a product A and product B in the CRM standalone system, what configuration I need to make so that when I enter product A in my sales order, product B will be added to the next order line as free goods?
    Your input is appreciated.
    Leon

    Hi Leon,
    There is no need to create separate free goods materials/products in CRM. You can make use of the existing materials/products as free goods by assigning appropriate free good condition records. In general free goods master data like materials and pricing condition records can be downloaded from R/3 into CRM. You need to do only the necessary free goods customizing activities under SPRO > CRM > Basic Functions > Free Goods > Setup Free Goods
    Please refer to the below SAP help document on free goods for complete understanding : http://help.sap.com/saphelp_crm50/helpdata/en/b7/4a893a8729337be10000000a11402f/frameset.htm
    Refer to the section ‘Replicating Condition Customizing (SAP CRM)’ in C03 best practice document for free good condition records master data download into CRM
    Refer to the section ‘Replicating Specific Conditions’ in B09 best practice document for free good customizing data download into CRM
    Refer to the section ‘Free Goods’ in C34 best practice document for free good CRM customizing activities.
    <b>Do not forget to reward if it helps</b>
    Regards,
    Paul Kondaveeti

  • Create Free Goods in CRM

    Hi Gurus,
    Could you please forward me the configuration document on how to create free goods?
    Many thanks!
    Leon

    Hi Leon,
    There is no need to create separate free goods materials/products in CRM. You can make use of the existing materials/products as free goods by assigning appropriate free good condition records. In general free goods master data like materials and pricing condition records can be downloaded from R/3 into CRM. You need to do only the necessary free goods customizing activities under SPRO > CRM > Basic Functions > Free Goods > Setup Free Goods
    Please refer to the below SAP help document on free goods for complete understanding : http://help.sap.com/saphelp_crm50/helpdata/en/b7/4a893a8729337be10000000a11402f/frameset.htm
    Refer to the section ‘Replicating Condition Customizing (SAP CRM)’ in C03 best practice document for free good condition records master data download into CRM
    Refer to the section ‘Replicating Specific Conditions’ in B09 best practice document for free good customizing data download into CRM
    Refer to the section ‘Free Goods’ in C34 best practice document for free good CRM customizing activities.
    <b>Do not forget to reward if it helps</b>
    Regards,
    Paul Kondaveeti

  • I have created a quotation in CRM system. I want that to be downloaded into ECC, so that, I can create a sales order there with reference to that quotation. So, what are the parameters that I need to set in CRM system so that my quotation gets replicated?

    Dear Experts,
    I have created a quotation in CRM system. I want that to be downloaded into ECC, so that, I can create a sales order there with reference to that quotation. What are the parameters that I need to set in CRM system so that my quotation gets replicated without any error?
    Please help me in this regard. An early and in detail step by step guidance is highly appreciated.
    Thanks,
    SMTP

    It may be best to recreate the folder and the smart playlists from scratch.
    tt2

  • On Workflow completion in ECC create Service ticket in CRM

    Hi Experts,
    Our client requirement is to create service ticket in CRM on completion of work flow in R3 system.
    Can anyone please advice me how to achieve the above requirement.
    Thanks in advance
    Kind Regards,
    Veined.

    Hello,
    You may try to call an RFC FM in CRM from ECC as the last step in your WF.
    Regards,
    Sharif.

  • Problem using BAPI to create Service Confirmation in CRM

    Good afternoon all.
    I have raised this is CRM forum too, just thought it best to ask the broader ABAP community the question too.
    We are encountering a problem using a BAPI to create a transaction in CRM, specifically:
    I am trying to create a Service Confirmation (BUS2000117) in a CRM system using the BAPI BAPI_BUSPROCESSND_CREATEMULTI.
    The BAPI succeeds in creating the header of the transaction, but I cannot make the BAPI create any other data in the transaction such as partners or items.
    Just want to be sure that I am not being foolish...has anyone succeeded in using this BAPI to create an error-free Service Confirmation?
    Regards
    Nick

    I am going to pop this thread into General ABAP forum too.
    Nick

  • How to create custom report in crm 2013

    Hi,
    I want to create custom report in crm 2013. I want to show Contact information in report. My scenario is that when I select multiple record and run report then contact information show in different pages. I want to show record in textbox in report. Here
    is an example of display record

    Hi Aamir,
    Have a look at below link it shows step by step how to create custom SSRS report.
    http://www.njevity.com/blog/creating-dynamics-crm-2011-reports-sql-reporting-services-pre-filtering-and-default-filters
    It tells using fetchxml, you can use SQL query as well. You need to use pre filtering to run report on selected record.
    Thanks,
    Prasad
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

  • Is it possible to create custom buttons in CRM Ondemand?

    Hi,
    Is it possible to create custom buttons in CRM Ondemand in any detail page like the inbuilt buttons like 'New', 'Delete' etc? If possible then how?
    Thanks
    Arpita

    You can add a button using custom javascript. but this could potentially have performance issues. please test the performance and functionality if you implement a lot javascript
    see this link : http://helponmyproject.com/TTOCOD/
    Regards,
    Royston

  • I need to create a  Notification in CRM WebUI  When we create a new contract

    Hi Experts,
    I am working in Utility Industry and as per the business requirement I need to create a  Notification in CRM WebUI
    When we create a new contract & click on apply button.
    As per my knowledge we are not maintaining Notification information in CRM System. So could you please
    help me to call IW52 during the new contract creation when we click on apply button.
    Thanks
    Roli

    Hello Roli,
    If your requirement is to launch Transaction IW52 after clicking apply button then you can use Transaction Launcher tool in CRM to integrate to CRM WebClient UI.
    Calling Transaction Launcher on user action
    BOR object or ITS based Transaction Launcher
    Regards,
    Ashik

  • How to create Lease Contract in CRM using CRMXIF_ORDER_SAVE

    Hi All,
    I need to upload CRM Lease contract from Legacy data in a flat file. I have created a test program where I call function module "CRMXIF_ORDER_SAVE".
    When I run this FM, it is creating a BDoc of type BUS_TRANS_MSG and I can see them in Txn SMW01
    Couls anyone please tell me:
    1. What next steps I need to follow to create a Lease Contract. Do I need to do some setting for BDoc consumoption.
    2. Is there any other alternative way like BAPI etc to create lease contract in CRM.
    <b>Reward point is gurranted for REAL HELPFUL answers.</b>
    -Regards
    Ashim
    I am also attching the code of my test program
    *& Report  YTESTCRMXIF_ORDER_SAVE
    REPORT  YTESTCRMXIF_ORDER_SAVE.
    DATA WA_CRMXIF_BUSTRANS_T TYPE CRMXIF_BUSTRANS_T.
    DATA WA_CRMXIF_BUSTRANS TYPE CRMXIF_BUSTRANS.
    DATA WA_CRMXIF_ORGMAN   TYPE CRMXIF_ORGMAN.
    DATA: WA_CRMXIF_STATUS   TYPE CRMXIF_STATUS,
          ITAB_STATUS LIKE TABLE OF WA_CRMXIF_STATUS.
    DATA:  WA_BAPIRETM TYPE BAPIRETM,
           WA_BAPIRETI TYPE BAPIRETI .
    DATA: WA_BAPIRETC TYPE BAPIRETC.
    DATA: WA_PARTNER TYPE CRMXIF_PARTNER,
          ITAB_PARTNER LIKE TABLE OF WA_PARTNER.
    DATA: BEGIN OF WA_TEMP_PARTNER,
          PARTNER_NO(10) TYPE C,
          PARTNER_FCT(8) TYPE C,
          PARTNER_PFT(4)    TYPE C,
          PFT_SUBTYPE(4) TYPE C,
          END OF WA_TEMP_PARTNER,
          ITAB LIKE TABLE OF WA_TEMP_PARTNER.
                  FILLING THE STRUCTURE OF THE PARTNER                    *
               WA_TEMP_PARTNER-PARTNER_NO = '0010000002'. WA_TEMP_PARTNER-PARTNER_FCT = '00000035'.
          WA_TEMP_PARTNER-PARTNER_PFT = '0012'.       WA_TEMP_PARTNER-PFT_SUBTYPE = 'CRM '.
          APPEND WA_TEMP_PARTNER TO ITAB.
          WA_TEMP_PARTNER-PARTNER_NO = '0010000002'. WA_TEMP_PARTNER-PARTNER_FCT = 'Z0000002'.
          WA_TEMP_PARTNER-PARTNER_PFT = '0029'.       WA_TEMP_PARTNER-PFT_SUBTYPE = 'CRM '.
          APPEND WA_TEMP_PARTNER TO ITAB.
          LOOP AT ITAB INTO WA_TEMP_PARTNER.
          MOVE-CORRESPONDING WA_TEMP_PARTNER TO  WA_PARTNER.
          APPEND WA_PARTNER TO ITAB_PARTNER.
          ENDLOOP.
           END    FILLING THE STRUCTURE OF THE PARTNER                    *
                  FILLING THE STRUCTURE OF THE ORDER HEADER               *
    WA_CRMXIF_BUSTRANS-OBJECT_TASK    = 'I'.
    WA_CRMXIF_BUSTRANS-PROCESS_TYPE   = 'LEAS'.
    WA_CRMXIF_BUSTRANS-OBJECT_TYPE    = 'BUS2000114'.
    WA_CRMXIF_BUSTRANS-POSTING_DATE   =  20061026.
    WA_CRMXIF_BUSTRANS-DESCR_LANGUAGE = 'E'.
    WA_CRMXIF_BUSTRANS-CREATED_AT     = 20061026203200.
    WA_CRMXIF_BUSTRANS-CREATED_BY     = 'DUTTAK'.
    WA_CRMXIF_BUSTRANS-CALC_SCHEMA    = 'Z00050'.
    WA_CRMXIF_BUSTRANS-SCENARIO       = 'A'.
    WA_CRMXIF_BUSTRANS-LOGICAL_SYSTEM = 'CDTCLN400'.
    WA_CRMXIF_BUSTRANS-CRM_RELEASE    = 'BBPCRM 500'.
    WA_CRMXIF_BUSTRANS-CLIENT         =  400.
           END FILLING THE STRUCTURE OF THE ORDER HEADER                  *
                  FILLING THE STRUCTURE OF THE ORGMAN                     *
    WA_CRMXIF_ORGMAN-SALES_ORG      = 'O 50000000'.
    WA_CRMXIF_ORGMAN-SALES_ORG_RESP = 'O 50000000'.
    WA_CRMXIF_ORGMAN-DIS_CHANNEL    = '10'.
    WA_CRMXIF_ORGMAN-DIVISION       = '20'.
           END FILLING THE STRUCTURE OF THE ORGMAN                        *
                  FILLING THE STRUCTURE OF STATUS                         *
    WA_CRMXIF_STATUS-STATUS = 'I1282'.
    WA_CRMXIF_STATUS-ACTIVE = 'X'.
    WA_CRMXIF_STATUS-TXT04  = 'CONH'.
    WA_CRMXIF_STATUS-TXT30  = 'Contract Header'.
    APPEND WA_CRMXIF_STATUS TO ITAB_STATUS.
           END FILLING THE STRUCTURE OF THE STATUS                        *
    MOVE WA_CRMXIF_ORGMAN TO WA_CRMXIF_BUSTRANS-ORGDATA-DATA.
    MOVE ITAB_STATUS TO WA_CRMXIF_BUSTRANS-STATUS-DATA.
    MOVE ITAB_PARTNER TO WA_CRMXIF_BUSTRANS-PARTNER-DATA.
    APPEND WA_CRMXIF_BUSTRANS TO WA_CRMXIF_BUSTRANS_T.
    *LOOP AT WA_CRMXIF_BUSTRANS_T INTO WA_CRMXIF_BUSTRANS.
    *LOOP AT WA_CRMXIF_BUSTRANS-PARTNER-DATA INTO WA_PARTNER.
    WRITE: / WA_PARTNER-PARTNER_NO,WA_PARTNER-PARTNER_PFT,WA_PARTNER-PARTNER_FCT.
    ENDLOOP.
    *ENDLOOP.
    CALL FUNCTION 'CRMXIF_ORDER_SAVE'
    EXPORTING DATA = WA_CRMXIF_BUSTRANS_T
    IMPORTING RETURN = WA_BAPIRETM.
    IF SY-SUBRC = 0.
    WRITE 'CONTRACT CREATED SUCCESSFULLY'.
    ELSE.
    WRITE: 'SY-SUBRC =', SY-SUBRC.
    ENDIF.
    LOOP AT WA_BAPIRETM INTO WA_BAPIRETI.
    LOOP AT WA_BAPIRETI-OBJECT_MSG INTO WA_BAPIRETC.
    WRITE: / WA_BAPIRETC-MESSAGE , WA_BAPIRETC-TYPE,WA_BAPIRETC-NUMBER.
    WRITE: / WA_BAPIRETC-MESSAGE_V1,WA_BAPIRETC-MESSAGE_V2.
    ENDLOOP.
    ENDLOOP.

    hi, it looks the crm pricing configuration doesn't suitable to the order data you inbounding.
    You can try to input a order according to your inbound data in SAP GUI or WEB UI order screen,  to check if the same error will also appear like IDOC inbound.  If so, then the configuration is in problem.  
    You can check the pricing related configure,  like pricing procedure,  procedure assign,  pricing condition record ,types,  and IPC if it is activated or not.
    If not,  you can check the data your filled in idoc,  maybe it is a data problem.

  • How to create an appointment in crm webui?

    hello experts!
    i'm verymuch new to crm webui. would anybody please let me know how to create an appointment in crm web ui. even though i established a account and contact relationship in t-code BP in GUI. The error still pops up asking me to enter Sales organization,distribution channel and division.
    regards
    sanguine

    You can follow chapter "3.1 Maintaining Organizational Data Profile" from best practices' building block ['C23: CRM Basic Sales'|http://help.sap.com/bp_crm70/BBLibrary/HTML/C23_EN_DE.htm]. For "Organizational Model Determin. Rule" instead of a rule 10000166 enter 10000194. It will determine org. data from current user.
    Also take a look in near settings. There you can define your own rule.
    Or check this thread Org Unit determination based on Emp Resp in Task which describes how to create profile for employee responsible.

  • FM for Create ASN programmatically in SNC (Supplier Network Collaboration)

    Hello,
    I am working in SNC (Supplier Network Collaboration) with version SAP SCM 7.0. I wanted to create ASN programmatically.
    Can anyone tell me the ways possible to create ASN programmatically using purchasing information?
    Thanks & Regards,
    Nitin

    HI Jens,
    In our forum, we discussed topic about BizTalk & SAP Integration before, hope it helps you.BizTalk
    & SAP Integration
    Best regards,
    Angie
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for

  • Enhancement of BP_ADDR component

    Hello, We are using CRM 2007, for one of the requirement we need to accumudate the source of enquiry creation. So we have selected the data origin field under the View :BP_ADDR. We have enhanced this field to Dropdowon lis box to display all the prob

  • I backed up onto the cloud but I cant find it in my cloud

    Backed up from my phone and now nothing shows up in my cloud?

  • Id on iphone

    how do i change my apple id from my old email to my new on my iphone so I can access my apple and itunes

  • I have Lightroom 3.6, which Photoshop should I add to edit faces & textures?

    I am an amateur photographer.  I have Lightroom 3.6 and use to manage and edit my existing shots.  I am interested in having more creative control over my shots by adding textures as well as more easily removing flaws in faces or photos than Lightroo

  • How to store contexts of HTMLB TextEdit in R/3

    Hi, I've searched everywhere for examples on this and found nothing. Has anybody managed to store contexts of HTMLB TextEdit in R/3 and retrieve them into a TextEdit ? As Eddy just taught me, 10 points to the best answer Milan.