Appearance
Lesson 14 Practice — Add Actions and Feature Control to Support Issues
In Lesson 13 Practice, your Support Issue BO gained:
text
default Status
validations
messagesNow make it state-aware.
Target behavior:
text
Open
└─ startProcessing → In Progress
└─ close → ClosedTarget architecture:
text
ZCL_ISSUE_ACTIONS_###
↓
EML
↓
ZR_ISSUE_###
↓
Managed RAP Behavior
├─ actions
├─ static field control
└─ instance feature control
↓
ZISSUE_###Practice information
| Time | About 3 hours |
| Prerequisite | Lesson 14 teacher-led work |
| Business Object | ZR_ISSUE_### |
| Behavior Pool | ZBP_R_ISSUE_### |
| New test class | ZCL_ISSUE_ACTIONS_### |
| Actions | startProcessing, close |
| Main goal | State-aware Issue behavior |
1. Verify the starting BO
Confirm these activate:
text
ZR_ISSUE_###
Behavior Definition
ZBP_R_ISSUE_###
ZCL_ISSUE_RULES_###Your current BO should already contain:
text
managed CRUD
managed UUID numbering
locking
ETag
determination
validations
messages2. Issue state model
Your status values are:
text
O = Open
I = In Progress
C = ClosedUse only these action-driven transitions:
text
O → I
I → CDo not create:
text
C → O
C → I
I → Oactions.
3. Choose the action names
Use:
text
startProcessing
closeExplain why these are clearer business commands than:
text
set Status = I
set Status = C4. Define the feature rules first
Use this matrix:
| Status | Start Processing | Close | EstimatedCost | CurrencyCode |
|---|---|---|---|---|
O | Enabled | Disabled | Editable | Editable |
I | Disabled | Enabled | Editable | Editable |
C | Disabled | Disabled | Read-only | Read-only |
Do not code until you understand every row.
5. Add static Issue Number control
Make:
text
IssueNoboth:
text
mandatory on create
read-only on updateUse BDEF field characteristics.
Do not implement this rule in get_instance_features.
6. Add dynamic field declarations
Add instance feature control for:
text
EstimatedCost
CurrencyCodeThese fields are dynamically read-only only when:
text
Status = C7. Declare startProcessing
Declare an instance action that:
text
uses instance feature control
returns [1] $selfDo not add an input parameter.
8. Declare close
Declare a second instance action with the same action characteristics:
text
features : instance
result [1] $self9. Preserve earlier behavior
Do not remove:
text
create
update
delete
numbering
locking
ETag
determination
validations
mappingLesson 14 extends the BO.
10. Generate handler methods
Use:
text
Ctrl+1where ADT offers Quick Fix.
You need methods for:
text
startProcessing
close
get_instance_featuresinside:
text
ZBP_R_ISSUE_###11. Implement startProcessing
Requirements:
text
provider-side EML
IN LOCAL MODE
set Status = I
return the changed Issue
no direct SQLUse the action keys as the identity of the affected instances.
12. Implement close
Requirements:
text
provider-side EML
IN LOCAL MODE
set Status = C
return the changed Issue
no direct SQLThe result must match:
text
result [1] $self13. Explain the action result
For each action, answer:
What does %param contain?
Why does the handler read the Issue again after updating it?
Is the action result already proof that persistence completed?
14. Implement instance feature control
Read:
text
Statusfor the requested Issue instances.
Then calculate:
text
startProcessing feature
close feature
EstimatedCost field feature
CurrencyCode field feature15. startProcessing feature
Return:
text
enabledonly when:
text
Status = OOtherwise:
text
disabled16. close feature
Return:
text
enabledonly when:
text
Status = IOtherwise:
text
disabled17. Cost field features
Return:
text
unrestrictedfor:
text
O
IReturn:
text
read-onlyfor:
text
Cfor both:
text
EstimatedCost
CurrencyCode18. Use the correct constant families
For actions:
text
if_abap_behv=>fc-o-enabled
if_abap_behv=>fc-o-disabledFor fields:
text
if_abap_behv=>fc-f-unrestricted
if_abap_behv=>fc-f-read_onlyDo not swap them.
19. Activate the BO
Run:
text
Ctrl+F2
Ctrl+Shift+F3Repair all BDEF/handler errors before runtime testing.
20. Create the test class
Create:
text
ZCL_ISSUE_ACTIONS_###Implement:
text
IF_OO_ADT_CLASSRUNThis class is an external consumer.
Do not use:
text
IN LOCAL MODEthere.
21. Reserved practice Issue Number
Use:
text
97000001for Lesson 14 Practice.
Make the exercise repeatable:
text
discover old UUID
delete only that instance through EML
commit cleanup22. Create one Open Issue
Create:
text
IssueNo = 97000001
Title = Dynamic feature control
Description = Lesson 14 practice
RequesterEmail = actions@example.com
Priority = H
Status = omitted
ReportedOn = today
EstimatedCost = 100.00
CurrencyCode = EURThe Lesson 13 determination should default:
text
Status = OCommit it.
Save the generated UUID.
23. Read the starting state
Expected:
text
IssueNo = 97000001
Status = ODo not continue if the starting Status is not O.
24. Request instance permissions
Use EML:
text
GET PERMISSIONS ONLY INSTANCE FEATURESRequest only:
text
startProcessing
close
EstimatedCost
CurrencyCodeOutput:
text
RESULT
FAILED
REPORTED25. Expected permissions for O
Record:
text
startProcessing:
close:
EstimatedCost:
CurrencyCode:Expected conceptually:
text
enabled
disabled
editable
editable26. Execute startProcessing
Use EML EXECUTE.
Inspect:
text
RESULT
FAILED
REPORTEDExpected action result:
text
Status = ICommit it.
27. Request permissions for I
Run the same permission request.
Expected:
text
startProcessing disabled
close enabled
EstimatedCost editable
CurrencyCode editableExplain why the feature method returned a different result without changing its code.
28. Execute close
Execute:
text
closefor the same UUID.
Expected action result:
text
Status = CCommit it.
29. Request final permissions
Expected for:
text
Status = Cis:
text
startProcessing disabled
close disabled
EstimatedCost read-only
CurrencyCode read-only30. Verify with CDS Data Preview
Open:
text
ZR_ISSUE_###Press:
text
F8Find:
text
97000001Expected:
text
Status = C31. Verify static field control
Inspect the BDEF declaration for:
text
IssueNoIt should express:
text
mandatory:create
readonly:updateAs a repair exercise, temporarily try to include IssueNo in a normal external EML update.
Observe the contract problem.
Restore the valid source.
32. Explain action vs update
Complete:
text
Generic update says:
________________________
startProcessing says:
________________________
close says:
________________________Then explain why a business action can remain stable even if its implementation becomes more complex later.
33. Explain static vs dynamic field control
Use your actual model:
text
IssueNo
→ ________________________
EstimatedCost
→ ________________________Explain why one belongs in a static field characteristic and the other belongs in instance features.
34. Explain feature control vs validation
Consider:
text
Status = I
EstimatedCost = -50Answer:
Is EstimatedCost editable?
Is -50 business-valid?
Which RAP mechanism answers each question?
35. Explain feature control vs authorization
Consider:
text
Status = Iso:
text
close = enabledCould authorization still deny the operation?
Explain.
Do not implement authorization yet.
36. Repair exercise A — wrong action state
Temporarily imagine:
text
startProcessing enabled when Status = CExplain why this conflicts with the state model.
Restore the correct matrix.
37. Repair exercise B — wrong constant family
Temporarily replace a field feature constant with an operation feature constant.
Run syntax check.
Restore the correct source.
Record:
text
Action feature constant family:
Field feature constant family:38. Repair exercise C — forget features : instance
Remove the BDEF feature declaration from one action or field temporarily.
Observe the resulting mismatch with the handler implementation.
Restore the correct BDEF.
Explain why behavior declaration and implementation must agree.
39. Repair exercise D — direct SQL action
Do not execute direct SQL.
Explain why this would be architecturally wrong:
abap
UPDATE zissue_###
SET status = 'C'
WHERE uuid = ...Your answer must mention:
text
transactional buffer
RAP validations
save sequence
ETag
business messages40. Repair exercise E — no action result
Suppose the BDEF declares:
text
result [1] $selfbut the implementation leaves:
text
resultempty.
Explain what the consumer would lose.
Restore the correct implementation.
41. Permission audit table
Complete from your real run:
| Status | Start Processing | Close | EstimatedCost | CurrencyCode |
|---|---|---|---|---|
O | ||||
I | ||||
C |
Do not copy the expected matrix.
Use the program output.
42. Action audit table
Complete:
| Action | Before | Action result | After COMMIT |
|---|---|---|---|
startProcessing | |||
close |
43. Consumer/provider audit
Complete:
text
Action declaration lives in:
____________________
Action implementation lives in:
____________________
Feature declaration lives in:
____________________
Feature calculation lives in:
____________________
Runtime permission request lives in:
____________________44. Certification-style mini task
Add one extra action:
text
reopenRules:
text
C → ORequirements:
text
instance action
result [1] $self
enabled only when Status = C
implemented with local-mode EML
tested with GET PERMISSIONS
executed through external EML
committed and verifiedThis is a stretch/certification-style task.
Do not keep it in the final submitted BO if your instructor wants the required state model to remain only:
text
O → I → C45. Optional challenge — parameterized action
Research a RAP action with an input parameter.
Design:
text
closeWithCommentthat could conceptually receive:
text
ClosingCommentDo not implement it unless you understand how RAP action parameter types are modeled.
Record:
text
Why would a parameterized action be better than adding an arbitrary temporary field to the BO?46. Optional challenge — global feature control
Research:
text
features : globalExplain one scenario where:
text
an action is globally disabled for all instanceswould make more sense than instance feature control.
Do not replace the required instance-feature solution.
47. Submission checklist
48. End-of-practice explanation
Explain without looking at the guided lesson:
text
Actions express named business operations.
Static field control expresses rules that never depend on instance state.
Instance feature control calculates availability from current BO state.
GET PERMISSIONS lets an ABAP consumer inspect those dynamic features.
Feature control is not validation.
Feature control is not authorization.
The BO remains the source of truth for all of these rules.If you can demonstrate:
text
O → I → Cwhile the action/field permissions change at every state, you are ready for Lesson 15.