‎2012 Mar 30 6:01 AM
Hi All,
I am using below logic for creating common spool for multiple customers the table on which i am applying loop is header table containing customer nos..
Now my requiremnt is I want to convert each customrs detail in PDF format and save in system.
Problem is only common spool is getting created and no otf data is returned from the SF function call within loop.
Please help...
Code.
CALL FUNCTION 'SSF_OPEN'
EXPORTING
output_options = lds_output_options
IMPORTING
job_output_options = lds_job_output_options
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
lds_control_parameters-no_open = 'X'.
lds_control_parameters-no_close = 'X'.
lds_control_parameters-preview = lds_job_output_options-tdpreview.
lds_output_options-tddest = lds_job_output_options-tddest.
MOVE-CORRESPONDING lds_job_output_options TO lds_output_options.
LOOP AT gdt_header INTO lds_header.
*if sy-tabix eq 1.
CALL FUNCTION ldf_formname
EXPORTING
datae_low = s_bldat-low
date_high = s_bldat-high
gds_header2 = lds_header
payement_details = p_pd
cleared_balance = p_cb
opening_balance = p_ob
control_parameters = lds_control_parameters
output_options = lds_output_options
job_output_info = gds_job_output
TABLES
gdt_open_items = gdt_open_items
gdt_cleared_items = gdt_cleared_items
gdt_invoice_detail = gdt_invoice_detail
gdt_header = gdt_header
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CLEAR:lds_header.
ENDLOOP.
CALL FUNCTION 'SSF_CLOSE'
IMPORTING
job_output_info = gds_job_output
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
‎2012 Mar 30 6:28 AM
Also is there any way to split the spool output....by converting it to OTF and something like that.....
‎2012 Mar 30 7:47 AM
In the smart form add a command node inside the loop and whenever a new customer is reached then trigger a new page.
‎2012 Mar 30 9:44 AM
at started my devlopment with this logic only.....
but the problem in this is that as item details are in loop, SF treats it as cntinus flow even if i give a forced page break....
In my case for a header table 3 items tables are to be displayed seperately in main window.
so as SF treats it a cntinus flow table allignmnt gets messd up.
‎2012 Mar 30 8:59 AM
Hi,
Have you checked this?
http://help.sap.com/saphelp_nw04/helpdata/en/64/bf2f12ed1711d4b655006094192fe3/content.htmhttp://help.sap.com/saphelp_nw04/helpdata/en/64/bf2f12ed1711d4b655006094192fe3/content.htm
If you want to start a new spool request for the print request, set the
TDNEWID field of the Output Options in this first call.
Also check http://help.sap.com/saphelp_nw04/helpdata/en/71/9ccd9c8e0e11d4b608006094192fe3/content.htm