Smartform printing + Get OTF Data

Hello, i have a problem with smartforms. I need to both print the smartforms and get the OTF Data in order to save it to disk and email it. But if I mark the getotf check in control parameters, it doesn't print. In fact the description for that field says: Return of OTF table. No printing, display, or faxing.
Is there a way to get both the printed version and the OTF Data without having to call the Smartforms function module twice with different control parameters?
Thanks in advance.

Hello
steps to fulfill your requirement
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
CALL FUNCTION 'POPUP_TO_CONFIRM'
    EXPORTING
      titlebar              = 'Select A option !'
      text_question         = 'Want a PDF file for this Transaction ?'
      text_button_1         = 'Yes'(001)
      text_button_2         = 'No'(002)
      display_cancel_button = ' '
      start_column          = 25
      start_row             = 6
    IMPORTING
      answer                = a.
  IF a = '1'.
*for CONTROL_PARAMETERS
    gw_ssfctrlop-getotf = 'X'.
    gw_ssfctrlop-no_dialog = 'X'.
*for OUTPUT_OPTIONS
    gw_ssfcompop-tdnoprev = 'X'.
    gw_ssfcompop-tdimmed = 'X'.
    CALL FUNCTION fm_name
CALL FUNCTION 'CONVERT_OTF'
CALL FUNCTION 'DOWNLOAD'
endif.
CALL FUNCTION 'POPUP_TO_CONFIRM'
      EXPORTING
        titlebar              = 'Select A option !'
        text_question         = 'Want to have a print privew for the same?'
        text_button_1         = 'Yes'(001)
        text_button_2         = 'No'(002)
        display_cancel_button = ' '
        start_column          = 25
        start_row             = 6
      IMPORTING
        answer                = a.
    IF a = 1.
      CALL FUNCTION fm_name. (without the control and output parameters).
endif.
This will surely solve your problem
Cheers,
Suvendu

