使用ABAP建立QR Code(二維碼)
In the previous blog we discuss how to generate QRCode to enable it be scanned via mobile phone.
In that solution, the QRCode is generated and stored in a PDF file via ABAP webdynpro framework, we only provide the form template. In fact it is quite easy to adapt the solution to generate the PDF by ourselves, so that the QRCode could be used more flexibly in many other scenario for example as an attachment of email.
Note: it is still necessary to create a form interface and form template as described in the blog.
The report source code is below:
PARAMETERS: content TYPE string.DATA:
ls_outputparams TYPE sfpoutputparams,
ls_docparams TYPE sfpdocparams,
ls_pdf_file TYPE fpformoutput,
ls_post TYPE crmd_soc_post,
lv_fm_name TYPE rs38l_fnam.ls_outputparams-noprint = 'X'.ls_outputparams-nopributt = 'X'.ls_outputparams-noarchive = 'X'.ls_outputparams-nodialog = 'X'.ls_outputparams-preview = 'X'.ls_outputparams-getpdf = 'X'.CALL FUNCTION 'FP_JOB_OPEN'
CHANGING
ie_outputparams = ls_outputparams
EXCEPTIONS
cancel = 1
usage_error = 2
system_error = 3
internal_error = 4
OTHERS = 5.CHECK sy-subrc = 0.TRY.
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING
i_name = 'ZPF_QRCODE' " put your own form template name here IMPORTING
e_funcname = lv_fm_name.
CATCH cx_fp_api_repository
cx_fp_api_usage
cx_fp_api_internal.
RETURN.ENDTRY.ls_docparams-langu = 'E'.ls_docparams-country = 'US'.CALL FUNCTION lv_fm_name
EXPORTING
/1bcdwb/docparams = ls_docparams
qrcode_input = content
IMPORTING
/1bcdwb/formoutput = ls_pdf_file
EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3
OTHERS = 4.CHECK sy-subrc = 0.CALL FUNCTION 'FP_JOB_CLOSE'EXCEPTIONS
usage_error = 1
system_error = 2
internal_error = 3OTHERS = 4.
execute the report, the PDF binary is stored in ls_pdf_file-pdf.
It could be scanned by the QRCode scanner installed in my mobile phone:
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2717429/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 使用ABAP程式碼生成二維碼(QR Code)
- QR Code二維碼
- Python 生成條形碼、二維碼 (Code 128、EAN-13、QR code等)Python
- 【轉載】 SAP 列印二維碼 QR Code or 2D Bar Code in SAP
- Amazing QR!一款 Python 二維碼生成器!Python
- 簡單易用的二維碼掃描工具:QR Capture for MacAPTMac
- 小巧實用的二維碼製作生成工具:QR Creator PRO Mac版Mac
- 如何使用ABAP程式碼建立SAP Product CategoryGo
- 使用Visual Studio Code編寫和啟用ABAP程式碼 (上)
- 使用 ABAP 程式碼製作手機能夠掃描的二維碼(QRCode)試讀版
- C++ 使用 new 建立二維陣列C++陣列
- 使用 Python 生成二維碼Python
- 使用ABAP程式碼給SAP CRM Business object建立附件AttachmentObject
- 使用ABAP程式碼建立S/4HANA裡的Sales Order
- 如何使用 Python 生成二維碼?Python
- 使用Java生成具有安全雜湊的QR碼 | Rustam MehmandarovJavaRust
- SAP ABAP關鍵字語法圖和ABAP程式碼自動生成工具Code Composer
- 二維碼管理平臺 生成二維碼
- 二維碼
- Flutter - 生成二維碼與識別二維碼Flutter
- Kotlin建立二維Int陣列Kotlin陣列
- 使用Go語言製作二維碼Go
- react使用qrcode.react生成二維碼React
- 使用Markdown建立PPT的VS Code外掛
- 直播系統搭建,java二維碼 生成二維碼Java
- 二維碼生成
- 二維碼解析
- 聊聊二維碼
- 使用ABAP程式碼返回S/4HANA Material上維護的Attachment明細
- Android 二維碼相關(二)Android
- 微信小程式:小程式碼、小程式二維碼、普通二維碼微信小程式
- How to update BOL entity property value via ABAP code
- 使用python玩轉二維碼!速學速用!⛵Python
- 二維碼知識
- 二維碼生成-PythonPython
- 趣味二維碼生成
- 從普通二維碼到檔案生成二維碼的轉變
- SAP ABAP應用伺服器的HTTP響應狀態碼(Status Code)伺服器HTTP