On your Part 1, retcode is used to pass back whether the report has terminated successful, with warning or errored. (I forget the numbers, but it will be in the developers guide for e-Business suite), errbuff is used to pass any error message you need the end user to see.
On part 2 fnd_file.put_line is the Oracle e-Business equivalent of dbms_output.put_line, so yes, it will write the XML in either the log or output area.
Is this all you needed?
thanks for your reply and clearing point 1.
In point 2, I have pasted a part of the code with a loop which was given in the link I have provided.
I am not able to understand why this loop is used even after taking the entire xml data into a clob variable l_result before writing the xml to log.
I would be thankful to you if you can throw some light on this loop part of the code.
Hi 32000 in the code is a 'safe' size smaller than the max available 32767, the loops purpose is to move through the entire thing in chunks that will be manageable in the limits of the data type.
Btw; if you are in Oracle e-business suite then you can also use Oracle reports very simply to create XML output.
If you have reports developer all you need to do is put raw sql (without any 'artifice' to create XML) in the report SQL and then set the reports output to XML in the program definition in Oracle e-business.
thanks for helping me to understand the code.
Yes I know that in Oracle EBS we can generate the XML file lot more easier with the help of RDF and that's the way I have been generating all the required reports so far .
But I wanted to learn an alternate way for doing the same.