cancel
Showing results for 
Search instead for 
Did you mean: 

New Page in Adobe Forms

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (7)

Answers (7)

Ratherfish
Explorer
0 Kudos

Check out this blog by Ben Patterson. It works great

link:

Former Member
0 Kudos

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

Ratherfish
Explorer
0 Kudos

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.

Former Member
0 Kudos

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.

Ratherfish
Explorer
0 Kudos

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.

Former Member
0 Kudos

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

Ratherfish
Explorer
0 Kudos

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.

Former Member
0 Kudos

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

Ratherfish
Explorer
0 Kudos

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

Former Member
0 Kudos

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 .

Ratherfish
Explorer
0 Kudos

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.

Former Member
0 Kudos

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.

Ratherfish
Explorer
0 Kudos

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

Former Member
0 Kudos

I am calling FP_JOB_CLOSE after processing all entries. It is still overwriting, getting the last customer values.