Hi,
we are implementing Email functionality on new lead creation through WEB UI.When user enter all lead related data like header, partner and survey details and save lead, then a automatic Email should get send to employee responsible with all lead details.For that i have created Alert category through SPRO and implemented BADI ALERT_EXIT_LOCAL_PPF.Here i could able to read all lead related data except survey details.I could get survey details like survey ID , survey version,value guid and value version. am trying to read answers selected for each question using below code.
DATA: rr_survey_texts TYPE REF TO cl_crm_svy_survey_texts.
* create survey texts object
CREATE OBJECT rr_survey_texts
EXPORTING
i_application_id = i_app_id
i_survey_id = wa_survey-surveyid
i_survey_version = wa_survey-surveyversion
i_language = sy-langu
i_valueguid = wa_survey-valueguid
i_valueversion = wa_survey-valueversion
EXCEPTIONS
survey_not_found = 1
OTHERS = 2.
CHECK sy-subrc = 0.
CLEAR e_all_values[].
CALL METHOD rr_survey_texts->get_all_values
IMPORTING
e_all_values = e_all_values.
CLEAR et_texts[].
CALL METHOD rr_survey_texts->get_all_texts
IMPORTING
et_texts = et_texts.
After CREATE OBJECT, sy-subrc value set to 2. It seems the values are not updating to the DB.Since sy-subrc not set 0, tables E_all_values and et_texts are not being filled up.Can any one help me on reading survey details(question and answers) from memory using value guid, value version and survey id.
Please do needful.
Thanks
Reddy