在做smartforms打印过程中遇到个问题,在当前页面打印高度不够时分页时导致一行错页问题
我打印的表单(table)中有二维码,导致高度不够时,第一页最后一行只有二维码,第二页第一行只有文字
两种方式:
一、在程序里循环控制,到一定行数强制分页
"打开打印设置
CALL FUNCTION 'SSF_OPEN'
EXPORTING
* ARCHIVE_PARAMETERS =
* USER_SETTINGS = 'X'
* MAIL_SENDER =
* MAIL_RECIPIENT =
* MAIL_APPL_OBJ =
output_options = ls_options
control_parameters = ls_control
* IMPORTING
* JOB_OUTPUT_OPTIONS =
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc NE 0.
* Implement suitable error handling here
ENDIF.
CHECK sy-subrc EQ 0 .
循环多次调用打印池
* loop at gt_alv-item into data(ls_gt_alv).
* append ls_gt_alv to gt_alv1-item.
* lv_index += 1.
* if lv_index = 1.
* lv_index = 0.
* page_index += 1.
* gt_alv1-page_nu = page_index.
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZEWM_RPT_020_F01_FORM'
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
fm_name = lv_form_name.
CALL FUNCTION lv_form_name
EXPORTING
control_parameters = ls_control
output_options = ls_options
it_pkhd = gt_alv
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
*
* CLEAR: gt_alv1-item.
* endif.
* ENDLOOP.
关闭打印
"""""""""""""""""""""""""""关闭打印
CALL FUNCTION 'SSF_CLOSE'
* IMPORTING
* JOB_OUTPUT_INFO =
* EXCEPTIONS
* FORMATTING_ERROR = 1
* INTERNAL_ERROR = 2
* SEND_ERROR = 3
* OTHERS = 4
.
二、在smartforms中不使用table ,增加循环,命令行和程序行,调整到新页