BAPI_LEAD_CREATEMULTI  - with surveys

somebody knows like enclosing a survey to lead?
use ' BAPI_LEAD_CREATEMULTI ' but does not create the document of surveys.
thanks

Hello. I have this same problem. We need a RFC function module where user can enter a lead description and survey answers. Then lead with filled in description and survey  with filled in answers get created in CRM and linked together. I debugged crmd_bus2000108. Here is my solution( it is a little test program for now but it works ). You can determine input values for your case for FMs using debugging. Procedure:
-create lead using CRM_ORDER_MAINTAIN_MULTI_OW
-create survey and populate the data( like on evaluation tab of lead ) using object cl_crm_svy_runtime.
-link survey to existing lead using CRM_ORDER_MAINTAIN_MULTI_OW
-save lead with CRM_ORDER_SAVE
-commit changes with BAPI_TRANSACTION_COMMIT
Code:
*& Report  Z_TEST_LEAD_SURVEY
REPORT  z_test_lead_survey.
DATA: o_survey_runtime TYPE REF TO cl_crm_svy_runtime,
      o_surveyvalues TYPE REF TO cl_crm_svy_values,
      t_application_params TYPE crm_svy_api_parameter_t,
      t_all_values TYPE survy_t_all_values.
DATA: survey_data TYPE string,
      valuexml TYPE string,
      valuexml_hex TYPE xstring.
DATA: lead_guid TYPE guid_32,
      lead_id TYPE crmt_object_id,
      valueguid TYPE crm_svy_db_sv_guid,
      valueversion TYPE crm_svy_db_sv_vers.
DATA: s_lead_h TYPE crmt_lead_h_com,
      t_lead_h TYPE crmt_lead_h_comt,
      s_orderadm_h TYPE crmt_orderadm_h_com,
      t_orderadm_h TYPE crmt_orderadm_h_comt,
      s_field_names TYPE crmt_input_field_names,
      t_field_names TYPE crmt_input_field_names_tab,
      s_input_fields TYPE crmt_input_field,
      t_input_fields TYPE  crmt_input_field_tab,
      s_objects_to_save TYPE crmt_object_guid,
      t_objects_to_save TYPE crmt_object_guid_tab,
      s_saved_objects TYPE crmt_return_objects_struc,
      t_saved_objects TYPE crmt_return_objects,
      s_survey TYPE crmt_survey_com,
      t_survey TYPE crmt_survey_comt.
