您的位置:首页 > 编程语言 > PHP开发

BW DTP过滤器中的程序使用

2013-07-05 16:37 155 查看
BW DTP过滤器中的程序使用

*&---------------------------------------------------------------------*

*& Include RSBC_SEL_ROUTINE_TPL

*&---------------------------------------------------------------------*

program conversion_routine.

* Type pools used by conversion program

type-pools: rsarc, rsarr, rssm.

tables: rssdlrange.

* Global code used by conversion rules

*$*$ begin of global - insert your declaration only below this line *-*

* TABLES: ...

* DATA: ...

*$*$ end of global - insert your declaration only before this line *-*

* -------------------------------------------------------------------

* Fieldname = CALMONTH

* data type = NUMC

* length = 000006

* -------------------------------------------------------------------

form compute_CALMONTH

tables l_t_range structure rssdlrange

using i_r_request type ref to IF_RSBK_REQUEST_ADMINTAB_VIEW

i_fieldnm type RSFIELDNM

changing p_subrc like sy-subrc.

* Insert source code to current selection field

*$*$ begin of routine - insert your code only below this line *-*

*程序开始

-----------------------------------------------------------------------------------------------------------------------

data: l_idx like sy-tabix.

read table l_t_range with key

fieldname = 'CALMONTH'.

l_idx = sy-tabix.

data: lastmonthday type sy-datum.

=====以下两行比较重要,一般测试不起作用就是因为这两行没有添加=========

l_t_range-iobjnm = '0CALMONTH'.

l_t_range-fieldname = 'CALMONTH'.

===============================================================

l_t_range-sign = 'I'.

l_t_range-option = 'BT'.

*取上月日期

CALL FUNCTION 'ZCCM_GO_BACK_MONTHS'

EXPORTING

CURRDATE = sy-datum

BACKMONTHS = '1'

IMPORTING

newdate = lastmonthday.

l_t_range-low = lastmonthday+0(6).

l_t_range-high = sy-datum+0(6).

*....

if l_idx <> 0.

modify l_t_range index l_idx.

else.

append l_t_range.

endif.

p_subrc = 0.

*$*$ end of routine - insert your code only before this line *-*

endform.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: