Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

CRM DINAMIC SURVEY

Hi, All

     I need help with create the dynamic questionnaire. In transaction CRM_SURVEY_SUITE I have the own survey with a few questions. I want to hide/delete some questions depending on the answers of to previous questions. To do this, I created own FM Z*PBO (copy of CRM_MKTCA_SURVEY_MKT_PBO). To begin, I write a simple code to instantly hide some questions, starting with the third. I'am using method ir_survey_values->no_display_add in that FM:


     loop at lt_all_values into ls_all_values.

      

       if ls_all_values-question_id = zcl_crm_mkt_svz_survey=>c_qst2 and lv_excl_flag is initial.

              lv_excl_flag = 'X'.

              continue.

       elseif lv_excl_flag = 'X'.

        

          ls_no_display-name = ls_all_values-question_id.

          append ls_no_display to lt_no_display.

       else.

         continue.

       endif.

     endloop.

call method ir_survey_values->no_display_add

      exporting

        it_no_display = lt_no_display.


As a result, I hide the questions and their answers. But the texts(for example: Text of the sections of the survey, Text for the answers ) are displaying. Tell me please  detail - how to hide them too. Maybe I need to create the javascript code, which can hide/show questions or sections of the survey? Or something else?



I found the code that returns text. Maybe there is functionality that they can change this texts?


data lo_surv_texts type ref to cl_crm_svy_survey_texts.

   data lt_crm_text_t type crm_svy_api_survey_text_t.

   create object lo_surv_texts

     exporting

       i_application_id = i_application_id

       i_survey_id      = i_survey_id

       i_survey_version = i_survey_version

       i_language       = sy-langu

     exceptions

       survey_not_found = 1

       others           = 2.

   call method lo_surv_texts->get_all_texts

     importing

       et_texts = lt_crm_text_t.




Regards, Valeriy

Not what you were looking for? View more on this topic or Ask a question