cancel
Showing results for 
Search instead for 
Did you mean: 

2D Barcode (PDF417) in Smartforms

former_member611006
Active Participant
0 Kudos

Hi Gurus,

I have a Smartforms with 2D-Barcode (PDF417).

I have to use header, field separators and foot into the barcode ( [)>, RS, GS, EOT...).

I define these separators like this:

CONSTANTS:
c_head VALUE '\0X5B\0X29\0X3E',       " Complience Indicator
c_rs   VALUE '\0X1E',                 " Format Trailer Character
c_gs   VALUE '\0X1D',                 " Data Field Separator
c_eot  VALUE '\0X04'.                 " Message Trailer

and then fill my barcode variable like this:

CONCATENATE
c_head c_rs '06'               
c_gs '12SGTLVWAG01'       
c_gs '2L'   gv_werk_empf     
c_gs '1L'   label_data-ablad  
c_gs        gv_license_plate   
c_gs 'P'    label_data-kdmat    
c_gs 'Q'    gv_vemng        
c_gs 'B'    label_data-vhmku   
c_gs 'V'    label_data-eikto    
c_gs '12S'  label_data-vbeln   
*c_gs '1T'   label_data-charg   
c_gs c_rs c_eot  
INTO gv_pdf.

The problem is, when I scan my barcode I have the \ separator, and I can't delete it...

\06\12SGTLVWAG01\2L22\1L001X1\1JUN341382615100348063\P 0B1 200 345 E\Q1\B106925\V261988\12S0063397339\\

Any idea how I can delete this \ ?

Regards,

David

Accepted Solutions (0)

Answers (5)

Answers (5)

tanju_lise3
Participant
0 Kudos

Hi David,

Firstly I created pdf417 barcode.

In smartforms I coded like this.

When I tried to read barcode, it is not reading.

No barcode message I saw it.

Is this wrong coding ?

Regards

CONCATENATE '[)>' '{RS}'

'06' '{GS}'

'P' lv_kdmat '{GS}'

'Q' lv_menget '{GS}'

'V' lv_eikto '{GS}'

'D' lv_sevk_tarih '{GS}'

'S' lv_etiketno '{GS}'

'N' lv_irsaliye '{EOT}'

INTO gv_pdf417.

ManojYadav
Explorer
0 Kudos

Anyone please share the correct code? i have similar requirement to generate PDF417 2d barcode.

tanju_lise3
Participant
0 Kudos

Hi David,

I have a same problem .

Did you solve the problem ?

Would you like to send me an email ? (tanju.lise@demisas.com.tr)

I am really appreciated .

Kind Regards

Tanju

Former Member
0 Kudos

SAP ABAP Code to Generate PDF417 Barcodes

Preparing SAP data to be printed as a linear barcode can be a pain at times; when 2D barcodes with proper field separators are required the pain factor goes up. Most of the problems come from trying to convince SAP to assign non-printing control characters to the output variable. So, I have written a small example which demonstrates both how to generate a PDF417 barcode and the steps required to assign special characters to a string in ABAP. SAPscript cannot handle 2D barcodes, so this code will only really work in SmartForms.

DATA: gv_pdf417 TYPE string,

      gv_date_old TYPE likp-wadat,

     gv_serial TYPE num9,

      gv_kdmat TYPE vwahn-kdmat,

      gv_meng TYPE char10,

     lf_masterorsingle TYPE char3,

      lf_hex_rs TYPE x LENGTH 4 VALUE '001E',

      lf_hex_gs TYPE x LENGTH 4 VALUE '001D',

      lf_hex_eot TYPE x LENGTH 4 VALUE '0004',

      lf_char_rs TYPE c,

      lf_char_gs TYPE c,

      lf_char_eot TYPE c.

FIELD-SYMBOLS: <lfs_rs>,

               <lfs_gs>,

               <lfs_eot>.


WRITE is_wahn-wadat TO gv_date_old yymmdd.

WRITE is_wahn-exidv+11(9) TO gv_serial.


" Get non-printing control characters set

ASSIGN lf_hex_rs TO <lfs_rs> CASTING TYPE c.

ASSIGN lf_hex_gs TO <lfs_gs> CASTING TYPE c.

ASSIGN lf_hex_eot TO <lfs_eot> CASTING TYPE c.

lf_char_rs = <lfs_rs>.

lf_char_gs = <lfs_gs>.

lf_char_eot = <lfs_eot>.


" Master or single label

