Smartform Dynamic Ppage Format

Hi All,
I need answers to the following questions.
1.I have a smartform for which the page format is Letter, while printing the form depending on some conditions I want to print the form on A4 paper.How can I dynamically change the Page Format, i have developed the layout such that when I take a printout, the default is letter when i change the spool attributes in sp01 to A4 it print correctly on A4, however i would like to change the page format dynamically and through my program, is there any way to change the spool attributes through the smartform driver program.
2. When pages in the smartform exceed 10 then instead of 10 of 10 it is displaying the page numbers as 10 of *.
Please help me with these issues.
Thanks & regards,
Vanita M.

For point 1, yes you need to create 2 Smartforms for handling different page sizes.
This code is working fine for me.
Page &SFSY-PAGE& of &SFSY-FORMPAGES(3ZC)&
Regards,
Naimesh Patel

Similar Messages

  • Smartform Dynamic Page Format

    hi
    IS IT POSSIBLE TO HAVE DYNAMIC PAGE FORMAT IN SMARTFROMS.
    EXAMPLE: DEPENDING ON ONE CONDITION I NEED TO PRINT THE PAGE EITHER IN LANDSCAPE OR PORTRAIT.
    PLEASE HELP ME.
    THANKS IN ADVANCE.
    KIRAN.

    I htink the page format is set at the time of creating the page itself.
    YOu cannot change it depending on the condition.

  • Dynamic character format in SMARTFORMS

    Dear Gurus,
    I want to make a dynamic character format in smartforms. I did it in SAPscript and success.
    what I did in program before passing to smartform :
    d_note = '<XX> dynamic text </>'
    and pass it to SAPscript and smartforms :
    &d_note&
    in SAPscript I made new character format XX as BOLD and UNDERLINED. it works for SAPscript. the output become  = dynamic txt
    unfortunately when I do this in smartforms, it is a fail although I have set new character format XX as bold and underline in smartstyles. the output become = <XX> dynamic text </>
    any guru has a solution for this smartform?

    Hi Sendy,
    You cant use tags (eg- <XX>) in smartfomrs like you did in sap scripts. Use your style in the smartform( form attributes) with all character formats and paragraph formats which you need. When you create a new text module in the smartform you will get two drop down lists for the paragraph formats and character formats in the top of the editor. Type your text there and highlight then choose 'XX'(or any other character format) character format from the drop down list.
    Hope this would help.
    Cheers,
    Jeewana

  • Convert Smartform in PDF format and send to SAP Workplace

    Hi to all.
    I need help of somebody expert in SMARTFORM's.
    I need to convert a smartform into PDF format and to send as attachement for SAP workplace
    of the user.
    I developed the next code.
    IT is to function and to send the mail for SAP workplace, but it happens that smartform
    contains images (logos) and tables, when the user tries to open the file pdf in inbox gives
    to error - "An unrecognized token ' q0 ' was found".
    I tried to call a smartform only with text and functioned well.
    Somebody can help me?
    My code:
    Begin ***********************************************
    REPORT zteste_nsa_send_pdf_sap_office.
    DATA: t_print LIKE zeps_fm04 OCCURS 0 WITH HEADER LINE,
          v_size TYPE i.
    DATA: ls_bil_invoice TYPE lbbil_invoice.
    TABLES: nast.
    DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
    i_tline TYPE TABLE OF tline WITH HEADER LINE,
    i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
    i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    Objects to send mail.
    i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
    i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
    Work Area declarations
    wa_objhead TYPE soli_tab,
    w_ctrlop TYPE ssfctrlop,
    w_compop TYPE ssfcompop,
    w_return TYPE ssfcrescl,
    wa_doc_chng TYPE sodocchgi1,
    w_data TYPE sodocchgi1,
    wa_buffer TYPE string,"To convert from 132 to 255
    Variables declarations
    v_form_name TYPE rs38l_fnam,
    v_len_in LIKE sood-objlen,
    v_len_out LIKE sood-objlen,
    v_len_outn TYPE i,
    v_lines_txt TYPE i,
    v_lines_bin TYPE i.
    START-OF-SELECTION.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = 'ZFPS_FICHA_VALORIZACAO'
        IMPORTING
          fm_name            = v_form_name
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      w_ctrlop-getotf    = 'X'.
      w_ctrlop-no_dialog = 'X'.
      w_compop-tdnoprev  = 'X'.
      CALL FUNCTION v_form_name
        EXPORTING
          control_parameters = w_ctrlop
          output_options     = w_compop
          user_settings      = 'X'
          is_bil_invoice     = ls_bil_invoice
          is_nast            = nast
          is_repeat          = 'X'
        IMPORTING
          job_output_info    = w_return
        TABLES
          t_list             = t_print
        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.
      i_otf[] = w_return-otfdata[].
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
          max_linewidth         = 132
          bin_filesize          = v_len_in
        TABLES
          otf                   = i_otf
          lines                 = i_tline
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          OTHERS                = 4.
      IF sy-subrc EQ 0.
      ENDIF.
    Convert PDF from 132 to 255.
      LOOP AT i_tline.
        TRANSLATE i_tline USING '~'.
        CONCATENATE wa_buffer i_tline INTO wa_buffer.
      ENDLOOP.
      TRANSLATE wa_buffer USING '~'.
      DO.
        i_record = wa_buffer.
        APPEND i_record.
        SHIFT wa_buffer LEFT BY 255 PLACES.
        IF wa_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    SEND MAIL
      REFRESH:  i_reclist,
                i_objtxt,
                i_objbin,
                i_objpack.
      CLEAR wa_objhead.
    Object with PDF.
      i_objbin[] = i_record[].
    Object with main text of the mail.
      i_objtxt = 'Fichas de Valorização e Esquemas Tipo'.
      APPEND i_objtxt.
    Document information.
      wa_doc_chng-obj_name   = 'SMART'.
      wa_doc_chng-expiry_dat = sy-datum + 10.
      wa_doc_chng-obj_descr  = 'Ficha de Valorização'.
      wa_doc_chng-sensitivty = 'F'. "Functional object
      wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + STRLEN( i_objtxt ).
    Pack to main body as RAW.
    Obj. to be transported not in binary form
      DESCRIBE TABLE i_objtxt LINES v_lines_txt.
      READ TABLE i_objtxt INDEX v_lines_txt.
      CLEAR i_objpack-transf_bin.
      i_objpack-head_start = 1.
      i_objpack-head_num   = 0.
      i_objpack-body_start = 1.
      i_objpack-body_num   = v_lines_txt.
      i_objpack-doc_type   = 'RAW'.
      APPEND i_objpack.
    Packing as PDF.
    Obj. to be transported in binary form
      DESCRIBE TABLE i_objbin LINES v_lines_bin.
      READ TABLE i_objbin INDEX v_lines_bin.
      i_objpack-transf_bin = 'X'.
      i_objpack-head_start = 1.
      i_objpack-head_num   = 0.
      i_objpack-body_start = 1.
      i_objpack-body_num   = v_lines_bin.
      i_objpack-doc_type   = 'PDF'.
      i_objpack-obj_name   = 'SMART'.
      CONCATENATE 'Ficha_Valorizacao' '.pdf' INTO i_objpack-obj_descr.
      i_objpack-doc_size = ( v_lines_bin - 1 ) * 255 + STRLEN( i_objbin ).
      APPEND i_objpack.
    e-mail receivers.
      CLEAR i_reclist.
      i_reclist-receiver = sy-uname.
      i_reclist-rec_type = 'B'.
      i_reclist-express  = 'X'.
      APPEND i_reclist.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = wa_doc_chng
          put_in_outbox              = 'X'
          commit_work                = ' '
        TABLES
          packing_list               = i_objpack
          object_header              = wa_objhead
          contents_bin               = i_objbin
          contents_txt               = i_objtxt
          receivers                  = i_reclist
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          document_type_not_exist    = 3
          operation_no_authorization = 4
          parameter_error            = 5
          x_error                    = 6
          enqueue_error              = 7
          OTHERS                     = 8.
      IF sy-subrc EQ 0.
      ENDIF.
    End  *************************************************
    Thanks very much to all and Happy New year...
    Nelson

    Please check this link...
    [http://help.sap.com/saphelp_nw04/helpdata/en/27/67443cc0063415e10000000a11405a/content.htm|http://help.sap.com/saphelp_nw04/helpdata/en/27/67443cc0063415e10000000a11405a/content.htm]
    -Muktar

  • How to send output of smartform in pdf format as an attachment to email

    how to send output of smartform in pdf format as an attachment to email
    search before posting further and follow Forum rules
    Edited by: Vijay Babu Dudla on Jan 15, 2009 4:50 AM

    Did u check on sdn?
    i dont think so or else there are many posts on this topic and good wikis too.
    look at one of these code tutorial wiki
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/mail%2bsend%2bthrough%2boutput%2bcontrols
    So next time do use the search functionality.
    кu03B1ятu03B9к
    Edited by: kartik tarla on Jan 15, 2009 12:33 PM

  • Smartform In PDF Format

    Hi All,
    Can anyone send me the sample code for attaching a SmartForm in PDF Format.
    Thanks in advance.
    Ulhas

    hi,
    check this
    http://www.****************/Tutorials/Smartforms/OTF2PDF.htm

  • VF01- invoice smartform in PDF format to be sent thro' mail

    Hello Gurus,
    We have a requirement from our client that we need to trigger a mail of invoice smartform in PDF format on saving in VF01.
    Can any body suggest the steps in NACE and also output..
    Regards

    As per your post, I understood that,
    After saving Invoice , automatically Invoice has to send in PDF format to the respective email id maintained in CMR-Payer master
    if yes, this involves ABAP & BASIS ,
    ABAP- Program & FOrm routine has to created & assigned in respective output type & type-PDF (Check in NACE- Output type)
    for this, you need to maintain the Condition record- VV31 - with medium as "Mail" -
    or else,
    you can do this manually also, in VF31- you can give a print  & save in PDF format- you can send it - but its complete manual process.

  • DOWNLOAD SMARTFORM IN TXT FORMAT

    NORMALLY WE DOWNLOAD SMARTFORM IN PDF FORMAT BUT I HAVE REQUIREMENT TO DOWNLOAD IN TEXT FORMAT.
    PLEASE HELP.
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on Jul 24, 2008 6:24 PM

    when you generate the spool you can down load that in txt format
    Function is used RSPO_DOWNLOAD_SPOOLJOB when you want to do that programatically.
    Using the spool number, and provide the path where you want to down load that time mention the name
    C:\smart.txt
    it will be downloaded .

  • Smartforms in HTML Format

    Hi Guru's,
    Please help me.
    I want to display Smartforms in HTML Format.
    i.e when I run my Tcode inspite of Print Preview the data should open in HTML Format.
    Thanks in Advance.

    Chk this..
    http://help.sap.com/saphelp_nw04/helpdata/EN/59/cd7da407d711d5b66f006094192fe3/content.htm
    Re: FM for conversion of graphical display of spool to html
    Regards,
    Midhun Abraham
    Edited by: Midhun Abraham on Oct 11, 2008 9:35 AM

  • Smartform to BIN format

    Hi all,
         I have requirement like attach Smartform into Purchase order .
    So that i want to convert Smartform to BIN format.
    How to do this.
    Thanks in advance.
    Regards,
    Arun.

    Hi all,
         I have requirement like attach Smartform into Purchase order .
    So that i want to convert Smartform to BIN format.
    How to do this.
    Thanks in advance.
    Regards,
    Arun.

  • Hi, I have converted different smartforms to pdf format.How to combine pdf?

    Hi All,
    I have converted different smartforms to pdf format. How to combine all the pdf's into single pdf.
    I need all the smartforms to be in single pdf.
    Please help me in this regard.
    Thanks in advance.

    Hi Keshu,
    Individual pdf should be sent to individual user.
    And at last all the pdfs of the smartform should be combined into one.
    And admin have the provision to download it .
    I mean the requirement is
    For example.
    For the month of september i will generate Pay Slip to each employee. And each pdf will be send to corresponding employee.
    And finally all the pay slips of all the employees will be combined into single PDF and admin will download it and keep it for reference.
    So as of now. I have generated individual pdfs and mailed it accordingly.
    But how to combine it into one PDF is my question.
    Please help me in this regard.
    Thanks in advance.

  • Displaying a smartform in pdf format using webdynpro

    Hi,
    I have created a smartform using t.code smartforms. I have created a function module within which i used the function mocule convert_otf which will convert the smartform into binary format. Now how do i proceed in displaying the form using web dynpro.
    Plz give me your suggestions.
    Thanks in advance.

    CALL FUNCTION LV_FUNC_MOD_NAME
        EXPORTING
          CONTROL_PARAMETERS = LS_SSFCTRLOP
          OUTPUT_OPTIONS     = LS_OUTPUT_OPTIONS
          USER_SETTINGS      = ' '
          RRNUM              = IM_RRNUM
        IMPORTING
          JOB_OUTPUT_INFO    = LT_RETURN
        EXCEPTIONS
          FORMATTING_ERROR   = 1
          INTERNAL_ERROR     = 2
          SEND_ERROR         = 3
          USER_CANCELED      = 4
          OTHERS             = 5.
      IF SY-SUBRC <> 0.
      ENDIF.
    CALL FUNCTION 'CONVERT_OTF'
      EXPORTING
        FORMAT                = 'PDF'
        MAX_LINEWIDTH         = 132
      IMPORTING
        BIN_FILESIZE          = LV_LENGTH
        BIN_FILE              = LV_XSTRING
      TABLES
        OTF                   = LT_RETURN-OTFDATA
        LINES                 = LT_TLINE
      EXCEPTIONS
        ERR_MAX_LINEWIDTH     = 1
        ERR_FORMAT            = 2
        ERR_CONV_NOT_POSSIBLE = 3
        ERR_BAD_OTF           = 4
        OTHERS                = 5.
    IF SY-SUBRC <> 0.
    ENDIF.
    LV_FUNC_MOD_NAME is your smartform function module name.
    LV_XSTRING contains the stream of the pdf , send this to the browser using the following code.
        LV_FILENAME = 'RebateRequest.pdf'.
        LV_CTYPE = 'pdf'.
        CL_WD_RUNTIME_SERVICES=>ATTACH_FILE_TO_RESPONSE(
                  EXPORTING I_FILENAME = LV_FILENAME
                            I_CONTENT  = LV_XSTRING
                            I_MIME_TYPE = LV_CTYPE
                            I_INPLACE = ABAP_TRUE
                            I_IN_NEW_WINDOW = ABAP_TRUE ).
    Abhi

  • Smartform and date format

    if i need the change the date format according to country how can i do it
    ( i.e ) I am creating a smartform, the date format i use is normally dd/mm/yyyy
    if the same smartform is printed in some other country( using format yyyy/mm/dd or any format)
    i want my date format to change based on where it is printed.
    In SAPScripts there is a command SET COUNTRY.
    Can I use this command for my requirement. If so How?

    hi check this referred link and do the coding accordinly...please search before you post ..
    Country specific date format
    and try this C14N_COUNTRY_DATE_DECF_GET too
    Edited by: Venkat Appikonda on Jan 28, 2009 12:37 PM

  • Smartforms as PDF format

    HI Experts,
                    How do I dispaly my smartforms in PDF format. How do I get Spool ID. where all the changes I have to made. plz describe properly.
    Thanks. Alot.
    Khan

    Hi
    You will get the Spool ID in the Fun module itself (in SE38 program)
    in the output paramters <b> DOCUMENT_OUTPUT_INFO =</b>  or
    <b>JOB_OUTPUT_INFO =</b>  take that
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSMARTFORM'
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    FM_NAME = FM_NAME
    EXCEPTIONS
    NO_FORM = 1
    NO_FUNCTION_MODULE = 2
    OTHERS = 3.
    if sy-subrc <> 0.
    WRITE: / 'ERROR 1'.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function FM_NAME
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    <b>* DOCUMENT_OUTPUT_INFO =</b>
    <b>JOB_OUTPUT_INFO =</b>
    JOB_OUTPUT_OPTIONS =
    TABLES
    GS_MKPF = INT_MKPF
    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.
    and pass that spool ID to the fun module
    call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
           exporting
                src_spoolid   = spoolid
                no_dialog     = 'X'
           importing
                pdf_bytecount = pdf_fsize
           tables
                pdf           = pdf_table
           exceptions
                others        = 0.
    Now PDF data is in PDF_TABLE
    so download it using GUI_DOWNLOAD and send it to your mail ID
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Converting a Smartform to ZPL format

    Hi,
    i'm facing the following Problem: i need to convert a smartform into zpl format.
    I don't need to print the smartform on a ZPL printer by using SAP standard procedure, i need the Smartform in ZPL as a "string" to send it by RFC to a specified destination (where the ZPL will be printed, finally).
    Thanks for your support,
    greeting Hannes

    Hello Hannes,
    there is actually a Smart Forms driver for Zebra label printers built into SAP. Device types LZEB2, LZEB3, LZEB6 use it (there are also other LZEBx device types, check out SAP notes for the differences).
    You should first try if you can generate suitable output for your Zebra label printer from  the Smart Form, via "normal" printing from SAP (i.e. via the SAP spooler and a connected Zebra printer).
    If this works, then there is a way to solve this. What you need to do is: create the spool request from your print program via SMart Forms, but not print it (i.e. immediate print = FALSE).  Remember you do need a valid printer definition in SAP for this, because Smart Forms needs one to generate the spool request.
    Function module RSPO_PROCESS_DIALOG_JOB allows you to have your current ABAP program process the spool request (as if it was an SPO spool process), but not send anything to the printer but instead write the print data into a file on the application server. You can then use OPEN DATASET ... READ DATASET...CLOSE DATASET to retrieve the print data (make sure you use binary mode, so as to not modify the print data) and do whatever you want with it.
    Best regards,
      Alexander

Maybe you are looking for

  • Display blanck image in big PDF

    I have some problem, to view PDF with big page size (when size of page is big then 6.5 MB I see only blanck images, without any Error). The source of the page is JPG (regular not JPG2000) I check this file in another pdf readers, and it's show me all

  • DVD Burn Speed - should I go Fast or Slow?

    Please help! I am getting conflicting advice regarding the best speed to burn a DVD Video (in DVDSP, iDVD, Disk Utility etc) that will be used as a duplication master. I have read online that you should avoid slowing down the burn too much (I think b

  • Upgrading from 9.2 to 10.2

    I have a Powerbook G3 Wallstreet (256MB RAM, 10GB HDD) with OS 9.2.2 preinstalled but I don't have the disks. I plan to upgrade to Jaguar 10.2 and understand that I will have to reformat the hard drive to create a <8GB partition. However, while resea

  • Numbers Template Chooser Dialog Tweak?

    In reference to the Numbers Template Chooser Dialog box... Does anyone know if there is a way to add your recent files to the "Side-Bar?" Here is a picture of the Template Chooser... !http://www.flickr.com/photos/18215579@N06/2228019841/!

  • How to backup an iphone while it is dead

    My iphone 4s is dead and how can i back it up. is even possible to back it up while dead