Skip to Content
author's profile photo Former Member
Former Member

New Page in Adobe Forms

Hi,

I am writing a program to call adobe form, to print all customer details .

Input selection : Customer Number

When the user inputs multiple customers and run the report, it should create a new page for every new customer, displays customer details, kna1 data, knb1 data and more..

How can i achieve this functionality, do i need to control this in the program level or form level.

if i do it at the program level, it is overwriting the form and displaying the last entry. I need to display all the customers data in one pdf file, each customer should start at new page.

Any help would be really appreciated.

Thanks,

Kumar

Add a comment
10|10000 characters needed characters exceeded

Related questions

7 Answers

  • Posted on Dec 06, 2011 at 07:15 PM

    Only call the Close function module once all Customers have been processed.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 06, 2011 at 07:47 PM

    Loop through all your customers calling the "Print" function module for each new customer. Then call the FP_JOB_CLOSE function. This will give you a new report for each customer.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      I wrote the below code. I am still getting only one output, the last page.

      CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'

      EXPORTING

      i_name = 'ZFI_CUST''

      IMPORTING

      e_funcname = fm_name.

      IF sy-subrc <> 0.

      WRITE : 'Exit at FP_FUNCTION_MODULE_NAME'.

      EXIT.

      ENDIF.

      *fp_outputparams-bumode = 'M'.

      CALL FUNCTION 'FP_JOB_OPEN'

      CHANGING

      ie_outputparams = fp_outputparams

      EXCEPTIONS

      cancel = 1

      urge_error = 2

      system_error = 3

      internal_error = 4

      OTHERS = 5.

      LOOP AT it_kna1 INTO wa_kna1.

      REFRESH t_bsid.

      LOOP AT it_bsid INTO wa_bsid WHERE kunnr = wa_kna1-kunnr.

      MOVE wa_bsid TO w_bsid.

      APPEND w_bsid TO t_bsid.

      ENDLOOP.

      IF t_bsid[] IS NOT INITIAL.

      CALL FUNCTION fm_name

      EXPORTING

      • /1BCDWB/DOCPARAMS =

      t_kna1 = it_kna1

      t_bsid = t_bsid

      • IMPORTING

      • /1BCDWB/FORMOUTPUT =

      EXCEPTIONS

      usage_error = 1

      system_error = 2

      internal_error = 3

      OTHERS = 4

      .

      IF sy-subrc <> 0.

      • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

      • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

      ENDIF.

      ENDIF.

      ENDLOOP.

      CALL FUNCTION 'FP_JOB_CLOSE'

      EXCEPTIONS

      usage_error = 1

      system_error = 2

      internal_error = 3

      OTHERS = 4.

  • Posted on Dec 06, 2011 at 09:03 PM

    This should work. The only thing I see that you are doing differently than what we are doing is that you may want to set up some of the fp_outputparams variables.

    Such as :

    fp_outputparams-device = 'PRINTER'

    fp_outputparams-nodialog = 'X'

    fp_outputparams-dest = "Your printer definition"

    fp_outputparams-reqnew = 'X'

    fp_outputparams-preview = 'X' if you want preview your output before printing

    If this doesn't work then the problem might be in your form definition

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Do you get all pages in a single pdf. I noticed that i am getting a pdf file for every customer, i can see them by clicking on a button >| (i.e. Last Document on the PDF file). How can i get all the customer outputs in a single pdf .

  • Posted on Dec 06, 2011 at 10:12 PM

    OK. I think I understand what you are looking for now.

    This isn't something that I've done before but I assume that you will have to pass all the cutomers to the form then in the form set up a conditional break to force a new customer to a new page.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks. I am able to Page break, go to next page using conditional break. I have another problem now. How would i get the customer no and customer address data before the loop. Since i have all the customer data in bsid table. Could you tell how to design this form.

      My design is

      Customer No: Customer Address:

      This area comes from loop data.

      BSID: Open Items Table Data

  • Posted on Dec 07, 2011 at 07:28 PM

    Pass the customer number and the customer address in your table then create an address node in your context and bind that to your form layout.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks alot for the help. Form looks much better now. I need a suggestion for printing the totals in footer. I have to display the subtotals calculated in the loop at the end of the page. I thought of putting the footer in main window, after the loop. This is not coming at the end of loop. It shows up after all the entries in the loop are finished.

      How can i display the subtotals calculated in the loop print at the end of the page. I have to do this for every customer. If i have only one customer, probably i can do that at program level.

      Input Selection.

      Customer Numbers

      Output Format is

      Custom Address Customer No

      Loop of BSID ENTRIES

      Footer: Subtotal of BSID-WRBTR Values at the end of the page (Almost at the bottom of the page).

  • Posted on Dec 08, 2011 at 08:44 PM

    One way that I have dealt with this is to create a table of subtotals by customer and pass that in the interface.

    Then in the context of the form create a control level on the BSID table and specify the customer number as the control.

    Then on the BSID table in the context create a Single Record specifing the table of subtotals that you created. On this Single Record definition create a With Key Conditions by linking the customer number on the BSID table and the customer number of the subtotal table.

    In the form definition create a subform with the fields you want to display from the subtotal table. These subtotals will be related to the customer you are displaying because of your work in the context.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks for the help. One more problem, i am getting the footer on every page. I want to print footer only on the last page of each customer. Could you please suggest me how can i achieve this functionality.

  • Posted on Dec 09, 2011 at 06:28 PM

    Check out this blog by Ben Patterson. It works great

    link: Adobe Forms: Fancy Footwork – Footer floating at the bottom of the page

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Thanks alot for the help. Form looks much much better now. only problem i am looking at now is, when there are more line items in BSID, it overflows to next page. In the next page, i am not getting customer address and customer number. How can i able to do that.

      My design is

      Customer No: Customer Address:

      This area comes from loop data.

      BSID: Open Items Table Data

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.