on 05-20-2015 7:24 AM
Hi,
I am new to Email functionality.
when we click mailsender button on service request overview page, it will display the email screen. Here for To Address field i want to read the email address from Address independent communication.
if i check the email componenet(crmcmp_ccs_eml) it doesn't have any attributes under emailheader view. all the buttens(To, BCC, CC..) are created in .htm page, don't know how the email address is coming into these fields.
email component: crmcmp_ccs_eml/emailheader
pls give me some inputs.
Thanks,
Venkat
Hi Venkat,
you can get the to address detail in your emailheader.htm view there if you observe page attribute there is structure CRMT_IC_EMAIL_RECIPIENT_DATA to_header that is automatically populating the to address. try to read this and manipulate according to your requirement if you have any queries plz let me know.
Thanks & Regards,
Srinivas.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Srinivas for your reply,
i have checked the .htm page in mailheader view, yes there is to_header whcih is type CRMT_IC_EMAIL_RECIPIENT_DATA structure.
but the email id is generating/getting from CL_CMPIC_MAIL_WRAPPER_BASE=>FILL_TO_ADDRESS_ONNEW() method when i check it in debug mode.
so here inside this method i need to do modification
pls let me know how to implement this method.. this is standard class.
Thanks,
venkat
Hi venakt,
the main source of generation to mail bcc,cc is CL_CMPIC_MAIL_WRAPPER_SC class in that go to ONNEW, ONREPLY or onforward.. this are the methods which are trigger when ever you pressing any button like reply,new,forward.. so debug in to that methods you may come to know where you will get that address.. you can change the too,bcc,cc address also observe this sc_icmail_2_maildata method too.
ex code: this method will give the too email deatils in lr_mail_data. in loop we are assigning too data..
sc_icmail_2_maildata(
EXPORTING is_ic_mail = currentmail
it_ic_mail_attachments = currentattachments
IMPORTING er_mail_data = lr_mail_data ).
LOOP AT lr_mail_data->to ASSIGNING <fs_address>.
lv_default_from = find_matching_outgoing_address( <fs_address>-address ).
IF lv_default_from IS NOT INITIAL.
EXIT.
ENDIF.
ENDLOOP.
so try to debug the methods which i have mention above class.
Regards,
Srinivas.
Hi Srinivas,
Thanks for reply, actually when i click the mailsender button on service request overview page that time CL_CMPIC_MAIL_WRAPPER_BASE=>FILL_TO_ADDRESS_ONNEW() is triggering.
if i want to modify the email id based on partner address number inside the above method or whatever you suggested class, those are standard classes which are triggering..
please let me know how to write my logic in those standard classes...
Thanks,
Venkat
Hi Venkat,
what my suggestion is you have to create implicit enhancement for that method and write the logic according to your requirement.
in menu goto edit->enhancement options->show implicit enhancement option and create enhancement write the condition according to your business role.
otherwise provide the break point in do_prepare_output of the email header view try to replicate the scenario which method is triggering first either do_prepare_output method or FILL_TO_ADDRESS_ONNEW method. i dont have access for checking because of that im giving instructions.
if do_prepare_out of the emailheader view will tirgger first time then do one thing enhance that.
write the logic like this.
declare gv_from1 in the impl class instance or static attribute .
data: gs_from TYPE ihttpnvp,
IF typed_context->mail->messagemode = 'New'. this is only trigger at first time( new mails)...
CLEAR : me->gv_from1.
SELECT ad_smtpadr werks bldg FROM yourtable INTO CORRESPONDING FIELDS OF TABLE lt_from WHERE userid = sy-uname.
IF sy-subrc = 0.
LOOP AT lt_from INTO ls_from.
gs_from-name = ls_from-ad_smtpadr.
gs_from-value = ls_from-ad_smtpadr.
APPEND gs_from TO gv_from1.
CLEAR : gs_from.
ENDLOOP.
ELSE.
CALL FUNCTION 'BAPI_USER_GET_DETAIL'
EXPORTING
username = sy-uname
cache_results = 'X'
TABLES
return = lt_return
addsmtp = lt_mail.
IF lt_mail IS NOT INITIAL.
READ TABLE lt_mail INTO wa_mail WITH KEY std_no = 'X'.
gs_from-name = wa_mail-e_mail.
gs_from-value = wa_mail-e_mail.
TRANSLATE gs_from-name TO UPPER CASE.
TRANSLATE gs_from-value TO UPPER CASE.
APPEND gs_from TO gv_from1.
CLEAR : gs_from.
ENDIF.
ENDIF.
ENDIF.
use that attribute into your emailheader.htm view.
in your fromlist pass the gt_values..
ex code:
<thtmlb:dropdownListBox id = "FromList"
nameOfKeyColumn = "NAME"
nameOfValueColumn = "VALUE"
selection = "<%= gv_selection_from %>"
width = "100%"
disabled = "false"
table = "<%= CONTROLLER->GV_FROM %>" />
try to implement both you may get some idea..
Regards,
Srinivas.
Hi Srinivas,
when i click the MailSender button on overview page, first ONNEW() method is triggering from the class CL_CMPIC_MAIL_WRAPPER_SC..
finally the email id is getting from method FILL_TO_ADDRESS_ONNEW() from CL_CMPIC_MAIL_WRAPPER_BASE class.
so you suggested me to implement the implicit enhancement for the above class. is there any other options instead of implicit enhancement..
suppose if i implement the enhancement in the above class is it possible to revert back the code if it is not required..
just i am asking i am new to enhancement for standard class.
Thanks,
Venkat
Hi Venkat,
what i said at first reply the class CL_CMPIC_MAIL_WRAPPER_SC will trigger when ever you click on reply,replyall,forward,new also.. but at that time what you said it is triggering another class. ok leave it.
if you enhance that method you can revert back that enhancement it is not an issue but suppose crmcmp_ccs_eml component is exists every business role then what are your changed code also will trigger all the business roles so you have to restrict that based on identifying your business role if not then execute the standard code like.
Regards,
Srinivas.
Hi Srinivas,
actually for cl_cmpic_mail_wrapper_sc having super class CL_CMPIC_MAIL_WRAPPER_BASE..
inside this CL_CMPIC_MAIL_WRAPPER_BASE class method FILL_TO_ADDRESS_ONNEW( ) is getting the mailid of partner
ok.. i try to implement the implicit enhancement for the above method in SE80, below procedure i just followed
1. opened the classCL_CMPIC_MAIL_WRAPPER_BASE in se80, and selected the method FILL_TO_ADDRESS_ONNEW( )
2. now just click the spiral button(enhance) on toolbar, now from edit->show implicit enhancements.
3. now in the starting of the method there is enhancement options(" " " """"""""") and belfore end of method bottom level same lines are there..
4. i just right click on enhancement line and created the enhancement ZCL_fill_email under package.
5. now below enhancement created
enhnacement 1 ZCL_FILL_EMAIL
*
endenhancement.
6. Now i activated this method. and try to make it in change mode...
Here i am getting popup Access key required...
it is not allowing me to write any code inside.
pls let me know any steps which i am missing above.
Thanks,
Venkat
Hi Venkat,
You will get con id in your enhancement based on that get the service order id. exporting into memory that will give redundancy issues in future so avoid that try to get service order id in to your enhancement itself.
there is a function module based on that your will get service order id.
just go through this link
if you solved your requirement
Please mark this Discussion with a Correct Answer and Helpful Answer where appropriate. SeeHow to close a discussion and why Even if you discovered the solution without any outside contributions, it helps others to understand what the solution turned out to be.
Regards,
Srinivas.
Hi Srinivas,
Thanks for your reply, sure i will give the marks and mark it as answered as you suggested. right now with export it is working fine, i will check above suggested link also.
at present in SQRM_INCIDENT_H/overview component where i have partner number. for this partner i need to get the i need to read the email from Address Independent data(BP_ADDR/IndependentEmail)
pls let me know how to access BP_ADDR component from SQRM_INCIDENT_H component.
Thanks,
Venkat
Hi Srinivas,
i can use BUPA_CENTRAL_GET_Detail function module...to read the address independent communication for partner.. but if we have more mail id's it will be difficlt to find which is assigned as independent communication email id in address independent assign block.
so if i able to access BP_ADDR in SQRM_INCIDENT_H ... then right email can get it.
Thanks,
Venkat
Hi Venkat,
Right now i don't have system access for giving right input so what my suggestion is based on partner number try to get email id using select statement. for example in but000 you will get partner nos right but already you have partner based on that you have to get address number for that partner so pass your partner in but000 you will get address number pass that address numbers into adr6 table will get all the emails for that partner.
try this this might be helpful to you.
Regards,
Srinivas.
Hi Venkat,
you can do one thing use bp_addr component into your srqm_xx_h component i think is give long procedure to access this component and getting values. or load the bp_addr_search model and search partner related information into your component that is the best way.
example code
go to this link in that there is bol search manipulate according to your requirement.
Regards,
Srinivas.
User | Count |
---|---|
5 | |
1 | |
1 | |
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.