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

Printing files...

david_fryda2
Participant
0 Likes
1,412

Hi,

I would like to print several files.

I do not want to send them separatedly to the printer : I want to send them as one job and send this job to the printer ?

Is it possible ?

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

athavanraja
Active Contributor
0 Likes
1,294

is it front end files or files stored in the application sever?

Regards

Raja

is it front end files or files stored in the application sever?

Regards

Raja

11 REPLIES 11
Read only

Vinod_Chandran
Active Contributor
0 Likes
1,294

From where are you printing?

Is it a SAPScript?

Vinod

Read only

Former Member
0 Likes
1,294

Assuming you want to combine the output of separate programs or multiple runs of the same program, you can write a program that submits the programs, exports the list to memory and returns. You then use FMs LIST_FROM_MEMORY and WRITE_LIST to write the separate lists.


data: begin of listobject occurs 0.
        include structure abaplist.
data: end of listobject.

      submit zftest
             with fyear    = fyear
             etc...
             exporting list to memory
             and return.
      call function 'LIST_FROM_MEMORY'
           tables
                listobject = listobject
           exceptions
                not_found  = 1
                others     = 2.

      call function 'WRITE_LIST'
           tables
                listobject = listobject
           exceptions
                empty_list = 1
                others     = 2.

I'm not entirely sure what you are trying to do. If this isn't what you want, please elaborate your requirements.

Rob

Read only

athavanraja
Active Contributor
0 Likes
1,295

is it front end files or files stored in the application sever?

Regards

Raja

Read only

0 Likes
1,294

Hi everyone,

Thanks for al the reply.

I am talking about files that are on the localhost.

I am trying your solution.

Thanks a lot.

Read only

0 Likes
1,294

what you can do is use the class/method

cl_gui_frontend_services=>execute method to print.

                                                     CALL METHOD cl_gui_frontend_services=>execute
  EXPORTING
    DOCUMENT               = <location of the document> djfkd/fdf/fdfd/txt'

    OPERATION              = 'PRINT'
                           

this you can call it in a loop.

Regards

Raja

Read only

0 Likes
1,294

Hi everyone,

I am really new at ABAP programming and I am getting dificulties to understand all this stuff.

Lets say I have 5 files to print. I do not want to send 5 files to the printer separatly. I want to create 1 job that contains all these files. And when this job is ready, I send it to the printer.

Those files are located on my local host and not a server machine.

Thanks a lot.

Read only

0 Likes
1,294

My guess is that you want to do it from a portal application, if yes.

develop a RFC function module in ABAP which would take the file path as parameters(table -so that you can supply multiple files).

within the function use the method i have mentioned earlier to do the job.

this RFC you can easily call from your java application.

Regards

Raja

Read only

0 Likes
1,294

Thanks a lot for your help..it really helps.

Nice day.

Read only

0 Likes
1,294

Hi again,

Last thing : Does cl_gui_frontend_services=>execute

exists in SAP/R3 4.6c version ?

Thanks.

Read only

0 Likes
1,294

sorry i can't confirm that as i dont have 4.6c system, i work in a 4.7 system.

in case if you dont find it in 4.6c system. you can use FM WS_EXECUTE which can do the same job.

Regards

Raja

Read only

0 Likes
1,294

Hi,

The method execute doesn't exist with parameter "operation".

I tried to use to WS_EXECUTE...it does print : it opens the file but do not close the file after printing.

Is there an option to close automatically the file after printing ?

Thanks.