cancel
Showing results for 
Search instead for 
Did you mean: 

Tab separation in string

Former Member
0 Kudos

Hi ABAP experts,

My requirement is to generate a barcode in PDF417 format with tab delimited string.

I have successfully configured barcode format PDF417 in SE73 and I can scan the string on to note pad file.

However i am facing challange in generating a tab delimited string. I searched lot on SDN and written below code.



CONSTANTS: lv_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.

    CONCATENATE
    wa_vbrk-bstnk_vf
    wa_j_1iexchdr-exnum
    datum
    st38
    vehno
    tot_amnt
    INTO
    barcode_string
    SEPARATED BY lv_tab.

but when i scan this on notepad or even on my sap transaction, it does not separate values by TAB . but instead displays '#'

the result is shown as

JOB/1911095#0010000000#06.04.201145

Kindly help

Accepted Solutions (1)

Accepted Solutions (1)

aidan_black
Active Contributor
0 Kudos

Hi,

For the TAB character in PDF417 barcode, you should use \0x09 in the barcode data. See the section on PDF417 in SAP note 645158.

regards,

Aidan

Former Member
0 Kudos

Hi Aidan

Thanks for the response; did solve the issue with the sap note itself.

Thanks & Regards

Praveen Dhankar

Former Member
0 Kudos

Hi Praveen,

i am also fcaing the same problem with barcode ..........,but i added \0x09 in barcode but it's not taking character \ ......

any solution.................

Regards,

suba.

Answers (1)

Answers (1)

Sandra_Rossi
Active Contributor
0 Kudos

Hi,

tabs can't be displayed in the debugger, SAP has chosen # as the replacement character for all non-displayable characters.

Have a look at the hexadecimal view of your data object and you'll see 09 or 0009 or 0900, which is the TAB code point in ASCII/Unicode.

Sandra

Former Member
0 Kudos

Hi sandra,

Thanks for your reply.

my problem is when i create output in barcode format PDF417 , it scans #.

I tried below little code.




DATA : string TYPE string.
DATA : filename TYPE string.
CONSTANTS: lv_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
DATA : it_string TYPE TABLE OF string.

CONCATENATE
'aniruddha'
'prashant'
'praveen'
'rajesh'
'kaustubh'
'mangesh'
'subodh'
'ritu'
INTO string
SEPARATED BY lv_tab.

APPEND string TO it_string.

filename = 'C:\Documents and Settings\Administrator\Desktop\12.txt'.

CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    filename                        = filename
  TABLES
    data_tab                        = it_string
 EXCEPTIONS
   file_write_error                = 1
   no_batch                        = 2
   gui_refuse_filetransfer         = 3
   invalid_type                    = 4
   no_authority                    = 5
   unknown_error                   = 6
   header_not_allowed              = 7
   separator_not_allowed           = 8
   filesize_not_allowed            = 9
   header_too_long                 = 10
   dp_error_create                 = 11
   dp_error_send                   = 12
   dp_error_write                  = 13
   unknown_dp_error                = 14
   access_denied                   = 15
   dp_out_of_memory                = 16
   disk_full                       = 17
   dp_timeout                      = 18
   file_not_found                  = 19
   dataprovider_exception          = 20
   control_flush_error             = 21
   OTHERS                          = 22
          .
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.


CALL FUNCTION '/1BCDWB/SF00000092'
  EXPORTING
    string                     = string
 EXCEPTIONS
   formatting_error           = 1
   internal_error             = 2
   send_error                 = 3
   user_canceled              = 4
   OTHERS                     = 5
          .
IF sy-subrc <> 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.

First I downloaded the string to text file,

it displayed output as

aniruddha prashant praveen rajesh kaustubh mangesh subodh ritu

then I printed it on using a smart form in Barcode .

when i scan the barcode it shows as below

aniruddha#prashant#praveen#rajesh#kaustubh#mangesh#subodh#ritu

Sandra_Rossi
Active Contributor
0 Kudos

Okay, sorry. It's not about the ABAP code, but about the output device/device type used (configuration in SPAD transaction). The device type has a character set for which the TAB code point is not defined, so SAP uses # instead.

So you should indicate which device type you use, and if it's not standard, which character set it uses, ..., and which exact printer model it is.

You may check also by yourself if the character set (named code page in other of SAP) has a corresponding code point assigned to TAB (09). Start transaction SCP, enter the code page, the character U0009, keep only display level "code", and execute, there must be one line, otherwise this code page has no assignment to U0009 so it is converted into #.

To know in which code pages U0009 has a code point defined, select initial node "character", direction "used in", character U0009, display level "code page" only, and display as a hierarchy. Then try to see which one could be the best for your printer model (table TSP0A, field CPCODEPAGE).

Sandra