Skip to Content
Author's profile photo Former Member

Smart Email notifications – own schedule and start condition checks.

We all use E-mail notifications in Solman, but not always all standard features satisfy our requirements. This blog will explain how you can make own Schedule/Start condition checks via PPF BADI for sending Emails.

Schedule condition – EVAL_SCHEDCOND_PPF

Start condition – EVAL_STARTCOND_PPF – this will be covered here

* Note EXEC_METHODCALL_PPF – is available also, but this type BADI will cost you more coding

          CONTAINER_PPF – only works if you use BOR objects, possible in ITSM but not for Charm ( requires BOR objects skills ).

Example Scenario: Normal Change send email to Developer when Developer Changed.


  1. Create Implementation for EVAL_STARTCOND_PPF with
  2. Create Action with Rule Type Conditions Using Business
    AddIn (BAdI)
  3. Choose start condition filter created in point 1
  4. Define parameter PARTNER_CHANGE
  5. Fill implementation with logic
  6. See results

1. Okay let’s start create Implementation for EVAL_STARTCOND_PPF with filter Z*

Launch SE18 choose BADI Name and enter EVAL_STARTCOND_PPF

ppf 1.JPG

Choose Filter Value – Create

ppf 2.png

Give name to Implementation f.e. ZBD_SOLE002_PPF  and filter = ZPARTNER CHANGED and hit confirm

ppf 3.JPG

Save changes and activate BADI ( Coding will be covered in next steps )

Ok now we are ready to see this in PPF conditions.

2.Create Action with Rule Type Conditions Using Business AddIn (BAdI)

Tcode SPPFCADM, choose CRM_ORDER and hit Define Action Profiles and Actions

ppf 4.JPG

Choose Action profile in our example its a ZMMJ_ACTIONS copied from standard SMMJ, double click Action Definition

ppf 5.JPG

Create New action f.e. ZMMJ_MAIL_DEV_CHNGE:

Mark – Scheduled Automatically

Processing when saving document

No restrictions


Rule Type – Conditions Using Business AddIn

Merging and technology look at pic below:

ppf 6.JPG

In processing Types you may use standard Email notifications / Class, but in my example Custom used

ppf 7.JPG

3.Choose start condition filter created in point 1

Tcode SPPFDETCRM, Application CRM_ORDER, Action Profile ZMMJ_ACTIONS and Mode = Change

ppf 8.JPG

Add  ZMMJ_MAIL_DEV_CHNGE and choose Start conditions – find your Z* condition

ppf 9.JPG

4.Define parameter PARTNER_CHANGE

Now we need to add Parameter

ppf 10.JPG

Initial Value SMCD0001 – Developer

ppf 11.JPG

Save all

5.Fill implementation with logic

The final step is coding, its very simple so don’t worry much about it

Find you Implementation by same method described in first step use Overview section.

*Note there two FM’s used CRM_PARTNER_READ_OW – give all information from buffer and CRM_PARTNER_READ_DB – what is in Database

  Simply compare values

  DATA: lr_crm_order        TYPE REF TO cl_doc_crm_order,
        ls_object          TYPE sibflporb,
        lv_partner_fct     TYPE crmt_partner_fct,
        lv_item_guid        TYPE crmt_object_guid,
        lv_guid            TYPE crmt_object_guid,
        lv_guid_db         TYPE crmt_object_guid,
        lt_partner_db      TYPE crmt_partner_db_tab,
        ls_partner_wrk     TYPE crmt_partner_external_wrk
  ep_rc = 1.
  lr_crm_order  ?= io_context->appl.
  IF lr_crm_order->get_crm_obj_kind( ) = 'A'.
    lv_guid  = lr_crm_order->get_crm_obj_guid( ).
  ELSEIF lr_crm_order->get_crm_obj_kind( ) = 'B'.
    lv_item_guid  = lr_crm_order->get_crm_obj_guid( ).
        iv_guid        = lv_item_guid
        ev_header_guid = lv_guid
        item_not_found = 1
        OTHERS         = 2.
  CASE flt_val.
      CHECK ii_container IS NOT INITIAL.
      CALL METHOD ii_container->get_value
          element_name = 'PARTNER_CHANGE'
          data         = lv_partner_fct.
      CHECK lv_partner_fct IS NOT INITIAL.
      SELECT SINGLE guid FROM crmd_orderadm_h INTO lv_guid_db WHERE  guid = lv_guid .
