Demo · Z_MM_PO_APPROVAL — Documentation
A process description and 11 handbook chapters read from the code, 28 objects and 20 tables inventoried. The business layer comes from a model in a real run.
Process description
Written from the code when the stage opens, no model call. A project exports the same document; its appendix stands at the foot of this page. The demo exports nothing.
In short
Reconstructed· from the codeWhat it does
- Creates purchase orders and starts workflows in SAP, reading purchase requisitions (EBAN) and suppliers (LFA1), selected by purchase requisition number.Source line 475Source line 421
- It creates purchase orders (BAPI_PO_CREATE1) and starts workflows (SAP_WAPI_CREATE_EVENT) and changes purchase requisitions (EBAN) and two custom tables (ZMM_PO_APPR, ZMM_PO_ATTACH) in SAP.Source line 421Source line 475
- It reads purchase requisitions (EBAN), suppliers (LFA1), supplier purchasing data (LFM1), cost centers (CSKS), 5 more tables, tables ZMM_VEND_BLOCK, ZMM_DEPT_HEAD and ZMM_NOTIFY_CFG and a file the user uploads from the PC.Source line 61Source line 154
- The result is a list on screen.Source line 542
- A user starts it from a selection screen with 4 inputs; it runs in the user's session.Source line 36Source line 129
- 12 business rules are fixed in the code.
What it does not do
- It calls no other system: no call names a DESTINATION.
Limits of this reading
- Supplier master data (LFA1, LFM1), cost center master data (CSKS) and material master data (MARC) are read as they are stored when it runs, not as they were on an earlier date.Source line 154Source line 161
- 1 place names its target only at run time; what it reaches is not determined.Not determined
- Why the program exists is not written in its code: this says what it does, not what it is for in your company.Not determined
- A line reference shows where a statement comes from in the code. It does not show that the business has confirmed it.
Owner and approval
- Process owner: Not determined — the code names no owner, and none is recorded here.Not determined
- Business approval: Not recorded — reconstructed from the code, not confirmed by the business.Not determined
Questions a reader asks
- Why is an item missing? — It selects by purchase requisition number. The checks that skip a record are listed with their condition and line.
- Why is a value unknown? — The business rules fixed in the code set the values; each says when it applies, and what happens when none does.
- Why is there no proposal or result? — The cases that end the run or skip a record, each with the message the user sees.
- What changes in S/4HANA? — Today it creates purchase orders (BAPI_PO_CREATE1) and starts workflows (SAP_WAPI_CREATE_EVENT) and changes purchase requisitions (EBAN) and two custom tables (ZMM_PO_APPR, ZMM_PO_ATTACH) in SAP. The move itself is decided in Design and Management, with the open questions.
Process description · At a glance
Reconstructed· from the codeDemo · Emergency purchase approval — Z_MM_PO_APPROVAL
Creates purchase orders and starts workflows in SAP, reading purchase requisitions and suppliers, selected by purchase requisition number.
The result is a list on screen.
Started by: A user starts it from a selection screen with 4 inputs; it runs in the user's session. Who carries out the steps is not provable from the code.
- Steps
- 11
Main path
Rules and risks to know
- Business rule BR-009 Deviation percent above 5 → runs “Hold for buyer” and ends “Check price”. Source line 315Source lines 316 to 317
- Business rule BR-010 Emergency set and amount at most 50000.00 → runs “Find department head” and “Request approval”. Source lines 325 to 327
- Business rule BR-004 Currency other than EUR → runs “Convert to EUR”. Source lines 69 to 70
- Changes SAP data directly: the purchase requisition. EBANSource line 240
- 5 values are fixed in the code, not in customizing. BR-001, BR-002, BR-003 +1Source line 17Source line 18
What this covers
- The process in Z_MM_PO_APPROVAL.abap: 11 steps, 17 decision points, 21 rules. Source lines 1 to 552
- An authorization check limits who can complete it. M_BANF_EKGSource lines 116 to 118
What it leaves out
- Settings and master data in 3 custom tables it only reads. ZMM_VEND_BLOCK, ZMM_DEPT_HEAD, ZMM_NOTIFY_CFGSource line 222
- Jobs, variants and schedules that start it, and manual steps around a run.
- What the 6 SAP functions and transactions it calls do inside SAP. GUI_UPLOAD, CONVERT_TO_LOCAL_CURRENCY, SAP_WAPI_CREATE_EVENT +3Source lines 129 to 140
- 2 includes whose source was not uploaded. Z_MM_PO_NOTIFY, Z_MM_PO_LOGSource line 363
1. How the process works
11 steps on the main path; 3 decision points between them can end the run. A run starts from a selection screen with 4 inputs.
How a run starts
- A user starts the report Z_MM_PO_APPROVAL and fills in its selection screen (4 fields); it can also run as a background job with a variant, which the code does not show. Source line 11Source line 36
- The processing runs in START-OF-SELECTION. Source line 41
Steps
How a run starts is read from the code; who carries out the steps is not provable from it: the steps hold no dialogue, background or update-task statement that says so.
Check authority — Reads the purchase requisition; can end early.
CHECK_AUTHORITYSource line 42Source lines 103 to 122Read requisition — Reads the purchase requisition; converts currency; can end early.
READ_REQUISITIONSource line 43Source lines 60 to 75Check requisition — Reads the cost center and the material plant data; can end early.
CHECK_REQUISITIONSource line 44Source lines 77 to 98Decision: Rejected? — Yes: the run ends; No: continue with “Upload attachment”
gv_rejected = abap_falseSource line 45Upload attachment — Changes a custom table; reads a file from the user's PC; can end early.
UPLOAD_ATTACHMENTSource line 46Source lines 124 to 146Read vendor — Reads the supplier and the supplier purchasing data; can end early.
READ_VENDORSource line 47Source lines 151 to 167Check vendor — Reads a custom table.
CHECK_VENDORSource line 48Source lines 219 to 228Decision: Rejected? — Yes: the run ends; No: continue with “Read info record”
gv_rejected = abap_falseSource line 49Read info record — Reads the purchasing info record and the info record purchasing data; can end early.
READ_INFO_RECORDSource line 50Source lines 250 to 269Check price
CHECK_PRICESource line 51Source lines 303 to 319Decision: On hold? — Yes: the run ends; No: continue with “Decide approval”
gv_on_hold = abap_falseSource line 52Decide approval — Reads the release strategy and 2 more tables; changes a custom table; starts workflow; calls 2 more SAP functions.
DECIDE_APPROVALSource line 53Source lines 324 to 340Notify requester — Reads a custom table; can end early.
NOTIFY_REQUESTERSource line 54Source lines 379 to 395Write result list
WRITE_RESULT_LISTSource line 55Source lines 540 to 552
2. Business rules and decision points
21 rules: 9 business rules, 7 decision points, 5 fixed values.
| Rule | When | Then | Step | Source |
|---|---|---|---|---|
| BR-009 | WhenDeviation percent above 5 | ThenRuns “Hold for buyer” and ends “Check price” | StepCheck price | SourceSource line 315Source lines 316 to 317 |
| BR-010 | WhenEmergency set and amount at most 50000.00 | ThenRuns “Find department head” and “Request approval” | StepDecide approval | SourceSource lines 325 to 327 |
| BR-004 | WhenCurrency other than EUR | ThenRuns “Convert to EUR” | StepRead requisition | SourceSource lines 69 to 70 |
| BR-005 | WhenMRP controller EMG or tracking number EMERG* | ThenHandled separately in “Read requisition” | StepRead requisition | SourceSource lines 72 to 73 |
| BR-006 | WhenPlant 1000 | ThenHandled separately in “Check requisition” | StepCheck requisition | SourceSource lines 95 to 96 |
| BR-008 | WhenMmsta 01 or Z9 | ThenRuns “Reject” | StepCheck material status | SourceSource lines 277 to 278 |
3. Exceptions
3 cases stop the run with an error; 3 warn and continue; 13 end a step or the run early.
| What happens | Step | The user sees | Result | Source |
|---|---|---|---|---|
| No purchase requisition found | StepRead requisition | The user sees“Purchase requisition not found …” | ResultRun stops (error) | SourceE001 · ZMM_POSource line 65Source line 66 |
| No purchase requisition found | StepCheck authority | The user sees“Purchase requisition not found …” | ResultRun stops (error) | SourceE001 · ZMM_POSource line 109Source line 110 |
| No authorization for purchasing group … | StepCheck authority | The user sees“No authorization for purchasing group …” | ResultRun stops (error) | SourceE002 · ZMM_POSource line 120 |
| Attachment could not be read | StepUpload attachment | The user sees“Attachment could not be read …” | ResultWarning; run continues | SourceW003 · ZMM_POSource lines 129 to 140Source line 142 |
| No exchange rate for … | StepConvert to EUR | The user sees“No exchange rate for …” | ResultWarning; run continues | SourceW004 · ZMM_POSource line 187 |
| Notification failed | StepNotify requester | The user sees“Notification failed for …” | ResultWarning; run continues | SourceW007 · ZMM_POSource lines 386 to 391Source line 393Open question: Name the call target |
4. What it changes and produces
8 effects on data and documents, the weightiest first.
| Effect | What | Source |
|---|---|---|
| Creates a document | WhatCreates the purchase order | SourceBAPI_PO_CREATE1Source lines 475 to 484 |
| Creates a document (batch input) | WhatCreates the purchase order by simulated entry through a transaction (batch input) | SourceME21N, MEPO_TOPLINE-SUPERFIELDSource line 508Source line 515Source lines 515 to 518 |
| Starts a workflow | WhatStarts the workflow | SourceSAP_WAPI_CREATE_EVENTSource lines 421 to 427 |
| Changes data | WhatCreates an entry in a custom table | SourceZMM_PO_APPRSource line 353 |
| Changes data | WhatCreates an entry in a custom table | SourceZMM_PO_ATTACHSource lines 531 to 534 |
5. Systems and data
It reads 12 tables; calls 7 functions by name; holds 4 controls.
Data it reads
12 tables read; which rows each read takes, as the code filters them.
Integrations
7 calls to other functions: 1 file, 2 functions, 1 workflow, 2 BAPIs, 1 transaction.
- Open question for 2 of the 7 rows: Add ATC results
Reads a file from the user's PC GUI_UPLOADSource lines 129 to 140
Converts currency in the step “Convert to EUR”. CONVERT_TO_LOCAL_CURRENCYSource lines 173 to 183
Used in the step “Run a step chosen at runtime”. (name computed at run time)Source lines 386 to 391Open question: Name the call target
Starts the workflow SAP_WAPI_CREATE_EVENTSource lines 421 to 427
Creates the purchase order BAPI_PO_CREATE1Source lines 475 to 484
Saves the changes in the step “Save the changes”. BAPI_TRANSACTION_COMMITSource lines 490 to 492
Creates the purchase order by simulated entry through a transaction (batch input) ME21NSource lines 515 to 518
Controls
4 controls in the code: authorization check, record of each case, saving changes, result check of a BAPI.
Authorization check. Checks the user’s authorization before it goes on.
M_BANF_EKG · NFR-05Source lines 116 to 118Source line 119Source line 120Record of each case. Keeps a record of each case in a custom table.
NFR-04Source line 234Source line 244Source line 339Saving changes. Saves its changes in 3 separate places in one run.
COMMIT WORK, CALL FUNCTION BAPI_TRANSACTION_COMMITSource line 243Source line 428Source lines 490 to 492Open question: Add ATC resultsResult check of a BAPI. Checks the result of the SAP call for errors.
GT_RETURN · NFR-08Source lines 475 to 484Source line 486
6. Open questions
7 open questions; 3 block the decision; 0 of 5 groups closed.
- Add the includesITSource line 363Source line 396
Parts of the program were not in the upload, so what they do is unknown. This project cannot take further includes, so the answer is yours to give.
- Choose the targetManagement
No target edition is declared, so what “works on the target” means is not settled.
- Name the call targetITSource line 386
What these statements call or which table they use is decided only while the program runs; the code alone cannot name it, so the answer is yours to give.
- Add ATC resultsITSource line 173Source line 490
Whether these function-module calls and file accesses still work on the target is not checked by this engine; your system’s ATC cloud-readiness check judges them.
- Add usage dataIT
Whether the program still runs is unknown until a usage export is imported. Never imported is unknown, not unused.
Business SOP and RACI
Model proposalWho does what at each step, who is accountable, and the controls — proposed by a language model from the process documentation read from your code. The steps and their lines stay the code reading.
Who is responsible Model proposal
A project starts from the model’s proposal; the demo calls no model. Name the roles yourself and say who does what at each step.
Explore the process
The process drawn from the code, with the chapter of each step beside it. Select a step to read its chapter.
Process as the code runs it Reconstructed· code reading
Appendix: details and evidence
What the body says shorter, in the code's own words, then every process element and statement the engine read. Each sentence is printed once (22 repeats merged); nothing is left out.
Steps at a glance
| No. | Step | What it does | Lines | Details |
|---|---|---|---|---|
| 1 | StepCheck authority | What it doesReads the purchase requisition; can end early. | LinesSource line 42Source lines 103 to 122 | Details5 |
| 2 | StepRead requisition | What it doesReads the purchase requisition; converts currency; can end early. | LinesSource line 43Source lines 60 to 75 | Details7 |
| 3 | StepCheck requisition | What it doesReads the cost center and the material plant data; can end early. | LinesSource line 44Source lines 77 to 98 | Details13 |
| 4 | StepUpload attachment | What it doesChanges a custom table; reads a file from the user's PC; can end early. | LinesSource line 46Source lines 124 to 146 | Details3 |
| 5 | StepRead vendor | What it doesReads the supplier and the supplier purchasing data; can end early. | LinesSource line 47Source lines 151 to 167 | Details7 |
| 6 | StepCheck vendor | What it doesReads a custom table. | LinesSource line 48Source lines 219 to 228 | Details1 |
| 7 | StepRead info record | What it doesReads the purchasing info record and the info record purchasing data; can end early. | LinesSource line 50Source lines 250 to 269 | Details5 |
| 8 | StepCheck price | What it does— | LinesSource line 51Source lines 303 to 319 | Details0 |
| 9 | StepDecide approval | What it doesReads the release strategy and 2 more tables; changes a custom table; starts workflow; calls 2 more SAP functions. | LinesSource line 53Source lines 324 to 340 | Details12 |
| 10 | StepNotify requester | What it doesReads a custom table; can end early. | LinesSource line 54Source lines 379 to 395 | Details3 |
| 11 | StepWrite result list | What it does— | LinesSource line 55Source lines 540 to 552 | Details0 |
Step details
The evidence, complete
Every process element and every statement the engine read, with its lines.
Demo · Z_MM_PO_APPROVAL
Process with 41 steps and 17 decision points.
97 of 97 shapes on this map carry a line anchor — 100.0 % traceability. The map draws a small routine as one shape, so this count can differ from the number of process elements read from the code.
Not generated. No Gemini key is available for this account — neither the community key nor one of your own. Every step keeps its technical name from the code, and every line anchor is unchanged.
Read by the engine out of the whole source the signed run analysed. No language model wrote its process structure or its statements. Every statement names the lines it was read from, or says that it is not determined and why. The one exception is marked where it appears: business names and lanes from the naming stage are model proposals.
- COMMIT WORK, does not wait — line 243
- COMMIT WORK, does not wait — line 428
- CALL FUNCTION BAPI_TRANSACTION_COMMIT, waits for the update — lines 490 to 492
A lane is the token the source writes, never a job title.
- ReconstructedZ_MM_PO_APPROVALprogram — line 11
- ReconstructedM_BANF_EKGauthority, from AUTHORITY-CHECK — lines 116 to 118