cancel
Showing results for 
Search instead for 
Did you mean: 

How to approve Order from Outlook Email

AB069
Active Participant
0 Kudos
1,406

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 

View Entire Topic
AB069
Active Participant
0 Kudos

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

deepika_chandrasekar
Active Contributor
0 Kudos

Hi Imran,

Happy that it helped you. Close this thread

Regards,

Deepika.

deepika_chandrasekar
Active Contributor
0 Kudos

Hi Imran,

Why you closed this thread with assumed answered?

Regards,

Deepika.

AB069
Active Participant
0 Kudos

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

deepika_chandrasekar
Active Contributor
0 Kudos

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.

AB069
Active Participant
0 Kudos

Thanks Deepika... Its working...

AB069
Active Participant
0 Kudos

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

deepika_chandrasekar
Active Contributor
0 Kudos

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.

AB069
Active Participant
0 Kudos

Hi Deepika,

Thanks i tried but Still l_mail_content is empty. though i am getting subject line with the same lo_document. do we need to make some arrangement in the mail body. i texted many line in the mail body to test it.

I appriciate your time. also please check ur mail.

Thanks

Imran

deepika_chandrasekar
Active Contributor
0 Kudos

Hi Imran

I sent mail to your ID. Check it.

You need to set the body text using Link Approve / Reject..

Regards,

Deepika.

Former Member
0 Kudos

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

.

AB069
Active Participant
0 Kudos

Hi Niel,

I just saw your post. Let me now if you still faceing same prob.

Thanks

Imran