2023 Sep 26 8:45 PM
Hey guys
I change the lock of an accounting document using the 'FI_DOCUMENT_CHANGE' function and it works, however the log is not registered in fb03 in the menu environment --> document changes --> payment block key however in other programs this is working and it registers correctly using the same function.
Does anyone know how I can record this log?
2023 Sep 26 9:01 PM
Try to do a COMMIT WORK after the function call.
Maybe it’s better to call FI_ITEMS_MASS_CHANGE. I remember that I had to switch to it when moving from ECC to S/4.
DATA:
s_bseg TYPE bseg,
t_fldtab TYPE tpit_t_fname,
t_buztab TYPE tpit_t_buztab.
s_bseg-zlspr = <NEW_VALUE>.
APPEND INITIAL LINE TO t_buztab ASSIGNING FIELD-SYMBOL(<fs_buztab>).
MOVE-CORRESPONDING s_bseg TO <fs_buztab>.
APPEND INITIAL LINE TO t_fldtab ASSIGNING FIELD-SYMBOL(<fs_fldtab>).
<fs_fldtab>-fname = 'ZLSPR'.
<fs_fldtab>-aenkz = abap_true.
* Change FI document
CALL FUNCTION 'FI_ITEMS_MASS_CHANGE'
EXPORTING s_bseg = s_bseg
IMPORTING errtab = et_errors
TABLES it_buztab = t_buztab
it_fldtab = t_fldtab
EXCEPTIONS bdc_errors = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
RETURN.
ELSE.
COMMIT WORK AND WAIT.
ENDIF.