01-13-2015 4:13 AM
I have a requirement that i have to send customer ledger output in pdf. for this we will be creating a back ground job to execute customer ledger report. and now i need to convert each customers ledger into pdf and have to send a mail to them with this attachment . but my problem is if u take the spool request it will give all the customers data into a single spool. but i want it in single single page. pls help
01-13-2015 9:06 AM
hey,
thanxs guys, i got the solution..
thanku very much.
i.e.
on change of customer number.
new-page.
endon.
thankyou
01-13-2015 5:52 AM
Hi
Try to submit one customer at a time and generate a spool for each customer and send it.
Regards,
Prakash.
01-13-2015 6:08 AM
hey, thanxs for replying,
but how to submit one customer at a time in background?? can u give any code to demo on it.
01-13-2015 6:20 AM
Hi Gunjan,
How are you generating the Ledger for the Customers,?
is it Smartforms?
Regards.
Praveer.
01-13-2015 6:27 AM
01-13-2015 6:15 AM
01-13-2015 6:26 AM
i got only for one customer but i want it for every new customer it will create a new page.
01-13-2015 6:44 AM
Hi Gunjan,
If i suggest, a very simple approch to solve your requirement.
Create a New Program with Customer No as Input to display the Ledger Information.
And call this Program inside your main program, so whenerver, the secondary program will execute, it will generate a new Spool with respect to customer no.
Regards.
Praveer.
01-13-2015 6:51 AM
hi,
in that case i want to see your internal table str and data .so that i can give more accurate soln.
Please share data & str.
01-13-2015 7:17 AM
01-13-2015 7:37 AM
in that case it's better to move smartform ,
why?
Gather all your data to internal table.
Dummy logic
gt-final_tmp = gt-final.
sort gt-final_tmp.
delete duplicate gt-final_tmp comparing kunnr
loop at gt-final_tmp
loop at gt-final where kunnr = gs-final_tmp-kinnr
gather all data wrt to one customer.
send your data to smart form customer
send mail to customer.
then process next customer so that each mail send to one respective customer.
Regards,
Swadhin
01-13-2015 8:45 AM
01-13-2015 8:14 AM
Hello Gunjan
One thing what you can do is, split the pdf( if you have fixed number of pages for one customer ).
For example, If you have 1 page for every customer. You need loop the final OTF data internal table until you find page first page break command. get the otf data for first page into separate internal table and convert the OTF data to PDF and mail that pdf as attachment.
For second customer you can start your loop on main OTF data with next sy-tabix until you find next page break command. Again do the same thing.
Hope it is clear!!!
01-13-2015 8:44 AM
Hey,
it is not fixed that every customer has only one page data... it's like if one customer data is more than one page then it will go to the second page also and it will also show in continue of first page....
01-13-2015 8:50 AM
Hello Gunjan
Try analyzing the pattern of OTF data in your internal table.
Run your report in foreground for limited customers and check the pattern of OTF data in debugging mode. Try to figure out any odds which can help you to split the OTF data.
Regards
Sreedhar
01-13-2015 9:06 AM
hey,
thanxs guys, i got the solution..
thanku very much.
i.e.
on change of customer number.
new-page.
endon.
thankyou
01-14-2015 6:27 AM
01-14-2015 6:40 AM