Skip to Content

how to generate one pdf page for every new customer?

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    Jan 13, 2015 at 09:06 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 13, 2015 at 05:52 AM

    Hi

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

    Regards,

    Prakash.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 13, 2015 at 06:15 AM

    This message was moderated.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 13, 2015 at 07: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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 13, 2015 at 08: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!!!😭

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member gunjan singh

      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