cancel
Showing results for 
Search instead for 
Did you mean: 

string to spool

adhilramruthan
Explorer
0 Kudos

Good day

I have a requirement to merge multiple XML files from the spool into one XML file.

I managed to get all the files merge into a string but I am unable to write the string to the spool.

The function modules RSPO_SR_WRITE and RSPO_SR_TABLE_WRITE dumps when i enter a string value so I convert string to TEXT but the text gets cut off at 255 characters which cuts off the tags which leads to a format error whilst trying to print.

Any suggestions as to how I can write a string to the spool?

Thanks

Adhil

Jelena
Active Contributor

What is the purpose of sending XML content to spool? Are you planning to print out XML? Sorry, the whole idea just doesn't make much sense to me the way it's described...

adhilramruthan
Explorer
0 Kudos

Theres a background job that calls program rsnast00 which will create multiple XML files for billing output types and sends it to an output device. These files are in the spool.The requirement is that I merge all the XML files in the spool into ONE file and send it to the output device. The output device is linked to an external party that reads the XML file which then does the neccessary processing and sends the print outs to customers.

My issue is that I cannot send the merge XML files as a string to the output device, I will have to write the string to a text which ends up splitting the tags in the XML and results in a formatting error.

Hence I'm looking for a function that allows a string to be sent to an output device.

matt
Active Contributor

Seems a bit strange. The spool is specifically a print spool.

You should configure your system so that for specific output types it generates the required output file and then sends it to the customer. You do not need to use the print spool as an intermediary.

For example, if the output type is email, it certainly doesn't go to the spool first.

adhilramruthan
Explorer
0 Kudos

The processing routine for the Output types are configured as print output using smart forms.

The output format for the smartform is XSF output and the output mode is Spool.

When rsnast00 is run for certain output types the smartform/ invoices get converted to XML and sent to a print server. In this case Multiple XML files and Spool I'd are created for one run.

Print server is an external company that send these invoices to the customers via web or email.

The requirement is that I merge the XML files for the different spools I'd and resend to the print server.

The other option is to configure the output types in NACE to combine all spool requests into one which I'm not sure how to do.

Accepted Solutions (0)

Answers (1)

Answers (1)

Patrick_vN
Active Contributor
0 Kudos

Have you considered splitting the string with the xml in such a way that each line of your resulting text table contains only one xml-element? And if the contents of an xml-element contain other xml-elements, in that case you could put the tags in separate lines.. like you get when using an xml-viewer:

<bookstore>
  <book category="children">
    <title>Harry Potter</title>
    <author>J K. Rowling</author>
    <year>2005</year>
    <price>29.99</price>
  </book>
  <book category="web">
    <title>Learning XML</title>
    <author>Erik T. Ray</author>
    <year>2003</year>
    <price>39.95</price>
  </book>
</bookstore>

That seems to be a workaround, unless you have tags that are longer than 255 characters of course..

Another option might be a "print as pdf" approach. A custom print report could collect the pdf data, gather it somewhere and add it together to create one big pdf, which then needs to be downloaded as xml.

adhilramruthan
Explorer
0 Kudos

Thanks, I did split the string so that each line has an XML element and I get a format error.

Do you have a sample code for splitting XML elements?

I will also try the 'Print as PDF' approach.

ArthurParisius
Contributor
0 Kudos

Try looking at FM /BDL/WRITE_XML for sample code.

adhilramruthan
Explorer
0 Kudos

Thanks,I copied the logic, all the tags were intact and not split up but I get the following message when outputing the file to the print server:

'Error converting data(output held) - filter error - zif_wrapper.sh: input XML corrupt, parsing error'