Skip to Content
Author's profile photo Former Member

How to create a QR code and show it in a Smartform

Before running the code given below what should we do?

1. Create a smartform. Follow the steps given below.

    Capture.PNG

2. Goto Form Interface and add a new variable under the import tab which holds the name
of the qrcode that we are passing from the driver program[W_NAME  type char20]

     Capture1.PNG

3. Create a new graphics and as shown below give the name as &W_NAME&. [Dynamic
variable]

        Capture2.PNG

  4.  Done.

  5. Copy the code below.

  6. Enjoy the emerging technology of qrcode in SAP.

Note : In the program given below I have used a screen 9000. Please do create it before running and also create acustom control in the screen layout and give the name ‘PICTURECONTROL’ to it.

SOURCE CODE

*&———————————————————————*
*& Report  Z03_QRCODE_IMAGE
*&
*&———————————————————————*
*&
*&
*&———————————————————————*

REPORT  z03_qrcode_image.

*types:  ty_boolean(1) type c.
*
*constants:
*  c_true  type ty_boolean value ‘X’,
*  c_false type ty_boolean value space.

DATA : bds_description  like bapisignatprop_value.

* BDS handling
constants:
  c_bds_classname type sbdst_classname value ‘DEVC_STXD_BITMAP’,
  c_bds_classtype type sbdst_classtype value ‘OT’,          ” others
  c_bds_mimetype  type bds_mimetp      value ‘application/octet-stream’,
  c_bds_original  type sbdst_doc_var_tg value ‘OR’.

* Graphic handling
constants:
      c_stdtext  like theadtdobject value ‘TEXT’,
      c_graphics like theadtdobject value ‘GRAPHICS’,
      c_bmon     like theadtdid     value ‘BMON’,
      c_bcol     like theadtdid     value ‘BCOL’.

DATA: gi_filename    type rlgrapfilename,
      gi_name        type stxbitmapstdname,
      gi_object      type stxbitmapstdobject,
      gi_id          type stxbitmapstdid,
      gi_btype       type stxbitmapstdbtype,
      gi_resident    type stxbitmapsresident,
      gi_autoheight  type stxbitmapsautoheight,
      gi_bmcomp      type stxbitmapsbmcomp,
      gi_resolution  type stxbitmapsresolution,

      l_extension type rlgrapfilename,
      l_docid     type stxbitmapsdocid.

“Picture Control
DATA: picture_container TYPE REF TO cl_gui_custom_container,
      picture_control   TYPE REF TO cl_gui_picture.

DATA: l_img_url     TYPE w3url.
DATA :l_img_subtype TYPE w3paramcont_type.
DATA : l_str_length TYPE i.
DATA : url TYPE string.
DATA l_content_length TYPE  i.


DATA mime TYPE  w3mimetabtype.
DATA: blob TYPE w3mimetabtype,
            blob_size TYPE w3paramcont_len,
            blob_type TYPE w3paramcont_type.

DATA : i_igs_image_converter TYPE REF TO cl_igs_image_converter.
DATA: content TYPE xstring.
DATA : http_client TYPE REF TO if_http_client.

TYPES : BEGIN OF ty_binary,
                    binary_field(1000) TYPE c,
               END OF ty_binary.

DATA : hex_tab1 TYPE TABLE OF ty_binary WITH HEADER LINE.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text001.
PARAMETERS : qr_text TYPE char100 OBLIGATORY.
SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text002.
  PARAMETERS : width TYPE int3,
               height TYPE int3.
SELECTION-SCREEN END OF BLOCK b2.

PARAMETERS : p_rad1 RADIOBUTTON GROUP rd1 DEFAULT ‘X’,
             p_rad2 RADIOBUTTON GROUP rd1.

START-OF-SELECTION.

  PERFORM download_qrcode.
  PERFORM convert_image.

*&———————————————————————*
*&      Form  DOWNLOAD_QRCODE
*&———————————————————————*
*       text
*———————————————————————-*
*  –>  p1        text
*  <–  p2        text
*———————————————————————-*

FORM download_qrcode .

  CONCATENATE http://chart.apis.google.com/chart?chs=200×200&cht=qr&chld=|1&chl=qr_text ‘/chart.png’ INTO url.

  CALL METHOD cl_http_client=>create_by_url
    EXPORTING
      url                = url
    IMPORTING
      client             = http_client
    EXCEPTIONS
      argument_not_found = 1
      plugin_not_active  = 2
      internal_error     = 3
      OTHERS             = 4.

  IF sysubrc = 0.

    http_client->send( ).

    http_client->receive( ).

    content = http_client->response->get_data( ).

    http_client->close( ).

    l_str_length = xstrlen( content ).

    CALL FUNCTION ‘RSFO_XSTRING_TO_MIME’
      EXPORTING
        c_xstring = content
        i_length  = l_str_length
      TABLES
        c_t_mime  = mime.

  ENDIF.