*        Read Main Partner from Buffer
          iv_ref_guid          = lv_guid
          iv_ref_kind          = 'A'
          iv_partner_fct       = lv_partner_fct
          iv_mainpartner_only  = 'X'
          es_partner_wrk       = ls_partner_wrk
          error_occurred       = 1
          parameter_error      = 2
          entry_does_not_exist = 3
          OTHERS               = 4.
      IF sy-subrc <> 0.
        "Issue with Buffer
*        Read Partners from Database
          iv_ref_guid                   = lv_guid
          iv_ref_kind                   = 'A'
          et_partner_db                 = lt_partner_db
*         ET_ATTRIBUTES_DB              =
*         ET_CUST_ATTRIBUTES_DB         =
*         ET_CUST_RELATIONS_DB          =
          entry_does_not_exist          = 1
          record_not_found              = 2
          at_least_one_record_not_found = 3
          parameter_error               = 4
          OTHERS                        = 5.
      IF sy-subrc <> 0.
        "Issue with Buffer
** Compare Partners from Buffer and DB
      READ TABLE lt_partner_db WITH KEY partner_no = ls_partner_wrk-bp_partner_guid partner_fct = lv_partner_fct TRANSPORTING NO FIELDS.
      IF sy-subrc = 0.
        ep_rc = 4.
        ep_rc = 0.

6.See results

Okay we done, don’t forget to activate BADI.

Launch SM_CRM find or create new Normal Change, after this try to change Developer.

Each time you change it email will go to New Developer when saving document.

p.s. for the EVAL_SCHEDCOND_PPF methodology is same.

Have fun using it 😉

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Thanks for the wonderful post,

      could you please guide me using EVAL_SCHEDCOND_PPF badi how to send SMS to a customer when the status changed(for email you have used smart form mail for SMS which option to be used and also please suggest the classes and methods required)

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi Reddy, Thank you for nice reply. First to which type of transaction you want this? incidents or Charm documents. Second if you want this to be triggered when status is changed use EVAL_STARTCOND_PPF there is already condition delivired by standard AI_STATUS_CHANGED Define Parameter in start condition Element          STATUS_CHANGE Name              STATUS_CHANGE Short Descript.  STATUS_CHANGE ABAP Dict. Data Type Type Name  FLAG Third and last about SMS check this threads BR Dan

      Author's profile photo Former Member
      Former Member

      Hi Daniyar,

      there are three SAP standard solutions to enhance PPF Action conditions. Using BADI CONTAINER PPF is one of them. Using BADI EVAL_SCHEDCOND_PPF or EVAL_STARTCOND_PPF is another solution.

      However, the most simplest solution is to enhance the BOR object providing context sensitive attributes which can be combined and evalutated. In most cases the enhancement can be done without development. In my opinion this solution is the most consultant friendly one.

      Because I could not find any guide explaining this solution in a good  and development free manner, I created an own one. Please be free to use it too.

      Kind regards,

      Author's profile photo Markus Katzberg
      Markus Katzberg

      Hi Daniyar,

      That helped me a lot. Thank you for this post.

      Kind Regards,


      Author's profile photo Juan-Carlos Garcia-Garavito
      Juan-Carlos Garcia-Garavito

      Straight to the point.

      Many thanks Daniyar.

      A door opener.


      Author's profile photo Former Member
      Former Member

      Thanks for sharing with us 🙂