*                     CREATE LEAD
* Fill required structures
s_orderadm_h-object_id = 'BUS2000108'.
s_orderadm_h-process_type = 'ZLEA'.
s_orderadm_h-description = 'TEST LEAD - DENEB'.
APPEND s_orderadm_h TO t_orderadm_h.
s_input_fields-ref_kind = 'A'.
s_input_fields-objectname = 'LEAD_H'.
APPEND s_input_fields TO t_input_fields.
s_input_fields-ref_kind = 'A'.
s_input_fields-objectname = 'ORDERADM_H'.
*Subtable FIELD_NAMES
s_field_names-fieldname = 'DESCRIPTION'.
APPEND s_field_names TO t_field_names.
*/Subtable FIELD_NAMES
s_input_fields-field_names = t_field_names.
APPEND s_input_fields TO t_input_fields.
s_lead_h-lead_type = '0007'.
APPEND s_lead_h TO t_lead_h.
* Create lead
CALL FUNCTION 'CRM_ORDER_MAINTAIN_MULTI_OW'
  EXPORTING
    it_lead_h             = t_lead_h
    iv_collect_exceptions = ''
  CHANGING
    ct_orderadm_h         = t_orderadm_h
    ct_input_fields       = t_input_fields
  EXCEPTIONS
    error_occurred        = 1
    document_locked       = 2
    no_change_allowed     = 3
    no_authority          = 4
    OTHERS                = 5.
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* Get GUID of created LEAD for later saving
READ TABLE t_orderadm_h INTO s_orderadm_h INDEX 1.
s_objects_to_save = lead_guid = s_orderadm_h-guid.
APPEND s_objects_to_save TO t_objects_to_save.
* Potrdi spremembe
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
*                     CREATE SURVEY SURVEY
* Create survey answers input string
CONCATENATE 'svyApplicationId=CRM_SURVEY_LEAD'
            '&SurveyId=ZNEW_LEAD_FORM_SISVSAP'
            '&svySurveyId=ZNEW_LEAD_FORM_SISVSAP'
            '&svyVersion=0000000003'
            '&SchemaVersion=1'
            '&svySchemaVersion=1'
            '&svyLanguage=EN'
            '&conid='
            '&survey/result/address/name1=Deneb Debelak'
            '&survey/result/address/street=Tekstilna 17a'
            '&survey/resultaddress/postalcode=4000'
            '&survey/result/address/city=Kranj'
            '&survey/result/address/region=Gorenjska'
            '&survey/result/address/phone=041966493'
            '&survey/result/address/fax=Nimam'
            '&survey/result/address/email=d.debelakhotmail.com'
            '&survey/result/address/uri=http://www.nimam.com'
            '&survey/result/bankdetails/bankcountry=Slovenija'
            '&survey/result/bankdetails/bankkey=1234'
            '&survey/result/bankdetails/bankaccount=78238348238328'
            '&survey/result/id_ddb164f9ec715ef1acf9001b7840a5e4/id_ddbc6515052e00f1acf9001b7840a5e4=Kr neki 1'
            '&survey/result/id_ddb164f9ec715ef1acf9001b7840a5e4/id_ddbc65a01ff500f1acf9001b7840a5e4=Kr neki 2'
            '&survey/result/id_ddb16f9ec715ef1acf9001b7840a5e4/id_ddbc66812b7273f1acf9001b7840a5e4=id_ddbc66872638c2f1acf9001b7840a5e4'
            '&survey/result/id_ddb164f9ec715ef1acf9001b7840a5e4/id_ddb165018f99b4f1acf9001b7840a5e4=Kr neki 3'
            '&survey/result/id_ddb164f9ec715ef1acf9001b7840a5e4/id_ddb1682cf66426facf9001b7840a5e4=Kr neki 4'
            '&survey/result/id_ddb16650885482f1acf9001b7840a5e4/id_ddb1666f95b6daf1acf9001b7840a5e4=Kr neki 5'
            '&survey/result/id_ddb16650885482f1acf9001b7840a5e4/id_ddb1671399e9c2f1acf9001b7840a5e4=Kr neki 6'
            '&survey/result/id_ddb16650885482f1acf9001b7840a5e4/id_ddb166a505462f1acf9001b7840a5e4=Kr neki 7'
            '&survey/result/id_ddb16650885482f1acf9001b7840a5e4/id_ddb166bcdef443f1acf9001b7840a5e4=Kr neki 8'
            '&survey/result/id_ddb16650885482f1acf9001b7840a5e4/id_ddb166d6b77e3ff1acf9001b7840a5e4=Kr neki 9'
            '&survey/result/id_ddb16650885482f1acf9001b7840a5e4/id_ddbd38c6829df9f1acf9001b7840a5e4=THE END'
            '&onInputProcessing(SUBMIT)=Save'
       INTO survey_data.
* Create survey runtime object
CREATE OBJECT o_survey_runtime
  EXPORTING
    i_runtime_mode   = 'INBOUND'
    i_application_id = 'CRM_SURVEY_LEAD'
    i_survey_id      = 'ZNEW_LEAD_FORM_SISVSAP'
    i_survey_version = '0000000000'
    i_language       = 'E'
    i_media_type     = '01'
    i_valueversion   = '0000000000'
    i_no_value_save  = ''.
* Save survey answers
o_survey_runtime->set_values( EXPORTING i_survey_data = survey_data
                              IMPORTING e_valueguid = valueguid
                                        e_valueversion = valueversion
                                        et_application_params = t_application_params ).
