首页 > 应用开发 > IT综合 > SmartForms总结(转)
SmartForms总结
步骤一:Create Form
1Tcode: smartforms;
2在Form后面输入名称,然后单击“创建”;
3输入描述;
4设计界面;
5保存并激活;
6执行,可以自到系统会自动产生一个Function module,如:/1BCDWB/SF00000016;
7执行,输入必要的参数;
8执行,输入OutputDevice;
9打印预览,可以看到设计的界面。
步骤二:建立程序
代码如下:
DATA W_SFLIGHT like sflight occurs 0 with header line.
*Name of Function Module
DATA: fm_name TYPE rs38l_fnam.
select * from sflight into table w_sflight.
*取SmartForms生成的功能模块名称*
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZTESTSMART_AJAX2' "Smartforms name
* VARIANT = ' '
* DIRECT_CALL = ' '
IMPORTING
FM_NAME = fm_name
* 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.
*调用SmartForms生成的功能模块,将触发打印功能*
CALL FUNCTION fm_name
EXPORTING
* ARCHIVE_INDEX =
* ARCHIVE_INDEX_TAB =
* ARCHIVE_PARAMETERS =
* CONTROL_PARAMETERS =
* MAIL_APPL_OBJ =
* MAIL_RECIPIENT =
* MAIL_SENDER =
* OUTPUT_OPTIONS =
* USER_SETTINGS = 'X'
zcompany = '某某公司' “自定义的接口
* IMPORTING
* DOCUMENT_OUTPUT_INFO =
* JOB_OUTPUT_INFO =
* JOB_OUTPUT_OPTIONS =
tables
i_sflight = W_SFLIGHT “自定义的接口(内表)
* 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.
说明:
<!--[if !supportLists]-->1)<!--[endif]-->屏幕左测显示所有对象,双击它可以显示属性;
<!--[if !supportLists]-->2)<!--[endif]-->只有主窗体中数据才能在多个页面中连续输出;
<!--[if !supportLists]-->3)<!--[endif]-->表格:
静态表格: 用Template节点
动态表格: 用Table、Loop、Complex section节点,最好要放在主窗口中,可以输出多页。
<!--[if !supportLists]-->4)<!--[endif]-->节点处理流程:从顶端到底端
come from:http://blog.csdn.net/ft1612796/archive/2007/06/15/1653746.aspx
more Smart Form templates available from SAP SAP Labs also has some more Smart Form templates for around 20 forms. They're preconfigured & have versions or translations in a few languages besides English. MOstly they cover SD and MM modules.
You have to have access to the Service Marketplace though.
SAP SmartForms lib:
http://help.sap.com/saphelp_46c/helpdata/en/a9/de6838abce021ae10000009b38f842/frameset.htm
Alternatively, go to help.sap.com, go to Basis components, then go to Basis Services/Communications Interface.
This has loads of information on SMARTFORMS
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/132884/viewspace-1004183/,如需转载,请注明出处,否则将追究法律责任。