How to Push sendMail Workflow Step to Fiori My Inbox

In SAP Workflow any decision task will appear in Fiori My Inbox if the Notification Center configuration is set up correctly. However, most workflows send notifications to Workflow Initiator after a decision task. These notifications are created as sendMail steps which do not show up in My Inbox by default.

The secret behind My Inbox is that it doesn’t only display decision tasks, but all tasks that need a user action. So everything you see under Workflow (Figure 1) node in your SBWP transaction is displayed in Fiori My Inbox.

Figure 1

The sendMail step with its default settings is usually seen in Unread Documents/Documents nodes as it is created as a background task. To make this a user task, you need to uncheck the Background processing checkbox in your sendMail task (Figure 2). You can find the sendMail task in Control tab of the workflow step. In Figure 2, I’ve also checked Confirm end of processing as I don’t want the task to disappear after a user opens it once, but I want it to stay until the user explicitly confirms the task.

Figure 2

Tip: You can set an external break-point in GET_INBOX method of class /IWWRK/CL_TGW_GEN_INBOX and open your Fiori My Inbox to see how the tasks are selected.

SAP PPM – Tasks/Checklist Items Dashboard

For a task/checklist item to be displayed in an users dashboard the following criteria must be met

  • The BP assigned to the Task/Checklist Item must be valid on the current date. If the BP validity period has expired the tasks will not be displayed.
  • The status of the Task/Checklist Item should be 10 – Released or 11 – Released (Processing has begun)
  • The parent node (can be project/phase/task/checklist header) must have one of the above statuses or 00 – Created.
  • Plan start date and end date should be between 1st January 1900 and 31st December 9999 (highly unlikely you’ll fail this condition). Alternatively, both the dates should be initial, if any one is initial and the other is not, the entry will not be displayed on dashboard (E.g. Plan start date is 0, but end date is set to 31st Dec, 2050).

Tip: To debug how tasks/checklist items are selected, you can set a break point in method GET_TASKS / GET_CLI of class CL_PRP_RESOURCE_PROJECT.

SAP Launchpad: Calling Transaction

Calling transactions from WebDynpro applications via Launchpad configuration is a simple task once you know how it works. The key elements to this are:

  • LPD_CUST Configuration
  • Analyzing the Receiver Transaction
  • Preparing Business Parameters for Receiver Transaction
  • Triggering LPD_CUST Navigation from WebDynpro

LPD_CUST Configuration

  • Go to transaction LPD_CUST, create a new launchpad (skip next step if you already have a launchpad to edit)
  • Enter a Role, Instance, Description and use ‘Z’ or ‘Y’ as Namespace
  • Once you are inside the launchpad, create a new application
  • Enter Link Text, Transaction Code, System Alias and Application Type as ‘TRA’ or Transaction (see Figure 1)
Figure 1: Launchpad Application Configuration
  • You can leave the rest of the fields with their default values
  • You can change the Entries Once Started field to Skip Initial Screen if Possible if your program sets the values on initial screen

Tip: Fill Application Alias with a unique value withing the launchpad to identify it within your program.

Analyzing Receiver Transaction

All types of transaction except OO transaction work well with LPD_CUST. If you have an OO transaction you will not be able to set parameters on the initial screen which makes it impossible to use Skip Initial Screen if Possible option. However, you will still be able to navigate to the transaction itself even for OO transaction.

Sample Receiver Transaction

Figure 2: Report Transaction
REPORT ycodex_tra_demo.
TABLES vicncn.
SELECT-OPTIONS: s_bukrs  FOR vicncn-bukrs,
                s_recnnr FOR vicncn-recnnr.

START-OF-SELECTION.
  WRITE: s_bukrs, s_recnnr.

Preparing Business Parameters

The proper way to pass business parameters to a transaction might sound a bit unconventional to most ABAPers. The secret is to use the Data Element name as Key instead of the screen field name (see Figure 3 & Figure 4). The reason behind this is, the launchpad program gets the report screen fields and match field with data elements rather than field names.

Key value pairs with data element used as keys
Figure 3: Sample Table Values
Figure 4: Screen Field Details

Tip: In case of SELECT-OPTIONS field you can pass multiple entries with the same key and different values and the program automatically assigns all the values to the same selection field.

Tip: You can use global sets by appending _SET to the key field in business parameters internal table.

Trigger Receiver Transaction

  • Get reference of WebDynpro Component API
  • Get reference of POWL Runtime Services
  • Use the above two references get a reference to LPD_CUST for the Role & Instance you’ve created at the beginning
  • GET_CONTENT method returns all the applications under the launchpad and APPLICATION_ALIAS field can be used to uniquely identify your application
  • From the content structure you retrieve above, you may have some default entries in APPLICATION_PARAMETER and BUSINESS_PARAMETER based on your configuration
  • Add your screen field key-value pair to BUSINESS_PARAMETER and launch the application using LAUNCH_APPLICATION method
