on 01-11-2011 2:46 PM
Hello,
I have a requirement where i need to add a new field in the mail form, i actually want the contact person email id to be there after executing the campaign using that mail form.
I know we can use the BADI CRM_IM_ADD_DATA_BADI can anyone provide me the sample code for that.
Thanks,
Shobhit
Hi Shobith,
Please follow thw below steps
1. Create one structure in SE11 with the additional fields you require in your Mail form.
2.Go to SPRO and Marketing - > Marketing Planning and campaign management -> Personalized Mail -> Maintain Attribute context for mail forms.
A) In above customizing create one entry with some name and then double click on STRUCTURE in left pane.
B) enter the structure name you created in it and tick mark ALL FIELDS.
C) Then create the BADI Implementation of CRM_IM_ADD_DATA_BADI with filter as you have given name in step A.
Implement BADI method CRM_IM_BPSELE
sample code for email.
Data:lt_att_values TYPE crmt_im_name_value_tab VALUE IS INITIAL,
ls_att_value TYPE LINE OF crmt_im_name_value_tab VALUE IS INITIAL,
ls_emailaddress TYPE bapiadsmtp,
lt_emailaddress TYPE TABLE OF bapiadsmtp,
index type SYTABIX .
lt_att_values[] = ct_att_values[].
LOOP AT lt_att_values INTO ls_att_value.
*if the channel is direct mail
If IV_CHANNEL = 'Z004'.
index = sy-tabix.
CASE ls_att_value-name.
WHEN 'ZMAIL_ADDNL_FIELDS-SMTP_ADDR'.
CALL FUNCTION 'BAPI_BUPA_ADDRESS_GETDETAIL'
EXPORTING
businesspartner = Is_bp_act-bp_number
TABLES
bapiadsmtp = lt_emailaddress.
READ TABLE lt_emailaddress INDEX 1 INTO ls_emailaddress.
IF sy-subrc = 0.
ls_att_value-value = ls_emailaddress-e_mail.
else.
ls_att_value-value = '-'.
ENDIF.
MODIFY lt_att_values FROM ls_att_value
INDEX index
TRANSPORTING value.
ENDCASE.
endif.
ENDLOOP.
ct_att_values[] = lt_att_values[].
After implementing the BADi u can verify if email address is populated in the MAILFORM.
Thanks,
Sanila
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.