天天看點

IBASE write buffer

created by jerry wang, last modified on apr 22, 2014

使用如下report 測試ibase write buffer:

parameters: id type ibap_head1-ibase obligatory default '3314',

            txt type ibib1-extid obligatory default 'c by code'.

data: ls_ibib           type ibib1,

       ls_header         type ibap_head1,

        ls_ibibt          type ibibt1.

ls_header-ibase = '3314'.

 call function 'crm_ibase_get_detail'

    exporting

      i_ibase_head  = ls_header

      i_level_down  = 1

    importing

      e_ibib1       = ls_ibib

      e_ibibt1      = ls_ibibt

    exceptions

      not_specified = 1

      doesnt_exist  = 2

      no_authority  = 3

      others        = 4.

 assert sy-subrc = 0.

 ls_ibib-extid = txt.

 call function 'crm_ibase_change'

      i_ibase_head        = ls_header

      i_ibib1             = ls_ibib

      i_ibibt1            = ls_ibibt

      data_not_consistent = 1

      ibase_locked        = 2

      not_succesful       = 3

      no_authority        = 4

      others              = 5.

 case sy-subrc.

  when 0.

     write: / 'change successful' color col_group.

  when 1.

     write: / 'data not consistent' color col_negative.

  when 2.

     write: / 'ibase locked' color col_negative.

  when 3.

     write: / 'change failed' color col_negative.

  when 4.

     write: / 'no authorization' color col_negative.

 endcase.

執行report:

IBASE write buffer

首先從db讀取ibase header 内容,填充read buffer. 此時write buffer( proc_tab )為空:  

IBASE write buffer

此處将最新的change 插入到write buffer:

IBASE write buffer

read buffer的資料來自db, external id為空:

IBASE write buffer

write buffer的值是report 傳入的最新的external id:

IBASE write buffer

function group ibibf裡的function module執行完畢之後的buffer狀态:

IBASE write buffer
IBASE write buffer
crm

繼續閱讀