ENDFORM.                    ” DOWNLOAD_QRCODE

*&———————————————————————*
*&      Form  CONVERT_IMAGE

*&———————————————————————*
*       text
*———————————————————————-*
*  –>  p1        text
*  <–  p2        text
*———————————————————————-*

FORM convert_image .

  CREATE OBJECT i_igs_image_converter .

  i_igs_image_converter->input = ‘image/png’.
  i_igs_image_converter->output = ‘image/bmp’.
  i_igs_image_converter->width = width.
  i_igs_image_converter->height = height.

  CALL METHOD i_igs_image_converter->set_image
    EXPORTING
      blob      = mime
      blob_size = l_content_length.

  CALL METHOD i_igs_image_converter->execute
    EXCEPTIONS
      communication_error = 1
      internal_error      = 2
      external_error      = 3
      OTHERS              = 4.

  IF sysubrc = 0.

    CALL METHOD i_igs_image_converter->get_image
      IMPORTING
        blob      = blob
        blob_size = blob_size
        blob_type = blob_type.

  ENDIF.

  IF sysubrc = 0.


    IF  p_rad1 = ‘X’.

      CALL SCREEN ‘9000’“Calling the screen for qrcode display

    ELSE.

      PERFORM show_smart_form. “calling the smartform for qrcode display

    ENDIF.

  ENDIF.

ENDFORM.                    ” CONVERT_IMAGE

*&———————————————————————*
*&      Module  STATUS_9000  OUTPUT
*&———————————————————————*
*       text
*———————————————————————-*

MODULE status_9000 OUTPUT.

  SET PF-STATUS ‘PF’.

“Creating the object for the container

  CREATE OBJECT picture_container
    EXPORTING
      container_name = ‘PICTURECONTROL’.
  CREATE OBJECT picture_control
    EXPORTING
      parent = picture_container.

  “Calling the screen

  PERFORM call_screen.

ENDMODULE.                 ” STATUS_9000  OUTPUT

*&———————————————————————*
*&      Form  CALL_SCREEN
*&———————————————————————*
*       text
*———————————————————————-*
*  –>  p1        text
*  <–  p2        text
*———————————————————————-*

FORM call_screen .

  “Creating the url of the image for the display in the container in the screen
  SPLIT blob_type AT ‘/’ INTO blob_type l_img_subtype.

  CALL FUNCTION ‘DP_CREATE_URL’
    EXPORTING
      type     = blob_type
      subtype  = l_img_subtype
      size     = blob_size
      lifetime = cndp_lifetime_transaction
    TABLES
      data     = blob
    CHANGING
      url      = l_img_url
    EXCEPTIONS
      OTHERS   = 1.

  IF sysubrc IS INITIAL.
    CALL METHOD picture_control->load_picture_from_url
      EXPORTING
        url = l_img_url.
  ENDIF.

ENDFORM.                    ” CALL_SCREEN

*&———————————————————————*
*&      Module  USER_COMMAND_9000  INPUT
*&———————————————————————*
*       text
*———————————————————————-*
MODULE user_command_9000 INPUT.

  IF syucomm = ‘BACK’.


    LEAVE TO SCREEN 0.

  ENDIF.

ENDMODULE.                 ” USER_COMMAND_9000  INPUT

*&———————————————————————*
*&      Form  SHOW_SMART_FORM
*&———————————————————————*
*       text
*———————————————————————-*
*  –>  p1        text
*  <–  p2        text
*———————————————————————-*

FORM show_smart_form .

  gi_name = ‘QRCODE10’.         “name of the qrcode will be in se78 after one time running this program
  gi_object = ‘GRAPHICS’.
  gi_id = ‘BMAP’.
  gi_btype = ‘BCOL’. “If u want black and white pass BMON
  gi_resident = ‘ ‘.
  gi_autoheight ‘X’.
  gi_bmcomp = ‘X’.
  l_extension = ‘BMP’.

  “importing the image into se78 before displaying it in the smartform.

  perform import_bitmap_bds    using blob
                                   gi_name
                                   gi_object
                                   gi_id
                                   gi_btype
                                   l_extension
                                   ‘ ‘
                                   gi_resident
                                   gi_autoheight
                                   gi_bmcomp
                          changing l_docid
                                   gi_resolution.

IF sysubrc = 0.

  DATA:fname TYPE rs38l_fnam.

  “gettingt the name FM of the smartform
  CALL FUNCTION ‘SSF_FUNCTION_MODULE_NAME’
   EXPORTING
     formname                 = ‘ZQR_TEST’
