cancel
Showing results for 
Search instead for 
Did you mean: 

How to create CRM Surveys dynamically

Former Member
0 Kudos

Hello All,

I am a new to surveys on CRM .We are currently on CRM 7.0. I want to create a survey dynamically. I have a webpage which holds some questions which will be answered , when this is saved I want to dynamically create a survey which will have some of the questions answered from the web page. This survery will need to be associated with a one order object.

Do I have to design a static survey first and associate this to the one order object ? If so, How do update the data that will be extracted from the web page and save the survey ? Please respond.

Thanks.

Accepted Solutions (0)

Answers (1)

Answers (1)

robert_kunstelj
Active Contributor
0 Kudos

You can use PBO and PAI function modules. Function module PBO is run before the survey is displayed. Function module PAI is run when you choose the Submit button in the survey. The survey runtime calls function module PAI at exit time PAI.

Look at this link to learn more about this functions: https://service.sap.com/sap/support/notes/638320

The is also one lackness in WEB UI. If you will open the survey in SAP GUI, PAI will be started, but in WEB UI the page is static and the PAI is not called during the processing of survey.

Regards.

Former Member
0 Kudos

Hi Robert ,

Thank you for you reply. I actually have a problem wherein I have to update a survey by an action . I read the data from a BSP , transalate them to the questions on the survey and have to update the survey with the answers from the BSP. Please respond.

Thanks.

robert_kunstelj
Active Contributor
0 Kudos

try with something like this...

  • 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 ).

regards.