Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

FB03 - Payment block key in environment -->document changes

ronaldo_aparecido
Contributor
0 Kudos
512

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?

1 REPLY 1

thkolz
Contributor
0 Kudos
447

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.