*   VARIANT                  = ‘ ‘
*   DIRECT_CALL              = ‘ ‘
  IMPORTING
    fm_name                  = fname
* EXCEPTIONS
*   NO_FORM                  = 1
*   NO_FUNCTION_MODULE       = 2
*   OTHERS                   = 3  .

“Calling the FM of the smartform for display
  CALL FUNCTION fname
    EXPORTING
*    ARCHIVE_INDEX              =
*    ARCHIVE_INDEX_TAB          =
*    ARCHIVE_PARAMETERS         =
*    CONTROL_PARAMETERS         =
*    MAIL_APPL_OBJ              =
*    MAIL_RECIPIENT             =
*    MAIL_SENDER                =
*    OUTPUT_OPTIONS             =
*    USER_SETTINGS              = ‘X’
      w_name                     = ‘QRCODE10’
*  IMPORTING
*    DOCUMENT_OUTPUT_INFO       =
*    JOB_OUTPUT_INFO            =
*    JOB_OUTPUT_OPTIONS         =
*  EXCEPTIONS
*    FORMATTING_ERROR           = 1
*    INTERNAL_ERROR             = 2
*    SEND_ERROR                 = 3
*    USER_CANCELED              = 4
*    OTHERS                     = 5            .

  IF sysubrc <> 0.
* Implement suitable error handling here
  ENDIF.

ENDIF.

ENDFORM.                    ” SHOW_SMART_FORM

*&———————————————————————*
*&      Form  IMPORT_BITMAP_BDS (Copied from standard program and modified it as per the requirement)
*&———————————————————————*
form import_bitmap_bds
        using    p_blob       type w3mimetabtype
                 p_name           type stxbitmapstdname
                 p_object         type stxbitmapstdobject
                 p_id             type stxbitmapstdid
                 p_btype          type stxbitmapstdbtype
                 p_format         type c
                 p_title          like bds_description
                 p_resident       type stxbitmapsresident
                 p_autoheight     type stxbitmapsautoheight
                 p_bmcomp         type stxbitmapsbmcomp
        changing p_docid          type stxbitmapsdocid
                 p_resolution     type stxbitmapsresolution.

data: l_object_key type sbdst_object_key.
data: l_tab        type ddobjname.


data: begin of l_bitmap occurs 0,
        l(64) type x,
      end of l_bitmap.

data: l_filename        type string,
      l_bytecount       type i,
      l_bds_bytecount   type i.
data: l_color(1)        type c,

      l_width_tw        type stxbitmapswidthtw,
      l_height_tw       type stxbitmapsheighttw,
      l_width_pix       type stxbitmapswidthpix,
      l_height_pix      type stxbitmapsheightpix.
data: l_bds_object      type ref to cl_bds_document_set,
      l_bds_content     type sbdst_content,
      l_bds_components  type sbdst_components,
      wa_bds_components type line of sbdst_components,
      l_bds_signature   type sbdst_signature,
      wa_bds_signature  type line of sbdst_signature,
      l_bds_properties  type sbdst_properties,
      wa_bds_properties type line of sbdst_properties.


data  wa_stxbitmaps type stxbitmaps.

* Enqueue
  perform enqueue_graphic using p_object
                                p_name
                                p_id
                                p_btype.

* Bitmap conversion
  call function ‘SAPSCRIPT_CONVERT_BITMAP_BDS’
       exporting
            color                    = ‘X’
            format                   = p_format
            resident                 = p_resident
            bitmap_bytecount         = l_bytecount
            compress_bitmap          = p_bmcomp
       importing
            width_tw                 = l_width_tw
            height_tw                = l_height_tw
            width_pix                = l_width_pix
            height_pix               = l_height_pix
            dpi                      = p_resolution
            bds_bytecount            = l_bds_bytecount
       tables
            bitmap_file              = p_blob
            bitmap_file_bds          = l_bds_content
       exceptions
            format_not_supported     = 1
            no_bmp_file              = 2
            bmperr_invalid_format    = 3
            bmperr_no_colortable     = 4
            bmperr_unsup_compression = 5
            bmperr_corrupt_rle_data  = 6
            others                   = 7.

  if sysubrc <> 0.

    perform dequeue_graphic using p_object
                                  p_name
                                  p_id
                                  p_btype.
    message id symsgid type symsgty number symsgno
            with symsgv1 symsgv2 symsgv3 symsgv4
    raising conversion_failed.

  endif.

