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

Problem with converting spool file into a text file.

Former Member
0 Likes
2,587

Hello all,

We have a requirement to send out spool files generated out of invoices to a 3rd party printing house (who prefer to get the file in a CSV,TXT,XLS format, not PDF). The bespoke ABAP program writes invoice data from individual spools into a text file and adds a Header line for each invoice.

This passes through the SAP standard module RSPO_RETURN_SPOOLJOB, where the RAW format is converted. There are OSS notes on this FM as some formats like EXT and BCS give a dump - none of the notes can help with the issue.

However, I am not able to get the correct formatting of the invoice data when the spool is saved as a text file - the alignment of columns is lost, and it looks more 'compressed' than what you see via SP01.

We use SAP Script to format data, and tried to tweak it to work, but it does not help.

Any help to resolve this gratefully received.

Thanks,

Pramod

Edited by: pgokhale on Apr 13, 2011 11:39 AM

Hello all,

We have a requirement to send out spool files generated out of invoices to a 3rd party printing house (who prefer to get the file in a CSV,TXT,XLS format, not PDF). The bespoke ABAP program writes invoice data from individual spools into a text file and adds a Header line for each invoice.

This passes through the SAP standard module RSPO_RETURN_SPOOLJOB, where the RAW format is converted. There are OSS notes on this FM as some formats like EXT and BCS give a dump - none of the notes can help with the issue.

However, I am not able to get the correct formatting of the invoice data when the spool is saved as a text file - the alignment of columns is lost, and it looks more 'compressed' than what you see via SP01.

We use SAP Script to format data, and tried to tweak it to work, but it does not help.

Any help to resolve this gratefully received.

Thanks,

Pramod

Edited by: pgokhale on Apr 13, 2011 11:39 AM

8 REPLIES 8
Read only

Former Member
0 Likes
1,856

Which program/transaction are you using to generate the output ?

Read only

0 Likes
1,856

Hi Anup,

Thanks for getting back.

We are using a bespoke print program (with SAP script) and output type to generate the output. The spool request gets generated automatically once the invoice is saved to the database.

Thanks,

Pramod

Read only

0 Likes
1,856

I encountered a similar situation while creating the output from F.27 / Program RFKORD11. The solution that was found was

that the standard report was copied as a custom and output ( Which was T_PDF_TAB )

CALL FUNCTION 'CONVERT_OTF'
           EXPORTING
             FORMAT                      = 'ASCII'
            TABLES
              OTF                         = I_OTF
              LINES                       = T_PDF_TAB

was formatted as per the requirement and FM 'GUI DOWNLOAD ' was called to download the formatted output in text format.

Read only

0 Likes
1,856

Hi Anup,

Many thanks for the prompt reply.

Please note that we are already using FM CONVERT_OTF already as part of RSPO_RETURN_SPOOLJOB. It picks up spool data in layout form, converts it to OTF with spacing as required etc, and then converted data is passed to CONVERT_OTF. But the text file that gets generated is NOT an exact replica of the spool file and that's where the problem is.

Thanks,

Pramod

Read only

0 Likes
1,856

That is what exactly i am trying to say. If your spool output doesn't match your text field output in terms of spacing and all

then you have to format the text output.

Read only

0 Likes
1,856

Thanks Rudolf and Anuj, the developers are currently investigating...

Read only

0 Likes
1,856

Hi Pgokhale!!!

Searching information in SDN forums I've found exactly the problem I have in your thread, please, can you help me if you solve the issue with the formatting text when you transfer a spool order into txt file? I'm having the same problem, the file I get and sent by attachment is not equal to the one that is in the spool order.

Please, help me, I'm getting crazy with this issue...

Thanks a lot, have nice day and happy new year.

Rebeca

Read only

Former Member
0 Likes
1,856

Hi,

Try to have a look at report: RSPO0047 . You can use this report to save spool data to a local file.

You can check the code and see how it is done which might be helpfull for you.

Cheers,

Roelof