Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

.PRN file

Former Member
0 Likes
2,423

Dear Friends,

I have a requirement in which i need to convert the contents of Internal Table to a .PRN file...

Can some one please guide me with any inputs on this ..

Is there any FM which can help me ..

5 REPLIES 5
Read only

Former Member
0 Likes
1,854

HI,

Try as shown below:

CALL FUNCTION 'WS_DOWNLOAD'

EXPORTING

FILENAME = 'c:\XYZ.prn'

FILETYPE = 'ASC'

TABLES

DATA_TAB = DISP_TAB3.

after executing your program you can check your file in DOS.

GOTO START--> RUN --> Type CMD

cd\

type XYZ.PRN

I think it will work.

or

CALL METHOD OF e_activesheet 'PrintOut'

EXPORTING

#1 = 1

#2 = 'True'

#3 = 'True'.

Read only

0 Likes
1,854

Hi .. This is simply creating a file with extension .PRN

which is not useful to me ..

.PRN file is a file which converts contents of any file into special Format which is in Printer readable format..

In other way if i want to print the contents on a file .. the format is .PRN

So the above code is really not useful .. is there any other way apart from this..

Read only

0 Likes
1,854

Hi all,

Guys after a lot of work around i found out the best possible solution with one of my Colleague.

Step 1. Go to zebra Designer and create the required format of Barcode.. and Say print to File. This will create a PRN file for u.

Step 2. Use this PRN file.. with FM GUI_Upload. this will copy the contents of your PRN file into the ITAB.

Step 3. Using this PRN file manipulate the contents.

Step 4. Download this PRN to Desktop using ws_download. Then simply execure this PRN file to the Zebra Printer. This will generate the Barcode for you.

For any help u can write to me.

Read only

0 Likes
1,854

Hi Jitesh, I am having samea requirement to convert the contents of Internal Table to a .PRN file. I am using FM - GUI_Download but not finding any PAGECODE to covert the file in .PRN format......

Please assist.....

Thanks.....

Read only

0 Likes
1,854
* TO convert the contents of PRN File into Internal table (I_FILE )
  CALL FUNCTION 'GUI_UPLOAD'
     EXPORTING
       FILENAME                      = 'C:\FINAL1234.PRN' "FILENAME
      FILETYPE                      = 'DAT'
*     HAS_FIELD_SEPARATOR           = ' '
*     HEADER_LENGTH                 = 0
*     READ_BY_LINE                  = 'X'
*     DAT_MODE                      = ' '
*     CODEPAGE                      = ' '
*     IGNORE_CERR                   = ABAP_TRUE
*     REPLACEMENT                   = '#'
*     CHECK_BOM                     = ' '
*     VIRUS_SCAN_PROFILE            =
*     NO_AUTH_CHECK                 = ' '
*   IMPORTING
*     FILELENGTH                    =
*     HEADER                        =
     TABLES
       DATA_TAB                      = I_FILE
*   EXCEPTIONS
*     FILE_OPEN_ERROR               = 1
*     FILE_READ_ERROR               = 2
*     NO_BATCH                      = 3
*     GUI_REFUSE_FILETRANSFER       = 4
*     INVALID_TYPE                  = 5
*     NO_AUTHORITY                  = 6
*     UNKNOWN_ERROR                 = 7
*     BAD_DATA_FORMAT               = 8
*     HEADER_NOT_ALLOWED            = 9
*     SEPARATOR_NOT_ALLOWED         = 10
*     HEADER_TOO_LONG               = 11
*     UNKNOWN_DP_ERROR              = 12
*     ACCESS_DENIED                 = 13
*     DP_OUT_OF_MEMORY              = 14
*     DISK_FULL                     = 15
*     DP_TIMEOUT                    = 16
*     OTHERS                        = 17
             .
  IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

  • to process ur PRN file.

loop at i_file.. 
endloop.

          • to download the prn file in C:

CALL FUNCTION 'WS_DOWNLOAD'
   EXPORTING
*   BIN_FILESIZE                  = ' '
*   CODEPAGE                      = ' '
     FILENAME                      = 'C:\Print.prn'
     FILETYPE                      = 'ASC'
*   MODE                          = ' '
*   WK1_N_FORMAT                  = ' '
*   WK1_N_SIZE                    = ' '
*   WK1_T_FORMAT                  = ' '
*   WK1_T_SIZE                    = ' '
*   COL_SELECT                    = ' '
*   COL_SELECTMASK                = ' '
*   NO_AUTH_CHECK                 = ' '
* IMPORTING
*   FILELENGTH                    =
    TABLES
      DATA_TAB                      = I_FILE_FINAL
*   FIELDNAMES                    =
* EXCEPTIONS
*   FILE_OPEN_ERROR               = 1
*   FILE_WRITE_ERROR              = 2
*   INVALID_FILESIZE              = 3
*   INVALID_TYPE                  = 4
*   NO_BATCH                      = 5
*   UNKNOWN_ERROR                 = 6
*   INVALID_TABLE_WIDTH           = 7
*   GUI_REFUSE_FILETRANSFER       = 8
*   CUSTOMER_ERROR                = 9
*   NO_AUTHORITY                  = 10
*   OTHERS                        = 11
            .
  IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.