在ABAP Webdynpro里显示PDF的一种办法

简介: 在ABAP Webdynpro里显示PDF的一种办法

There is a good blog about how to get PDF preview in CRM web client UI. However several development are invovled in that solution. You have to implement your own ICF node to make PDF displayed in UI, and you have to generate the binary code of PDF by yourself.


There is just another approach to achieve the same result but with much less coding by leveraging the standard control “Adobe Interactive form” in ABAP webdynpro. In this way no ICF node implementation, no manual PDF binary code generation, just a few model task.


(1) Create an form interface in tcode SFP.

image.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.pngimage.png

method WDDOINIT .

 data(lo_node) = wd_context->get_child_node( 'ZPF_EXAMPLE' ).

 DATA: lv_name type string,

       lv_score type int4.

 lv_name = cl_wd_runtime_services=>get_url_parameter( name = 'NAME' ).

 lv_score = cl_wd_runtime_services=>get_url_parameter( name = 'SCORE' ).

 lo_node->set_attribute( name = 'NAME' value = lv_name ).

 lo_node->set_attribute( name = 'SCORE' value = lv_score ).

endmethod.

image.png

DATA: lr_popup    TYPE REF TO if_bsp_wd_popup,

       lr_cn       TYPE REF TO cl_bsp_wd_context_node,

       lr_obj      TYPE REF TO if_bol_bo_property_access,

       lt_parameters TYPE tihttpnvp,

       ls_params   TYPE crmt_gsurlpopup_params.

 data(lo_data) = me->typed_context->data->collection_wrapper->get_current( ).

 DATA(ls_line) = VALUE ihttpnvp( name = 'NAME' value = lo_data->get_property_as_string( 'NAME' ) ).

 APPEND ls_line TO lt_parameters.

 ls_line = VALUE ihttpnvp( name = 'SCORE' value = lo_data->get_property_as_string( 'VALUE' ) ).

 APPEND ls_line TO lt_parameters.

 cl_wd_utilities=>construct_wd_url(

     EXPORTING

       application_name = 'ZADOBEFORM'

       in_parameters    = lt_parameters

     IMPORTING

       out_absolute_url = mv_url ).

 lr_popup =  me->comp_controller->window_manager->create_popup(  iv_interface_view_name = 'GSURLPOPUP/MainWindow'

                                                                 iv_usage_name          = 'GSURLPOPUP'

                                                                 iv_title               = 'Adobe Interactive Form Control' ).

 lr_cn = lr_popup->get_context_node( 'PARAMS' ).           "#EC NOTEXT

 lr_obj = lr_cn->collection_wrapper->get_current( ).

 ls_params-url = mv_url.

 ls_params-height = '700'.                                 "#EC NOTEXT

 lr_obj->set_properties( ls_params ).

 lr_popup->set_display_mode( if_bsp_wd_popup=>c_display_mode_plain ).

 lr_popup->set_window_width( 700 ).

 lr_popup->set_window_height( 700 ).

 lr_popup->open( ).

Of course you need to add component GSURLPOPUP via component usage.

In the runtime after name and score fields are maintained in CRM UI and hyperlink is clicked, the corresponding PDF will be generated and displayed by ABAP Webdynpro framework.

image.png

目录
相关文章
|
2月前
|
UED
在 ABAP Webdynpro 的 FPM 中控制单独的 UIBB 可编辑性
在 ABAP Webdynpro 的 FPM 中控制单独的 UIBB 可编辑性
34 0
|
3月前
|
JavaScript 前端开发 数据库
如何在 SAP CRM 里通过 navigation framework 跳转到 ABAP Webdynpro 页面
如何在 SAP CRM 里通过 navigation framework 跳转到 ABAP Webdynpro 页面
21 0
|
7月前
|
BI 数据库
SAP ABAP 释放 TR 遇到错误消息 ended with return code 8 的含义和处理办法
SAP ABAP 释放 TR 遇到错误消息 ended with return code 8 的含义和处理办法
82 0
|
7月前
|
BI 数据安全/隐私保护
SAP ABAP 生成 PDF 的几种技术综述
SAP ABAP 生成 PDF 的几种技术综述
105 0
|
7月前
使用 ABAP 代码给 PDF 文件分配 usage right(未经笔者验证)
使用 ABAP 代码给 PDF 文件分配 usage right(未经笔者验证)
46 0
|
3月前
|
XML 持续交付 开发工具
SAPGUI 里 ABAP 代码导出成 PDF 格式的隐藏小技巧
SAPGUI 里 ABAP 代码导出成 PDF 格式的隐藏小技巧
30 0
|
6月前
|
数据库
小技巧分享 - 找出 SAP ABAP SPRO 配置项后台对应配置表的两种办法试读版
小技巧分享 - 找出 SAP ABAP SPRO 配置项后台对应配置表的两种办法试读版
50 0
|
7月前
|
XML 存储 Java
使用 ABAP 调用 Adobe Document Service 生成 PDF 文档
使用 ABAP 调用 Adobe Document Service 生成 PDF 文档
62 0
|
7月前
|
BI 数据库 数据安全/隐私保护
如何用 ABAP 生成带有水印(Watermark)的 PDF 文件试读版
如何用 ABAP 生成带有水印(Watermark)的 PDF 文件试读版
58 0
|
7月前
|
存储 XML BI
如何使用 ABAP 代码发送带有 PDF 附件的电子邮件试读版
如何使用 ABAP 代码发送带有 PDF 附件的电子邮件试读版
88 0
如何使用 ABAP 代码发送带有 PDF 附件的电子邮件试读版

热门文章

最新文章