Similar Messages

  • Print preview while getting otf data

    hi experts,
    can somebody tell me how to get the print preview of sap script
    while getting the otf data.
    I have set the ITCPO-TDGETOTF = 'X' option in OPEN FORM but when i give it its not showing the output. How can  I see output ?

    hi ajay,
    TABLES ITCPO.
    DATA: T_OTF TYPE TABLE OF ITCOO.
    ITCPO-TDGETOTF = 'X'.
    CALL FUNCTION 'OPEN_FORM'
         EXPORTING
              DEVICE                      = 'PRINTER'
              DIALOG                      = 'X'
              FORM                        = 'ZPRG_TEST'
              OPTIONS                     = ITCPO
         EXCEPTIONS
              CANCELED                    = 1
              DEVICE                      = 2
              FORM                        = 3
              OPTIONS                     = 4
              UNCLOSED                    = 5
              MAIL_OPTIONS                = 6
              ARCHIVE_ERROR               = 7
              INVALID_FAX_NUMBER          = 8
              MORE_PARAMS_NEEDED_IN_BATCH = 9
              SPOOL_ERROR                 = 10
              OTHERS                      = 11.
    IF SY-SUBRC  0.
    ELSE.
      CALL FUNCTION 'CLOSE_FORM'
           TABLES
                OTFDATA                  = T_OTF
           EXCEPTIONS
                UNOPENED                 = 1
                BAD_PAGEFORMAT_FOR_PRINT = 2
                SEND_ERROR               = 3
                SPOOL_ERROR              = 4
                OTHERS                   = 5.
    ENDIF.
    Check this code ok.
    why dont you try giving a pdf preview which will be possible.
    Regards,
    Midhun Abraham
    Edited by: Midhun Abraham on Oct 12, 2008 11:01 AM
    Edited by: Midhun Abraham on Oct 12, 2008 11:05 AM

  • Get OTF data for a sales order document

    I have a problem in getting the information of the created sales order document number  as OTF data. I need this OTF data so to convert into PDF format using function module 'CONVERT_OTF_2_PDF'. My situation is i am keeping a parameter for sales order document number . when i execute the report after giving a sales order document number, i should get the OTF data .

    Hi!
    Firstly you have to define what technique is used for creation of sales order as printed document - smartform or sapscript. Then proceed as follows.
    In case of smartform:
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = 'ZFORMNAME'
    IMPORTING
    fm_name = v_form_name
    EXCEPTIONS
    no_form = 1
    no_function_module = 2
    OTHERS = 3.
    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'
    IMPORTING
    job_output_info = w_return
    EXCEPTIONS
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    OTHERS = 5.
    i_otf[] = w_return-otfdata[].
    In case of sapscript:
      options-tdgetotf = 'X'.
    CALL FUNCTION 'OPEN_FORM'
    EXPORTING
    options = options
      CALL FUNCTION 'CLOSE_FORM'
    IMPORTING
      RESULT                         =
      RDI_RESULT                     =
       TABLES
         otfdata                        = i_otf
       EXCEPTIONS
         unopened                       = 1
         bad_pageformat_for_print       = 2
         send_error                     = 3
         spool_error                    = 4
         OTHERS                         = 5.
    i_otf -
    Regards,
    Maxim.

  • Get OTF data of an SAP SCRIPT

    Hi,
    I have a situation where I have to call a standard report from my custom report which is based on some condition.
    This is fine. But the standard report which I am calling is print program of an SAP Script.
    So, the requirement now is that my custom report should be able to send an email of the SAP Script output. For this I need to have the OTF data of the SAP Script in my custom report.
    How to get this?
    Your help will be highly appreciated.
    Thanks,
    -Sandeep

    Hi,
    Go through these links,here they mentioned how to capture OTF data into internal table
    http://scn.sap.com/thread/1083143

  • Getting OTF data of an SAPscript

    Hello Experts,
            Right now, I am receiving the OTF data from the combination of the Function Modules 'OPEN_FORM' and 'CLOSE_FORM' and the mail is already being sent by these function modules and the document is being archived. The transmission medium is External Send i.e. 5. However my new requirement is the subject line of the mail should be as high as 255 chars. So now I wish to restrict the use of OPEN_FORM and CLOSE_FORM only for archiving and Print Preview and send the mail using CL_BCS, which allows me the subject length of 255 chars.
             I want to retrieve the OTF data. I know we can do that by setting the parameter itcpo-tdgetotf and get the OTF table at CLOSE_FORM. However, I have noticed that when I set the tdgetotf parameter, the archiving is not taking place, which again will be an issue. Is there some other way of retrieving OTF data. I cam acroos function modules such as CONVERT_OTF and CONVERT_OTF_MEMORY. But no use.
            So in short, I just want to get the OTF data. Other all things are working for me now, and from what I have found out, I cannot use TDGETOTF and archiving in the same OPEN_FORM.
            Any help will be greatly appreciated.
    Regards,
    Shaheen

    Hi ssm,
       the  problem has been rectified. thanks for your inputs. i remodelled my programming. i set the tdgetotf and got the otf table from there. and used CONVERT_OTF_AND_ARCHIVE for archiving. it works great.
    thanks again all...
    Emanuel, are you interested to know how am I doing it or you were asking it to answer my question? let me know, in case if you want to, i will share my 2 cents of knowledge.

  • Error in smartform printing where main data of the form is blacked out

    Hi Guys,
    I encountered a problem when printing my form. The main window is blacked out (not blank) but viewing it in SAP data are correctly displayed. The main window is a table. Hope you guys can help. Thanks a lot.
    Ian

    Sorry mate I thought it is SAPScript and giving solutions for SAP script now I realised it is SF, this could be one of the reasons...
    double click on main window and click on Output options tab at the bottom you will see saturation  under shading label, if it is 100% then it will black out your page try to set to 0%, for normal white display for grey shade keep 10 %
    I hope this will solve your problem.
    Regards,
    SaiRam

  • How to get both OTF data and spool at a time

    Hi Experts,
        My requirement is to get both OTF data and spool.
    In 'OPEN_FORM' i tried passing itcpo-TDGETOTF = 'X'. itcpo- TDNEWID = 'X'.
    I was able to get OTF data but spool is not getting generated.
    IF i pass only itcpo- TDNEWID = 'X'. the spool is getting generated but not OTF data.
    when both the fields are set i.e. itcpo-TDGETOTF = 'X'. itcpo- TDNEWID = 'X'.
    the spool is generation is getting supressed.
    Similarly when i tried to get OTF data by passing itcpo-TDGETOTF = 'X'. to 'OPEN_FORM' as i need to convert it to PDF and send it to vendors as email ,
    The print preview in TCODE ME23n was not getting generated for 'MESSAGE' option 'External send'.
    Please suggest me how to get both OTF data and spool at a time.

    Hi Kartik,
    This one is similar to my question to print and email invoice at same time.  I pass itcpo-tdgetotf = 'X' in order to get otfdata and send email with the attachment of otfdata.
    Now I have data in otfdata, but when I call print_otf function, I clear out itcpo-tdgetotf, and passed
    itcpo-tddest = device_type but I still get error message said 'Handler not valid for open spool request'.
    Can you give me a working example that you have otfdata table and print data from that table.  I also post my question on other thread
    submit report and export to memory
    thanks

  • Regarding OTF Data

    Hi All,
    I need to know is it possible to  get OTF data by calling FM CLOSE_FORM as well create a spool in SP01 for related script.
    Regards
    Dhiraj Shetty

    Hi,
    Manual conversion to OTF format
    If there are more than 10 pages,
    Tick the spool request
    then click Edit -> OTF display -> No. of OTF pages
    Convert SAP Script to text
    Display the spool request
    then click Goto -> List display
    Automatic conversion to OTF format
    tables: tline.
    data:   begin of int_tline1 occurs 100.
                 include structure tline.
    data:   end of int_tline1.
    call function 'OPEN_FORM'
                     device         = 'OTF_MEM'
    after CLOSE_FORM
    call function 'CONVERT_OTF_MEMORY'
         exporting
              format                = 'ASCII'
              max_linewidth         = 132
         tables
               lines                 = int_tline1
         exceptions
              err_max_linewidth        = 1
              err_format                    = 2
              err_conv_not_possible = 3
              others                          = 4.
    write the text file to spool
    loop at int_tline1.
       if int_tline1-tdline = space.
          skip.
       else.
          write:/ int_tline1-tdline.
       endif.
    endloop.
    Regards
    Sudheer

  • Archive Smartform Copies - Error - OTF end command // missing in OTF data

    Hi All,
    We are printng invoices and archiving them at the same time.
    When I try to print and archive just the original invoice it works fine
    That is , it prints and archives.
    However when I set the flag SSFCOMPOP-TDARCCOP to 'X'  (Archive Copies as well),
    I get the error OTF end command // missing in OTF data.
    Im guessing that the system tries to archive multiple copies and the End of File Command // at the end of each copy is causing the issue. But I dont know how to go about solving it.
    Regards,
    Nehal.

    Implemented SAP Note 1123505 - OTF-PDF conversion. Archiving several copies

  • How do I get the date to print at the bottom right of a page

    fI can't get the date to print at the bottom of a page. I go to page setup and header/footer and ensure that date/time is entered into the lower right corner box and the date still doesn't print on a page.
    == This happened ==
    Every time Firefox opened

    Try setting your bottom margin on File > Page Setup > Header & Footer to .3 or .4
    You probably are not seeing the date at the bottom in Print Preview either.
    On my system, with HP 6200 series, I experience the same problem if my bottom margin is set to 0 (zero).
    You may experience the same problem with headers with a 0 (zero) top margin.

  • While converting smartform output toPDF: end command // missing in OTF data

    Hi,
    While Converting smartform output to PDF i am getiing the following error.
    end command // missing OTF data . And also in the importing parameter of smartform  function module also (job_output_info ) i did not findout the data. Where did i make a mistake. How can i correct this error. Thanks in advance.

    Implemented SAP Note 1123505 - OTF-PDF conversion.

  • Smartform printing & sending multyple table data

    Hi All..
    I designed a smartform & print Pgm.( for Invoice not SAP standard)
    How can i send multiple table(kna1,vbrk,vbrp,vbdk) data in to a smart form? & how can i declare that internal table in smart form & in print pgm?
    And it is also not printing.even i set it in NACE.
    Plz any one can help me asap..
    Thanks & Regards
    Raj

    Hi Raj,
    You must have to create a new Structure and a new TABLE TYPE in program to send multiple data.
    Lets say, you have created Main internal table in your print program to send multiple data to smartforms as below.
    TYPES: BEGIN OF ty_cus,
              F1,
              F2,
              F3,
              F4,
           END OF ty_cus.
    so, instead defining above types in your program, just create a new structure(lets say Z_CUS) with the above fields in SE11.
    Then create new TABLE TYPE (ZT_CUS) with that structure (Z_CUS).
    Now, in your print program, create internal table with the type of Z_CUS as below.
    DATA: it_cus TYPE TABLE TYPE z_cus,
          wa_cus TYPE z_cus.
    And in the Layout, Form interface - Tables section give it as below
    IS_CUS    TYPE   ZT_CUS.
    In your print program, assign your internal table to IS_CUS for generated function module.
    CALL FUNCTION fm_module.
    EXPORTING
    IMPORTING
    TABLES
       IS_CUS   = it_cus
    EXCEPTIONS
    Let me know if you hav any quesions

  • Date format within smartforms printing

    Hello,
    I have an issue regarding date format.
    When I print a delivery note date format is e.g. 08.04.2011, printing an invoice it shows 04-08-2011.
    It seems that depending on the customers country the invoice printing converts to date format within country settings
    (V_T005-DATFM) while delivery form doesn't.
    If I always want to print in date format of sales company what should I do?
    Thanks a lot,
    Wolfi.

    I guess, it should work if you define
    /: SET COUNTRY &country_key&
    in the Initialization section of your smartform.
    Note: The country-dependent formatting options are stored in the T005X table.
    Regards,
    SaiRam

  • I need to know how do i get a date on the printed paper it always did but then i had my pc upgraded

    Please can you tell me how does one get a date printed will printing a document

    Please read this post then provide some details.  What printer model? What operating system? What program are you printing from?
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • How to get sqlplus to print the current date/time

    From a unix command line I can type:
    prompt> date; <any_Cmd>; date
    This will result in a timestamp being output before and after the command you inserted. Is there a way to make sqlplus print the current date/time after it is done executing an sql statment. This would be useful for me to know how long it took to execute and sql statement without watching it.
    Something like:
    SQL> select * from table; date;

    u cld set the following statements in sql*plus :
    sql>set time on
    sql>set timing on
    hope this solves ur problem.

