Skip to Content
Technical Articles

Send e-mail to vendor with PO after Fiori Approval

Introduction.

We have to make it possible that an automated email containing PO is sent to the vendor when PO is approved from Fiori PO Approval App.

Problem

Connecting PO Smart Form and sending email to relevant vendor using standard workflow was not working for us.

Solution

In order to make it possible without modifying standard workflow in short amount of time.I came up with an idea to make it possible as a separate functionality and run it as background job.

Steps.

  1. PO smart from was working properly to start with so I just added email functionality to it using class method..CL_BCS.
  2. After adding mail functionality to PO smart from we were able to send PO to desired email address…To check mail status use t-code SOST.
  3. Now i have to make it possible to send multiple PO to the relevant email addresses only when they are approved in Fiori PO App.

To make it possible i made a program to run as background scheduled job..

  •  CDPOS and CDHDR are table used to record document change in SAP. I extracted document change from these table with certain conditions matching EKKO table where released PO’s will have release indicator 3.

  • Once i had data in the internal table i checked it with EKKO.

  • IF data is matched it is then recorded in internal table and all the non-matching entries are inserted in Z-table with messages of data missing.
  • Now all the entries are present in internal table with PO number and vendor email addresses.

  • All the verified data is then inserted in Ztable to keep track of emailed PO’s
  • I used submit method to call my PO program with desired parameters and loop is required to iterate it with all the entries.

Note. Programming paradigm might change according to your expertise but the above code is pretty basic for understanding the concept.

3 Comments
You must be Logged on to comment or reply to a post.
  • Hi Mohammad,

    I didn’t check this scenario, but I don’t understand one thing.

    PO output should be a standard mechanism of purchase orders (PO output is created after the PO is released). What was exactly the problem?

    Didn’t the PO output (message) appear in Messages? ME9F?

    • Hi Shai,

      Let me explain.

      Purchase order is created via Z-Program with PO number as input. (Smart Form)

      We had to send email to vendor with SMART FORM of Purchase Order after PO is fully approved by hierarchy.

      Sending Email from standard PO approval workflow didn’t work for us.

      P.S : Emails are meant to be sent to vendors (external entities)