* Save bitmap in BDS
  create object l_bds_object.

  wa_bds_componentsdoc_count  = ‘1’.
  wa_bds_componentscomp_count = ‘1’.
  wa_bds_componentsmimetype   = c_bds_mimetype.
  wa_bds_componentscomp_size  = l_bds_bytecount.
  append wa_bds_components to l_bds_components.

  if p_docid is initial.          ” graphic is new

    wa_bds_signaturedoc_count = ‘1’.
    append wa_bds_signature to l_bds_signature.

    call method l_bds_object->create_with_table
         exporting
              classname  = c_bds_classname
              classtype  = c_bds_classtype
              components = l_bds_components
              content    = l_bds_content
         changing
              signature  = l_bds_signature
              object_key = l_object_key
         exceptions
              others     = 1.

    if sysubrc <> 0.

      perform dequeue_graphic using p_object
                                    p_name
                                    p_id
                                    p_btype.
*      message e285 with p_name  ‘BDS’.

    endif.

    read table l_bds_signature index 1 into wa_bds_signature
    transporting doc_id.

    if sysubrc = 0.

      p_docid = wa_bds_signaturedoc_id.

    else.

      perform dequeue_graphic using p_object
                                    p_name
                                    p_id
                                    p_btype.
*      message e285 with p_name ‘BDS’.

    endif.

  else.                ” graphic already exists

********* read object_key for faster access *****
   clear l_object_key.
   select single * from stxbitmaps into wa_stxbitmaps
       where tdobject = p_object
         and tdid     = p_id
         and tdname   = p_name
         and tdbtype  = p_btype.

   select single tabname from bds_locl into l_tab
      where classname = c_bds_classname
         and classtype = c_bds_classtype.


   if sysubrc = 0.

     select single object_key from (l_tab) into l_object_key
       where loio_id = wa_stxbitmapsdocid+10(32)
         and classname = c_bds_classname
           and classtype = c_bds_classtype.

   endif.

******** read object_key end ********************

    call method l_bds_object->update_with_table
         exporting
              classname  = c_bds_classname
              classtype  = c_bds_classtype
              object_key = l_object_key
              doc_id     = p_docid
              doc_ver_no = ‘1’
              doc_var_id = ‘1’
         changing
              components = l_bds_components
              content    = l_bds_content
         exceptions
              nothing_found = 1
              others        = 2.

    if sysubrc = 1.   ” inconsistency STXBITMAPS – BDS; repeat check in

      wa_bds_signaturedoc_count = ‘1’.
      append wa_bds_signature to l_bds_signature.

      call method l_bds_object->create_with_table
           exporting
                classname  = c_bds_classname
                classtype  = c_bds_classtype
                components = l_bds_components
                content    = l_bds_content
           changing
                signature  = l_bds_signature
                object_key = l_object_key
           exceptions
                others     = 1.

      if sysubrc <> 0.
        perform dequeue_graphic using p_object
                                      p_name
                                      p_id
                                      p_btype.
*        message e285 with p_name ‘BDS’.

      endif.

      read table l_bds_signature index 1 into wa_bds_signature
      transporting doc_id.
      if sysubrc = 0.
        p_docid = wa_bds_signaturedoc_id.
      else.

        perform dequeue_graphic using p_object
                                      p_name
                                      p_id
                                      p_btype.

*        message e285 with p_name ‘BDS’.

      endif.

    elseif sysubrc = 2.


      perform dequeue_graphic using p_object
                                    p_name
                                    p_id
                                    p_btype.

*      message e285 with p_name ‘BDS’.

    endif.

  endif.

* Save bitmap header in STXBITPMAPS
  wa_stxbitmapstdname     = p_name.
  wa_stxbitmapstdobject   = p_object.
  wa_stxbitmapstdid       = p_id.
  wa_stxbitmapstdbtype    = p_btype.
  wa_stxbitmapsdocid      = p_docid.
  wa_stxbitmapswidthpix   = l_width_pix.
  wa_stxbitmapsheightpix  = l_height_pix.
  wa_stxbitmapswidthtw    = l_width_tw.
  wa_stxbitmapsheighttw   = l_height_tw.
  wa_stxbitmapsresolution = p_resolution.
  wa_stxbitmapsresident   = p_resident.
  wa_stxbitmapsautoheight = p_autoheight.
  wa_stxbitmapsbmcomp     = p_bmcomp.
  insert into stxbitmaps values wa_stxbitmaps.

  if sysubrc <> 0.

     update stxbitmaps from wa_stxbitmaps.

     if sysubrc <> 0.

*       message e285 with p_name ‘STXBITMAPS’.

     endif.

  endif.

