on 12-06-2011 6:26 PM
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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).
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Only call the Close function module once all Customers have been processed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.