IF is_wahn-zzmastersingle = 'M'.

        lf_masterorsingle = 'M'.

ELSE.

        lf_masterorsingle = 'S'.

ENDIF.


CONCATENATE

'[)>' lf_char_rs

'06' lf_char_gs

'P' gv_kdmat lf_char_gs

'Q' gv_menge lf_char_gs

'V' gv_lifnr lf_char_gs

'D' gv_date_old lf_char_gs

  lf_masterorsingle gv_serial

  lf_char_rs lf_char_eot

INTO gv_pdf417.

If all goes well, then the variable gv_pdf417 should contain a string like the one below (the characters in the angle brackets are the hex codes for the control characters). In SmartForms the variable should be output in a text area with using the PDF417 barcode character formatting (your basis team will have to install it if it is not already available). The barcode at the top of page is generated from the string below.
tisha_dharod
Explorer
0 Kudos

Hi Renato

With above code suggested by you I am getting ## when scanned .

Could you please let me know how did you resolved this issue .

Thanks

tisha_dharod
Explorer
0 Kudos

Hello

I am facing similar issue .

Could you please let me know how did you resolve this issue .

Thanks

former_member611006
Active Participant
0 Kudos

Hi guys,

please define separators as follow:

DATA: 2d_record_separator     TYPE char01,
      2d_group_separator      TYPE char01,
      2d_end_of_transmission  TYPE char01.

2d_record_separator     = '$'.
2d_group_separator      = '^'.
2d_end_of_transmission  = '!'.

....

CONCATENATE
'[)>'                      " Format Header
2d_record_separator
'06'                       " Format Header
'12SGTLVWAG01'            
2d_group_separator
'2L'   gv_werk_empf       
2d_group_separator
'1L'   label_data-ablad   
2d_group_separator
       gv_license_plate   
2d_group_separator
'P'    label_data-kdmat   
2d_group_separator
'Q'    gv_vemng           
2d_group_separator
'B'    label_data-vhmku   
2d_group_separator
'V'    label_data-eikto   
2d_group_separator
'12S'  label_data-vbeln   
2d_group_separator
2d_record_separator
2d_end_of_transmission  INTO gv_pdf.

Regards,

David

Former Member
0 Kudos

I hope to help
The following steps had to do.


Se73

create bar code 417

smartstyles create

In smartforms create

2D-Barcode

                           VWBR

\0x5B\0x29\0x3E\0x1E06\0x1DF01001P\0x1D1JUN6000000160000002\0x1DV60000003\0x1D16K\0x1D6D60000004\0x1D2L60000005/60000006\0x1DB60000007\0x1DF02010I\0x1DP 60000008\0x1D4LBR\0x1D1T600000092P\0x1D14D60000010\0x1D7Q60000011PC\0x1D7Q6000001258\0x1E\0x04

tisha_dharod
Explorer
0 Kudos

Hi Renato

I have already configured bar code  and done all the above settings .

Thanks

tisha_dharod
Explorer
0 Kudos

Hi David ,

Now '$'. is printed as is instead if # .


Please suggest

Thanks

Tisha

former_member611006
Active Participant
0 Kudos

Hi Tisha,

separators are not printed, they appears if you scan the barcode
.
What's the result of your scan?

Regards,

David

Former Member
0 Kudos

Hi Tisha.

This code only worked when typed directly into SmartForms .
You can send me a print bar code and its SmartForms ?


Regards.

Former Member
0 Kudos

Hello David,

I have searched the SDN for this query but have not found any satisfactory answer for the human readable text when a 2D barcode is scanned on a label.

My requirement is that when my label is scanned using a barcode scaner, the scanner should read the data as

'Sales Order' 'Tab'(space between the two field values)'Serial Number' and should also be displayed under the 2D barcode. I have checked the separators but not sure how it can be used.

Help will be highly apreciated.

Thanks.

Regards,

Rasika

gautam_totekar
Active Participant
0 Kudos

HI.

Did you find any solution. I have same issue

former_member196079
Active Contributor
0 Kudos

Hi

you should delete dthe '/' from the constats,

for example


c_gs   VALUE '\0X1D',  

is right that scan found the / beacuse in the cancatenate this char is present.

regards

Macro

former_member611006
Active Participant
0 Kudos

Hi,

these constants are Hexadecimal, so I have to give '\0xAA' to interprate the value AA as Hex.

Regards,

David

former_member196079
Active Contributor
0 Kudos

Hi

so maybe the scan can't read the hexadecimal code.....

regards

Marco