Business Scenario:
The SAP system must record the initiator and the final approver for financial transactions that go through workflow for posting. These fields must describe for each posting the individual who parked the entry as well as the individual whose approval directly led to the posting of the entry. The Final Approver is the individual who is ultimately responsible for the individual posting and by approval has also approved the attached supporting documentation.
This information is either available within Approval Sub-Workflow container or it can be viewed separately for each FI document in transactions FBV3 or FB03 from the workflow protocol via the generic object services.
This document provides a custom solution to this requirement. It is possible to capture the final level Workflow Approver within BKPF (Accounting Document Header) table.
Benefits:
Extend BKPF table structure
Perform the following steps to add new field ‘Final Approver’ to BKPF table
Extend BKPF_SUBST structure
During posting of FI document, all fields from BKPF_SUBST structure are transferred to BKPF structure. Perform the following steps to add new field ‘Final Approver’ to BKPF_SUBST table
Now both BKPF and BKPF_SUBST structures have new field FINAL_APPROVER.
Implement Business Transaction Event (Process interface 1120)
BTE 1120 can be used to populate the fields of structure BKPF_SUBST, which are eventually transferred to BKPF table.
SAP Reference IMG -> Financial Accounting -> Financial Accounting Global Settings -> Business Transaction Events
or
Function ‘ZSAMPLE_PROCESS_00001120’
FUNCTION zsample_process_00001120.
*"--------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(I_BKDF) TYPE BKDF OPTIONAL
*" TABLES
*" T_BKPF STRUCTURE BKPF
*" T_BSEG STRUCTURE BSEG
*" T_BKPFSUB STRUCTURE BKPF_SUBST
*" T_BSEGSUB STRUCTURE BSEG_SUBST
*" T_BSEC STRUCTURE BSEC OPTIONAL
*" CHANGING
*" REFERENCE(I_BKDFSUB) TYPE BKDF_SUBST OPTIONAL
*"--------------------------------------------------------------
DATA :
l_bkpfsub TYPE bkpf_subst,
l_bkpf TYPE bkpf.
DATA :
l_agent TYPE sww_aagent,
l_wi_cd TYPE sww_cd,
l_wi_ct TYPE sww_ct,
l_objkey TYPE swo_typeid.
CLEAR :
l_agent.
* Read BKPF record
READ TABLE t_bkpf INTO l_bkpf INDEX 1.
CHECK sy-subrc EQ 0.
CLEAR l_objkey.
CONCATENATE l_bkpf-bukrs l_bkpf-belnr l_bkpf-gjahr
INTO l_objkey.
CONDENSE l_objkey.
* Determine Final JE approver from Workflow LOG tables
SELECT wi_aagent wi_cd wi_ct
FROM swivobject
UP TO 1 ROWS
INTO (l_agent,l_wi_cd,l_wi_ct)
WHERE objtype = 'FIPP'
AND objkey = l_objkey
AND wi_type = 'W'
AND wi_stat = 'COMPLETED'
AND wi_rh_task = 'TS00007914'
ORDER BY wi_cd DESCENDING wi_ct DESCENDING.
ENDSELECT.
IF NOT l_agent IS INITIAL.
* Read BKPF substitute record
READ TABLE t_bkpfsub INTO l_bkpfsub INDEX 1.
IF sy-subrc EQ 0.
MOVE l_agent TO l_bkpfsub-final_approver.
* Update the BKPF substitute table
MODIFY t_bkpfsub INDEX 1 FROM l_bkpfsub
TRANSPORTING final_approver.
ENDIF.
ENDIF.
ENDFUNCTION.
Database view SWIVOBJECT provides all the work item headers for workflows linked to the parked document (FIPP). Task ‘TS00007914’ specifies Approval task and descending SORT by date and time – provides the Final Approver of the Parked Document.
Working Prototype
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
11 | |
10 | |
7 | |
6 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |