Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Spliting spool output

mayankmrai
Explorer
0 Likes
809

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.

4 REPLIES 4
Read only

mayankmrai
Explorer
0 Likes
719

Also is there any way to split the spool output....by converting it to OTF and something like that.....

Read only

0 Likes
719

In the smart form add a command node inside the loop and whenever a new customer is reached then trigger a new page.

Read only

0 Likes
719

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.

Read only

former_member189779
Active Contributor