Application Development 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: 

how to generate one pdf page for every new customer?

gunjan_singh
Explorer
0 Kudos

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

1 ACCEPTED SOLUTION

gunjan_singh
Explorer
0 Kudos

hey,

thanxs guys, i got the solution..

thanku very much.

swadhin ghatuary gave the rite answer...

i.e.

on change of customer number.

new-page.

endon.

thankyou

17 REPLIES 17

prakashjasti
Contributor
0 Kudos

Hi

Try to submit one customer at a time and generate a spool for each customer and send it.

Regards,

Prakash.

Prakash J

0 Kudos

hey, thanxs for replying,

but how to submit one customer at a time in background?? can u give any code to demo on it.

0 Kudos

Hi Gunjan,

How are you generating the Ledger for the Customers,?

is it Smartforms?

Regards.

Praveer.

0 Kudos

no i am writing the code. it's not the smartform

former_member182915
Active Contributor
0 Kudos

This message was moderated.

0 Kudos

i got only for one customer but i want it for every  new customer it will create a new page.

0 Kudos

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.

0 Kudos

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.

0 Kudos

HI ,

PLEASE CHECK THE NEW PAGE IN top of page event.

former_member182915
Active Contributor
0 Kudos

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

0 Kudos

i don't want it into the smartform.

0 Kudos

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!!!

0 Kudos

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....

0 Kudos

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

gunjan_singh
Explorer
0 Kudos

hey,

thanxs guys, i got the solution..

thanku very much.

swadhin ghatuary gave the rite answer...

i.e.

on change of customer number.

new-page.

endon.

thankyou

0 Kudos

Hi Gunjan,

Where is my point

0 Kudos

i marked ur answer as helpful. u deleted....