* Get survey values object
o_survey_runtime->get_values( IMPORTING er_survey_values = o_surveyvalues ).
* Get XML values - filled out in previous call
o_surveyvalues->get_internal_values_xml( IMPORTING e_internal_values_xml = valuexml
                                                   e_internal_values_xml_hex = valuexml_hex ).
*                     LINK SURVEY WITH LEAD
* Fill required structures
CLEAR t_input_fields.
s_input_fields-ref_guid = lead_guid.
s_input_fields-ref_kind = 'A'.
s_input_fields-objectname = 'SURVEY'.
*Subtable FIELD_NAMES
CLEAR: s_field_names, t_field_names.
s_field_names-fieldname = 'EVALUATION_INFOS'.
APPEND s_field_names TO t_field_names.
s_field_names-fieldname = 'SURVEYID'.
APPEND s_field_names TO t_field_names.
s_field_names-fieldname = 'SURVEYVERSION'.
APPEND s_field_names TO t_field_names.
s_field_names-fieldname = 'VALUEGUID'.
APPEND s_field_names TO t_field_names.
s_field_names-fieldname = 'VALUEVERSION'.
APPEND s_field_names TO t_field_names.
s_field_names-fieldname = 'VALUEXML'.
APPEND s_field_names TO t_field_names.
*/Subtable FIELD_NAMES
s_input_fields-field_names = t_field_names.
APPEND s_input_fields TO t_input_fields.
s_survey-ref_guid = lead_guid.
s_survey-ref_kind = 'A'.
s_survey-surveyid = 'ZNEW_LEAD_FORM_SISVSAP'.
s_survey-surveyversion = '0000000003'.
s_survey-valueguid = valueguid.
s_survey-valueversion = valueversion.
s_survey-valuexml = valuexml_hex.
s_survey-mode = 'A'.
APPEND s_survey TO t_survey.
* Link survey to lead
CALL FUNCTION 'CRM_ORDER_MAINTAIN_MULTI_OW'
  EXPORTING
    it_survey             = t_survey
    iv_collect_exceptions = ''
  CHANGING
    ct_orderadm_h         = t_orderadm_h
    ct_input_fields       = t_input_fields
  EXCEPTIONS
    error_occurred        = 1
    document_locked       = 2
    no_change_allowed     = 3
    no_authority          = 4
    OTHERS                = 5.
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* Save lead
CALL FUNCTION 'CRM_ORDER_SAVE'
  EXPORTING
    it_objects_to_save = t_objects_to_save
  IMPORTING
    et_saved_objects   = t_saved_objects
  EXCEPTIONS
    document_not_saved = 1
    OTHERS             = 2.
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 t_saved_objects INTO s_saved_objects INDEX 1.
lead_id = s_saved_objects-object_id.
* Commit work
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
*                     WRITE GUIDs
WRITE: 'LEAD GUID:', lead_guid, /,
       'LEAD ID:', lead_id, /,
       'VALUE GUID:', valueguid, /.
Revard points if usefull.
Edited by: Deneb Debelak on Dec 11, 2008 3:21 PM

