Skip to Content
author's profile photo Former Member
Former Member

doubt in smartform

Hi All ,

I have created Smartform for Invoice printing in which invoice no is input field ( Parameter field ) and i pass one internal table to smartform function module corresponds to that invoice no .

Now requirement is to change invoice no from parameter field to select-option ( for range ) so that multple invoice can be printed Simultaneously .

How , it can be done and how data will be passed for select-options .

on change of Invoice No page has to be changed ?


Mohit Bansal

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 20, 2008 at 09:49 AM

    Hi Mohit,

    There are various ways of doing the thing.

    One way is to select the Invoice numbers in the driver program and pass it to the function module one by one.


    You are looping on a table which contains the Invoice Numbers:-

    Call the function module of the smartform and pass the invoice no to the function module. (It will process the smartform with that invoice number)

    Endloop. (So that for the new loop the new invoice number will be passed to the smartform and the processing will be with the new onvoice number).

    Second way is to pass the whole invoice numbers to the Smartform as the parameter in which you are passing the invoice number is a table. So just append the invoice numbers and pass as a whole to the smartform and in the smartform set a table to do the looping and in that set the sort ascending by invoice number and choose the at new properties of the table and set a process control to trigger a new Page. This will trigger each and every invoice from a fresh page.

    Try this, Hope that will work.

    Check out and revert back.

    Warm Regards.


    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 30, 2008 at 12:06 PM


    here i m giving program to you.

    in Smartforms you are goin to use 'SSF_FUNCTION_MODULE_NAME' to call the functionmodule generated.

    check the sample code

    DATA: ls_print_data_to_read TYPE lbbil_print_data_to_read.

    DATA: ls_bil_invoice TYPE lbbil_invoice.

    DATA: lf_fm_name TYPE rs38l_fnam.

    DATA: ls_control_param TYPE ssfctrlop.

    DATA: ls_composer_param TYPE ssfcompop.

    DATA: ls_recipient TYPE swotobjid.

    DATA: ls_sender TYPE swotobjid.

    DATA: lf_formname TYPE tdsfname.

    DATA: ls_addr_key LIKE addr_key.

    DATA: ls_dlv-land LIKE vbrk-land1.

    DATA: ls_job_info TYPE ssfcrescl.

    • SmartForm from customizing table TNAPR

    lf_formname = tnapr-sform.

    • determine print data

    PERFORM set_print_data_to_read USING lf_formname

    CHANGING ls_print_data_to_read


    IF cf_retcode = 0.

    • select print data

    PERFORM get_data USING ls_print_data_to_read

    CHANGING ls_addr_key





    IF cf_retcode = 0.

    PERFORM set_print_param USING ls_addr_key


    CHANGING ls_control_param






    IF cf_retcode = 0.

    • determine smartform function module for invoice


    EXPORTING formname = lf_formname

    • variant = ' '

    • direct_call = ' '

    IMPORTING fm_name = lf_fm_name

    EXCEPTIONS no_form = 1

    no_function_module = 2

    OTHERS = 3.

    IF sy-subrc 0.

    • error handling

    cf_retcode = sy-subrc.

    PERFORM protocol_update.



    IF cf_retcode = 0.

    PERFORM check_repeat.

    IF ls_composer_param-tdcopies EQ 0.

    nast_anzal = 1.


    nast_anzal = ls_composer_param-tdcopies.


    ls_composer_param-tdcopies = 1.

    DO nast_anzal TIMES.

    • In case of repetition only one time archiving

    IF sy-index > 1 AND nast-tdarmod = 3.

    nast_tdarmod = nast-tdarmod.

    nast-tdarmod = 1.

    ls_composer_param-tdarmod = 1.


    IF sy-index NE 1 AND repeat IS INITIAL.

    repeat = 'X'.


    • call smartform invoice

    CALL FUNCTION lf_fm_name


    archive_index = toa_dara

    archive_parameters = arc_params

    control_parameters = ls_control_param

    • mail_appl_obj =

    mail_recipient = ls_recipient

    mail_sender = ls_sender

    output_options = ls_composer_param

    user_settings = space

    is_bil_invoice = ls_bil_invoice

    is_nast = nast

    is_repeat = repeat

    importing job_output_info = ls_job_info

    • document_output_info =

    • job_output_options =

    EXCEPTIONS formatting_error = 1

    internal_error = 2

    send_error = 3

    user_canceled = 4

    OTHERS = 5.

    IF sy-subrc 0.

    • error handling

    cf_retcode = sy-subrc.

    PERFORM protocol_update.

    • get SmartForm protocoll and store it in the NAST protocoll

    PERFORM add_smfrm_prot.



    • get SmartForm spoolid and store it in the NAST protocoll

    DATA ls_spoolid LIKE LINE OF ls_job_info-spoolids.

    LOOP AT ls_job_info-spoolids INTO ls_spoolid.

    IF ls_spoolid NE space.

    PERFORM protocol_update_spool USING '342' ls_spoolid

    space space space.



    ls_composer_param-tdcopies = nast_anzal.

    IF NOT nast_tdarmod IS INITIAL.

    nast-tdarmod = nast_tdarmod.

    CLEAR nast_tdarmod.




    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.