* Set description in BDS attributes

  wa_bds_propertiesprop_name  = ‘DESCRIPTION’.
  wa_bds_propertiesprop_value = p_title.
  append wa_bds_properties to l_bds_properties.

  call method l_bds_object->change_properties
       exporting
            classname  = c_bds_classname
            classtype  = c_bds_classtype
            object_key = l_object_key
            doc_id     = p_docid
            doc_ver_no = ‘1’
            doc_var_id = ‘1’
       changing
            properties = l_bds_properties
       exceptions
            others         = 1.

  perform dequeue_graphic using p_object
                                p_name
                                p_id
                                p_btype.

endform.

*&———————————————————————*
*&      Form  ENQUEUE_GRAPHIC
*&———————————————————————*
* Enqueue of graphics stored in BDS
*———————————————————————-*

form enqueue_graphic using p_object
                           p_name
                           p_id
                           p_btype.

  call function ‘ENQUEUE_ESSGRABDS’
       exporting
*           MODE_STXBITMAPS = ‘E’
            tdobject        = p_object
            tdname          = p_name
            tdid            = p_id
            tdbtype         = p_btype
*           X_TDOBJECT      = ‘ ‘
*           X_TDNAME        = ‘ ‘
*           X_TDID          = ‘ ‘
*           X_TDBTYPE       = ‘ ‘
*           _SCOPE          = ‘2’
*           _WAIT           = ‘ ‘
*           _COLLECT        = ‘ ‘
       exceptions
            foreign_lock    = 1
            others          = 2.

  if sysubrc <> 0.
    message id symsgid type symsgty number symsgno
          with symsgv1 symsgv2 symsgv3 symsgv4
    raising enqueue_failed.
  endif.

endform.                    ” ENQUEUE_GRAPHIC

*&———————————————————————*
*&      Form  DEQUEUE_GRAPHIC
*&———————————————————————*
* Dequeue of graphics stored in BDS
*———————————————————————-*

form dequeue_graphic using p_object
                           p_name
                           p_id
                           p_btype.

  call function ‘DEQUEUE_ESSGRABDS’
       exporting
*           MODE_STXBITMAPS = ‘E’
*           X_TDOBJECT      = ‘ ‘
*           X_TDNAME        = ‘ ‘
*           X_TDID          = ‘ ‘
*           X_TDBTYPE       = ‘ ‘
*           _SCOPE          = ‘3’
*           _SYNCHRON       = ‘ ‘
*           _COLLECT        = ‘ ‘
            tdobject        = p_object
            tdname          = p_name
            tdid            = p_id
            tdbtype         = p_btype.

endform.                    ” DEQUEUE_GRAPHIC

OUTPUT

Capture3.PNG

Capture4.PNG

Capture6.PNG

