FMKU_BUDGET_EVNT is a BadI for transaction FMBB in SAP. This BadI have 3 method and those have own functionality, you can use those methods related to your requirement. Those methods are
- DOCUMENT_CHECKS for checking Budget Document before posting
- LINE_CHECKS for checking line item data
- POST this method you can implement your logic during budget document posting.
In this article i want to show you how to check or validate header document budget – document type which is the requirement is program check only some user id able to post budget doc with particular budget type.
DATA : lw_fmbb TYPE zta_fmbb_userid,
ls_msg TYPE bubas_s_msg.
SELECT SINGLE * INTO lw_fmbb FROM zta_fmbb_userid WHERE uname = sy-uname.
IF sy-subrc NE 0.
IF i_s_header-doctype = '1ENT' OR i_s_header-doctype = '4SPL'.
ls_msg-msgno = '000'.
ls_msg-msgty = 'E'.
ls_msg-msgid = '0K'.
ls_msg-msgv1 = 'User ID not authorize to enter budget using '.
ls_msg-msgv2 = 'type ENTR and SUPL'.
CALL METHOD i_ref_msg->cumulate_message
i_s_msg = ls_msg.
Note : This enhancement have custom table ZTA_FMBB_USERID , you can input any user id that you want to give authorization to post budget document with budget type 1ENT and 4SPL. If the user don’t have authorization the message error will show and then budget document cannot posted.