abap 将xstring转换成PDF展示

收到外围系统的xstring之后,如何在sap中将其打开呢

1.创建一个屏幕

2.绘制一个customer control

3.创建流逻辑

4.流逻辑如下:

DATA: go_html_container TYPE REF TO cl_gui_custom_container,
go_html_control   TYPE REF TO cl_gui_html_viewer,
lv_url           TYPE char255,
lt_data          TYPE STANDARD TABLE OF x255.

MODULE status_0100 OUTPUT.

  IF go_html_container IS INITIAL .
    CREATE OBJECT go_html_container
      EXPORTING
        container_name = 'PDF'.

    CREATE OBJECT go_html_control
      EXPORTING
        parent = go_html_container.

    CALL METHOD go_html_control->load_data
      EXPORTING
        type                   = 'application'
        subtype                = 'pdf'
      IMPORTING
        assigned_url           = lv_url
      CHANGING
        data_table             = lt_data
      EXCEPTIONS
        dp_invalid_parameter   = 1
        dp_error_general       = 2
        cntl_error             = 3
        html_syntax_notcorrect = 4
        OTHERS                 = 5.

    CALL METHOD go_html_control->show_url
      EXPORTING
        url                    = lv_url
        in_place               = 'X'
      EXCEPTIONS
        cntl_error             = 1
        cnht_error_not_allowed = 2
        cnht_error_parameter   = 3
        dp_error_general       = 4
        OTHERS                 = 5.
  ENDIF.

ENDMODULE.

MODULE user_command_0100 INPUT.
  CALL METHOD go_html_control->free
    EXCEPTIONS
      cntl_error        = 1
      cntl_system_error = 2
      OTHERS            = 3.
  LEAVE TO SCREEN 0. "因为我有两个屏幕,所以我要返回上一个,若只有一个,可以注释这句
ENDMODULE.
相关推荐
SAPABAP东芝1 天前
【SAP-ABAP】MIRO--界面增强增加数据导出导入按钮
sap·abap·fico
cyqweqe1231 天前
SAP采购发票税额总额非自动计算。TAX不写行号
abap
乐乐82344 天前
ABAP:SET CURSOR FIELD设置鼠标焦点
abap
冰魄禾11 天前
SAP ABAP开发学习——BAPI
运维·开发语言·笔记·运维开发·sap·abap
Lisson 321 天前
The ABAP program lines are wider than the internal table.
abap
1314lay_10073 个月前
FUNCTION_ALV 下拉框的实现
abap
Fireworks_me3 个月前
SAP 有趣的‘bug‘ 选择屏幕输入框没了
abap
李安迪是大神3 个月前
上传PDF、DOC文件到SAP HCM系统中案例
pdf·word·sap·abap·sap erp
荀彧原名苟或3 个月前
SAP MIGO屏幕增强的具体实施步骤介绍(SE19:MB_MIGO_BADI) <转载>
java·数据库·缓存·sap·abap
LilySesy3 个月前
ABAP小白开发操作手册+(九)ABAP调用http
开发语言·网络·网络协议·http·sap·abap