ABAP顾问
分类:
2009-07-25 14:34:16
网友: 城市火柴 | 时间:2009-07-24 09:41:32 | |||
|
我做了一个测试,这样写似乎并无不妥:
REPORT z_barry_bapi_pr_change.
DATA: itemtext TYPE bapimereqitemtext OCCURS 0 WITH HEADER LINE,
i_return TYPE bapiret2 OCCURS 0 WITH HEADER LINE .
PARAMETERS p_banfn LIKE eban-banfn .
START-OF-SELECTION.
itemtext-preq_no = p_banfn.
itemtext-preq_item = '00010'.
itemtext-text_id = 'B01'.
itemtext-text_form = '*'.
itemtext-text_line = 'aaaa'.
APPEND itemtext.
itemtext-text_form = '/'.
itemtext-text_line = 'bbbb'.
APPEND itemtext.
itemtext-preq_item = '00020'.
itemtext-text_form = '*'.
itemtext-text_line = 'cccc'.
APPEND itemtext.
itemtext-text_form = '*'.
itemtext-text_line = 'dddd'.
APPEND itemtext.
CALL FUNCTION 'BAPI_PR_CHANGE'
EXPORTING
number = p_banfn
TABLES
return = i_return[]
pritemtext = itemtext[].
COMMIT WORK AND WAIT .
LOOP AT i_return.
WRITE / i_return-message .
ENDLOOP.
qdbarry2009-08-04 11:25:07
我上面的例子是ECC6的,没有错误,但是ECC5和470都是有Bug的。 470的Bug是: 临时内表没有清空,数据向下累积,比如本例会成为: 10: aaaa bbbb 20: aaaa bbbb cccc dddd ECC5的Bug是: 没有根据行项目做筛选,导致所有的行项目都是同样的内容,本例为: 10: aaaa bbbb cccc dddd 20: aaaa bbbb cccc dddd ECC5的解决方法是更改lcl_bapi_item的METHOD map2i_item_texts,在语句LOOP AT me->my_header->my_parent->my_bapi_itemtext加上行项目的条件。