2023 Jul 29 5:20 AM
hello community
I need to create a program that selects and compares all bseg and bsis values and if it is different I must update the table. I would like to know if there is a specific function for selecting bseg and bsis data and if I can use the 'FI_DOCUMENT_CHANGE' function to update values data.
sample of function:
LOOP AT lt_bsegaux INTO ls_bsegaux.
ls_log1-zlspr = ls_bsegaux-zlspr.
i_buzei = ls_bsegaux-buzei.
l_accchg-newval = ls_bsegaux-zlspr.
l_accchg-fdname = 'ZLSPR '.
l_accchg-oldval = ls_bsegaux-oldval.
APPEND l_accchg.
CLEAR l_accchg.
CALL FUNCTION 'FI_DOCUMENT_CHANGE'
EXPORTING
i_awtyp = accpmblk_fi-awtyp
i_awref = accpmblk_fi-awref
i_aworg = accpmblk_fi-aworg
i_awsys = accpmblk_fi-awsys
i_lifnr = accpmblk_fi-lifnr
TABLES
t_accchg = l_accchg.
endloop.
2023 Jul 29 5:56 AM
In the question editor, there's a button marked "code". Please use it when posting code. Like this:
LOOP AT lt_bsegaux INTO ls_bsegaux.
ls_log1-zlspr = ls_bsegaux-zlspr.
i_buzei = ls_bsegaux-buzei.
l_accchg-newval = ls_bsegaux-zlspr.
l_accchg-fdname = 'ZLSPR '.
l_accchg-oldval = ls_bsegaux-oldval.
APPEND l_accchg.
CLEAR l_accchg.
CALL FUNCTION 'FI_DOCUMENT_CHANGE'
EXPORTING
i_awtyp = accpmblk_fi-awtyp
i_awref = accpmblk_fi-awref
i_aworg = accpmblk_fi-aworg
i_awsys = accpmblk_fi-awsys
i_lifnr = accpmblk_fi-lifnr
TABLES
t_accchg = l_accchg.
endloop.
2023 Jul 29 9:27 AM
Please edit your question (Actions>Edit), select your code and press the button [CODE], which makes the code appear colored/indented, it'll be easier for people to look at it. Thanks!
2023 Jul 29 11:44 PM
2023 Jul 30 9:24 AM
Basically, FI_DOCUMENT_CHANGE is not released by SAP, not documented anywhere, although some SAP notes give some very limited recommendations how to use it (2713775), I'd say that it's at your own risk, as always.
What is supported for FI documents is batch input, direct input program RFBIBL00, etc.
2023 Aug 16 3:38 PM