Skip to Content

1.Introduce

We have a requirement to use QRCODE in party person’s machine in SAP GUI.

Since our SAP version is too low and IT team do not want to access internet interface for QRcode.

So I developed the local file version QRCODE.

I will be happy if it is useful for you.

There will be bugs maybe even it works fine for me in my machine Windos7 64 bite.

2.How to use?

2-1. prepare the EXE file

a.download  the Python3.4 build result file  named [dist.rar] in link http://download.csdn.net/detail/budaha/9558379,

the size is 7207kb more than 1M. So I did not upload in this page by sap attachment.

/wp-content/uploads/2016/06/55_982417.png

/wp-content/uploads/2016/06/66_982427.png

b.copy the 3 files[qrcode.exe  python34.dll   and file named tcl]

c.past  the 3 files to your windows computer [C:\Windows\SysWOW64] and [C:\Windows\System32] [modify in20160624,must in both file path]

2-2. prepare the abap source code

a. create a report named as your will star with y or z.

b. paste below code,save check and active it.


REPORT YWUFEIYUNTEST.

DATA GV_DIR TYPE STRING.

*QRCODE logo in center
PARAMETERS: P1 TYPE STRING LOWER CASE  DEFAULT ‘d:\11.png’,
            P2
TYPE STRING LOWER CASE OBLIGATORY DEFAULT ‘d:\’,
            P3
TYPE STRING LOWER CASE OBLIGATORY DEFAULT ‘QRCODE TEXT HELLO WORLD’.

INITIALIZATION.
%_P1_%_APP_%
TEXT = ‘Full Path of central image’.
%_P2_%_APP_%
TEXT = QRcode saved in’.
%_P3_%_APP_%
TEXT = ‘QRCODE Text’.

START-OF-SELECTION.
DATA GV_PARAMETER TYPE STRING.

CONCATENATE P2  \AutoQr_’ SYDATUM  ‘_’ SYUZEIT ‘.PNG’ INTO GV_DIR.
CONDENSE P1 NOGAPS.
IF P1 IS INITIAL.
CONCATENATE
            
‘-o’
             GV_DIR
            
‘-s’
            
INTO    GV_PARAMETER RESPECTING BLANKS SEPARATED BY SPACE.
ELSE.
CONCATENATE ‘-i
             P1
            
‘-o’
             GV_DIR
            
‘-s’
            
INTO    GV_PARAMETER RESPECTING BLANKS SEPARATED BY SPACE.
ENDIF.

REPLACE ALL OCCURRENCES OF ‘\\’ IN GV_PARAMETER WITH ‘\’.

CONCATENATE GV_PARAMETER P3 INTO GV_PARAMETER RESPECTING BLANKS SEPARATED BY SPACE.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
   
EXPORTING
      APPLICATION           
= qrcode
     
PARAMETER              = GV_PARAMETER
  
EXCEPTIONS
     CNTL_ERROR            
= 1
     ERROR_NO_GUI          
= 2
     BAD_PARAMETER         
= 3
     FILE_NOT_FOUND        
= 4
     PATH_NOT_FOUND        
= 5
     FILE_EXTENSION_UNKNOWN
= 6
     ERROR_EXECUTE_FAILED  
= 7
     SYNCHRONOUS_FAILED    
= 8
     NOT_SUPPORTED_BY_GUI  
= 9
    
OTHERS                 = 10
        
.
IF SYSUBRC <> 0.
  
MESSAGE I398(00) WITH ‘call ERROR’ ‘SY-SUBRC’ SYSUBRC.
  
RETURN.
ENDIF.

DATA LV_ADD TYPE SO_TEXT255.
LV_ADD
=  GV_DIR.

CALL FUNCTION ‘CALL_INTERNET_ADRESS’
 
EXPORTING
    PI_ADRESS          
= LV_ADD
 
EXCEPTIONS
    NO_INPUT_DATA      
= 1
   
OTHERS              = 2
          
.
IF SYSUBRC <> 0.
  
MESSAGE I398(00) WITH ‘open ERROR’ ‘SY-SUBRC’ SYSUBRC.
  
RETURN.
ENDIF.

3. Run the ABAP  report.

a. without logo

/wp-content/uploads/2016/06/11_982315.png

Run and get the result like this QRCODE.

/wp-content/uploads/2016/06/22_982409.png

b. with a central Logo image.

/wp-content/uploads/2016/06/33_982415.png

result with a image in central

/wp-content/uploads/2016/06/44_982416.png

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. Simone Milesi

    Nice blog and nice option.

    Still i wonder if we can use something similar to run a script on server side to generate the QRCode via batch (i.e. massive invoice sending via mail with pdf in the smartform)

    (0) 

Leave a Reply