DATA: lr_provider     TYPE REF TO if_apb_lpd_provider,
      lr_wd_component TYPE REF TO if_wd_component,
      lv_role         TYPE apb_lpd_role VALUE 'ZAM_DASH',
      lv_instance     TYPE apb_lpd_instance VALUE 'TASKS',
      lr_launchpad    TYPE REF TO cl_apb_launchpad_api,
      lt_content      TYPE apb_lpd_t_content,
      ls_content      TYPE apb_lpd_s_content.

lr_wd_component = wd_this->wd_get_api( ).
CREATE OBJECT lr_provider TYPE cl_powl_runtime_services.
cl_apb_launchpad_api=>read_for_display(
      EXPORTING
        id_role           = lv_role
        id_instance       = lv_instance
        ir_provider       = lr_provider
        ir_wd_component   = lr_wd_component
      RECEIVING
        er_launchpad      = lr_launchpad
      EXCEPTIONS
        parameter_missing = 1
        not_found         = 2
        OTHERS            = 3 ).

lt_content = lr_launchpad->get_content( ).
READ TABLE lt_content WITH KEY application_alias = 'CONTRACT_DEMO' INTO ls_content.
IF sy-subrc EQ 0.
  APPEND VALUE #( key = 'BUKRS' value = '3000' ) TO ls_content-business_parameter.
  APPEND VALUE #( key = 'RECNNUMBER' value = '1000892' ) TO ls_content-business_parameter.
  lr_launchpad->launch_application( it_application_parameters = ls_content-application_parameter
                                    it_business_parameters    = ls_content-business_parameter ).
ENDIF.

SAP Project Management: Adding Links & Buttons to Dashboard

There is no straight forward way that SAP provides to add links to column grids for Dashboard. Luckily for us we have a way to get past that limitation by using some OOP hacks and the BAdI DPR_EVE_DASHBOARD.

Create an implementation for the afore mentioned BAdI and in the method IF_EX_DPR_EVE_DASHBOARD~GET_FIELDS_FOR_SELECTION, use the below code to access the SALV table configuration.


DATA: lo_locator TYPE REF TO cl_wd_alv_ui_log_reuse,
      lo_deligate TYPE REF TO cl_wdr_delegating_view,
      lo_data TYPE REF TO object,
      lo_config_table TYPE REF TO cl_salv_wd_config_table.


lo_locator ?= cl_dpr_ui_log_locator=>get_instance( ).
lo_deligate ?= lo_locator->get_alv_context_node( )->get_context( )->controller.
lo_data ?= lo_deligate->delegate.
ASSIGN lo_data->('IF_VI_LOCATOR~MR_CONFIG_TABLE') TO FIELD-SYMBOL( <lo_config_table>).
lo_config_table = <lo_config_table>.
lt_columns = lo_config_table->if_salv_wd_column_settings~get_columns( ).

The statement lo_deligate ?= lo_locator->get_alv_context_node( )->get_context( )->controller. is only for type casting purposes to avoid object slicing. Without doing this we will not have access to delegate attribute of the class.

The statement lo_data ?= lo_deligate->delegate. is added to be able to dynamically access IF_VI_LOCATOR~MR_CONFIG_TABLE attribute via ASSIGN keyword. To know more about this you can refer to the SAP help documentation of how the ASSIGN statement behaves differently for class reference variables and interface reference variables.

SAP Project Management: Things You Shouldn’t Do (Technical)

BAdI DPR_EVENTS

The BAdI DPR_EVENTS is a very powerful one as it allows you to catch all the events that affect a cProject. Such extensive control over the application always comes with some unwanted side effects. In this case, if you try to get all of nodes’ children from which the event originated within ON_CHANGED method, it might break your application (short dump).

Related SAP Notes:

1480895 – Create subtask: Exception ‘NOT_FOUND’ triggered

cProject Subsystems

Subsystems in cProjects is another great enhancement option we have in SAP Portfolio & Project Management. Since this has impact over core functions like transaction commit; not implementing them correctly can crash your application (short dump).

Always ensure that your subsystem is activated only when necessary. You can deactivate it by not returning an instance from IF_DPR_APPL_PLUG_IN_SUBSYSTEM~GET_INSTANCE method or by returning -1 from IF_DPR_APPL_BOOTSTRAP_MEMBER~GET_SEQUENCE_PLACE method.

Method IF_DPR_APPL_PLUG_IN_SUBSYSTEM~HAS_CHANGES is very critical as returning ABAP_TRUE at the wrong time can break your application during transaction commit.

Disable Type-Ahead Search in SAP

SAP has introduced a new feature called Type-Ahead Search (also referred to as Enhanced Search/Proposal Search/Fuzzy Search). The fuzzy search is a nice little feature that gives a list of values to pick from as you type in an input field. However, this requires the GUI to send a request to back-end which sometimes gets really annoying as the screen freezes after every character you type. In such scenarios you can choose to disable this feature with a simple setting on your GUI client or on ABAP server Continue reading

SAP Adobe Forms – The Font Family Issue

Symptoms

You are using a Text Module with Smart Style in Adobe Form with the option Copy styles from text module enabled for the text in the form Context, you see the font size as maintained in the style but the font family is different.
E.g.: You’ve maintained Helve in the Text Module but the Adobe form prints out Arial. Continue reading