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

Print a file on application server

0 Likes
1,109

Hi Experts,

Is there any function module to print a file on application server ? If not, how can I print a file using abap.

<<removed by moderator>>

Thanks.

Patrice.

Hi Experts,

Is there any function module to print a file on application server ? If not, how can I print a file using abap.

<<removed by moderator>>

Thanks.

Patrice.

5 REPLIES 5
Read only

Former Member
0 Likes
1,034

Hi,

As per my knowledge we have download that file into applecation server and sent to externalmail or print whatever it is we can do.

Regards

ranga

Read only

Former Member
0 Likes
1,034

You will have to use the OPEN DATASET and READ DATASET ABAP commands to read the file from the AP server into an internal table. From there, you can print it.

Rob

Read only

0 Likes
1,034

Thanks for your answers.

Rob,

The file is a PDF. When I read the file by the commands READ DATASET ABAP the internal table contains unreadable characters.

How can I print it.

Patrice.

Read only

Former Member
Read only

Former Member
0 Likes
1,034

Tyr this.

DATA : BEGIN OF itab OCCURS 0,
        test(200) TYPE c,
        test1(200) TYPE c,
        test2(200) TYPE c,
       END OF itab.

DATA : p_file(11) TYPE c VALUE 'test_sharat'.
DO 3 TIMES.
  itab-test = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX50'.
  itab-test1 = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX100'.
  itab-test2 = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX50'.
  APPEND itab.
  CLEAR itab.
ENDDO.

OPEN DATASET p_file FOR OUTPUT IN TEXT MODE.
IF sy-subrc EQ 0.
  LOOP AT itab.
    TRANSFER itab TO p_file.
  ENDLOOP.
ENDIF.
CLOSE DATASET p_file

Regards

Sharat