cancel
Showing results for 
Search instead for 
Did you mean: 

tab between two fields in barcode printing

Former Member
0 Kudos
  • Hi SAP guru's

            I want to print barcode with two fields separated by tab space .I used below code for achive this .But in smartforms tab value show '#' symbol.

How to clear this probelm.

DATA:bar TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.

DATA:test1 TYPE char10 VALUE 'TEST1'.

DATA:test2 TYPE char10 VALUE 'TEST2'.

DATA:test TYPE char20.

CONCATENATE test1 test2 INTO test SEPARATED BY bar.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Below method will do 100%.

Resolved this issue myself. Used '\0x09' to concatenate tab space between two fields. Moreover think this will work only in 2D bar coding (PDF 417).

Example:

Data: test1 type char5 value 'TEST1',

           test2 type char5 value 'TEST2',

           test  type char15.

 

concatenate test1 '\0x09'  test2 into test.        " Use lowercase 'x'

Finally if you pass the string test to smartforms with bar code character type created in transaction SE73, bar code will be generated.

Thanks to all,

Answers (1)

Answers (1)

gouravkumar64
Active Contributor
0 Kudos

Hi,

Try like this,

REPLACE ALL OCCURRENCES OF bar in <string> with space.

after this

DATA:bar TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.


Gourav.

Former Member
0 Kudos

If we replace with space the output will be like this 'Test Test' . This is not a tab space .Customer wants tab space between two fields.

Former Member
0 Kudos

Hi,

Can you try with hexadecimal constant with value '09'.

Data: test1 type char10 value 'TEST1',

         test2 type char10 value 'TEST2',

         test type char20.

constants: co_tab type x value '09'.

concatenate test1 test2 into test separated by co_tab.

Hope this works.

Thanks

Harsha