Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member192023
Active Participant

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.

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_' SY-DATUM  '_' SY-UZEIT '.PNG' INTO GV_DIR.

CONDENSE P1 NO-GAPS.
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 SY-SUBRC <> 0.
  
MESSAGE I398(00) WITH 'call ERROR' 'SY-SUBRC' SY-SUBRC.
  
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 SY-SUBRC <> 0.
  
MESSAGE I398(00) WITH 'open ERROR' 'SY-SUBRC' SY-SUBRC.
  
RETURN.
ENDIF.

3. Run the ABAP  report.

a. without logo

Run and get the result like this QRCODE.

b. with a central Logo image.

result with a image in central

1 Comment