Created by Jerry Wang, last modified on Apr 22, 2014
Function group IB_CRM_API里定义了一个类型为int的全局变量handle, 其作用是作为一个指向internal read / write buffer的pointer。
write / read buffer定义在下列的function group里:
使用下列report 测试:
PARAMETERS: id TYPE ibib-ibase OBLIGATORY DEFAULT '13835'.
DATA: ls_header TYPE ibap_head1,
lt_struc_tab TYPE ibap_struc1_tab,
ls_line LIKE LINE OF lt_struc_tab,
ls_comp TYPE ibap_dat1,
ls_comp_detail TYPE ibap_comp2.
ls_header-ibase = id.
CALL FUNCTION 'CRM_IBASE_GET_DETAIL'
EXPORTING
i_ibase_head = ls_header
IMPORTING
e_struc_ibase_tab = lt_struc_tab
EXCEPTIONS
not_specified = 1
doesnt_exist = 2
no_authority = 3.
CHECK sy-subrc = 0.
LOOP AT lt_struc_tab INTO ls_line.
WRITE: / 'Component ID: ' , ls_line-instance COLOR COL_NEGATIVE.
ls_comp-ibase = id.
ls_comp-instance = ls_line-instance.
CALL FUNCTION 'CRM_IBASE_COMP_GET_DETAIL'
EXPORTING
i_comp = ls_comp
IMPORTING
e_comp_det = ls_comp_detail
EXCEPTIONS
not_specified = 1
doesnt_exist = 2
no_authority = 3.
WRITE: / 'Component Description:' , ls_comp_detail-descr COLOR COL_POSITIVE.
ENDLOOP.
UI上有一个root IBASE 13835,里面包含13836和13837两个IBASE component。
在使用CRM_IBASE_GET_DETAIL获取IBASE detail时,首先要获得一个handler,其value 为1:
首先去IBIBHANDLE_TAB buffer table里的write buffer IBIB_PROC_TAB 尝试读取指定的IBASE信息,
读取失败,再尝试read buffer,仍然失败:
最后从DB table IBIB取值,然后将读取出的信息写入read buffer:
对于读取IBASE hierarchy的逻辑同理:
采用buffer class读取instance信息:
双击c_wa-r_engine->struc->G_R_STRUC_BUF查看read buffer和write buffer:
可以发现在read scenario里read buffer被填充,而write buffer为空: