SAP 实例 1 Images in HTML
REPORT zharpo_010 NO STANDARD PAGE HEADING. TABLES : t001.
TYPE-POOLS: slis.
DATA : w_repid LIKE sy-repid.
TYPES : BEGIN OF ty_comp.
INCLUDE STRUCTURE t001.
TYPES : END OF ty_comp.
DATA: wa_layout TYPE slis_layout_alv.
DATA: it_fieldcat TYPE slis_t_fieldcat_alv,
wa_fieldcat TYPE slis_fieldcat_alv.
DATA : it_comp TYPE TABLE OF ty_comp. INITIALIZATION.
w_repid = sy-repid. START-OF-SELECTION.
SELECT * FROM t001 INTO TABLE it_comp. END-OF-SELECTION.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = w_repid
i_internal_tabname = 'IT_COMP'
i_structure_name = 'T001'
i_inclname = w_repid
CHANGING
ct_fieldcat = it_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = w_repid
i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
i_html_height_top = 50 "控制表头栏目的初始高度
is_layout = wa_layout
it_fieldcat = it_fieldcat
TABLES
t_outtab = it_comp
EXCEPTIONS
program_error = 1
OTHERS = 2. *&---------------------------------------------------------------------*
*& Form html_top_of_page
*&---------------------------------------------------------------------*
FORM html_top_of_page USING document TYPE REF TO cl_dd_document.
DATA: text TYPE sdydo_text_element.
text = 'Company Code Data'.
CALL METHOD document->add_text
EXPORTING
text = text
sap_style = 'HEADING'.
CALL METHOD document->new_line.
CALL METHOD document->new_line.
text = 'User Name : '.
CALL METHOD document->add_text
EXPORTING
text = text
sap_emphasis = 'Strong'.
CALL METHOD document->add_gap
EXPORTING
width = 2.
text = sy-uname.
* CALL METHOD document->add_text
* EXPORTING
* text = text
* sap_style = cl_dd_document=>SMALL.
** sap_emphasis = cl_dd_document=>EMPHASIS.
CALL METHOD document->add_text
EXPORTING
text = text
* TEXT_TABLE =
* FIX_LINES =
* SAP_STYLE = cl_dd_document=>WARNING
sap_color = cl_dd_document=>list_total_int
sap_fontsize = cl_dd_document=>large
sap_fontstyle = cl_dd_document=>serif
sap_emphasis = cl_dd_document=>emphasis "加粗还是斜体 STRONG是加粗
* STYLE_CLASS =
* CHANGING
* DOCUMENT =
. CALL METHOD document->add_gap
EXPORTING
width = 10.
CALL METHOD document->add_icon
EXPORTING
sap_icon = 'ICON_DATE'.
text = 'Date : '.
CALL METHOD document->add_text
EXPORTING
text = text
sap_emphasis = 'Strong'.
CALL METHOD document->add_gap
EXPORTING
width = 2.
text = sy-datum.
CALL METHOD document->add_text
EXPORTING
text = text
sap_style = 'Key'.
CALL METHOD document->add_gap
EXPORTING
width = 10.
text = 'Time : '.
CALL METHOD document->add_text
EXPORTING
text = text
sap_emphasis = 'Strong'.
CALL METHOD document->add_gap
EXPORTING
width = 2.
text = sy-uzeit.
CALL METHOD document->add_text
EXPORTING
text = text
sap_style = 'Key'.
CALL METHOD document->new_line.
CALL METHOD document->underline. "Draw an underLine
CALL METHOD document->add_link
EXPORTING
* NAME =
url = 'http://www.87cool.com'
tooltip = '水寒冰居'
text = '87Cool'
* DESTINATION_IN_DOC_SET =
* DESTINATION_IN_DOC_POS =
* TABINDEX =
* HOTKEY =
* IMPORTING
* LINK =
.
ENDFORM. "HTML_TOP_OF_PAGE
Description
Images loaded here from the MIME repository using an API are displayed in two browser controls.
- The method main1 uses the class CL_GUI_HTML_VIEWER directly. Its method LOAD_DATA is used to provide a URL for the image in the internal table, which is then used on the HTML page.
- The method main2 uses the class CL_ABAP_BROWSER as a wrapper for the direct use of CL_GUI_HTML_VIEWER and calls of the method LOAD_DATA. A reference, associated with the name used in the HTML page, is passed to the internal table.
See also the example for direct access to objects from the MIME repository using ICF.
SAP 实例 1 Images in HTML的更多相关文章
- SAP 实例 8 HTML from the MIME Repository
REPORT demo_html_from_mime. CLASS mime_demo DEFINITION. PUBLIC SECTION. CLASS-METHODS main. PRIVATE ...
- SAP 实例 4 CFW
*&---------------------------------------------------------------------* *& Report demo_cfw ...
- SAP 实例- 下拉框
效果图 源代码 REPORT rsdemo_dropdown_listbox . DATA init. TABLES scarr. TABLES spfli. TABLES sflight. TABL ...
- SAP 实例- 页签tabsrip
屏幕页签:项目上有一需求,对标准TCODE 一个屏幕增加一个页签.于是做了个例子. 下面屏幕有两个页签. 我们来看一下屏幕结构.100屏幕是主屏幕,101,102是子屏幕,对应页签test1,test ...
- SAP 实例 13 Random Grouping with LOOP
REPORT demo_loop_group_by_random. CLASS demo DEFINITION. PUBLIC SECTION. CLASS-METHODS: main, class_ ...
- SAP 实例 12 List Box with Value List from PBO Module
REPORT demo_dynpro_dropdown_listbox. DATA: name TYPE vrm_id, list TYPE vrm_values, value LIKE LINE O ...
- SAP 实例 10 List Box with value list from input help
*&---------------------------------------------------------------------* *& Report DEMO_DROP ...
- SAP 实例 9 Text output
REPORT demo_show_text. CLASS demo DEFINITION. PUBLIC SECTION. CLASS-METHODS main. ENDCLASS. CLASS de ...
- SAP 实例 6 HTML input
REPORT demo_html_input. CLASS demo DEFINITION. PUBLIC SECTION. CLASS-METHODS main. PRIVATE SECTION. ...
- SAP 实例 5 CFW Events
REPORT demo_custom_control . * Declarations ***************************************************** CL ...
随机推荐
- 线程的概念及Thread模块的使用
线程 一.什么是线程? 我们可以把进程理解成一个资源空间,真正被CPU执行的就是进程里的线程. 一个进程中最少会有一条线程,同一进程下的每个线程之间资源是共享的. 二.开设线程的两种方式 开设进程需要 ...
- 六、IDEA安装
一.IDEA下载与安装 1.1.下载IDEA安装包 博主在这里给大家准备了一个64位操作系统的IDEA以便大家下载(使用的是迅雷) 点击此处下载 提取码:dgiy 如果其他小伙伴的电脑版本不一样,博主 ...
- 实现深拷贝还在用JSON.parse(JSON.stringify(obj))?带你用JS实现一个完整版深拷贝函数
使用JavaScript实现深拷贝 1.JSON序列化实现深拷贝 在JS中,想要对某一个对象(引用类型)进行一次简单的深拷贝,可以使用JSON提供给我们的两个方法. JSON.stringfy():可 ...
- 2021.08.30 前缀函数和KMP
2021.08.30 前缀函数和KMP KMP算法详解-彻底清楚了(转载+部分原创) - sofu6 - 博客园 (cnblogs.com) KMP算法next数组的一种理解思路 - 挠到头秃 - 博 ...
- go 中 select 源码阅读
深入了解下 go 中的 select 前言 1.栗子一 2.栗子二 3.栗子三 看下源码实现 1.不存在 case 2.select 中仅存在一个 case 3.select 中存在两个 case,其 ...
- 【第五课】VIM编辑器(学习笔记)
4月10日学习笔记打卡
- python学习-Day17
目录 今日内容详细 生成器对象(自定义迭代器) 小总结 自定义range方法 通过生成器模拟range方法 先以两个参数的range方法为例 针对一个参数情况 针对三个参数情况 自定义的range方法 ...
- 自己的~/.vimrc
" 语法高亮syntax on " 搜索高亮set hlsearch " 显示行号set number" let mapleader="," ...
- 【HashMap】浅析HashMap的构造方法及put方法(JDK1.7)
目录 引言 代码讲解 属性 HashMap的空参构造方法 HashMap的put方法 put inflateTable initHashSeedAsNeeded putForNullKey hash ...
- spring boot validation
先简单打个草稿 @NotNull 不能为 null @NotEmpty 不能为空(允许空格) ,只能用于字符串 @NotBlank 不能为空(trim()后) 用于验证字符串不为空且不能全为空格,只能 ...