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

SAPSCRIPT - File Copy

Former Member
0 Likes
676

How Do Everyone!

I am about to embark on a development request which I

need someones kind advice.

We have a customised transaction which calls a SAPSCRIPT

which produces an invoice. These invoices are held in

separate spool files which are printed off via SP02.

What I need to do is as well as writing to the spool file

I also need to write to a text file. Everything that

appears on the invoice needs also to be in this new text

file. This new text file will then be imported into a

separate document management system.

Any ideas or suggestions would be gratefully appreciated.

Cheers

Andy

5 REPLIES 5
Read only

Former Member
0 Likes
652

I'd look at the ABAP driver program that controls the SAPscript. Compare what it feeds to the forms (structures and tables) and then write whatever information you want to a file.

Read only

Former Member
0 Likes
652

Hi Andy,

In your print program :

you can pass the required information in to an internal table and then use "DATA SETS" to transfer the data in to a file on application server or separate document management system.

Regards,

Lanka

Read only

Former Member
0 Likes
652

Hi Andy,

I think in your driver program declare an internal table which has the information you want in the text file and download it onto the Application server using

OPEN DATASET <FILENAME> FOR OUTPUT IN TEXT/BINARY MODE.

Read only

Former Member
0 Likes
652

Hi Andy,

Another simple method could be to record a BDC for your transaction and then call it form inside of your program after the output has been issued. You can record this BDC for SP02 where you select the relevant line item and display its contents using the "Display Contents (F6)" button. Then you can download this text to a local file throught the menu path "Spool Request -> Forward -> Save to Local File..." and specify the path through your BDC.

Hope this helps,

Regards,

Madhur

NB: Please do award points if found helpful

Read only

0 Likes
652

Thanks Madhur, that really helped a lot.

Perhaps I didn't really explain myself properly when I

mentioned a file. If you imagine a PDF output for each

invoice then that is the type of file I was talking about.

Thanks

Andy