JSON报文展示

DATA: LV_CONVERT TYPE STRING,
LO_JSON_SER TYPE REF TO CL_TREX_JSON_SERIALIZER,
LV_ERR_TEXT TYPE STRING.
DATA: LV_JSON TYPE STRING.

* 将JSON转换为HTML
CALL TRANSFORMATION SJSON2HTML SOURCE XML LV_JSON
RESULT XML DATA(LV_HTML).
CATCH CX_XSLT_RUNTIME_ERROR INTO DATA(LO_ERR).
LV_ERR_TEXT = LO_ERR->GET_TEXT( ).
WRITE: LV_ERR_TEXT.
RETURN.
ENDTRY.

* 显示HTML
LV_CONVERT = CL_ABAP_CODEPAGE=>CONVERT_FROM( LV_HTML ).
CL_ABAP_BROWSER=>SHOW_HTML( HTML_STRING = LV_CONVERT ).

posted @   ll的个人笔记  阅读(13)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示