report zform1 .
data: p_address(30) type c,
p_date type dats.
data: result like itcpp,
rdi_result like rdiresult.
move '中国上海' to p_address.
move sy-datum to p_date.
types: begin of st,
col1 type i,
col2 type i,
end of st.
data: it_tab type table of st with header line,
st_tab type st.
do 5 times.
st_tab-col1 = sy-index.
st_tab-col2 = sy-index ** 2.
append st_tab to it_tab.
enddo.
call function 'OPEN_FORM'
exporting
form = 'ZFORM1'
language = sy-langu
exceptions
canceled = 1
device = 2
form = 3
options = 4
unclosed = 5
mail_options = 6
archive_error = 7
invalid_fax_number = 8
more_params_needed_in_batch = 9
spool_error = 10
others = 11.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function 'WRITE_FORM'
exporting
element = 'HEADER'
type = 'BODY'
window = 'HEADER'
exceptions
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
spool_error = 8
others = 9.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
loop at it_tab.
call function 'WRITE_FORM'
exporting
element = 'DEC'
type = 'BODY'
window = 'MAIN'
exceptions
element = 1
function = 2
type = 3
unopened = 4
unstarted = 5
window = 6
bad_pageformat_for_print = 7
spool_error = 8
others = 9.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endloop.
call function 'CLOSE_FORM'
importing
result = result
rdi_result = rdi_result
* TABLES
* OTFDATA =
exceptions
unopened = 1
bad_pageformat_for_print = 2
send_error = 3
spool_error = 4
others = 5
.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
==========================================================
SE71 中的代码:
第一个write form 调用的
*** header
/E HEADER
F1 交货地址: &P_ADDRESS& &AAA& 交货日期: &P_DATE&
----------------------------------------------------------
第二个write form 调用的
*** dec
/E DEC
/: SET TIME MASK = 'HH:MM'
/ &IT_TAB-COL1&,,&IT_TAB-COL2&
**-----------------------------------------------------------------------
补充:
**-----------------------------------------------------------------------
/: BOX WIDTH 15 CM HEIGHT 1 CM FRAME 10 TW INTENSITY
F2 ID,,,,,,NAME,,,,DATA
/: BOX WIDTH 15 CM HEIGHT 2 CM FRAME 10 TW
/: BOX WIDTH 15 CM HEIGHT 3 CM FRAME 10 TW
/: BOX WIDTH 15 CM HEIGHT 4 CM FRAME 10 TW
/: BOX XPOS 3 CM WIDTH 0 TW HEIGHT 4 CM FRAME 10 TW
/: BOX XPOS 6 CM WIDTH 0 TW HEIGHT 4 CM FRAME 10 TW
/: BOX XPOS 9 CM WIDTH 0 TW HEIGHT 4 CM FRAME 10 TW
/: BOX XPOS 9 CM WIDTH 0 TW HEIGHT 4 CM FRAME 10 TW
/: BOX XPOS 9 CM WIDTH 0 TW HEIGHT 4 CM FRAME 10 TW
这个可以画出一个表格出来
*