ITPub博客

首页 > 应用开发 > IT综合 > Read Purchasing Document

Read Purchasing Document

原创 IT综合 作者:tolyhuang 时间:2007-11-01 11:49:34 0 删除 编辑
Sample:[@more@]Report ZRP_Read_Purchase_His.
*---- Selection Screen -------------------------------------------------
parameters: ebeln like ekko-ebeln memory id bes obligatory,
ebelp like ekpo-ebelp memory id bsp.
*---- Variables --------------------------------------------------------
data: w_comwa like vbco6,
it_doc like ekbe occurs 0 with header line,
it_txt like dd07v occurs 0 with header line,
begin of it_type occurs 0,
vgabe like ekbe-vgabe,
text like dd07v-ddtext,
end of it_type.
*-----------------------------------------------------------------------
start-of-selection.
call function 'ME_READ_HISTORY'
exporting
ebeln = ebeln
ebelp = ebelp
webre = 'X'
tables
xekbe = it_doc.
perform write_docs.
*-----------------------------------------------------------------------
form write_docs.
call function 'GET_DOMAIN_VALUES'
exporting
domname = 'VGABE'
tables
values_tab = it_txt
exceptions
no_values_found = 1
others = 2.
case sy-subrc.
when 1. write: / 'Warning: No texts found for',
'transaction/event type, purchase order history!'.
when 2. write: / 'Warning: Cannot retrieve descriptions for',
'transaction/event type, purchase order history!'.
when 0. perform sort_texts.
endcase.

write: / it_doc-ebeln,it_doc-ebelp,'- Purchasing Document History:'.
loop at it_doc.
perform write_type using it_doc-vgabe.
write: it_doc-belnr,
it_doc-buzei,
it_doc-budat.
endloop.
endform.
*-----------------------------------------------------------------------
form sort_texts.
loop at it_txt.
it_type-vgabe = it_txt-domvalue_l.
it_type-text = it_txt-ddtext.
append it_type.
clear it_type.
endloop.
sort it_type.
endform.
*-----------------------------------------------------------------------
form write_type using value(p_vgabe) like ekbe-vgabe.
data w_txt(30) type c.
read table it_type with key vgabe = p_vgabe binary search.
case sy-subrc.
when 0. w_txt = it_type-text.
when others. w_txt = '?'.
endcase.
write / w_txt intensified off.
endform.
*-----------------------------------------------------------------------

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9437124/viewspace-980343/,如需转载,请注明出处,否则将追究法律责任。

下一篇: 真实条件句
请登录后发表评论 登录
全部评论

注册时间:2010-07-22

  • 博文量
    268
  • 访问量
    1413921