cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple invoice print problm in smartform

Former Member
0 Kudos

Hi experts,

I am printing some invoice in a program via smartform. What i have done is im passing all header details and item details of invoice to smartform in a loop of inyternal table which contains such multiple invoices. I want all invoice to be printed at once. But what it is doing is it prints a single invoice and then shows the dialog box forr printer and preview gain 7 again for all invoices.

Can anyone advise me how i can print all invoice sat one shot.

Thanks in advance.

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member206454
Participant
0 Kudos

hi umakant ,

  if you are using following as it is

•1st call:

     NO_OPEN = SPACE.

     NO_CLOSE = 'X'.

•nth call:

     NO_OPEN = 'X'.

     NO_CLOSE = 'X'.

•last call:

     NO_OPEN = 'X'.

     NO_CLOSE = SPACE .

  you have to change code a little when there is only 1 page . because in this scenario it will go to the 1st call

NO_OPEN = SPACE.

NO_CLOSE = 'X'.

  and for the print to come it should go to last call i.e.

     NO_OPEN = 'X'.

     NO_CLOSE = SPACE .

Former Member
0 Kudos

thanks kumar,

i resolved the issue using u r logic.

correct answer.

Thanks,

Umakant.

Former Member
0 Kudos

Hi,

Set NO_DIALOG  as X and set default printer for your user name in SU3

former_member206454
Participant
0 Kudos

Hi  Satyanarayan Panigrahi,
   I was also facing the same problem and I resolved it.
   In control_parameters there are two parameter
   no_option and no_close

Note:-NO_OPEN
AND NO_CLOSE parameter of CONTROL_PARAMETERS are used to include
several forms into one print request. When calling the generated
functions modules, set the parameters as follows:

•1st call:
     NO_OPEN = SPACE.
     NO_CLOSE = 'X'.
•nth call:
     NO_OPEN = 'X'.
     NO_CLOSE = 'X'.
•last call:
     NO_OPEN = 'X'.
     NO_CLOSE = SPACE .

Do like following sample coding it will be done...

data:
  control_parameters  type ssfctrlop,
     w_cnt type I,
     w_cnt2 type I.

call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
      formname           = 'ZCUSTOMER_LEDGER'     
    importing
      fm_name            = fname
    exceptions
      no_form            = 1
      no_function_module = 2
      others             = 3.


  if sy-subrc <> 0.
    message 'Wrong Smartform Name' type 'E'.
  endif.
************************** CHANGE FROM HERE
  describe table it_tab lines w_cnt.

  loop at it_tab into st_tab.
    w_cnt2 = sy-tabix .
    case w_cnt2.
      when 1.
        control_parameters-no_open   = space .
        control_parameters-no_close  = 'X' .
      when w_cnt .
        control_parameters-no_open   = 'X' .
        control_parameters-no_close  = space .
      when others.
        control_parameters-no_open   = 'X' .
        control_parameters-no_close  = 'X' .
    endcase.

    call function fname
      exporting
        control_parameters         = control_parameters
        w_kunnr                    = st_tab-kunnr
        w_bukrs                    = p_bukrs
        w_bdat_l                   = s_budat-low
        w_bdat_h                   = s_budat-high

Former Member
0 Kudos

Hi kumar,

i have same scenario but i m unable to print 2nd page of smart-form.

consider if one invoice has 25 line items for this type of invoice unable

get print-view or print. just executing with no output.

Thanks in advance.

Former Member
0 Kudos

Hi,

Pass the both header and item details to the smartforms and in smartforms do as follows.

-> First loop the header details in the sort event provide the filed invoice no and select the event at end of

-> Now you will get the event node under the loop before that

node loop the item details in the where condition put item-invoice no = header-invoice.

-> below the event node create a command node in that select go to new-page in that provide the same page as the next page.

->By this you will get all the invoice printed at one shot.

Thanks,

NN.

Former Member
0 Kudos

Hi,

U can pass the print parameters to the Function module of the smartform with NO_DIALOG set the appropriate value. U will not get the pop up.

Thank you.

Reward points if found useful.