cancel
Showing results for 
Search instead for 
Did you mean: 

How to read mail form's file export attribute's description in Campaign Element ID ?

Former Member
0 Kudos

How to read mail form's file export attribute's description in Campaign Element ID ?

Accepted Solutions (1)

Accepted Solutions (1)

VishnAndr
Active Contributor
0 Kudos

Hello, Raja.

Check CRMD_PML_HEAD - here you find MAIL_GUID for MAIL ID (ID of mail form which is stored in campaign element).

Then using this GUID you'll find description in CRMD_PML_DESCR.

Former Member
0 Kudos

Thanks for the reply Andrei.

I need the description of the individual mail form ATTRIBUTE's description.

the table provided will give me the Mail Form's description.

Appreciate your help.

VishnAndr
Active Contributor
0 Kudos

Raja,

could you please elaborate your needs? Do you need the description of attribute which is available in popup on pressing Attribute button during mail form creation? Or do you need to find the description of attribute which is already inserted in mail form?

Screenshot with the example would be great.

For instance, if you want to get description of an attribute in mail body (the second option) then you should follow such sequence:

table CRMD_PML_HEAD

     find MAIL_GUID by MAIL_ID for instance

CRMD_PML_ELE

     find all or desired elements of your mail form ( EL_GUID ) by MAIL_GUID

CRMD_PML_TXTSUBJ

     find the entry by EL_GUID. In TEXT there is the content of element. In rawstring. You should convert it to simple string and parse it.

For example I have such mail form with attributes inserted.

With this simple report you can see where the description is:

REPORT  zplm.

PARAMETERS: p_id TYPE crmt_pml_el_guid,

                            p_st TYPE i.

START-OF-SELECTION.

DATA: lv_xtext TYPE xstring,

        lv_text TYPE string.

  SELECT SINGLE text INTO lv_xtext

    FROM crmd_pml_txtsubj

    WHERE el_guid = p_id.

  CALL FUNCTION 'CRM_IC_XML_XSTRING2STRING'

    EXPORTING

      inxstring = lv_xtext

    IMPORTING

      outstring = lv_text.

  WRITE: / lv_text+p_st.

Here is the output (I used p_st = 100, because the very beginning is a head part of html)

Hope this will help you. If I didn't get you right please correct me.

0 Kudos

Hi Andrei ,

Thanks for the code , could you please help me to read mail form's content below  i am attaching screen shot with highlighted color .

Regards

Rahul

VishnAndr
Active Contributor
0 Kudos

Hello Rahul.

Not sure what you're talking about. But could you please open a separate discussion to ask your question and please elaborate your requirements there. Thanks.

Best regards,

Andrei

Former Member
0 Kudos

Hi Rahul,

Use the below code to get mail form's body text.

cl_crm_pml_mail_form_api=>read_text(

    EXPORTING

      iv_mail_guid         lv_form_guid      "" Mail form guid

    IMPORTING

      es_text                 ls_text 

      et_text                  lt_text 

      et_messages       lt_messages 

    EXCEPTIONS

      mail_not_found     = 1

      not_read                = 2

      OTHERS               = 3

  ).

READ TABLE lt_text INTO ls_text INDEX 1.

lv_body_text = cl_crm_pml_mail_form_exec=>convert_xstring_to_string( iv_xstring = ls_text-text ).

Now lv_body_text contains the body of your mail form.

0 Kudos

Hi Ritu ,

Thanks for your help . using above code i am able to resolve my issue .

Regards

Rahul Dubey

Answers (0)