该报表打印销售订单,可以在报表里选中多个销售单打印,对应的smartform实现了分页,自动补充空行及显示当前页和总页数等功能,smartform在资源里可以找到。
*&---------------------------------------------------------------------*
*& Report ZSDR003*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zsdr003 .
TYPE-POOLS :slis .
TABLES :vbak , vbap , lips , makt , likp .
DATA : it_head TYPE TABLE OF zsdr003_head WITH HEADER LINE .
DATA : it_head1 TYPE TABLE OF zsdr003_head WITH HEADER LINE .
DATA : gt_sfhead TYPE TABLE OF zsdr003_head WITH HEADER LINE .
DATA : it_item TYPE TABLE OF zsdr003_item WITH HEADER LINE .
DATA : c_form_name TYPE tdsfname ,
c_form_title TYPE string .
DATA : gv_title TYPE lvc_title .
DATA : gs_layout TYPE slis_layout_alv ,
gt_fields TYPE slis_t_fieldcat_alv ,
gs_fields TYPE LINE OF slis_t_fieldcat_alv .
SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME TITLE text - 001 .
SELECT-OPTIONS : s_vkorg FOR vbak -vkorg . "销售组织
SELECT-OPTIONS : s_vtweg FOR vbak -vtweg . "分销渠道
SELECT-OPTIONS : s_kunnr FOR vbak -kunnr . "客户编号
SELECT-OPTIONS : s_vbeln FOR vbak -vbeln . "销售订单号
SELECTION-SCREEN END OF BLOCK block1 .
START-OF-SELECTION .
PERFORM getdata .
PERFORM alvdata .
*&---------------------------------------------------------------------*
*& Form getdata
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM getdata .
SELECT
vbeln
vkorg
vtweg
sp