Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
Hongjun_Qian
Product and Topic Expert
Product and Topic Expert
2,005
SAP Cash Management provides a program FQM_UPD_FLOW_TYPE to update Flow Type in Accounting Document.

As the program will set the Flow Types based on the master data definition (like G/L account, bank account), configuration data (like Payment program) and transaction data (mostly the accounting document itself), and the customizing (IMG path is: Financial Supply Chain Management > Cash and Liquidity Management > Cash Management > Flow Types > Assign Flow Types to G/L Accounts).

However, the program won't reset the flow types in the Accounting Documents automatically.

Here comes a program which help you to reset all the Flow Types in Accounting Documents which you can reset all Flow Types if you need to.
REPORT ZAC_RESETFLOWTYPE.

PARAMETERS p_bukrs TYPE BUKRS OBLIGATORY.
PARAMETERS p_hkont TYPE HKONT.
PARAMETERS p_shkzg type shkzg.
DATA: gv_amount TYPE i.

INITIALIZATION.



START-OF-SELECTION.

CLEAR: gv_amount.
IF p_hkont is not INITIAL AND p_shkzg IS NOT INITIAL.
SELECT COUNT( * )
FROM BSEG
INTO gv_amount
WHERE bukrs = p_bukrs
AND hkont = p_hkont
AND shkzg = p_shkzg.

UPDATE BSEG
SET FQFTYPE = ''
WHERE bukrs = p_bukrs
AND hkont = p_hkont
AND shkzg = p_shkzg.
ELSEIF p_hkont IS NOT INITIAL AND p_shkzg IS INITIAL.
SELECT COUNT( * )
FROM BSEG
INTO gv_amount
WHERE bukrs = p_bukrs
AND hkont = p_hkont.

UPDATE BSEG
SET FQFTYPE = ''
WHERE bukrs = p_bukrs
AND hkont = p_hkont.
ELSEIF p_hkont IS INITIAL AND p_shkzg IS NOT INITIAL.
SELECT COUNT( * )
FROM BSEG
INTO gv_amount
WHERE bukrs = p_bukrs
AND shkzg = p_shkzg.

UPDATE BSEG
SET FQFTYPE = ''
WHERE bukrs = p_bukrs
AND shkzg = p_shkzg.
ELSE.
SELECT COUNT( * )
FROM BSEG
INTO gv_amount
WHERE bukrs = p_bukrs.

UPDATE BSEG
SET FQFTYPE = ''
WHERE bukrs = p_bukrs.
ENDIF.

COMMIT WORK AND WAIT.
WRITE 'BSEG UPDATED COMPLETED: '.
WRITE gv_amount.
2 Comments
fadeevom
Explorer
0 Kudos
Great. Thanks. It has helped a lot. I thought that I was doing something wrong but it seems that the standard app only sets the flow types but not resets them
fadeevom
Explorer
0 Kudos

Hi Hongjun_Qian. In the lates version of the SAP flow type initialization transaction the flow types are cleared if the account is not CM relevant. So no need to implement this code.