*&---------------------------------------------------------------------*
*& Report ZMMF_09_PRINT
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ZMMF_09_PRINT.
"先自定义结构,ZMM_S_09
DATA: GW_ITAB TYPE ZMM_S_09. "WORK AREA
DATA: GT_ITAB LIKE TABLE OF GW_ITAB. "取出数据放到此内表,然后再调用SMARTFORM传入
DATA FM_NAME TYPE RS38L_FNAM. "FIXED TYPE,装SMARTFORM 返回出来的 FUNCTION MODULE
INITIALIZATION.
PERFORM GET_DATA. "GET DATA
PERFORM SF_TO_FM. " SMARTFORM TO FUNCTION MODULE
START-OF-SELECTION.
PERFORM SHOW_SMARTFORM. "SHOW SMARTFORM
END-OF-SELECTION.
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM GET_DATA .
SELECT
*
FROM ( ( EKPO AS A
INNER JOIN EKKO AS B ON A~EBELN = B~EBELN )
INNER JOIN MAKT AS C ON A~MATNR = C~MATNR )
INTO CORRESPONDING FIELDS OF TABLE GT_ITAB
WHERE A~EBELN = '4500000318'.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form SF_TO_FM
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM SF_TO_FM .
"该FUNCTION 是把SMARTFORM变成一个FUNCTION MODULE
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
FORMNAME = 'ZMM_FORM_PRINT_09' "THIS IS SMARTFORM'S NAME
IMPORTING
FM_NAME = FM_NAME "获取到返回出来的FUNCTION MODULE
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form SHOW_SMARTFORM
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM SHOW_SMARTFORM .
"调用获取到的FUNCTION MODULE
CALL FUNCTION FM_NAME
EXPORTING
* OUTPUT_OPTIONS = ssfcomp
* control_parameters = control_parameters
** MAIL_APPL_OBJ = nast-objtype
* MAIL_RECIPIENT = LVS_RECIPIENT
* MAIL_SENDER = LVS_SENDER
USER_SETTINGS = SPACE
TABLES
* S_HEAD = I_HEAD "传入的内表
GT_ITAB = GT_ITAB
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 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.
ENDFORM.
相关文章
- 01-29实现一个最简单的VIM文本编辑器(可能有bug,随便写了一个)
- 01-29最简单的移动端适配方案(rem+vw)--没有之一
- 01-29最简单的MyEclipse配置Hibernate框架
- 01-29Android Studio实现最简单走马灯
- 01-29tensorflow rnn 最简单实现代码
- 01-29基于python的机器学习开发环境安装(最简单的初步开发环境)
- 01-29freemarker最简单的测试小demo
- 01-29【转】WPF获取外部EXE图标最简单的方法
- 01-29FastReport.net 使用 WebForm 实现打印 最简单版
- 01-29全网最简单的Flutter Navigator2.0路由指南