‎2005 May 09 9:36 AM
Hi Frens,
I am facing problem while assigning different reports one spool.
I am doing one selection report.
For each customer some different reports should be generated(more than 1 reportS).
All the reports assigned to each customer submitted to only one spool.
for each customer i want to create new spool.
Needed Help.
‎2005 May 09 9:46 AM
Hi Amitav,
There are a few options here:
1. From one central report per customer, SUBMIT the other reports with EXPORTING LIST TO MEMORY. You can then from the central report import the lists and write them out (and hence only 1 report does the writing and only 1 spool is generated).
2. Run the reports normally and then merge the spools yourself. See the function modules:
- RSPO_RETURN_ABAP_SPOOLJOB,
- RSPO_SR_OPEN
- RSPO_SR_WRITE
There is an example of these function modules being used in the following thread:
Hope that helps.
Please remember to acknowledge those who help you by using the points system (this includes the EDI stuff from earlier...
Cheers,
Brad
‎2005 May 09 9:46 AM
Hi Amitav,
There are a few options here:
1. From one central report per customer, SUBMIT the other reports with EXPORTING LIST TO MEMORY. You can then from the central report import the lists and write them out (and hence only 1 report does the writing and only 1 spool is generated).
2. Run the reports normally and then merge the spools yourself. See the function modules:
- RSPO_RETURN_ABAP_SPOOLJOB,
- RSPO_SR_OPEN
- RSPO_SR_WRITE
There is an example of these function modules being used in the following thread:
Hope that helps.
Please remember to acknowledge those who help you by using the points system (this includes the EDI stuff from earlier...
Cheers,
Brad
‎2005 May 09 7:51 PM
Amitav,
Here's a simple example of creating multiple spools within the same program.
Bruce
REPORT z.
*
data v_count(2) type n.
data v_text(30).
data: cover_text(68).
do 3 times.
add 1 to v_count.
concatenate 'LIST #' v_count into v_text.
concatenate sy-repid(8)'-' 'Spool' '-' v_count into cover_text.
new-page print on
destination 'LB9' "<<== my printer
receiver 'TJOSVOB'
cover text cover_text "<<== Title or Spool req. name
list name v_text
list dataset v_text
immediately ' ' " X means print now
keep in spool 'X' " X means keep spool
new list identification 'X'
no dialog .
write: / v_text.
new-page print off.
enddo.
‎2005 May 12 7:44 AM
Hi Brad ,
My req is The " selection report to customer".
I am passing " output type ( kschl) and date( erdat) "
i am collecting the objky info from nast table respective to 'v3' application area.
From nast , i am getting so many billing doc(objky).
taking the objky info , i am getting the respective vbpa-kunnr( customer ) details .
For each customer there are some detail reports assigned to it, which a am getting by calling FM "CLFM_SELECT_AUSP"
and passing the mafid , class type and customer number.
I am getting the customer details in table from the FM.
then i have to submit all these reports to one spool for this customer.
For another customer i should do the same proceedure to get the respective reports, and have to submit to another spool.
I am getting stuck here.
Regards ,
Amitav
‎2005 May 12 10:53 AM
Hi Amitav,
So why can't you use option 1 from my earlier post?
<i>1. From one central report per customer, SUBMIT the other reports with EXPORTING LIST TO MEMORY. You can then from the central report import the lists and write them out (and hence only 1 report does the writing and only 1 spool is generated).</i>
Please try to better explain where you are getting stuck.
Thanks,
Brad
‎2005 May 12 11:16 AM
To expand on my previous post:
As I understand it, you have in one program a list of customers for which you must submit reports that should only be in one spool.
So, what I would suggest is that for each customer you submit a batch job with a z program passing it the customer number.
In the z program you would select the reports for that customer using the function CLFM_SELECT_AUSP. Once you have the list of reports for that customer you could use SUBMIT ... EXPORTING LIST TO MEMORY, and then import the list using LIST_FROM_MEMORY. Then loop through the list and use write statements to write the list from the z program.
Thus, your z program would run once for each customer in a batch job, and it would produce one spool which would contain all the reports that need to be executed for that customer.
That should work fine yes?
Cheers,
Brad
Message was edited by: Brad Williams