on 2014 Jan 07 10:27 AM
Hi Frds,
I have created a functionality where Order Approval notification sent to Res person MS Outlook mail.
Now requirement is that the approver can approve or reject form Out Look mail itself, For this i need to create a link for approve and reject at the end of the mail body which on click in either link update the status of Order.
Please do the needful
I appricete if you provide some sample code.
Thanks
Imran
Hi All,
Thanks for your Help. I dont know how. but the code is working fine.
Thanks Deepika. All credit to gone to you.
Regards
Imran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deepika,
One last ques. Act there are two object which sent mail, one is report where i have created link and working fine. and other is from Workflow which use Business object zmethod to sent mail. (bus2000115). I stuck to get Workflow ID number.
Could you please let me know how can i get this WF ID. All i have Order ID , GUID and related details.
Thanks
Imran
Hi Imran
You can use program exits in workitem step to send mail
check this link
Program Exits In Workflow - ABAP Development - SCN Wiki
or else u can use below tables.
SELECT wi_id FROM sww_wi2obj INTO TABLE lt_wiid WHERE catid = 'BO' AND typeid = 'BUS2000111' AND instid = 'docguid'.
SELECT wi_id FROM swwwihead INTO TABLE lt_wihead FOR ALL ENTRIES IN lt_wiid WHERE wi_id = lt_wiid-wi_id wi_stat = 'READY'
wi_rh_task = 'ur workitem task id'.
.
Regards,
Deepika.
Hi Deepika,
I need to capture the mail body but its not caputring to get reason for rejection.
Below is the code.
method IF_INBOUND_EXIT_BCS~PROCESS_INBOUND.
data : io_sreg TYPE REF TO CL_SEND_REQUEST_BCS.
document type ref to if_document_bcs,
document = io_sreg->get_document( ).
The variable document give subject text but not body text. Any idea.
Below is the mail Body.
APPROVED.
Testing reason text….. Testing reason text….. Testing reason text….. Testing reason text…..
!!!Please do not change this automatically generated email. Enter Rejection\Return Notes in this Email Body ABOVE THIS MESSAGE!%
Regards
Imran
Hi Imran.
data:
lt_body TYPE soli_tab,
ls_body TYPE soli,
TRY.
lo_document = io_sreq->get_document( ).
l_mail_attr = lo_document->get_body_part_attributes( '1' ).
CATCH cx_document_bcs.
ENDTRY.
TRY.
l_mail_content = lo_document->get_body_part_content( '1' ).
CATCH cx_document_bcs.
ENDTRY.
lt_body = l_mail_content-cont_text.
Loop lt_body and take the content.
Regards,
Deepika.
Hi ,
I am having similar issue the workitem doesnt get updated even after processing the email.
When i debug the standard method IF_INBOUND_EXIT_BCS~PROCESS_INBOUND
lo_document = io_sreq->get_document( ) statement is always failing to get the Email content so nothing is being processed.
Please advice.
Thanks,
Niel
.
HI Frds,
Now i received mail into my CRM system. bt i am stuck in updating the order status.
In SCOT, I maintain handler class exit and in one method of class when i am trying to read my current Mail it getting fail.below is the code.
data : lv_document type ref to if_document_bcs,
io_sreq type ref to CL_SEND_REQUEST_BCS.
lv_document = io_sreq->get_document( ).
lv_document valiable is found intial. It shoud contan all details of mail.
Please suggest what else needed to be done.
Thanks,
Imran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Imran,
I looks like you have already the notification mail working for order approval. Please check the link
URL's for quick access to WebUI - CRM - SCN Wiki to find out the way to display , edit and create an CRM Object. I am not sure if status update is possible. You can try out the parameter "crm-object-action " as "C", If this doesnt work then you have have a RFC FM call via a link to perform the update.
Hope this helps.
Best Regards,
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Imran,
Check this Link
http://www.saptechnical.com/Tutorials/Workflow/offline/Index.htm
Do configuartion specified in above link.
for link in mail while adding mail content you should use below code.
ls_message-line = '<a href="' .
APPEND ls_message TO lt_message.
CONCATENATE 'APPROVE' iv_wi_id INTO lv_text .
CONCATENATE 'mailto:test@abc.com?Subject=' lv_text INTO lv_text.
ls_message-line = lv_text.
APPEND ls_message TO lt_message.
lv_text = '&body=Comments:'..
ls_message-line = lv_text.
APPEND ls_message TO lt_message.
ls_message-line = 'target="_top">'.
APPEND ls_message TO lt_message.
ls_message-line = 'Approve</a>'.
APPEND ls_message TO lt_message.
Regards,
Deepika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Deepika,
Your suggestion are very Helpful. Could you please provide the complete code which build Link in the mail body and when we click ,it sent mail to SAP system.
Example : Approval / Reject
On onclick on Approval link ,it sent Approval respone and onclick on Reject it sent reject response to sap system
please mail if possible: imranra.sap@gmail.com
Regards
Imran
Hi Imran.
While sending mail itself in mail content add the code i mentioned above where you want approve/ reject option. you shoud give approve and reject separately like click approve or reject.
replace test@abc.com with your mailbox email ID you have configured for this email reply.
Regards,
Deepika.
Hii Imran,
I am having same issue. Can you please send me the code that Deepika as forwarded to u. Your help is really appreciated. My mailid is anilkumar662@gmail.com
Thanks & Regards
Anil.
User | Count |
---|---|
27 | |
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.