Assigned Tags

      42 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Krishna K
      Krishna K

      Hi James ,

       

           Can you share the configuration checks. I'm trying this one but it is through "Internal Communication error'.

       

      Thanks & Regards,

      Krishna

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi,

       

      May be this due to the internet connection problem ... My program needs an internet connection.It is taking the qrcode from internet.So if no internet connection it will create some issues.

      Author's profile photo Krishna K
      Krishna K

      Hi,

         having internet , whether we have to create Proxy or what..?

       

      Thanks & Regards,

      Krishna

      Author's profile photo Former Member
      Former Member

      Hi James,

      we are using SAP system(ERP 6 EHP 6) below mentioned version.

      /wp-content/uploads/2016/03/d1_909406.png

      /wp-content/uploads/2016/03/d2_909431.png

      is it possible to enable QR Barcode in the above sap version.if it is possible, please provide me the relevant steps.

       

      Thanks

      Regards,

      Vijayakumar.

      Author's profile photo Former Member
      Former Member

      Hi,

       

      After the Kernel upgraded 720 to 721 issue has been resolved. QR barcode enabled and working fine.

       

      please suggest us which model printers will support for QR Barcode Labels printing.

       

      Thanks

      Regards

      Vijayakumar

      Author's profile photo satheesh Kumaran R
      satheesh Kumaran R

      Hi James,

           thanks for sharing....

       

      am getting ERROR in " http_client->receive( )" as below...

      Exception condition "HTTP_COMMUNICATION_FAILURE" raised.

       

      could you help me to fix this...

       

      Thanks and regards,

      Satheesh

      Author's profile photo Former Member
      Former Member
      Blog Post Author

      Hi,

       

      May be this due to the internet connection problem ... My program needs an internet connection.It is taking the qrcode from internet.So if no internet connection it will create some issues.

      Author's profile photo Elko Hasse
      Elko Hasse

      Thanks for sharing.

      The use of the Google Chart API seems to be an easy way for QR Code creation, but I am asking myself since this is an free external service how reliable it is.

       

      Do you have any experience with this? Would you suggest to use it in an productive environment ?

      Author's profile photo Former Member
      Former Member

      In addition to this, I'd be concerned about transferring internal business-related data to an external company for processing - but then, we have another solution in place (a DLL that snaps into SAPlpd/SAPsprint/SAP GUI to perform the Barcode Magic).

      Author's profile photo Former Member
      Former Member

      Hi Alenlee,

       

      Thanks for sharing such a nice information.

       

      But also I wanted to know one thing,

       

      CONCATENATE 'http://chart.apis.google.com/chart?chs=200x200&cht=qr&chld=|1&chl=' qr_text '/chart.png' INTO url.

       

      Here you have used the Google API to generate the QR Code,

      just wanted to know how to find the appropriate Google API URL for my desired symbology.

       

      I am asking this since I want to use Google API for printing ECC 200 2 D Bar Code.

       

      Thanking You All.

      Enjoy SAP.

      Author's profile photo Former Member
      Former Member

      Hi,

       

      thanks for this Information.

       

      I try it. Create Smartform and Report.

       

      When i try to execute it (with smartform) i get an error in:

       

        CALL METHOD i_igs_image_converter->execute
          EXCEPTIONS
            communication_error = 1
            internal_error      = 2
            external_error      = 3
            OTHERS              = 4.

       

      sy-subrc is 1 (communication error).

       

      What can i do?

       

      Regards, Dieter

       

      Problem is the RFC: IGS_RFC_DEST

      I will check it via SM59.

      Author's profile photo Patrick Dean
      Patrick Dean

      Absolutely brilliant, thanks a lot.

      And thinking about it, one could use any of the other charting APIs for this! Brilliant!

      Author's profile photo Former Member
      Former Member

      Hi Alenlee,

       

      Thanks for sharing such a nice Article. I was really looking for such stuff.

       

      But also I would like to know one thing,

       

      CONCATENATE 'http://chart.apis.google.com/chart?chs=200x200&cht=qr&chld=|1&chl=' qr_text'/chart.png' INTO url.

       

      Here you have used the Google API to generate the QR Code,

      Actually I want to disclose full patient data against qr code. But I am unable to do this. Please help me in this regard.


      I will tell you in little detail that I concatenate other fields with this api to get patient data but i didn't get the exact details. Its just giving me  some unknown data which is not even in that record. How should I get the exact one.

       

      Author's profile photo Mario Thomas
      Mario Thomas

      Hi,

       

      I'am getting the following Dump:

       

      COMPUTE_INT_TIMES_OVERFLOW

       

       

      Short Text

           Whole number overflow on multiplication.

       

       

      Information on where terminated

          Termination occurred in the ABAP program "SAPLSTXBITMAPS" - in

           "FILL_BMFILE_FROM_BMP".

          The main program was "ZSD_VTT ".

       

          In the source code you have the termination point in line 1960

          of the (Include) program "LSTXBITMAPSF03".

          The termination is caused because exception "CX_SY_ARITHMETIC_OVERFLOW"

           occurred in

          procedure "FILL_BMFILE_FROM_BMP" "(FORM)", but it was neither handled locally

           nor declared

          in the RAISING clause of its signature.

       

          The procedure is in program "SAPLSTXBITMAPS "; its source code begins in line

          1844 of the (Include program "LSTXBITMAPSF03 ".

       

       

       

       

      >>> otf_bminfo-dpi = ( bmp_xpelspermeter * 100 ) / 3937.

       

      Can anyone help me?

       

      Many Thanks

      Author's profile photo Mario Thomas
      Mario Thomas

      Is the program still working?

       

      I don't know why I get this dump!

      Author's profile photo Simone Milesi
      Simone Milesi

      Hello!
      i would love to use this method (and it works great for me!) but Google put the API under Depraction Policy!

      Any workaround?

      Terms of Service

      Last modified: May 10, 2013

      By using this API, you consent to be bound by these terms in addition to the Google APIs Terms of Service ("API ToS") at https://developers.google.com/terms.

      1. 1.  Deprecation Policy

      Google will announce if it intends to discontinue or make backwards incompatible changes to this API or Service. Google will use commercially reasonable efforts to continue to operate those Google Chart Tools versions and features identified at http://developers.google.com/chart/chart-api-list without these changes until April 20, 2015, unless (as Google determines in its reasonable good faith judgment):

      o    required by law or third party relationship (including if there is a change in applicable law or relationship), or

      o    doing so could create a security risk or substantial economic or material technical burden.

      The above policy is the "Deprecation Policy."

      After April 20, 2015, this Deprecation Policy will not apply.

      Author's profile photo Nelson Miranda
      Nelson Miranda

      I used the code above with some modifications and made my own webservice, and that made the trick.

      Author's profile photo Matthew Billingham
      Matthew Billingham

      Use the same technique with any of the other QR generating web services around.

      Author's profile photo Simone Milesi
      Simone Milesi

      As stated by Volker Wegert below, there is a privacy/security issue AND a maintainence one: if the web service stop working for any reason, i've to start over.
      Anyway someone suggested me some OSS notes to manage QR code as any other barcodes

      QR code in Smartform - PDF

      Author's profile photo SRIKANTH DHEEKONDA
      SRIKANTH DHEEKONDA

      I am getting communication_error, some one please help me out.

       

        CALL METHOD i_igs_image_converter->execute

          EXCEPTIONS

            communication_error = 1

            internal_error      = 2

            external_error      = 3

            OTHERS              = 4.

      -Srikanth

      Author's profile photo Former Member
      Former Member

      Hallo everybody,

      I get the dump: COMPUTE_INT_TIMES_OVERFLOW

       

        ofs_rgbquad = ofs_bitmapinfoheader + bmp_bisize.

      * now we have OFS_RGBQUAD    -> color table

      *             OFS_BITMAPDATA -> bitmap bytes

        otf_bminfo-new_rd_format = c_false.

        otf_bminfo-is_resident   = c_false.

        otf_bminfo-dpi = ( bmp_xpelspermeter * 100 ) / 3937.

       

      does anyone have the same problem?

      Author's profile photo Former Member
      Former Member

      Hi guru's,

       

      Thanks a lot for this document.

       

      The first time I run the program I could print the QR, but then I experienced the same dump:

       

      COMPUTE_INT_TIMES_OVERFLOW

       

        ofs_rgbquad = ofs_bitmapinfoheader + bmp_bisize.

      * now we have OFS_RGBQUAD    -> color table

      *             OFS_BITMAPDATA -> bitmap bytes

        otf_bminfo-new_rd_format = c_false.

        otf_bminfo-is_resident   = c_false.

        otf_bminfo-dpi = ( bmp_xpelspermeter * 100 ) / 3937.

       

      Does anyone find the solution for this problem?

       

      Thank you very much

      Author's profile photo Primoz Gricar
      Primoz Gricar

      Dear colleagues,

       

      I guess, this is missing in data declaration section at the beginnig of the code:

       

      TYPE-POOLS: SBDST.
      TABLES: STXBITMAPS.


      Regards,

      Primoz


      Author's profile photo Former Member
      Former Member

      Thank you Primoz.

       

      I tried that but still the same dump persists.

       

      Regards,

       

      Alejandro

      Author's profile photo Former Member
      Former Member

      Hi James and Matthew Billingham ,

       

      I am using this code. when i run the program, i am getting ERROR in " http_client->receive( )" as below...

      Exception condition "HTTP_COMMUNICATION_FAILURE" raised.

       

      could you help me.

       

      I having internet connection also.

       

      Thanks & Regards,

      JAYAKANTHAN

      Author's profile photo Nelson Miranda
      Nelson Miranda

      Hi, I had this trouble before and the causes have been connection issues. Try to check if there's a firewall behind the server. Another thing I recommend is to generate the QR Code directly from your browser just to confirm that the address and parameters are set ok.

       

      Hope it helps.

      Author's profile photo Tran Thanh Quynh
      Tran Thanh Quynh

      Dear Alenlee James , Nelson,

       

      I try to use your source code and test run, but it dont show anything. I try again with debug mode and see that this program error on line command with subrc = 2.

      CALL METHOD i_igs_image_converter->execute

           EXCEPTIONS

             communication_error = 1

             internal_error      = 2

             external_error      = 3

             OTHERS              = 4.


      Please help me to reslove this problem.

      Thank you so much,

      QT.

      Author's profile photo Alexander Bolloni
      Alexander Bolloni

      Hello,

      QR Barcode generation for SAPscript/Smart Forms will be part of SAP standard with NW 740 SP09  (see note 2030263); this feature can be implemented in older releases via kernel patch and support package:

       

      702 with SP17

      730 with SP13

      731 with SP14

      see notes 2029824 and 2029589.

      Regards,

        Alexander

      Author's profile photo Former Member
      Former Member

      Hi James

       

      Nice document. We want to use the same with UPS MAXICODE.

       

      Is that possible

      Author's profile photo Eric Chen
      Eric Chen

      Hi Alenlee,

       

      Very useful document, I'm looking for solution of creating QR Code.

      Many thanks for sharing.

      Author's profile photo Rafael Cermeño
      Rafael Cermeño

      COMPUTE_INT_TIMES_OVERFLOW error someone can correct ??

      Thank you

      Author's profile photo Former Member
      Former Member

      I think that OSS notes 2029824 and 2030263 are the best way to use QR codes on SapScript & Smartforms... they work perfectly...

       

      http://service.sap.com/sap/support/notes/2029824

       

       

      http://service.sap.com/sap/support/notes/2030263

      Author's profile photo Rafael Cermeño
      Rafael Cermeño

      Thanks for your help but the problem with these notes is that I'm in the same vesion 7.0 and 7.2 are for onwards.

      I have read countless forums and anything that can help me.

      Greeting and thanks

      Author's profile photo Former Member
      Former Member

      I am on 7.02,

      Please, have a look on transaction SE73.

      Choose "System bar codes"... change...

      create a new barcode, then choose "new barcode technology, you will be able to create a QR Code...

       

      SE73.gif

      Author's profile photo Former Member
      Former Member

      Hi Mick Farina,

       

      we are using SAP system(ERP 6 EHP 6) below mentioned version.

      /wp-content/uploads/2016/03/d1_909404.png

      /wp-content/uploads/2016/03/d2_909405.png

      is it possible to enable QR Barcode in the above sap version.if it is possible, please provide me the relevant steps.

       

      Thanks

      Regards,

      Vijayakumar.

      Author's profile photo Primoz Gricar
      Primoz Gricar

      Hi,

       

      As far as I know, the only good possibilitiy for QR in Smartforms (and SAP script) is under the following conditions:

      SAP OSS note: 2030263 - Support for QR Code 2005 Barcode in SAPscript and Smart Forms

       

      From Release 740 SP09, the New Barcode Technlogy for Smart Forms (and SAPscript) supports the 2D Barcode Symbology "QR Code

      2005" (according to ISO standard ISO/IEC 18004:2006).

       

      Attention: Since the QR Code generator is kernel-based, the 742 kernel patch from note 2029589 is required for 740 SP09 !

      Even though this development was originally released in 740 SP09, it is possible to enable the functionality in certain older releases: For Release

      7.40, SP08 and lower, you can apply this note via SNOTE. For more information about downporting the functionality to lower releases, refer to

      notes 2029589 and 2029824.

       

      We opgraded kernel level for several clients in December 2015 due to legal requirement to register cash sales at the government and the returned authorization identification print on the bill as a QR bar code.

       

      All other options are semi-professional and do not give sufficient and robust results for serious printing in a company.

      Author's profile photo Primoz Gricar
      Primoz Gricar

      Hi, colleagues,

       

      As already mentioned above by Alexander, currently the best solution to include QR code in smart forms and/or SAP script is to implement the following OSS note:

      2030263 - Support for QR Code 2005 Barcode in SAPscript and Smart Forms

      This will give you a standard  way to include the code in your documents.

       

      We did it and it works OK.

       

      Regards,

      Primoz

      Author's profile photo José Luis Holguin Serrano
      José Luis Holguin Serrano

       

      Hi colleaguesI try to use your source code and test run, but it dont show anything. I try again with debug mode and see that this program error on line command with subrc = 2.

      CALL METHOD i_igs_image_converter->execute

      EXCEPTIONS

      communication_error = 1

      internal_error      = 2

      external_error      = 3

      OTHERS              = 4.

      Please help me to resolve this issue.

      Thanks a lot.

       

      Author's profile photo Da Thang
      Da Thang

      thx for your sharing, it's very useful for us.

      Author's profile photo Stephen A Yeats
      Stephen A Yeats

      I tried this, debug shows I get to the section -

      CALL METHOD go_image_converter->execute
      EXCEPTIONS
      communication_error = 1
      internal_error = 2
      external_error = 3
      OTHERS = 4.

      Which then returns an internal error (sy-subrc) = 2

      Can anyone help me resolve this issue ?

      Author's profile photo Former Member
      Former Member

      Hello,

       

      Kindly let me know the maximum length of QRCODE Barcode.

      Author's profile photo Cowealth Cowealth
      Cowealth Cowealth

      Have you solved it?

       

      An exception occurred that is explained in detail below.
      The exception, which is assigned to class 'CX_SY_ARITHMETIC_OVERFLOW', was not
      caught in
      procedure "FILL_BMFILE_FROM_BMP" "(FORM)", nor was it propagated by a RAISING
      clause.
      Since the caller of the procedure could not have anticipated that the
      exception would occur, the current program is terminated.
      The reason for the exception is:
      In the current program "SAPLSTXBITMAPS", multiplying the numbers 300613632 and
      100 (using the operation '*' or 'MULTIPLY') resulted in a value
      greater than 2147483647 or smaller than -2147483648. This
      results in a whole number overflow.