Similar Messages

  • How to create a report with survey data

    Hi All,
    I need to create a report with survey data in below format. Can anyone help me how to display the summary in this format.
    Swapna

    Hi Swapna,
    According to your description, you want to create a report with survey data and display the summary.
    Reporting Services is used for rendering the report with data retrieved from datasource. In Reporting Services, we can retrieve data from the datasource then design a report, after the report processed, data is fixed on the report. So it’s not supported
    to have the end users selection and do summary. For your requirement, it’s can’t be achieved currently.
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu
    Qiuyun Yu
    TechNet Community Support

  • Send Email to contact on Save with survey link

    Hello everyone,
    I have rquirement to send an email to contact on save .Email have the survey link and we have to track the survey response.
    I have created mail form with survey link .I know to track response there is concept of MIG with survey url .
    But here we have to send email using FM and how to add MIG in URL for tracking and other required places/tables etc.
    Or there is any other approach/fm/etc for this.
    Regards..Harish Kumar

    Make two Address Book entries for him; one for each of his e-mail addresses. Make a new Address Book group and put both of his entries in it. When you send him an e-mail just type in the name of the group in the To: field.

  • Issue with Surveys/Checklist in SAP Sservice Manager 4.0 for PPC Platform

    Hi All,
    I am working with SAP Service Manager 4.0 application . I was checking the Surveys functionality in the standard application and came to know that the surveys functionality is not available in PPC platform.
    However it is present for Iphone/Ipad platforms.
    After a detailed check I found that the button which initiates the survey List screens are available in iphone/ipad but not in PPC . where as the Surveys List screens is available for all the 3 platforms iphone/ ipad / PPC .
    Is this a issue in the standard application or the Surveys is not included for PPC platform.
    Please clarify
    Thanks and Regards
    Neha Mahanty

    The surveys functionality was not included for PPC platform in the Service Manager 4.0 release.  There was I beleive a technical issue that prevented it from being included.  It may be included in a future release.
    --Bill

  • Create activity with survey through BSP

    Hello,
    can somebody tell me how we can create a survey through a BSP page and link this to an activity?
    Kind regards
    Geoffrey

    Hi Gerard,
    Any speific reason to go in for a BSP? If you have the Enterprise Poratl 6.0, you have a quickpoll / survey feature in Knowledge Management. Pl post this question in the BSP or EP forums for a better response.
    Regrads,
    Suresh Datti

  • Report with survey contents

    Hi Folks
    In our CRM 3.1 system, our customizer has customized a Survey when creating af Activity.
    And it works fine. Now she need a ABAP report, which among other values, is going to write out the values registered in the Survey. Which standard report can we use?
    Or if I have to develop our own ABAP report,  I can see there are som tables CRMSVY and Function Modules CRMSVY But which one do I have to use.
    I have found the GUID via FM: CRM_SURVEY_GET_LINK. BUt how do I get the saved values?
    Best regards
    Carsten

    Hi Carsten,
    FM : CRM_SVY_VALUES_READ and the required guids are stored in the table CRMD_SURVEY
    I am sure this works in CRM 4.0 and CRM 5.0, but I am not sure for CRM 3.1, But you can give a try
    Do not forget to reward useful answers
    Regards,
    Paul Kondaveeti

  • Survey Builder : Survey question not populate with questionnaire link.

    Dear Friends
    i have created application using SURVEY BUILDER Package application .
    i have two application with same schema .one is my created application :100 and second is Survey Builder pacaskge application 105 ,with no chamge in survey builder application.
    My Questionnaire Link is created but when i put this link into address bar then there is no rection,no question set open in that window.
    Questionnaire Link
    http://178.110.201.231:7777/apex/f?p=100:Q::AAL8:::code:AQDQEIWJAUWVCGGZ
    this is my application question link.
    But if i change application no 100 with survey builder application 105 and submit then survey question open .
    I am confuse where is problem why survey question does not populate with my application 100.
    Please help.
    Thanks

    Did you get your link from "Manage Respondents"?
    I usually get a link like
    http://apex.oracle.com/pls/apex/f?p=67351:Q::ABCD::::
    (this is an example that doesn't point to a real live survey).
    http://178.110.201.231:7777/apex/f?p=105:Q::AAL8:::code:AQDQEIWJAUWVCGGZ
    did not work for me, maybe because of your specific IP:port in the URL. Sometimes the colons ::: create a problem when copying/pasting to email, so I use a service such as is.gd to transform it into a simpler URL like
    http://is.gd/B7hxIl
    Does that help?
    Ben

  • Interaction Centre: Survey not saved correctly

    Hi,
    We are using SAP CRM 5.0 Interaction Centre. While creating a customer feedback transaction with survey in Interaction Centre, following is the observation:
    1. We open the customer feedback transaction, enter the mandate information in the details tab and save the transaction.
    2. Then navigate to questionaire tab and fill-in the survey questions and save the survey.
    3. Navigate back to details tab and save the transaction. The survey and the transaction are saved correctly. Instead, without navigating back to details tab, when we try to save the transaction from the questionaire tab, neither the survey nor the transaction is saved.
    Recently the application was upgraded from SP15 to SP16.
    Please provide your inputs in solving this issue.
    Thanks in advance.
    Regards,
    Venkat
    Edited by: kvenkat24 on Dec 14, 2010 8:02 AM

    Hi Hongyan Shao,
    Thanks for taking your time to answer my issue.
    Actually we have two issue in this
    1.When users press the End button, ideally, the current screens should be closed and default screen of Accoutn Identification should be shown.
    This does not happen.
    Actually, nothing happens when users press the End button.
    Users cannot click on anything else too and the screen seems to be frozen.
    Users have to close the IC session and relogin.
    2.And one more issue is when user ends call by click on end button it goes to account identification but Name of the account still be there on top left top side where it shown account name. but it allows agent to take another call and create service ticket.
    Please note that we are  using CTI( Avaya phone)
    Now since these two are an intermittent issues, i do not have reproduction steps.
    Thanks and regards,
    Teja

  • Survey questionaire not saved

    Hi,
    We are using SAP CRM 5.0 Interaction Centre. While creating a customer feedback transaction with survey in Interaction Centre, following is the observation:
    1. We open the customer feedback transaction, enter the mandate information in the details tab and save the transaction.
    2. Then navigate to questionaire tab and fill-in the survey questions and save the survey.
    3. Navigate back to details tab and save the transaction. The survey and the transaction are saved correctly. Instead, without navigating back to details tab, when we try to save the transaction from the questionaire tab, neither the survey nor the transaction is saved.
    Recently the application was upgraded from SP15 to SP16.
    Please provide your inputs in solving this issue.
    Thanks in advance.
    Regards,
    Venkat

    a bug. rare but happens

  • Creating a survey in acrobat, processing on hard copy, and data compiling via Acrobat scanning

    Hi there,
    I am new to creating PDF forms using Acrobat Pro 9. I have been asked by my manager to sort out a way we can create a survey (for staff)and have the data input to the survey, processed and compiled ready for an analyst to create a report of the data.
    Basically, this is a survey of staff by staff, anonymous and to be completed on hard copy (Printed PDF with survey template).
    So, I have started to think about the best way to go about this, can I create a survey in Acrobat, print it, fill out the multiple choice questions, scan it in Adobe, and allow acrobat to gather the data?
    Personally I would like to use Acrobat (as I am enjoying learning it), but is this the right tool for that job? Is there a feature that enables multiple choice surveys to be created, printed, filled out, scanned again (with answers filled in), and compiles the data?
    I hope I have explained that clear enough...;-)
    Kind regards
    Kevin

    By itself Acrobat does not "compile data".
    By the way nothing compiles data from a picture. All scanners output a picture of the scanned paper (that is, an image file such as TIFF).
    Acrobat can perform Optical Character Recognition (OCR) of the picture of text.
    The OCR output is the characters - no format, tables, rows, columns, no text styling, etc.
    So harvesting useful information can pose something of a challenge.
    You may want to consider manually compiling the results.
    Be well...

  • How do I save personalised survey answers in CRM

    Hi experts:
    In SAP Help I found this statement:
    ...When the recipient enters this URL in a Web browser, a survey is displayed. The recipient completes the survey and sends it (by pressing the u2018Saveu2019 button) to the companyu2019s SAP CRM system. The system then uses the answers specified in the survey to determine appropriate additional marketing activities for the original recipient of the e-mail. ...
    I would like to implement this.
    How exactly does the recipient send the survey to SAP CRM system? I know that PAI can create a document with survey in CRM. In this case the survey is linked to an email. I have never seen loose surveys (without document) in CRM.
    Am I supposed to have an integracion with an contact of type email where the survey answers will be saved in case the marketing contact anwers the survey?
    Hoping for your help.
    Thanks,
    Cristina

    Hello,
    First of all, I am not sure in which scenario you are using. In my earlier reply, my answer was broad too since i am not aware of which scenario you are using.
    Your survey attribute might be having PAI module attached which creates/changes a lead on checking the process mode. Process calls CRM_SVY_LEAD_PAI_CREATE to create a lead.If this is not successful, it will raise the message to stop.
    Therefore, You should also check if you create a lead through crmd_order  Is it created error free?
    one more point is: You can not use Lead survey and Lead PAI/PBO for URL.Sending an url to a business partner is a Marketing scenario hence only marketing survey and PBO/PAI should be used.
    Lead survey and it's PAI/PBO should be used only when you create lead in crmd_order transaction and want to determine the relevant survey during creation.
    Do you want to create lead through campaign execution or want to use Campaign automation application for the same ?
    If your scenario is to send an e-mail to a business partner and as soon as he replies to the response , for each reponse you want to generate a lead.
    For above scenario, you have to model the scenario in campaign Automation application.
    Hope this helps.
    Thanks
    Raja
    CRM Marketing Forum Moderator

  • Add image to SharePoint Survey for multiple questions??

    Hi,
    How can i show a particular picture for group of questions in sharepoint 2010 survey? From following link i was able to add image for one question. so what i need to do if i want to add more questions with the same image?
    http://robdevereaux.wordpress.com/2013/08/09/how-to-add-pictures-to-a-survey/
    Thanks

    If you want to add images to multiple questions using the code at that link do something like:
    elements[e].innerHTML = elements[e].innerHTML
    .replace('CAR_IMAGE','<img src="/PATHTO/IMAGE/CAR.jpg"></img>')
    .replace('BOAT_IMAGE','<img src="/PATHTO/IMAGE/BOAT.jpg"></img>')
    .replace('PLANE_IMAGE','<img src="/PATHTO/IMAGE/PLANE.jpg"></img>');
    Also, if you would like to add a picture, text or formatting to every survey page in a survey with page breaks you will typically need to edit both the NewForm.aspx and EditForm.aspx pages using SharePoint Designer or by adding a Content Editor Web
    Part to both pages.
    Here's some of the other things like this I have done with surveys:
    http://techtrainingnotes.blogspot.com/2013/02/add-content-editor-web-part-cewp-to.html
    http://techtrainingnotes.blogspot.com/2010/07/sharepoint-add-instructions-and-color.html
    (and there's a chapter on surveys in my customization book.)
    Mike Smith TechTrainingNotes.blogspot.com
    Books:
    SharePoint 2007 2010 Customization for the Site Owner,
    SharePoint 2010 Security for the Site Owner

  • Survey results not updated to Application

    Hi Experts,
    I have created a Survey and Questionnaire in SAP-BIW using "SURVEY COCKPIT" (TCODE : SURVEY).
    I have than assigned one Target Group to that survey which is having 3 recepients (e-mail ID's).
    When I send the Survey to them the mail is deliverd to recepients with survey form as an attachment, but when they are submitting the Questionnaire/Survey the results are not updated into the system.
    I have enabled the setting for Questionnaire as Direct Update into Application.
    Still the problem persists. I have also done all the required settings in SICF and SO50.
    Please help.
    Thanks in Advance.

    Dear Nishant
    For inspection point you need to import SAMPLE_RESULTS also similar to CHAR_RESULTS. A simple method you can adopt is
    First create an inspection lot and record this manualy. Once you have recorded it pass the inspection lot to this BAPI - BAPI_INSPOPER_GETDETAIL. Check the data in this BAPI
    The same pattern of DATA has to be passed in the BAPI_INSPOPER_RECORDRESULTS
    This is BAPI is running fine for me. Please check and let me know if you have any issues
    Regards
    Gajesh

  • Survey BSP application for never answered surveys

    Hello Experts,<br />
    I need to launch the BSP application CRM_SVY_SERVER for an order whose survey hasn't been answered yet.<br />
    <br />
    <b>Let me explain it better:</b><br />
    The customer survey is properly setup, I'm able to answer it in CRMD_ORDER and see the results in CRM_SURVEY_SUITE.<br />
    Now I need to enable answering for an order from the BSP application mentioned. But to create an answer in this application, relating to an order, I need to provide the valueguid of the answer (table CRM_SVY_DB_SVS, field VALUEGUID).<br />
    <br />
    <b>The main problem is:</b> The valueguid of the answer doesn't exist yet, as the survey wasn't answered yet. If I pass the order header guid (CRMD_ORDERADM_H-GUID) to the application, it says: "Survey not found".<br />
    <br />
    Is there a way to pass the order header guid (CRMD_ORDERADM_H-GUID) to the BSP application, so it creates the answer valueguid automatically? How this BSP application deals with surveys never answered?<br />
    I think i'll have to code a little bit, to instantiate a survey and get a valueguid, before calling the BSP application. If you have any ohter idea, please let me know.<br/>
    <br />
    Sorry for the long text, its just a lot of details.<br />
    <br />
    Regards,<br />
    Rafael Schaffer<br />
    <br />

    Hi Rafael,
    I'm not sure what's the error. I'll give sample code that's already working in my CRM system. It may give you some ideas.
    REPORT  ZTEST3.
    INCLUDE:CRM_OBJECT_KINDS_CON,
            CRM_OBJECT_NAMES_CON.
    DATA: s_orderadm_h TYPE crmt_orderadm_h_com,
          t_orderadm_h TYPE crmt_orderadm_h_comt,
          s_input_fields TYPE crmt_input_field,
          t_input_fields TYPE crmt_input_field_tab,
          s_field_names TYPE crmt_input_field_names,
          t_field_names TYPE crmt_input_field_names_tab,
          s_activity_h TYPE CRMT_ACTIVITY_H_COM,
          t_activity_h TYPE CRMT_ACTIVITY_H_COMT,
          s_objects_to_save TYPE crmt_object_guid,
          t_objects_to_save TYPE crmt_object_guid_tab,
          s_saved_objects TYPE crmt_return_objects_struc,
          t_saved_objects TYPE crmt_return_objects.
    ***** SURVEY**********
    DATA: lead_guid TYPE guid_32,
          activity_guid TYPE guid_32,
          lead_id TYPE crmt_object_id,
          activity_id TYPE crmt_object_id,
          valueguid TYPE crm_svy_db_sv_guid,
          valueversion TYPE crm_svy_db_sv_vers.
    DATA: survey_value_guid TYPE guid_32,
          it_values TYPE CRM_SVY_API_STRING_T.
    DATA: et_survey_param TYPE CRM_SVY_API_PARAMETER_T,
          it_survey_param TYPE CRM_SVY_API_PARAMETER_T,
          wa_survey_param TYPE CRM_SVY_API_PARAMETER,
          cs_evaluation_infos TYPE CRM_SVY_RE_TAR_OBJ.
    DATA: o_survey_runtime TYPE REF TO cl_crm_svy_runtime,
          o_surveyvalues TYPE REF TO cl_crm_svy_values,
          t_application_params TYPE crm_svy_api_parameter_t,
          t_all_values TYPE survy_t_all_values.
    DATA: value TYPE string.
    ****** END SURVEY *****
    DATA: guid_h TYPE CRMT_OBJECT_GUID,
          guid_i TYPE CRMT_OBJECT_GUID,
          process_type TYPE CRMT_PROCESS_TYPE,
          item_type TYPE CRMT_ITEM_TYPE,
          object_type TYPE CRMT_SUBOBJECT_CATEGORY,
          process_mode TYPE CRMT_MODE,
          it_survey_ui TYPE CRMT_SURVEY_UI_TAB.
    *   Fill required structures
      CLEAR: s_orderadm_h, t_orderadm_h.
      s_orderadm_h-object_id = 'BUS2000126'."'BUS2000108'.
      s_orderadm_h-process_type = 'ZCRC'.
      s_orderadm_h-description = 'Description nih'.
      APPEND s_orderadm_h TO t_orderadm_h.
    ******  ADD FIRST PROPERTY TO INPUT FIELDS -> ACTIVITY_H
      CLEAR: s_input_fields, t_input_fields .
      s_input_fields-ref_kind = gc_object_kind-orderadm_h."'A'.
      s_input_fields-objectname = gc_object_name-activity_h."'ACTIVITY_H'."'LEAD_H'.
      CLEAR: s_field_names, t_field_names.
    * in order to get location and external reference no values, their fieldnames must be added to these
      s_field_names-fieldname = 'ACT_LOCATION'. APPEND s_field_names TO t_field_names.
      s_field_names-fieldname = 'CATEGORY'. APPEND s_field_names TO t_field_names.
      s_field_names-fieldname = 'EXTERN_ACT_ID'. APPEND s_field_names TO t_field_names.
      s_input_fields-field_names = t_field_names.
      APPEND s_input_fields TO t_input_fields.
    ******  END FIRST PROPERTY TO INPUT FIELDS -> ACTIVITY_H
    ******  ADD SECOND  PROPERTY TO INPUT FIELDS -> ORDERADM_H
      CLEAR: s_input_fields.
      CLEAR: s_field_names, t_field_names.
      s_input_fields-ref_kind = gc_object_kind-orderadm_h ."'A'.
      s_input_fields-objectname = gc_object_name-orderadm_h."'ORDERADM_H'.
    *Subtable FIELD_NAMES
      s_field_names-fieldname = 'DESCRIPTION'. APPEND s_field_names TO t_field_names.
    */Subtable FIELD_NAMES
      s_input_fields-field_names = t_field_names.
      APPEND s_input_fields TO t_input_fields.
    ******  END ADD SECOND  PROPERTY TO INPUT FIELDS -> ORDERADM_H
    CLEAR: s_activity_h, t_activity_h.
      s_activity_h-ACT_LOCATION = 'Location nih'.
      s_activity_h-EXTERN_ACT_ID = 'Extern ref no nih'.
      s_activity_h-category = 'ZC1'.
      APPEND s_activity_h TO t_activity_h.
    * Create activity
      CALL FUNCTION 'CRM_ORDER_MAINTAIN'
        EXPORTING
    *    it_lead_h             = t_lead_h
          it_activity_h         = t_activity_h
    *    it_partner            = t_partner_h
    *      iv_collect_exceptions = ''
        CHANGING
          ct_orderadm_h         = t_orderadm_h
          ct_input_fields       = t_input_fields
        EXCEPTIONS
          error_occurred        = 1
          document_locked       = 2
          no_change_allowed     = 3
          no_authority          = 4
          OTHERS                = 5.
      IF sy-subrc <> 0.
    *  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    *    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    * Get GUID of created LEAD for later saving
      READ TABLE t_orderadm_h INTO s_orderadm_h INDEX 1.
      CLEAR: s_objects_to_save.", t_objects_to_save.
    *s_objects_to_save = lead_guid = s_orderadm_h-guid.
      s_objects_to_save = activity_guid = s_orderadm_h-guid.
      APPEND s_objects_to_save TO t_objects_to_save.
    *** continue to next post
    because of SDN forum limitation (2500 line of code from [this link|Formatting issues in SDN postings (character limit and code tags);) , please see my next post to continue my code

  • Problem flagging pics in Survey & Loupe mode

    Am running LR 3. It used to be, when I had several images open in Loupe mode, I could select one of those and flag it (or apply a rating or color) and only that image would be tagged. Now, for some reason (i'm assuming some update), when I do the same, it flags all the images open in Loupe mode, not just the selected image. This is also the case with Survey mode. This is majorly annoying and makes my editing process difficult. What happened? Is this a glitch wiht some update, or was this purposeful on the part of Adobe (in whihc case, can we please go back to the way it was)?
    If anyone can enlighten me and let me know how to solve this problem, I would greatly appreciate it. I'm getting very frustrated with editing!!
    Thanks!
    Brian

    Brian,
    My guess is that you have AutoSynch turned on. Look at the button in the lower right or the Metadata->Enable Autosynch menu item.
    Hal

Maybe you are looking for