Application Development 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: 

Best way to select bseg and bsis and update data

ronaldo_aparecido
Contributor

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.
5 REPLIES 5

matt
Active Contributor

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.

Sandra_Rossi
Active Contributor
0 Kudos

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!

ronaldo_aparecido
Contributor

sandra.rossi and matthew.billingham

ready is changed ,thanks

Sandra_Rossi
Active Contributor
0 Kudos

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.

raymond_giuseppi
Active Contributor
0 Kudos
  • Does RFINDEX raise a message during consistency check
  • Did you perform some archiving on those tables (BSEG vs BSIS+BSAS)