Reading COMPLETE survey data
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???
Awaiting for your replies.
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.
call method survey1->GET_ALL_VALUES
E_ALL_VALUES = ls_all_values.
call method survey1->GET_ALL_TEXTS
ET_TEXTS = ls_texts.
you will get all values.