SAPSMARTFORMS凭证连续打印设置操作之三Word文件下载.docx
《SAPSMARTFORMS凭证连续打印设置操作之三Word文件下载.docx》由会员分享,可在线阅读,更多相关《SAPSMARTFORMS凭证连续打印设置操作之三Word文件下载.docx(17页珍藏版)》请在冰豆网上搜索。
![SAPSMARTFORMS凭证连续打印设置操作之三Word文件下载.docx](https://file1.bdocx.com/fileroot1/2022-11/27/8408bf8c-5b99-4f3f-b0c8-699240a89b20/8408bf8c-5b99-4f3f-b0c8-699240a89b201.gif)
Report
ZP_SD_006
REPORT
zp_sd_007.
INCLUDE
zp_sd_007_varl.
zp_sd_007_form.
zp_sd_007_alv.
START-OF-SELECTION.
PERFORM
get_data_alv.
show_alv
TABLES
gt_vbak_alv.
包含
ZP_SD_007_VARL
TABLES:
vbak.
DATA:
formname
TYPE
tdsfname,
fm_name
rs38l_fnam,
control
ssfctrlop,
errtab
tsferror.
BEGIN
OF
gt_vbak
OCCURS
0.
"
定义内表
zwyvbap.
END
gt_vbak.
gt_vbap
0,
vbeln
LIKE
vbak-vbeln.
gt_vbap.
p_vbeln
*
定义传递到FORM中的页头数据
vkorg
vbak-vkorg,
销售组织
vtweg
vbak-vtweg,
分销渠道
vkbur
vbak-vkbur,
销售办事处
vkgrp
vbak-vkgrp,
销售组
kunnr
vbak-kunnr,
供应商代码
name1
kna1-name1,
供应商名称
vbak-vbeln,
订单号码
audat
vbak-audat.
过账日期
定义显示在ALV界面上的内表
gt_vbak_alv
0,
vbak-audat,
sele
char1.
定义选中栏,边上的
SELECTION-SCREEN
BLOCK
100
WITH
FRAME
TITLE
text-001.
*PARAMETERS
s_vbeln
vbak-vbeln
OBLIGATORY.
SELECT-OPTIONS:
FOR
DEFAULT
'
4970'
TO
4990'
.
定义需要打印的凭证号码
100.
ZP_SD_007_FORM
*$
显示在界面上的数据
FORM
SELECT
vkorg
vtweg
vkbur
vkgrp
kunnr
vbeln
audat
INTO
CORRESPONDING
FIELDS
TABLE
gt_vbak_alv
FROM
vbak
WHERE
IN
s_vbeln.
ENDFORM.
get_data_alv
Form
print_so
text
设置打印的程序
*----------------------------------------------------------------------*
print_so.
CLEAR
gt_vbap[].
SELECT
vbak
获取选中的数据,并把选中的数据传递至
内表中。
LOOP
AT
=
X'
.
gt_vbap-vbeln
gt_vbak_alv-vbeln.
APPEND
ENDLOOP.
ZSD_PRINT_001'
CALL
FUNCTION
SSF_FUNCTION_MODULE_NAME'
EXPORTING
#########Form##
importing
IMPORTING
fm_name
EXCEPTIONS
no_form
1
no_founction_module
2
OTHERS
3.
IF
sy-subrc
<
>
0.
MESSAGE
ID
sy-msgid
sy-msgty
NUMBER
sy-msgno
sy-msgv1
sy-msgv2
sy-msgv3
sy-msgv4.
ENDIF.
control-no_dialog
control-preview
control-no_open
control-no_close
SSF_OPEN'
ARCHIVE_PARAMETERS
=
USER_SETTINGS
MAIL_SENDER
MAIL_RECIPIENT
MAIL_APPL_OBJ
OUTPUT_OPTIONS
control_parameters
control
JOB_OUTPUT_OPTIONS
formatting_error
internal_error
send_error
3
user_canceled
4
5.
error
handling
EXIT.
gt_vbap.
对凭证号进行循环处理,即在程序中进行分页的设置
gt_vbap-vbeln.
获取打印的表头数据
SINGLE
(vkorg,vtweg,vkbur,vkgrp,kunnr,vbeln,audat)
p_vbeln.
获取打印的表体数据
gt_vbak[].
清空内表
posnr
matnr
arktx
kwmeng
netwr
netpr
meins
gt_vbak
vbap
销售订单
客户
日期
name1
TABLES
传递内表数据到SMARTFORMS中
SSF_CLOSE'
JOB_OUTPUT_INFO
4.
analyse
internal
table
of
Smart
Forms
SSF_READ_ERRORS'
errortab
errtab.
NOT
IS
INITIAL.
add
your
ZP_SD_007_ALV
TYPE-POOLS:
slis.
*-----------------------------------------------------------*
*ALV相关内表和结构
*
it_fieldcat
slis_t_fieldcat_alv,
wa_layout
slis_layout_alv,
wa_status
slis_formname
VALUE
SUB_SET_PF_STATUS'
wa_comand
USER_COMMAND'
it_events
slis_t_event.
g_layout
lvc_s_layo,
fieldcat
LINE
lvc_t_fcat,
gt_fieldcat
lvc_t_fcat.
显示ALV
text
-->
P_LT_TAB
table.
*ALV表格显示样式
alv_list_layout.
*ALV报表的字段设置
pf_alv_list_fcat
USING
it_fieldcat.
*ALV报表显示
pf_alv_list_disply
SHOW_ALV
ALV_LIST_LAYOUT
p1
--
p2
wa_layout-colwidth_optimize
wa_layout-detail_initial_lines
wa_layout-box_fieldname
SELE'
定义边框选中栏
PF_ALV_LIST_FCAT
P_IT_FIELDCAT
p_it_fieldcat.
lw_afieldcat
slis_fieldcat_alv,
lw_pos
i.
DEFINE
d_field.
clear
lw_afieldcat.
+
1.
lw_afieldcat-col_pos
lw_pos.
lw_afieldcat-fieldname
&
LW_AFIELDCAT-fix_column
lw_afieldcat-seltext_l
2.
lw_afieldcat-ref_fieldname
lw_afieldcat-ref_tabname
lw_afieldcat-no_zero
lw_afieldcat-hotspot
6.
lw_afieldcat-outputlen
7.
lw_afieldcat-edit
8.
lw_afieldcat-key
9.
append
lw_afieldc