cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hi all,

we have to create a new AdobeForm containing a DataMatrix barcode with the following special characters:

GS = group separator = hex 1D or decimal 29

RS = record separator = hex 1E or decimal 30

EOT = end of trnasmission = hex 4 or decimal 4

The content could be something like this (placeholders replaced by the special separator sign):

[)>RS06GS2K200612542GSP1068420081GSRSEOT

Please, can anybody tell me how to include these separators into my barcode data?

Thanks

Thorsten

0 Likes
View Entire Topic
thorsten_muller
Explorer
0 Likes

Hi!

Any news on this one?

Thanks!

Thorsten

Former Member
0 Likes

Hi Thorsten,

you must convert to hex barcode values:

Example for seperator / prefix

constants:

begin of gcs_2dbc_gen_c,

   prefix(15) type c value '[)>\0x1E06\0x1D',

   seperator(5) type c value '\0x1D',

   suffix(10) type c value '\0x1E\0x04',

end of gcs_2dbc_gen_c,

begin of gcs_2dbc_gen,

   prefix(15) type x value '5B293E5C3078314530365C30783144',

   sep(5) type x value '5C30783144',

   suffix(10) type x value '5C307831455C30783034',

end of gcs_2dbc_gen.

Kind regards

Dietmar Blome

Former Member
0 Likes

Hi Dietmat Blome,

Could you please explain  bit more by providing  a sample driver for  implementing the datamatrix barcode?

A sample program will be of great help.

Thanks

Anand

Former Member
0 Likes

Hello Anand,

here is a little description for barcode sap implementation  (ZEBRA printing):

Example for type of printer: ZEBRA ZM400

Install Zebra Driver in SAP:

ZEBRA/BAR one Printer and Adjusting its Co-Ordinates

http://scn.sap.com/docs/DOC-10347

ZPL Command (see program guide for ZPL):

Data Matrix Bar Code

^BX

Data Matrix Bar Code

Description The ^BX command creates a two-dimensional matrix symbology made up of

square modules arranged within a perimeter finder pattern.

The ability to create a rectangular Datamatrix bar code is not available as a ZPL coding option.

Format ^BXo,h,s,c,r,f,g

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0debfc6-138c-2d10-718e-85ddc787c...

Example Code for special separators:


FORM 2D_BARCODE_AUFBEREITEN  USING    PS_WA_2DBARCODE_DAT
                                      PV_HEX_KZ
                             CHANGING PV_2DBARCODE TYPE CHAR255.

  CONSTANTS:
        LC_FORMAT_TRAILER  TYPE X VALUE '1E00',
        LC_FORMAT_SUFFIX   TYPE X VALUE '1E04',
        LC_FIELD_SEPARATOR TYPE X VALUE '1D00',
        LC_MESSAGE_TRAILER TYPE X VALUE '0400',
        LC_MESSAGE_PREFIX(7)  TYPE X VALUE '5B293E1E30361D'.
  DATA: LV_STELLE       TYPE I,
        LV_LENGTH       TYPE I,
        LV_TEXT_X(2)    TYPE X.
  DATA: LV_PREFIX_C   TYPE CHAR50.
  DATA: LV_FORMAT_SUFFIX_C TYPE CHAR50.
  DATA: OFF TYPE I.
  DATA: LV_SUFFIX_C(10) VALUE '\0x1E\0x04'.
  DATA: LV_SEPARATOR_C(5) VALUE '\0x1D'.
  DATA: LV_SEPARATOR_C_NEW(2).
  DATA: Z_PS_WA_2DBARCODE_DAT TYPE CHAR255.

  CALL FUNCTION 'ZBIN_TO_TEXT'
    EXPORTING
      FI_HEX  = LC_MESSAGE_PREFIX
    IMPORTING
      FE_CHAR = LV_PREFIX_C.
  CALL FUNCTION 'ZBIN_TO_TEXT'
    EXPORTING
      FI_HEX  = LC_FIELD_SEPARATOR
    IMPORTING
      FE_CHAR = LV_SEPARATOR_C_NEW.
  CALL FUNCTION 'ZBIN_TO_TEXT'
    EXPORTING
      FI_HEX  = LC_FORMAT_SUFFIX
    IMPORTING
      FE_CHAR = LV_FORMAT_SUFFIX_C.

  FIND FIRST OCCURRENCE OF LV_SEPARATOR_C IN PS_WA_2DBARCODE_DAT
  MATCH OFFSET OFF.

  CONCATENATE LV_PREFIX_C PS_WA_2DBARCODE_DAT+OFF
  INTO Z_PS_WA_2DBARCODE_DAT.

  REPLACE ALL OCCURRENCES OF LV_SEPARATOR_C IN Z_PS_WA_2DBARCODE_DAT
          WITH LV_SEPARATOR_C_NEW.
  REPLACE ALL OCCURRENCES OF LV_SUFFIX_C IN Z_PS_WA_2DBARCODE_DAT
          WITH LV_FORMAT_SUFFIX_C.

  LV_LENGTH = STRLEN( Z_PS_WA_2DBARCODE_DAT ).

  DO LV_LENGTH TIMES.

    CALL FUNCTION 'SCMS_TEXT_TO_BIN'
      EXPORTING
        TEXT_LINE = Z_PS_WA_2DBARCODE_DAT+LV_STELLE(1)
      IMPORTING
        BIN_LINE  = LV_TEXT_X
      EXCEPTIONS
        FAILED    = 1
        OTHERS    = 2.
    IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
*
    IF LV_TEXT_X = LC_FORMAT_TRAILER.
      CONCATENATE PV_2DBARCODE '\1E'
                  INTO PV_2DBARCODE.
    ELSEIF LV_TEXT_X = LC_FIELD_SEPARATOR.
      CONCATENATE PV_2DBARCODE '\1D'
                  INTO PV_2DBARCODE.
    ELSEIF LV_TEXT_X = LC_MESSAGE_TRAILER.
      CONCATENATE PV_2DBARCODE '\04'
                  INTO PV_2DBARCODE.
    ELSE.
      CONCATENATE PV_2DBARCODE Z_PS_WA_2DBARCODE_DAT+LV_STELLE(1)
                 INTO PV_2DBARCODE.
    ENDIF.
    ADD 1 TO LV_STELLE.
  ENDDO.


ENDFORM.                    " 2D_BARCODE_AUFBEREITEN

Kind Regards

Dietmar Blome

Former Member
0 Likes

Hi Dietmar,

Is this solution for smartforms or for the adobe livecycle solution?

Thank you,

Dider

Former Member
0 Likes

Hello Dider,

yes this solution is also for ADS (Adobe Document Service).

Kind Regards

Dietmar

Techouest_B
Explorer
0 Likes

Hi Dietmar,

and about your Function ZBIN_TO_TEXT

how is it inside ?

Thank You

François

  

Former Member
0 Likes

Hello Francois,

see  attachment and SAP Package SCMS with Modul "SCMS_BIN_TO_TEXT"!

Kind Regards

Dietmar

Techouest_B
Explorer
0 Likes

Great Dietmar !

as I work on ECC I'll use function SCMS_BIN_TO_TEXT

Best Regard

François

Former Member
0 Likes

Hello Dider,

Did you find the solution for this.we are having same problem.

Techouest_B
Explorer
0 Likes

Hello Guruprasad,

You can use Dietmar's Solution it works fine.

François