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

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

  • How Can we get the data from Non-SAP to SAP in WebDynpro

    Hi,
    I hope u understand my query, How can we get the data from Non-SAP to SAP thru WebDynpro Programming.
    Help out with the steps for getting the data or procedure.
    Regards,
    Mutyapu

    You can expose the APIs in the Non-SAP backend as Web Services, and consume them in SAP by creating an Enterprise Proxy. Then these can be called just like normal class methods from Web Dynpro.
    Regards,
    Nithya

  • Get no. of lines in sap script

    I am using Command  'Address / End address' in sap script for printing address.
    How do I get the Number of Lines we get from this command.

    /: ADDRESS [DELIVERY] [TYPE t] [PARAGRAPH a] [PRIORITY p] [LINES l]
    /: ENDADDRESS
    LINES
    This specifies how many lines may be used for formatting the address.
    If there are too few lines available to allow all the address data to be formatted,
    then the data specified in the PRIORITY parameter are omitted.
    If there is no LINES parameter and if this command is in a layout set window of
    a type other than MAIN, then the number of lines available for formatting
    the address are automatically calculated based on the current output position
    and the size of the window.

  • Display data vertically using sap script

    Hi Developers,
    Is there any way to display data vertically in a form using sap script?
    thanx in advance,
    binu

    Hi Binu,
    It is not possible to rotate text in SAPscript.  The usual work-around, provided this is static text and not from a variable, is to scan an image of the text and include it as a graphic.
    Regards,
    Nick

  • Getting the error in the sap script

    Hi,
    I am running the Tcode f.26, which uses the standard sap script named F_DUZI_01. When running I am getting the error:
    Element 0031 window INFO is not defined for
    F_DUZI_01
    Please suggest what should i do or what could be the reason behind the problem.

    Hi,
    Check the Script whether that element is being used or not. Such  errors raise when you called the elements in the program without delcaring in the script.
    Please close the thread, if solved
    Regards,
    Aditya

  • Date printing in SAP SCRIPT

    hi friends,
    I am workin in sap script, here i had used  
    PERFORM GET_DATE IN PROGRAM ZTEST
    USING &EKPO-EBELN&
    USING &EKPO-EBELP&
    CHANGING &DEL_DATE&
    ENDPERFORM
    AND in subroutine program i had writen logic to fetch date,
    but when I am printing date in my script, it is printed in format yyyymmdd, and i wan it in dd.mm.yyyy
    so is there any standard way i can do it?

    hi,
    CONVERSION_EXIT_PDATE_OUTPUT , use this function module
    or
    Write the below code in your subroutine
    DATA : wa_date(8) ,
           wa_date1(10).
    wa_date = sy-datum.
    CONCATENATE wa_date+6(2) WA_DATE+4(2) wa_date+0(4) INTO wa_date1 SEPARATED by '.'.
    WRITE wa_date1.
    Thanks & Regards
    Edited by: Always Learner on Dec 11, 2008 10:01 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.

  • 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.

  • 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

  • Urgent ......regarding date format in SAP Script

    In my MAIN WINDOW  I have date fields like Date of Manifacture, created date and Expiry date.
    So, currently  I am using SET DATE MASK = 'YYYY-MM' and it is printing same format for all fields.
    But now my requirement is I want to show date for Expiry Date like 'YYYY-MM-DD'. For this I defined one temparary variable in the form like below
    DEFINE &outdate& = &mchar-vfdat&
    SET &outdate& MASK = 'YYYY-MM-DD'.
    but still it is showing format YYYY-MM...
    Plz help me how to print my desired date format...
    I am waiting for ur reply...
    Regards,
    Kumar

    Hi Kishore kumar,
    What you can do is befor printing the Expiry date set the date Mask as 'YYYY-MM-DD' and after printing your Expiry Date again set the DATE MASK to 'YYYY-MM'
    i.e.
    /: SET DATE MASK = 'YYYY-MM-DD'
       &mchar-vfdat&
    /: SET DATE MASK = 'YYYY-MM'
    Regards,
    Sunil

  • Two spool getting generated for a single SAP script

    Hi ABAPers,
    I have a SAPscript development. This is a PO form for India. When I do a "Trial printout" in ME9K I see that two spools are generated. This is my first problem as till last week only one spool was getting generated. Only spool should be generated.
    My second problem is that, the second spool which is generated has texts shown in some different language than English (my form only exists in language EN which is the orginal one too). When I debugged this whole thing, on the second run of the debugger (i.e. when the second spool is generated), when the control goes to a text in one of the windows, that text is shown in some other language (in debug mode also). Please note that the standard text is a Global standard text and it exists in around 6 languages.
    I guess if only one spool is generated then my second problem would be solved. But then why are 2 spools generated in the first place?
    If anyone has came across similar kind of problem please help. Thanks in advance.
    regards,
    Prakhar

    Hi,
       Check this..
    1. Go to txn. NACE... select application "EF"... then click on "Condition Records" button
    2. Select your Output Types...(ex. NEU)....
    3. Go to Change condtion Record Screen. Select ur condtion then click on "communication" button..
    4. Under Print Output Check the field "Number of Message" if it is 2 then delete it.
    Regards
    GK.

  • SAP Script OTF data problem

    hello,
    Im trying to convert a script to pdf data.
    In the open_form I set getotf = 'X' and in the close form , i get the OTf data.
    I convert this otf to pdf data.
    In the pdf output, I only have the static fields and no data.Though the number of pages generated are same in the PDF output and the script.
    help me figure it out ..

    Hi,
    There is a very useful post to check how you have converted otf to pdf:
    Emailing Sap Scripts
    Cheers,
    Bhanu

  • 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

Maybe you are looking for

  • Sat Pro M10 will not boot up anymore

    My Sat Pro M10 worked fine until yesterday. I removed the harddrive just to check Part number (as i need to install a larger drive and want to make sure I got it right)and then re-inserted it. Now it boots up as far as the XP Pro loading screen (blac

  • .Mac Address Book/Contacts Design

    Perhaps I am just not finding what I am looking for a would be happy if some one might clarify my frustration with Apple's design of the .Mac contacts features for the Address Book. As a writer/journalist, I am a person with a fairly sizable Address

  • How to display an image on the HTML page by using applet

    Dear friends, I am now writing an java applet, I want to display an image on the HTML page, and tried the following commands: {color:#ff00ff}{color:#000000}Image map; //put in the class definition map=getImage(getCodeBase(),"hhh.gif"); //put in the f

  • Size/time limit for AppleTV movie files?

    Scenario: I have a few hundred iMovie projects that I want to convert to AppleTV movies. My first project was just under two hours, and it converted fine. The second project was just under three hours total (33GB .DV file), and it crashed at 99% comp

  • Odd iBook question - g4 board in a g3 case?

    After dealing with another logic board failure on my iBook g3, I have reached the point of wondering if I should avoid the g3 boards entirely and go with an iBook g4 board this time. Does anyone know if the logic board from a 12" iBook g4 will physic