简体   繁体   中英

Data seems not updated between Update and Read despite commit

i am developing an ABAP report using the PSM BAPIs

  1. FM_FUNDS_CTR_CHANGE_NO_SCREEN
  2. FM_FICTR_READ_SINGLE

within a DO ... WHILE.

In the first iteration I update the funds center using BAPI (1). In a later iteration I need to read the funds center again using BAPI (2).

The problem is: In the later iteration I still get the old data of the funds center. The data changed using BAPI (1) are not regarded. Once the program is finished, the data is updated correctly - in a later program execution the updated data are present. I tried several options of committing between the two BAPIs:

  • Using the BAPI parameter i_flg_commit (also with "SET UPDATE TASK LOCAL" before the BAPI Call
  • COMMIT WORK
  • COMMIT WORK AND WAIT
  • Function Module BAPI_TRANSACTION_COMMIT
  • COMMIT WORK, and then WAIT UP TO 10 SECONDS

Unfortunately, none of these commands helped. I tried also several combinations of them. Has anyone an idea, why this problem appears?

Here a code snippet:

" Tried with and without this one
" SET UPDATE TASK LOCAL.

CALL FUNCTION 'FM_FUNDS_CTR_CHANGE_NO_SCREEN'
  EXPORTING
    I_FIKRS                 = gv_fikrs
    I_FISTL                 = gv_fictr
    IT_FUNDS_CTR            = lt_fistl
    IT_FUNDS_CTR_TEXT       = lt_fistl_t
    IT_FUNDS_CTR_HISV       = lt_fistl_h
    I_FLG_TEST              = pa_test
    I_FLG_COMMIT            = 'X' "Tried with and without this one
  IMPORTING
    ET_MESSAGES             = lt_return
  EXCEPTIONS
    [...]
.

" Several commit options tried
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
" COMMIT WORK.
" COMMIT WORK AND WAIT.
" WAIT UP TO 10 SECONDS.

CALL FUNCTION 'FM_FICTR_READ_SINGLE'
  EXPORTING
    I_FIKRS                        = gv_fikrs
    I_FICTR                        = gv_fictr
    I_FLAG_TEXT                    = 'X'
    I_FLAG_HIER                    = 'X'
    I_LANGUAGE                     = c_spras
    I_DATE                         = sy-datum
  IMPORTING
    E_F_FMFCTR                     = ls_current_fistl
    E_F_FMFCTRT                    = ls_current_fistl_t
    E_F_FMHISV                     = ls_current_fistl_h
  EXCEPTIONS
    [...]
.

Thank you in advance! Jonathan

As I see FM_FICTR_READ_SINGLE stores the read data in statics inside the forms. I cannot see a refreshing, clearing method available, meaning if once read it won't get changed in a program run.

Looked at the function group and I see FM_FICTR_READ_MULTIPLE FM there. In there I see no caching, you can try that, passing only one object in parameters.

Where I checked, EA-PS is on 617/05 version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM