Skip to content

Lesson 14 Practice — Add Actions and Feature Control to Support Issues ​

In Lesson 13 Practice, your Support Issue BO gained:

text
default Status
validations
messages

Now make it state-aware.

Target behavior:

text
Open
 └─ startProcessing → In Progress
                      └─ close → Closed

Target architecture:

text
ZCL_ISSUE_ACTIONS_###
        ↓
       EML
        ↓
ZR_ISSUE_###
        ↓
Managed RAP Behavior
   ├─ actions
   ├─ static field control
   └─ instance feature control
        ↓
ZISSUE_###

Practice information ​

TimeAbout 3 hours
PrerequisiteLesson 14 teacher-led work
Business ObjectZR_ISSUE_###
Behavior PoolZBP_R_ISSUE_###
New test classZCL_ISSUE_ACTIONS_###
ActionsstartProcessing, close
Main goalState-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
messages

2. Issue state model ​

Your status values are:

text
O = Open
I = In Progress
C = Closed

Use only these action-driven transitions:

text
O → I
I → C

Do not create:

text
C → O
C → I
I → O

actions.


3. Choose the action names ​

Use:

text
startProcessing
close

Explain why these are clearer business commands than:

text
set Status = I
set Status = C

4. Define the feature rules first ​

Use this matrix:

StatusStart ProcessingCloseEstimatedCostCurrencyCode
OEnabledDisabledEditableEditable
IDisabledEnabledEditableEditable
CDisabledDisabledRead-onlyRead-only

Do not code until you understand every row.


5. Add static Issue Number control ​

Make:

text
IssueNo

both:

text
mandatory on create
read-only on update

Use BDEF field characteristics.

Do not implement this rule in get_instance_features.


6. Add dynamic field declarations ​

Add instance feature control for:

text
EstimatedCost
CurrencyCode

These fields are dynamically read-only only when:

text
Status = C

7. Declare startProcessing ​

Declare an instance action that:

text
uses instance feature control
returns [1] $self

Do not add an input parameter.


8. Declare close ​

Declare a second instance action with the same action characteristics:

text
features : instance
result [1] $self

9. Preserve earlier behavior ​

Do not remove:

text
create
update
delete
numbering
locking
ETag
determination
validations
mapping

Lesson 14 extends the BO.


10. Generate handler methods ​

Use:

text
Ctrl+1

where ADT offers Quick Fix.

You need methods for:

text
startProcessing
close
get_instance_features

inside:

text
ZBP_R_ISSUE_###

11. Implement startProcessing ​

Requirements:

text
provider-side EML
IN LOCAL MODE
set Status = I
return the changed Issue
no direct SQL

Use 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 SQL

The result must match:

text
result [1] $self

13. 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
Status

for the requested Issue instances.

Then calculate:

text
startProcessing feature
close feature
EstimatedCost field feature
CurrencyCode field feature

15. startProcessing feature ​

Return:

text
enabled

only when:

text
Status = O

Otherwise:

text
disabled

16. close feature ​

Return:

text
enabled

only when:

text
Status = I

Otherwise:

text
disabled

17. Cost field features ​

Return:

text
unrestricted

for:

text
O
I

Return:

text
read-only

for:

text
C

for both:

text
EstimatedCost
CurrencyCode

18. Use the correct constant families ​

For actions:

text
if_abap_behv=>fc-o-enabled
if_abap_behv=>fc-o-disabled

For fields:

text
if_abap_behv=>fc-f-unrestricted
if_abap_behv=>fc-f-read_only

Do not swap them.


19. Activate the BO ​

Run:

text
Ctrl+F2
Ctrl+Shift+F3

Repair all BDEF/handler errors before runtime testing.


20. Create the test class ​

Create:

text
ZCL_ISSUE_ACTIONS_###

Implement:

text
IF_OO_ADT_CLASSRUN

This class is an external consumer.

Do not use:

text
IN LOCAL MODE

there.


21. Reserved practice Issue Number ​

Use:

text
97000001

for Lesson 14 Practice.

Make the exercise repeatable:

text
discover old UUID
delete only that instance through EML
commit cleanup

22. 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   = EUR

The Lesson 13 determination should default:

text
Status = O

Commit it.

Save the generated UUID.


23. Read the starting state ​

Expected:

text
IssueNo = 97000001
Status  = O

Do not continue if the starting Status is not O.


24. Request instance permissions ​

Use EML:

text
GET PERMISSIONS ONLY INSTANCE FEATURES

Request only:

text
startProcessing
close
EstimatedCost
CurrencyCode

Output:

text
RESULT
FAILED
REPORTED

25. Expected permissions for O ​

Record:

text
startProcessing:
close:
EstimatedCost:
CurrencyCode:

Expected conceptually:

text
enabled
disabled
editable
editable

26. Execute startProcessing ​

Use EML EXECUTE.

Inspect:

text
RESULT
FAILED
REPORTED

Expected action result:

text
Status = I

Commit it.


27. Request permissions for I ​

Run the same permission request.

Expected:

text
startProcessing disabled
close           enabled
EstimatedCost   editable
CurrencyCode    editable

Explain why the feature method returned a different result without changing its code.


28. Execute close ​

Execute:

text
close

for the same UUID.

Expected action result:

text
Status = C

Commit it.


29. Request final permissions ​

Expected for:

text
Status = C

is:

text
startProcessing disabled
close           disabled
EstimatedCost   read-only
CurrencyCode    read-only

30. Verify with CDS Data Preview ​

Open:

text
ZR_ISSUE_###

Press:

text
F8

Find:

text
97000001

Expected:

text
Status = C

31. Verify static field control ​

Inspect the BDEF declaration for:

text
IssueNo

It should express:

text
mandatory:create
readonly:update

As 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 = -50

Answer:

Is EstimatedCost editable? ​

Is -50 business-valid? ​

Which RAP mechanism answers each question? ​


35. Explain feature control vs authorization ​

Consider:

text
Status = I

so:

text
close = enabled

Could 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 = C

Explain 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 messages

40. Repair exercise E — no action result ​

Suppose the BDEF declares:

text
result [1] $self

but the implementation leaves:

text
result

empty.

Explain what the consumer would lose.

Restore the correct implementation.


41. Permission audit table ​

Complete from your real run:

StatusStart ProcessingCloseEstimatedCostCurrencyCode
O
I
C

Do not copy the expected matrix.

Use the program output.


42. Action audit table ​

Complete:

ActionBeforeAction resultAfter 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
reopen

Rules:

text
C → O

Requirements:

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 verified

This 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 → C

45. Optional challenge — parameterized action ​

Research a RAP action with an input parameter.

Design:

text
closeWithComment

that could conceptually receive:

text
ClosingComment

Do 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 : global

Explain one scenario where:

text
an action is globally disabled for all instances

would 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 → C

while the action/field permissions change at every state, you are ready for Lesson 15.