Maybe you are looking for

  • HP PSC all-in-one printer not working

    I reinstalled the driver cd disc, rebooted, corrected the printer default connection.  I've unplugged everything.  Printer doesn't work. It just stopped, but then sometimes it will print.  Never jammed.  I use power surge protectors high quality.  Al

  • Pointing existing RAC nodes to a fresh Shared Storage discarding old one

    Hi, I have a RAC Setup with the Primary Database on Oracle 10gR2. For this setup, there is a Physical Standby Database Setup (using DataGuard configuration) also with 30min delay. Assume that the "Shared Storage" of the Primary DB fails completely. I

  • Portal integration with bo report was not opening from folders

    Dear friend, Please can u give me suggestion/solution on the following area, we are implementing business objects XIR2 portal integration with weblogic in which after login to business objects through portal report was not opening. Regards sekhar

  • Kernel panics waking from deep sleep after SSD upgrade

    Hi Kernel panics every time a 15-inch mid 2012 MacBook Pro 9,1* wakes from deep sleep** following upgrade from original HDD to an SSD***. The first SSD was replaced under warranty and the issue is still occuring. The extended Apple Hardware Test repo

  • Want to find the Data type of a variable at runtime ?

    Hi, I Want to find the Data type of a variable at runtime ? I think there is a function module... But i forgot ..... Can you please help me out. Points are rewarded immediately.