使用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)
- 用ABAP 生成二維碼 QR Code
- QR Code二維碼
- 使用 Python 生成二維條形碼 QR CodesPython
- 【轉載】 SAP 列印二維碼 QR Code or 2D Bar Code in SAP
- Python 生成條形碼、二維碼 (Code 128、EAN-13、QR code等)Python
- 如何使用Java、Servlet建立二維碼JavaServlet
- 簡單易用的二維碼掃描工具:QR Capture for MacAPTMac
- 使用 ABAP 程式碼製作手機能夠掃描的二維碼(QRCode)試讀版
- react使用qrcode.react生成二維碼React
- iOSQRCode(二維碼)iOS
- 小巧實用的二維碼製作生成工具:QR Creator PRO Mac版Mac
- 如何使用ABAP程式碼建立SAP Product CategoryGo
- 使用 Swift 建立簡單的二維碼掃描應用Swift
- 二維碼生成工具 Simple QrCode
- qrcodejs js生成二維碼JS
- phpqrcode不能輸出二維碼PHP
- C++ 使用 new 建立二維陣列C++陣列
- 使用ABAP程式碼給SAP CRM Business object建立附件AttachmentObject
- QRCode-二維碼識別與生成
- Pyhton列印barcode及二維碼標籤
- 使用 Python 生成二維碼Python
- 使用ABAP程式碼建立S/4HANA裡的Sales Order
- 使用 jquery.qrcode.js 生成網站地址url二維碼圖片jQueryJS網站
- PHP Qrcode 二維碼介面 可傳引數PHP
- 如何使用 Python 生成二維碼?Python
- IOS 使用 ZbarSDK 二維碼掃描iOS
- 二維碼管理平臺 生成二維碼
- Flutter - 生成二維碼與識別二維碼Flutter
- phpqrcode生成動態二維碼簡單例項PHP單例
- Qt-qrencode開發-生成、顯示二維碼📀QT
- ABAP Tcode t-code 程式碼中英文描述
- 快速建立空二維陣列陣列
- 使用Go語言製作二維碼Go
- Java使用QRGen類庫生成二維碼Java
- 使用Java生成具有安全雜湊的QR碼 | Rustam MehmandarovJavaRust
- 直播系統搭建,java二維碼 生成二維碼Java
- iOS 花式二維碼生成和二維碼識別iOS