cancel
Showing results for 
Search instead for 
Did you mean: 

Reading COMPLETE survey data

Amey-Mogare
Contributor
0 Kudos

Dear all,

I am using following steps to get the Survey data of a CRM transaction . That is (Questionnaire in CRMD_ORDER)


    REFRESH: IT_SURVEY_UI[].
    CALL FUNCTION 'CRM_SURVEY_DATA_GET'
      EXPORTING
        IV_OBJECT_KIND = 'A'
        IV_OBJECT_GUID = it_crmd_orderadm_h-guid
      IMPORTING
        ET_SURVEY_UI   = IT_SURVEY_UI
      EXCEPTIONS
        ERROR_OCCURRED = 1
        OTHERS         = 2.
 

From this, get the survey's VALUEGUID and VALUEVERSION and pass it on to


  REFRESH : IT_SURVEYVALUES[].
    CALL FUNCTION 'CRM_SVY_DB_SV_READ'
      EXPORTING
        VALUESGUID    = L_VALUEGUID
        VALUESVERSION = L_VALUEVERSION
      TABLES
        SURVEYVALUES  = IT_SURVEYVALUES.

Now this IT_SURVEYVALUES contains the answer text in VALUE fields which is having length of 255 chars. But survey data is of 655 chars of length. So my I am getting data which is incomplete.

So is there any other way to get the data into similar format as above FM but with NO chars length Limit. that is complete text data???

I have found one more FM 'CRM_SVY_VALUES_READ' which gives the XML file for the survey which is containing COMPLETE data... but how do I parse this XML in ABAP to get some legible data???

Pls help.

Awaiting for your replies.

Regards,

Amey Mogare

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You are in correct way. You get survery details from crm_order_read (et_survey). Here you get xmlvalue.

now get the application id from table CRM_SVY_DB_S

where SURVEYID = your survey-SURVEYID got from et_survey.

next create an object for example survey1 type ref to CL_CRM_SVY_SURVEY_TEXTS.

now create like this.

create object survey1 exporting I_APPLICATION_ID = appl

I_SURVEY_ID = line_survey-SURVEYID

I_SURVEY_VERSION = line_survey-SURVEYVERSION

I_LANGUAGE = 'E'

I_VALUEGUID = line_survey-VALUEGUID

I_VALUEVERSION = line_survey-VALUEVERSION.

then,

call method survey1->GET_ALL_VALUES

importing

E_ALL_VALUES = ls_all_values.

call method survey1->GET_ALL_TEXTS

importing

ET_TEXTS = ls_texts.

************************

you will get all values.

best wishes,

mallik

Former Member
0 Kudos

Hi Mallik,

I too have the same problem. i used the technique given by you but still it does not give all data. it truncates the data after 255 characters.

If any other solution is there please let me know.

Regards,

Navin Chettiar

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Amey,

I realize that this is a really old post but I'm having a similar issue as your originally reported and am wondering if the solution provided here worked for you. We have a survey that goes out to customers that has both numeric and free text values for the responses. The numeric values are easy to retrieve but the free text answer is difficult because, as you found, it is cut off after a certain number of characters.

I'm trying to derive the values from table CRM_SVY_DB_CRV.

Anyway, if you could just let me know if what was recommended by Mallikarjuna Rao Antyakula worked then I can try to implement this.

Thanks,

Jeff Mazzeo

Amey-Mogare
Contributor
0 Kudos

Hello Jeff,

Unfortunately I left the organization where I was trying to implement this scenarion long time back.

About reply of Mallikarjuna, I heard from my colleague in that organization that it did not work.

However, I remember that 'CRM_SVY_VALUES_READ' contained complete survey data, but in XML format.

Maybe you could try ABAP XML parsing APIs to parse this XML & retrieve the data.

Wish you all the best.

Warm regards,

Amey Mogare

Former Member
0 Kudos

You can use FM 'CRM_SVY_VALUES_READ' to get the XML and then use FM 'SMUM_XML_PARSE' to convert the data to a readable format.

Hope this helps,

Jerry