SAP Mobility
SAP Fiorl Approve Requests
Applicable Releases:
SAP Fiori Approve Requests 1.0
SAP NetWeaver Gateway 2.0 SP 07
SAP Fiori Launchpad
ve
June 2014
on 3.1{© copyrgnt 2013 SAP AG. Aros reserves
Busines Objects and he Business Obes ogo, BusnessObes, Crystal
Reports, crystal
(jects proauts and serves memoned neten as well as mer espectue
logos are trademarks or egsterec racemars of Business Objects
Sofware Ld. Business Otjectsis an SAP company
SSAP "Howto" Gulss ae tenes 1 simply me proautt plementation.
While specie produc features and procedues typical ae expianed ina
acta business conte tis nt ipl that hese tates and
procedures ate teeny approach m solving specie business problem
using SAP NetWeaver. Show you wshtofeceve aoatonalinfoenaton
clanneston or supper please reer o SAP Consuong
Any sohsare coding aneor code Ines / tings (Code neuded inthis
cumentaton ate cn examples and are not ninded ibe usee ma
prooucve system enaronment. The Cove sony intended beter explain
ana wsusize he syntax ano phrasing nes of can coding. SAP oes not
‘arate coeciness and completeness of he Code given herein, and
‘SAP shal nt be fable fr eres or damages caused by he usage othe
Coe, except it sucn damages were caused by SAP intentional or grossly
egigent.
Diciaimer
‘Sme components ois produc are baseaon Java™. Any coae change
‘nese components may cause unpreaciale ana severe matuncons
ana mere expressively prod. 3 san decompo of nese
‘Any Jovam™ Source Code severed win ns products cm tobe used by
SAP’ Suppor Services and may nl be most or atered in any waDocument History
Document Version Description
1 The first release version.
With Gateway 2.0 SP06 and Approve Request SPO1
2 With Gateway 2.0 SPO7 and Approve Request SPO3.
3 Simplified. Removed check steps.
34 Stop 6 ABAP code is updated with escaping valueTypographic Conventions loons
Type Style Description Icon Description
Example Text Words or characters quoted
from the screen. These
include field names, screen
titles, pushbuttons labels,
menu names, menu paths,
and menu options.
Cross-references to other
documentation
Caution
Note or Important
Example
Recommendation or Tip
Example text Emphasized words or
phrases in body text, graphic
titles, and table tiles
Example text File and directory names and
their paths, messages,
names of variables and
parameters, source text, and
names of installation,
upgrade and database tools.
Example text User entry texts. These are
words or characters that you
enter in the system exactly as
they appear in the
documentation.
Variable user entry. Angle
brackets indicate that you
replace these words and
characters with appropriate
entries to make entries in the
system,
EXAMPLE TEXT Keys on the keyboard, for
example, F2 or ENTERTable of Contents
Business scenario
‘Sample scenario
Prerequisites
4. Step 1 . Get workflow template information [ERP]
14
12
13
14
18
Find the workflow tempiate ID
Find the approval step ID and step type.
Find the task ID
Find the Business Object and method for Activity step type.
Find the outcomes from the step.
2. Step 2. Define workflow scenarios [Gateway]
24
22
23
24
3. Step 3. Add a tile to the Launchpad [Gateway]
34
32
33
34
4, Step 4. Configure the task deci
44
42
Define scenario.
Assign consumer type,
Assign role
Assign task
Start the launchpad designer (system admin action),
Check the Target Mapping tile Click on the target mapping tile and make sure the
data matches the list below
‘Add a new “App Launcher — Dynamic" tle
‘Add app to Launchpad (End user action)
n [ERP]
Define workflow template and the step.
Assign the stop keys
5. Step 5. Implement BADI for decision outcomes [ERP]
5A
52
Create BAd! Configuration and Class for Decision Handling
Implement BAdI Class for Decision Handling
6. Step 6. Display application data [Gateway]
64
Including business data by BADI (Optional but Recommended)[Gateway]
7. Testthe scenario
TA
Approve from SAP Fiori Approve Requests
9
10
10
10
18
18
18
20
20
26
30
30
34
34Adding a custom workflow scenario to the SAP Fiori Approve Requests in 6 steps ery
Business scenario
With SAP Fiori Approve Requests, you can add workflow tasks to the Approve Requests. SAP delivers
several standard approval scenarios but standard scenarios are not enough for your business. Now
you are going to add additional custom workflow scenarios to SAP Fiori Approve Requests.
Htmaking an approvalireject decision is simple, you can go live with the generic contents of Approve
Requests. Its an easy and quick solution without big development effort.
If additional functions and UI screens are required, you can enhance the app or develop a custom app.
Sample scenario
In this exercise we will show you how to add “Notification of Absence” workflow scenario which is the
demo workflow of SAP Business Workfiow.Itis avaliable in all AS ABAP systems. This workfiow is an
‘Absence Approval scenario. It has an Activity step type which is bound to a BOR object/method. Your
jb willbe to expose this to SAP Fiori Approve Requests app,
Implementation steps are 6 steps.
‘Get workflow template information
Define workflow scenarios
Add a tile to the Launchpad
Configure the task decision
Implement the BADI for task outcomes
Display application data
Parenae
SAP NetWeaver
Gateway
Backend Systems
[ee |
Prerequisites
‘SAP Fiori Approve Requests is used for illustration throughout this exercise.
‘+The workflow scenario is up and running in the SAP Business Suite system,
* SAP NetWeaver Gateway 2.0 SPO7 or higher system and basic settings are configured.
‘+ SAP Notes for SAP Business Workflow have been applied. The notes are listed in the SAP Fiori
Installation and Configuration guide.
‘+ One of the standard SAP Fiori approval apps are configured and running,
Jun 2014 1Adding a custom workflow scenario to the SAP Fiori Approve Requests in 6 steps ery
1. Step 1 . Get workflow template information [ERP]
Before configuring the scenario, you should know the workflow template information.
Note: If you are in an SAP Education course, different workflow template ID and task ID are assigned
to each user. Please get your assigned workflow template ID and task ID from your instructor and
replace the WSXXXXXXXX and TSXXXXXXXX by your assigned ID.
Table: Workfiow Information.
Den Btu) ee ay
this doc
1 Workflow template ID WSXXXXXXXX
2 Approval step ID 48
3 Step type Activity
4 Task ID TSXXXXXXXX
5 Business Object FORMABSENC
6 Approval Method APPROVE
7 Outcomes Container or Event Container value
Approve A
Reject R
Others
1.1 Find the workflow template ID
You are already using workflow scenarios in the production system. Find the workflow template ID that
you are going to integrate with SAP Fiori Approve Requests.
Note: This step will show you where to go to obiain the required information however no activity will be
performed here
List workflow template last 365 days
1. Launch the SAP GUI (Start > SAP Logon for Windows -> ZME System -> enter assigned
credentials)
2. Ifyou're already in the GUI enter/N to return to the home screen in the ZME system then.
enter Transaction: SWI2_FREQ and choose enter from your keyboard
& program Edit Goto System Hel
© J swie FREQ) *}4ae
Jun 2014 2Adding 2 custom workflow scenario to the SAP Fiori Approve Requests in 6 steps
EM
3. Select Last 365 days, uncheck Dialog and check (Sub-) Workflow then choose Execute
2 Access to Work Item Analysis (SWI2)
© “48 CO@ BNR HF
Access to Work Item Analysis (SWI2)
| Noritring pois
Olan dine
Ota 0 dave
Work itm to
r
Becterourd
4, Select the Task Header and Sort in descending order
_ Work items per task from 28.03.201
QE AB] & Bere Sow TE
Task [Task text
Stufenetatus setzen
General Workflow for Documents
Approval Process:
5. Workflow Templates are prefixed with ‘WS’. reference the workflow number for ZOO user
(WS97 100480).
Remember this step is to show you where to find workflow templates and how to filter.
NOTE: The W$30000015 Process Notification of absence is the sample workflow in this
Exercise
Work items per task from 28.03.2012" to 27.03.2013"
DEF BE BB Bow TAR D Brinower
FRCS nsdn a br Ase (Ganberstew "
‘kort Appeal a i enon (Sanentfon 10
erktoe OX A fete (Satboriter a
‘hes mn eamoiof Coae BU NE (Saorktow 0
DEAS Wont rar) (Saeter
Baye erieon of asence psese (inten
Dewo Wl encuton sh os (Gatberitow
ior decion ein? crn (Saabentfow i
Cree base (sinmoeon 3
Ste rg (hereon ™
Sit Bocurens Rai (Ganvraten a
‘Rilo! Gone narton fester f
roel Sart (Sino
Mo (Sinan
(Gatbentow
(Wonton trons of puch Saar (Gawd
fees torow Toni tewnt (Saboten
‘aro Toe (Saabariton
(ior ty Phan (smuoten
at ew camer (Sakoton
Jun 2014Adding a custom workflow scenario to the SAP Fiori Approve Requests in 6 steps SAP @
1.2 Find the approval step ID and step type
Display the workflow template
6. Enter Transaction: /NPFTC
st elt Goto Settngs Sy
© Jnerra “4a
7. Choose Workflow template in the task type drop down and manually enter your
assigned task number (only the number as shown in the image below) in the task fisld. Then
choose the glasses button to cisplay
Tak ope Wao tate >
Tak ‘seoooong J
veme
8 Choose Workflow Builder
Workflow Template: Display
Paee
None
Release steve
Wo Ne Tost
Jun 2014Adding a custom workflow scenario to the SAP Fiori Approve Requests in 6 steps ery
9. Notice the approval step is 48. Choose this step by double clicking on it,
Workflow Builder ~ Display ‘AF process’
O87 @:ea0
10. Check the step type (At the top of the screen above the tabs)
moo (000048 Approve notification of absence
Explanation of Step types (for our exercise we want Activity step type)
eo oid
Bactivity Activity Function Module or Transaction will be called, Most of
approval tasks are activity type.
|[Bucer Decision User Decision —_User will select decision options manually
DPieb activity Web activity Web application integration
Form Form From integration
If the approval step type is Web activity or Form type, you need to adjust workflow template
Please contact workflow consultants to adjust
Jun 2014 5EM
Adding a custom workflow scenario to the SAP Fiori Approve Requests in 6 steps
1.3 Find the task ID
1. Note your approval task ID (it should match the task number that was assigned to you) and
double olick it
Workflow Builder ~ Display ‘AF process’
Osy7 a: Gan
Womans — =I) I Activity 000048 Aepose oticaton afaence
aon [06109 Oba Deis (Ouncomes (Noten [Later End Ragone:
Tok (21 [Es0n0001] Acerove rotfcaton of
f= cls step Name Toorve neifeation ofataence
Navision as & Binging (at)
Ase
i 114500180
Ge Sindee Exes)
Tack Proerti
[O)@ Avert Aevenment
(Getler erent
1.4 Find the Business Object and method for Activity step type
(Most of approval steps are activity type which calls Business Object method.)
2. Notice the Business Object is FORMABSENC
Method is APPROVE
Standard Task: Display
Paeg
—_ Arye reenter eel
(esscreson | $PContiner | @)THassrng events | A Temin
Release sts =
Ober method
Makod ‘APPROVE Aewove
Jun 2014Adding a custom workflow scenario to the SAP Fiori Approve Requests in 6 steps ery
1.5 Find the outcomes from the step
1. Select F3 from your keyboard to return to the previous Workflow Builder ~ Display screen
2, Choose the Outcomes tab
Notice Approved and Rejected are listed as possible outcomes for the approve step.
Workflow Builder ~ Display ‘AF process’
O8ve7Sa0
ix
etrty 3208 ror ot
3. Select the outcome Approved and Rejected by double clicking them and see the result value.
The result value of Approved is “A”
The result value of Rejected is “R”.
ane ere!
Owe Teer
None Reiected
‘Distin ion
eau Aine
eee ®
Sat Tejas
(wis)
4, Now you have all required workflow information:
Table: Workflow Information
ee eens
cd
1 Workflow template ID ws30000015
2 Approval step ID 48
Jun 2014 7Adding a custom workflow scenario to the SAP Fiori Approve Requests in 6 steps
3 Step type Activity
4 Task ID 730000016
5 Business Object FORMABSENC.
6 Approval Method APPROVE
7 Outcomes Container or Event Container value
Approve A
Reject R
Others:
Jun 2014Adding a custom workflow scenario to the SAP Fiori Approve Requests in 6 steps ery
2. Step 2. Define workflow scenarios [Gateway]
2.1 Define scenario
Set the workflow scenarios in the task gateway customizing in the SAP NetWeaver Gateway.
1. Enter Transaction: NSPRO -> SAP Reference IMG
SAP NetWeaver -> Gateway Service Enablement -> Content -> Task Gateway Service ->
Scenario Definition
Display IMG
BE cising B sets p20 See wr A
sryenre
1d SAP Curtontin inceneriaien Qe
+B & cia Baier arctone
o 7 ppnawiae
Stern Soden Enter
aoe Be
“8 Okeaciiated
+ General Settings
> Gener Shanna
2. Search for your entry — ifit is not there enter the following information
Change View “Scenario Definition”: Overview
olive] OR
Scenario Identifier Z## ABSENCE Technical ID
Scenario Display Zit Absence Form Task group in SAP Fiori
Name Approve Requests
Scenario order blank blank
Technical Service IIWPGWITASKPROCESSING Technical Name for generic
Name Inbox service. Select by Fa
help.
Version 1 Version of Technical service
name,
Entity Set External Task
Name
Property External TaskDefintionID
Name
Default Sort by Createdon Sort property
Property
Mass Action blank
Jun 2014 9Adding a custom workflow scenario to the SAP Fiori Approve Requests in 6 steps SAP @
Class for Scenario blank In the Class for Scenario Count
Count fiold, enter the name of the class
that implements the
JMWWRK/IF_TGW_SCENARIO
interface in the SAP system,
Quick Action x Quick Approval by left slide on
mobile deviee.
Select your Scenario by choosing the block next to the name
P roenes o B
“Geserrim sagen —— sa. henirere
*Gigy cre pe mr canrwener Jae es
2.2 Assign consumer type
With your scenario highlighted choose Assign consumer Type to Scenario by double clicking it and
notice the 3 available types
ig scare a a
* (scene eter is
‘san coins Type to Ss
PeopRoeCraum | eh Cnaae 1Wst05
Citak cart some pan Te
| Jpenera
| Lames
li
2.3 Assign role
Ifyou want to enable the scenarios and consumer type to specific user groups, you can assign roles.
The users who have assigned role get task box in the SAP Fiori Approve Requests. If there is no role
assigned, all users will get the task box. This is an optional setting.
2.4 Assign task
You can assign multiple tasks to the Scenario. Choose Task Definition for Scenario by double
clicking it
Jun 2014
10ssts in 6 steps ery
NOTE: In all of these steps we just looked and didn't make any changes. The point is to show you
the different task assignments and how to assign them
\P Fiori Approve Req
Adding a custom workflow scenario to the
Dat stacae ‘seo seer 00 ance
‘Giscerooentan
~ Corsgn consumer Typeto
Th eon
Te
‘Safa Demon for Seaman -
Sfpiomm ceed — BEI. oe
Jun 2014 aAdding a custom workflow scenario to the SAP Fiori Approve Requests in 6 steps SAP @
3. Step 3. Add a tile to the Launchpad [Gateway]
3.1 Start the launchpad designer (system admin action).
Launch Google Chrome and choose quick Link LPD Designer CUST
CB https: //accounts.google.com /Ser a
ApS sof Launchpad |") LPD Designer cust] [") LPO Designer CONF
Ifyou receive @ security warning choose ‘proceed anyway and if prompted enter your login
credentials and choose Log In
‘Authentication Required
‘The server http/ametdc00.waf.sap.corp:S5060 requires a
sername and password. The server says: SAP NetWeaver
‘Application Server [2ME/200].
User Name: flor,
smn fees
Log In Cancel
Select the SAP FND Transactional Applications (SAP_FND_TC_T_X1) catalog
a a 81.234 B
Jun 2014 12Adding a custom workflow scenario to the SAP Fiori Approve Requests in 6 steps SAP @
3.2 Check the Target Mapping tile
Click on the target mapping tile and make sure the data matches the list below
; es |
Semantic Object: WorkfiowTask.
Action: approveRequests
Launchpad Role: UIX01CAt
Launchpad Instance: TRANSACTIONAL
Application Alias: ApproveRequests
€
‘Once confirmed choose the back arrow
3.3. Add anew “App Launcher — Dynamic’ tile
Choose the blank tile
© > G [[D anetsi00 ner sep corp S5 iS S50) rynainhtnsap~
pt a inpas 3 UO STB gece
InvertaryManaooe Coron
now Manager Cox ‘Troe wapons sonrove Form avsence
Production Supercor Cnt,
Project Managar Content
oo“ @ 1.234 g
‘Quaty Engineer Coreore
SAPEAM
‘SAP EAM Tiansectons|
‘SAP FINFact Snects
FrvTrensacuena AD
Jun 2014 13Adding a custom workflow scenario to the SAP Fiori Approve Requests in 6 steps ery
Choose App Launcher ~ Dynamic
€ covet ate eno
‘App Launcher—Dynamic | TergetWapping News Tie ‘App Launcher - state
‘eeanon bona sous Sipncaron eet Nowe Rater ceconigued
+ + + +
Choose this new tile and enter the information below:
Title: Enter the name of your workflow scenario, for example, Approve Absence Requests.
Icon: Choose whatever you like
Service URL:
© Goto Start > Documents -> SAPXO3_95
© Open the file named “Unit 4_Lesson10_W
© Copy the URL
IsaplopulodatalWPGW/TASKPROCESSING:mo/ScenarioCollection?Sfiter=key%20eq%
20ZXX_ABSENCE’
NOTE: Change 200 to match your number ZXX
© Paste the URL into the Link to Application space as shown below
rkflow_O1.txt” and locate the URL
Semantic Object: Entor WorkllowTask.
Action: Enter approveRequests
Parameters: Enter scenariol
scenatiold=Z00_ABSENCE)
your scenario identifier> (Example:
Choose Save
Jun 2014 14Adding a custom workflow
‘General
Approve Ansence leenetion Requests
‘Approve Feequests
Dynamic Data
SOE NES | traplopuladstanWPGINTASKPROCESSING eve
Navigation
semantic otectnagaion:
i \yoriow task a
mopraveReauests
‘On the Cantirmation Popup choose OK
© Confirmation
‘Are you Sune yoU Want to Save the configuration changes?
3.4. Add app to Launchpad (End user action).
Make sure your user has the role SAP_FND_TCR_T_X1
Open a now Goagle Chrome tab and choose the Launchpad quick link
Jun 2014Adding a custom workflow
Click on “Open Catalog". Select the “Approve Absence Requests" app by clicking on the + sign.
a”
Approve Form Absence Approve Absence
seer Sd Notfication Requests
0
‘Choose the back arrow to return to the application. The application will show
Jun 2014 16Adding a custom workfiew scenario ta the SAF Fio
Employee FIOR!: Approve notification ef absence
Enpioye FOR Appr
‘aliflealen of abnance nem men ven
Jun 2014 7Adc
4.
Say
ing a custom workflow scenario ta the SAP Fioni Approve Requests in 6 steps
Step 4. Configure the task decision [ERP]
4.1 Define workflow template and the step
To
Dial
1
expose the possible decision options of an Activity task type assigned to a BOR method with a
log We need to-configure the decisions options.
Go ta IMG and enter Transaction: SPRO (enter INPRO if youre not on the homepage of the
Gun
Choose SAP Reference IMG
Content Navigate to SAP NetWeaver -» Gateway Service Enablement -» Content «» Workflow
‘Settings and chaose the execute button next to Maintain Task Names and Decision Options
Display IMG
BAM ating 20 Game 6 «
“B "SAP Gomont Jeng lmaien entation Guide:
siectecs op nest
BB scan cannes Fercinon
v sebthtianse
— taraees Eiineet
+ Steed Covi Ghemel
artis
oe
“ nnmg tttou Ses stag
EoD Besirrain Tash Merise and Decivon Oonend)
LEG me ora
Geer fae
» ana Sha
In the list of workfiaws look for your Workflaw ID, Ifit is nat listed choase New Entries and enter
the information as described in the table below, IFit is listed choose it by selecting the gray box
next fo the Workflow ID.
Change View "Step ame": Overviewr
? fore JOR OR AB
"Ets ee ———
a
a ee
Workflow ID WS30000015 Workflow template ID
Step ID 48 ‘Step ID
Icon MIME Repository blank
Step Description Approve absence: Task name in UL
4.2 Assign the step keys
‘The key order should be exactly the same as task definition oulcomes. Choose Decision Keys by
double clicking i,
Jun 2014 1sAdding @ custom workflow scenario ta the SAF Fiori Apprave Reque:
Fito DEAE
‘s” &: Baie - |
Nate: If the step type i User Decision type, you can skip this step 2. The first option is assigned to
POSITIVE and the second option is assigned to NEGATIVE. We are just looking at the entries and
‘hore is nothing further to accompaish in this step.
Jun 2014 75. Step 5. Implement BADI for decision outcomes [ERP]
Adding a custom workti
5.1. Create BAdI Configuration and Class for Decision Handling
‘Te-handie.a decision that is made on the task we need ta configure and implement a BAG! that will
‘contain the logic for doing this. The BAd| class will need to contain the same logic for completing the
‘task that is done in the assigned BOR object dilog method, These dialog methods are all slightly
different so you need to take it on a case by case basis when implementing the decision BAd!, So
understanding how the step works in the workflow and how the dialog method is implemented is keyin
‘this process,
1, Enter transaction NSE 18 and choose enter from your keyboard
2, The Enhancement Spot for getting Business Context data is
AWWRKJES_WF_W|_BEFORE_UPD_IB. Enter that inio the Enhancement Spot input field then
choose the Display button
BAdI Builder: Initial Screen for Definitions
ee 908 8
(Enhancement Soot "ARMS, RT MORE ra
a rome o
Gee 7 ore co)
3, You should now see the following:
Embancement Spot /IWWRK/ES_WF_WI_BEFORE_UPD_IB Display
ee 9OG 12h ASOR KOS Aw
xrancarect Spat Fm We Wi HERES acwe
OG) 2) oes ‘adit Definton, (raven BAGE_we_eerGeE_oa_st
saa ne
+ EAR Vite DETER te Sa e
5. Right-click on the Implementations node and select Create BAdl Implementation in the context
menu:
Jun 2014 20OS) 2)
Eeaabefntos | Desouten
= 5 /WMR/BADL WE arto anal ec betre upee
* Beets
Bree
a
6. Inthe popup window click the create icon in the bottom right hand camer:
(fhrceersirererton ce Sor Tet a
[owner ins matin t/a 32.18 aL setts eutn naaters
7, Inthe Create Enhancement Implementation enter the details as shown below then choose the
green check mark
8, If you receive the Create Object Directory Entry enter STMP in the package then choose the
‘Save button
Cbject _[RSTR|Emeo|/210_ET_ABSENCE_FIORT
Attrbutes
Package
Person Responsble
Onignal System
rested on,
Jun 2014 aiAdding a custom workflow scenario ta the SAF Fiori Approve Requests in 6 steps ery
9. You will be navigated back to the Select or Create Enhancement Implementation popup window,
Make sure your newly craated Enhancement Implementation is selected as shawn bela and
choose the green check mark,
‘Scture Conezrent endeobirg
ow fe Coe reenact nn
10. The Create BAdI Implementation popup window will now be displayed:
Enter in the details as shown below being sure to,replace the XX with your assigned number
then choose the grean check mark
BAdl Implementation 2XX_BADI_ABSENCE_FORM
Deseription: ZXX BAD! Implementation Absence Form
Implementing Class EXX_IC_ABSENCE_FORM
11. On the Create Object Directory Enlry popup choose the save bution
Jun 2014 22‘Object [RSTR|/cas|z19_1¢_ABSENCE_FoRE
Latmibutes
Package =
FIOBT-10
12. You should now see the following:
Enhancement Implementation Z_EI_ABSENCE_DECISION Display
#9 90¢@ 4:5¢ ASOM Y Ons
19, Go inta Change mods by click the Display/Change button,
Enhancement Implementation Z10_EI_ABSENCE_
eo ee #2: 84 4208 YOR!
erhuncement aeration ‘au wsae oR
a Repertes_ietory | Technica etats_2e ETT
Bea) oO) oat
Jun 2014 23114, Drill nto the BAd| implementation you just created by choosing the dropdown arraw and double
licking the Filter Val
Enhancement Implementation
ac Brspectin Cine Tactical Osta Ae
| (aa) Bad! Implementation
FlBAdt Inplernantations: Description
~ 4 200_BAD1_ABSENCE FORWZ
15. Choose the change made butten again and on the right hand side you will see the filter details
view displayed then choose the Create Combination button
Eahencement imolementation 10.20 ABSENCE FLOR! Change
eefehe aa asco ona
heart ied, Ea eoa po neon
mts 0) Teen A
Sia) Om a
[ited roerevinirs _Cespien Se [2m va iw va wo Ucn)
Tb ULC ETEE {ED ACCMOMMeTeN Seas ARNCORO ea eS Con
+ Diresrere ce
16. Inthe popup windo¥r select both WORKFLOW_ID and STEP_ID by holding dawn Shift and
choosing the gray box next fo each and choose the green chack box
ey)
‘ake tes dr
Bree © sam type fer Sot Tet
17, ‘You should now see the following:
ier ves
(Sia) Donte contre Pott rm. rm [Eon]
a o fa om sp mm mm
‘me |g ee ™ wounen.p 7m mm
Jun 2014 24Adding 2 custom workflow scenario to the SAP Fiori Approve Requests in 6 steps SAPG
18. Double click on the ‘?777’ in the Value 1 column for the STEP_ID row. You should see the
following popup window:
ell
Fees Nee Games)
rata
vet hh
—
re aa
ix)
19.
Enter 48 into the Value 1 input field (48 is the step ID for Approve absence notification), and set
Comparater 1 t to'=', The filter should now look like so. Choose the green check mark.
FterTioe
Phevave
wx
20. Now set the WORKFLOW ID filter choose the 722? Value 1 setting and enter 'WSXXXXXXXX
(where the X's are replaced with your assigned number) and Comparator 1 to
the green check mark.
Then choose
21. Your ites should now bo set as shown below:
iat nnn sana manana
‘mec |
a g = se
Bye wsooons = woestow
22,
Activate your BAd! by clicking the Activate button,
Enhancement Implementation Z10_ELABSENCE.FIORI Change
eo eae offs 2888 KERN
eet try eee be eRe
eaom
lot meenerotrs — cezeten
(SB) Deere | Meares ev ect iw Jo)
4 2,5) SEE 210 8A vernon Ares om
* Binseneroe oss
Jun 2014
2523, In the Inactive Objects for FIORI-XX user choose the green check box
oe sue wwe)
efor omens
24, Note: you might see a warning telling you that the method that holds the actual implementation
60d8 has mot been inplemented...this will be done in the following section
‘Congrats! You have created a BAdI that can be callad ta access that business context data of the
Absence approval notification step.
5.2 Implement BAd| Class for Decision Handling
“The BAI class implementation for decision handling is going to be dependent an the workfow, the
‘task, and the BOR Object Dialog method that the task is bound to, You will need to examine all of
‘hose elements to determine the necessary implementation. In any case you willbe making use of the
‘SAP_WAPI" Business Workflow functions,
1. In your Enhancement Implementation switch to the Enh. Implementation Elements tab and
double click Implementing Class nada.
Enhancement Implementation ‘Zou ET ABSENCE FORK ‘hac
—Provertes_| Hitry | TechncslOetale Enh. Implementation Blements |
Badl Implementation ‘200 BADI_ ABSENCE FORM
Description 200 BADI Implementation Abs
ei FoRND _ Default implementation
|Exampk Implementation
= CTsacte not swichable thrcugh Custom. (IMG)
Jun 2014 262. You will be displayed the following on the right hand side of the screen. Double click the method.
Enhancement Implementation (zoo er wwe ort Inactive
Properties | Hetory | Tecrnicaltietae Enh Implementation ements |
Eibaat implementations: erface.
+ de 0, pact_ansence_FoR21 lvplementng Class
3. Inthe Create Method Implementation popup chaose Yes.
Interface method was not implemented
@ co you want to create implementation?
Ge =
4 Switen to change mode and add the follow eode between the mathad and.endmethad tines.
Goto Start-> Documents -> SAPXO2.95
Open the file named “Unit 4.Lesson09_Workflaw_01.txt" and locate the eode
© Copy the code (displayed below)
© Pastein between Method and end method lines
Please read the code and understand it
DATA ts pbyact TYPE sat_abi_2
DATA mpbytype TYPE swr_structobjort
DATA te obikey TYPE SWR_STRUCT-OBIECT_ KEV
DATA mrolende TYPE syste
DATA & container TYPE TABLE OF
DATA bx contsinr_line TYPE su,
DATA FORMNUMBER TYPE SWXEORMABS-FORMNUMBER
DATA ts foembss TYPE swrfoemabs
"Acces tho workiow da
CALL FUNCTION SAP_WAPL_GTT_ORIECTS:
EXPORTING
woskitom_id
IMPORTING.
Jun 2014 2FVeacing_otyect_2 = s_otject.
far is
OME 'x_ooject. ind TO fomnmumbar
select singla* from swsdormabs
Info fomabs.
where formrmber
CTION SAP_WAPI_READ_CONTAINER’
CALL FU
EXPORTING
workitem_s is deta Lio
IMPORTING
ratum_code retcod
TABLES
simple_container = tLeontainee
CASE ins
WHEN 0001
‘s_container line
Jorma grocetate ="
WHEN 0002 "Rajoctod
‘_comtainer_ting-vaue
Is fonmats-procsinte =F
ENDGASE
workflow keys of a dale
‘WLRESULT
ine TRANSPORTING
d container back
CALL FUNCTION SAP_WAPI_VRITE_CONTAINER
EXPORTING
WORKITEM ID:
Do_coaarT =
IMPORTING
RETURN CODE
TABLES
SIMPLE_CONTAINER,
IF impotcedo NEO
ees
Jun 2014 eeAdding a custom workfiew scenario ta the SAF Fio
's formats-approwiats
Ic formats ap
= sy.uname
update swxormabs from fs formas.
(CALL FUN
EXPORTING
WORKITENLID:
I SAP_WAP|_WORKITEM_COMPLETE®
‘CALL FUNCTION SAP_WAPI_WéORKITEM_CONFIRN!
PORTING.
WORKITEMLID: = in_oi_deteils- wid
5, Save and Activate your changes.
(© method Edt Goto Utiities -—Enyronment System — Helo
@ -|(G) eee Cam snaa
(Class Builder: Class Z1Q_IC_ABSENCE_FORM Change
eo PRG e af BS ASOD SS pate rotor sy
Method [/IUWRR/EF_WF_WI_BEFORE_UPD_[B-BEPORE_UPDATE Inactive
DATA Ie_container TYPE TABLE OF swr_cont-
DATA Ig container Line TYPE swr_cont
DATA FORMMUMBER TYPE SUXPORMABS-FORMNUMBER.
DATA 1g formabs TYPE euxformabs
6, On the Inactive Objects for Ficri-X popup chaose the graen check mark
Jun 2014 26. Step 6. Display application data [Gateway]
Adding a custom workti
6.1 Including business data by BADI (Optional but
Recommended)[Gateway]
‘You can enhance the warkitem description by implementing BAD|. HTML format is supported in
‘workitam description area.
The Enhancement spot name is /WPGWIES_TGW_TASK_DATA
Please rafar the section 5 for datalis stops of BADI implamentation
(edt Bankes: trial Screen for Definitions
oe 106 oO
serwemen set [RATTAN
sua wre. al
ts) Pee) (ae)
Please make sure you maintain the filer.
= BWF
Enhancement Implentantation Z00_€..FASK Oiyptay
ee y08 Ores Acoe Xenk
wenn erie
Butrico |i) (BIE) Saris Sacre Pi Mn Woe BS
TH BBCI Satta (Minton rw
‘oe * Parc
a nau
Mothod is MODIFY_TASK_DESCRIPTION.
o Start > Documents -» SAPKO3.95
Open the file named “Unit 4_Lesson09_Workflaw_02.txt” and locate the cade
Capy the parameters (ane at a time)
Paste the code
Jun 2014 30Please read the code and understand it
The value shauld be escaped ta avoid orass side script attacks.
Please look at help docurent,
ct nt value "_WI_OBJECT_1D',
ing value ‘1DEcLNTG00
data: num(i2) type m value "oooo00000000",
string,
uznosde
aubeer ndard table
er bor ol owr_cer
subcontainer_al
standard table of awr_cont wi
Jun 2014 31Adding a custom workflow scenario ta the SAF Fiori Approve Requests in 6 steps ey
L_OBJECTS
objects with table key element = 1c
conc
ON *" inte C¥_DESC
escaps( val = 1s.
sscaped =
formnumber format = ¢
CONCATENR
val_sscaped = escape( val =
cl_abap_format=>¢_xss_ml }
IPTION "ct r>Namec/td> | " val,
septeestre'
val_ascaped
escapa( va
format
scape ( val
abap_format=>e_xss.
j_DESCRIPTION
DES ON " | Cost conter* val_
rx! inte C¥_DESCRIPTION,
3_formiat
xes_ml }.
Shrrthd>Pramé/tdestd>" walls
Firstdayl forma _abap_f
CONCATENATE C¥_DESCRIPTION
Jun 2014 32Adding a custom workflow
tdoTo' val_escaped *
‘ctrocteoLeave Type | " wal_s
"ctrx | Reason¢/tde | " val_escap
"" val_e
ON.
"" inte C¥_DESCRI;
Jun 2014 337. Test the scenario
Adding a custom workti
7.1. Approve from SAP Fiori Approve Requests
+. Launch the Fiori Launchpad by going to Google Chrome and choosing the Launchpad quick link
I prompted enter your logon credentials
3, Select the approve icon.
4. Make a cammbont and choose Submit
5, You should receive a successful message and the workflow item is removed fram the list.
Jun 2014 38www.sdn.sap.com/irj/sdn/howtoguides
| |