Smartforms abap

how to insert excel sheet into main window of smartform.
thank u,

Smartforms create spools (remember Adobe pdf format was a printer spool format at the beginning)
So you cannot include XLS in a spool.
You have to create a Table in your form.
Regards.
PS: Look at <a href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVSCRSF/BCSRVSCRSF.pdf">SAP Smart Forms</a>

Similar Messages

  • Smartform & ABAP Webdynpro & Internal table

    Hi Expert,
    I am able to open the smartfrom by using ABAP Webdynpro.
    But when I try to add the table under "Global Settings -> From Interface -> Table"
    Paramemter Name       Type Assignment    Associated Type
    I_ZSG_PAY_DATA     Like                          ZSG_PAY_DATA
    It works fine when I test it in t-code SMARTFORMS. But when I use the same ABAP Webdynpro program to open this smartform, the error appear.
    "Calling Parameter incorrect"
    Could you please let me know how to fix it?
    Thanks a lot,
    WF

    Hi William,
    If you have a working smartform then you should be able to display it in WD by passign its XSTRING to the PDFSOURCE of it.
    Just check that where you have written the code to get the XSTRING of smartform in WD. You might have modified the smartform interface and forgot to call the revised FM generated after the smartform was changed in WD.
    Just re-write the entire code to generate XSTRING for smartform and see if it works or not.
    You can also try to put a break point in the code and see where exactly it is failing i.e. whether it is to do with calling smartform or converting it or WD related.
    Thanks,
    Abhishek

  • SAP SmartForms (ABAP)

    hi,
    hope u r doing well, i am working on smartforms For first time.my doubt is :- 1) HOW TO USE STANDARD TEXT IN SMARTFORMS ? 2)How to display the contents of a standard text ?
    pls guide me with small example. i m waiting for ur reply ,
    Thanx in Adv.
    Prabhas

    hi,
    Refer these threads...
    smartforms
    SMARTFORMS
    Cheers
    Alfred
    Reward points for helpful answers

  • SMARTFORM for Carrier Instruction

    Hi
    I need to create a smartform for carrier instructions, this form do not have standard driver program. So i created a new zprogram, i am also calling FUNCTION SSF_FUNCTION_MODULE_NAME in my program. the fields that has to be displayed in the form are in different tables, I want help in getting the data into this function. Can anyone give me some example programs that i can look ?
    Thanks

    Hi,
    have a look at the below links, you will get an idea
    http://www.erpgenie.com/abap/smartforms.htm
    SAP SmartForms (ABAP)
    http://www.erpgenie.com/abap/smartforms_described.htm
    Regards
    Sudheer

  • SUMIT PARKASH - WARNING!!

    Dear moderators and users,
    I can see that this Sumit is trying to misuse this Forum. I guess he's preparing for an interview and is trying to gather information for all his questions.
    1) All the questions he's asking are already answered in some threads earlier. Instead of searching for them, he creates new threads.
    2) The following are the threads raised by him today alone.
    smartform
    ABAP Development » ABAP, General, Apr 11, 2007 1:32 AM
    what is diff between table and template in smartform?
    smartform
    ABAP Development » ABAP, General, Apr 11, 2007 1:30 AM
    in smartform i want to transfer the data from printprogram to smartform?how can i do?
    call transaction
    ABAP Development » ABAP, General, Apr 11, 2007 1:27 AM
    how we can know the data is updated in call transaction?
    lsmw
    ABAP Development » ABAP, General, Apr 11, 2007 1:13 AM
    plzz tell me the techniques in lsmw
    updation
    ABAP Development » ABAP, General, Apr 11, 2007 1:12 AM
    how can i know the updation is sucessfull?
    call transaction
    ABAP Development » ABAP, General, Apr 11, 2007 1:11 AM
    how we can handle errors in call transaction? could u plzz tell me?
    alv report
    ABAP Development » ABAP, General, Apr 11, 2007 1:03 AM
    how can i handle a button in alv report ,like in which event? could u plzz tell me?
    event
    ABAP Development » ABAP, General, Apr 11, 2007 1:01 AM
    what is the use of at-selection screen output,at-selection screen on field and at selection?could u ...
    Though many members have sincerely answered the questions, he has not closed the thread or awarded points to them. This sends out a wrong signal that none of the answers are correct.
    3) He opens new threads for the same question again and again.
    e.g.
    smartform
    ABAP Development » ABAP, General, Apr 11, 2007 1:32 AM
    smartform
    ABAP Development » ABAP, General, Apr 11, 2007 1:30 AM
    If he continues this, then we must start ignoring his questions.
    Moderators, please make a note of this.
    Thanks,
    Sam 

    I think Sumit is now  'sheik rahimul' .

  • Class CL_BCS Query for body part of mail

    HI,
    I want to send the mail with out attachement using Class CL_BCS. Can any body help me on how to send the message body in the mail using CL_BCS class....
    Thanx & Regards,
    Sameer

    Hi Sameer
    I've been struggling with this class CL_BCS too for a while and I want to give my experience with that class. Following a code example which will submit a report to memory and send the report as an attachment by mail thru the SMTP interface.
    *& Report  ZOBR_SEND_TRIP_SIM_BY_MAIL                                  *
    *& This program does following:
    *& 1. Submit a travel expense report to memory
    *& 2. Read the travel expense report from memory
    *& 3. Convert the travel expense report to HTML format
    *& 4. Copy the travel expense report from format RAW(1000) to RAW(255)
    *& 5. Send an email with body text and attachtments
    REPORT  zobr_send_trip_sim_by_mail                                  .
    DATA:
    gi_abaplist     TYPE TABLE OF abaplist,
    gi_html         TYPE          w3htmltab,
    gs_html         LIKE LINE OF  gi_html,
    gw_string       TYPE          string,
    gw_length       TYPE          i,
    gw_length_c     TYPE          so_obj_len,
    gi_solix        TYPE          solix_tab,
    gs_solix        LIKE LINE OF  gi_solix,
    gi_soli         TYPE          soli_tab,
    gs_soli         LIKE LINE OF  gi_soli,
    go_send_request TYPE REF TO   cl_bcs,
    go_document     TYPE REF TO   cl_document_bcs,
    go_sender       TYPE REF TO   cl_sapuser_bcs,
    go_recipient    TYPE REF TO   if_recipient_bcs,
    go_exception    TYPE REF TO   cx_bcs.
    * Submit report to memory
    SUBMIT rprtef00 "USER sy-uname
      EXPORTING LIST TO MEMORY AND RETURN
      WITH pnppernr EQ '00001000'
      WITH pnptimra EQ 'X'
      WITH pnpxabkr EQ 'D2'
      WITH pnppabrp EQ '11'
      WITH pnppabrj EQ '2006'
      WITH s_reisen EQ '0002600221'
      WITH hinz_dru EQ space
      WITH hinz_weg EQ space
      WITH hinz_dyn EQ 'X'
      WITH allesdru EQ 'X'
      WITH reisepro EQ 'X'
      WITH reisetxt EQ 'X'
      WITH sw_antrg INCL 'X'
      WITH addinfo EQ 'X'
      WITH extperio EQ '000'
      WITH simulate EQ space
      WITH einkopf EQ space.
    * Read report from memory
    CALL FUNCTION 'LIST_FROM_MEMORY'
      TABLES
        listobject = gi_abaplist
      EXCEPTIONS
        not_found  = 1
        OTHERS     = 2.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    * Convert report to HTML format
    CALL FUNCTION 'WWW_HTML_FROM_LISTOBJECT'
    * EXPORTING
    *   REPORT_NAME         =
    *   TEMPLATE_NAME       = 'WEBREPORTING_REPORT'
      TABLES
        html                = gi_html
        listobject          = gi_abaplist.
    LOOP AT gi_html INTO gs_html.
      CONCATENATE gw_string
                  gs_html
             INTO gw_string.
    ENDLOOP.
    gw_length = STRLEN( gw_string ).
    gw_length_c = gw_length.
    * copy table from format raw(1000) to raw(255)
    CALL FUNCTION 'TABLE_COMPRESS'
      TABLES
        in  = gi_abaplist
        out = gi_solix.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    TRY.
    *   Create persistent send request
        go_send_request = cl_bcs=>create_persistent( ).
    *   Create document (body text in text format)
        gs_soli = 'Trip is now settled, see attachment.'.
        APPEND gs_soli TO gi_soli.
        gs_soli = 'Reimbursement is paid out by your next salary.'.
        APPEND gs_soli TO gi_soli.
        go_document = cl_document_bcs=>create_document( i_type    = 'RAW'
                                                        i_text    = gi_soli
                                                        i_subject = 'Trip reimbursement' ).
    *   Add attachment (ABAP list format)
        CALL METHOD go_document->add_attachment
          EXPORTING
            i_attachment_type    = 'ALI'
            i_attachment_subject = 'Expense report(ALI)'
            i_att_content_hex    = gi_solix.
    *   Add attachment (HTML format)
        CALL METHOD go_document->add_attachment
          EXPORTING
            i_attachment_type    = 'HTM'
            i_attachment_subject = 'Expense report(HTM)'
            i_att_content_text   = gi_html.
    *   Add note (Text format)
        CALL METHOD go_send_request->set_note( gi_soli ).
    *   Add document to send request
        CALL METHOD go_send_request->set_document( go_document ).
    *   Get sender object
        go_sender = cl_sapuser_bcs=>create( sy-uname ).
    *   Add sender
        CALL METHOD go_send_request->set_sender
          EXPORTING
            i_sender = go_sender.
        go_recipient = cl_cam_address_bcs=>create_internet_address( '[email protected]' ).
    *   Add recipient with its respective attributes to send request
        CALL METHOD go_send_request->add_recipient
          EXPORTING
            i_recipient  = go_recipient
            i_express    = ' '
            i_copy       = ' '
            i_blind_copy = ' '
            i_no_forward = ' '.
    *   set send immediately flag
        go_send_request->set_send_immediately( 'X' ).
    *   Send document
        CALL METHOD go_send_request->send( ).
        COMMIT WORK.
    * Exception handling
      CATCH cx_bcs INTO go_exception.
        EXIT.
    ENDTRY.
    Notice that the only way to put a body text in the email is to call the method cl_document_bcs=>create_document with input of a type 'RAW'.
    Be aware of the settings of the SMTP node in SAPConnect (transaction SCOT) because the seetings could cource an unwanted conversion of the email.
    1. Doubbelclick on the TMTP node and a popup screen will show.
    2. Click on the 'Set' button next to 'Internet' under 'Supported address type' and a       popup screen will show.
    3. Set output format for SAP documents as 'SAPscript/Smart forms' = 'PDF', 'ABAP list' = 'PDF', 'RAW text' = 'TXT'.
    This setting will convert 'SAPscript/Smartforms', 'ABAP list' to PDF format. If 'RAW text' = 'PDF' the body text wil be converted to 'PDF' format and change to an attachment and the body text will disappear.
    Hope this is usefull for you and others.
    Best regards
    Ove Bryntesson
    Applicon A/S

  • How to comment in smartform for text value in abap

    how to comment in smartform for text value in abap.
    i want to comment text value which is coming in output
    From drag and drop option i had dropped an item text in text window and now i dont want to delete it i just want to comment it so can any one help me in commenting the text value.
    Advance Thanks for your help

    hi
    open the text element in the smartform.
    on the left corner, we have text editor button.
    open that and change the editor (goto-->change editor)
    on the new line, give the format as comment line /*. and you can write the comments as required.
    such lines doesnt reflect in the output layout.
    thanks
    pavan

  • How can i print data in smartforms from ABAP program.

    Dear gurus:
    in my abap program i process require data, and saved in a internal table.
    how can l print the data in smartforms.?
    who can give me a code sample is better:)
    reward all helpful advise.

    Try this....
    1) Tcode --> SmartForms
    2) Form name --> Z_SF_TEST Create
    3) Under Global settings
    a) Form Interface  
        Table Tab
       ITAB LIKE EKPO
    b) GLOBAL Definitions
    WA_NETPR LIKE EKPO-NETPR
    In smart forms if we want to display quantity and currency fields. We can't directly display currency field and quantity fields
    For that we have to create an extra variable in global definitions
    Ex: netpr FIELD of EKPO
    CREATE program lines and specify WA_NETWR = itab-netpr.
    4) RT CLick on main Window
       CREATE --> TABLE
      Click Table painter
    DEFAULT %LTYPE will be Created
    a) If you want more like Header footer etc add by rt click on %LTYPE1
    Table (Tab)
    %LTYPE  Radio(SELECT) 5 CM 5 CM 6 CM
    CLICK on DATA (Tab)
    INTERNAL TABLE ITAB LIKE ITAB
    5)RT click on table control and create --> program lines
    General attribute (Tab)
    INPUT PARAMETER               OUTPUT PARAMETER
    itab                               WA_NETPR
    Code Area
    WA_NETWR = ITAB-NETPR.
    6) RT CLcick on table ctl and create 3 text to display the fields
    a) % text1 +button(insert field)
       FIELD name &itab-ebeln&
    Output options (tab)
    Check New line   LINETYPE   %Ltype1
    check new cell
    b) % text2
       & itab-ebelp&
    output options
    check new cell
    c) % text2
       & wa_netpr&
    output options
    check new cell
    <b>Report ac
    Tables ekpo.
    Data: itab1 like ekpo occurs 0 with header line.
    select * into table itab1 from ekpo.
    Call function module --> smart form function module and pass your internal table</b>
    Regards,
    SaiRam

  • How do we call smartforms in abap program or web services

    how do we call smartforms in abap program or web services
    How many types of smartforms are there?
    points will be rewarded

    Hi
    See this sample program
    Using the fun module smartform is called from the program
    Calling SMARTFORMS from your ABAP program
    REPORT ZSMARTFORM.
    Calling SMARTFORMS from your ABAP program.
    Collecting all the table data in your program, and pass once to SMARTFORMS
    SMARTFORMS
    Declare your table type in :-
    Global Settings -> Form Interface
    Global Definintions -> Global Data
    Main Window -> Table -> DATA
    http://sapr3.tripod.com
    TABLES: MKPF.
    DATA: FM_NAME TYPE RS38L_FNAM.
    DATA: BEGIN OF INT_MKPF OCCURS 0.
    INCLUDE STRUCTURE MKPF.
    DATA: END OF INT_MKPF.
    SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
    SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
    MOVE-CORRESPONDING MKPF TO INT_MKPF.
    APPEND INT_MKPF.
    ENDSELECT.
    At the end of your program.
    Passing data to SMARTFORMS
    <b>call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZSMARTFORM'</b>
    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 <b>FM_NAME</b>
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    CONTROL_PARAMETERS =
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    OUTPUT_OPTIONS =
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    JOB_OUTPUT_INFO =
    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.
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Calling smartform and displaying ALV grid in ABAP WEBDYNPRO

    Hi all,
    I am new to ABAP web dynpro.I ahve few custom reports which are simple ALV list reports which I now need to convert to ABAP web dynpro application .
    For one particular report,based on the selection screen input,I need to display the ALV list and when I select the records from the ALV list,I need to call a smartform on clik of a push button.
    My questions:
    1. Im using 'REUSE_ALV_GRID_DISPLAY' FM  to display the o/p in my report.Is there any similar FM in webdynpro ABAP which will display my list in ALV GRID in my web dynpro application??/
    2. How to call a smartfrm in ALV grid in web dynpro??
    Edited by: abap_1000 on Jan 9, 2011 6:09 PM

    Hi,
    You can search SDN, there are several posts available. Just to get some idea, you can check --
    [Beginneru00B4s questions on WDA ALV;
    [Reg ALV Display;
    For clicking event on ALV --
    [Reg Row Data fetching on click in ALV;
    For ALV display on WDA --
    [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/101df93f-4b5c-2910-14aa-9eb0338c2110?quicklink=index&overridelayout=true]
    Thanks.
    Kumar Saurav.

  • Smartforms : Repeation of data on the smartforms, but in ABAP is correct.

    Hi all,
    I am fetching the data on the smartforms by ABAP program, but when it is comming on the smartforms, it is repeat.
    In the ABAP program, i have a internal table which is contain the some fields, and in the smartforms, i am using the table ->Program lines ->Text to show the data. so how am i correct it.?
    Regards,

    Hi,
    I have a internal table with data as:
    doc no            ref. no          posting_key             amount
    1002               po/0012          31                         15000
    1002               po/0012          40                          1000
    1002               po/0012          50                          500
    and i have a four variable as: netamt, grsamt, tdsamt & othamt.
    then i have a condition as :
    IF WA_FINAL-BSCHL = '31'.
      NETAMT = WA_FINAL-DMBTR.
    ENDIF.
    IF WA_FINAL-BSCHL = '40'.
      GRSAMT = WA_FINAL-DMBTR.
    ENDIF.
    IF WA_FINAL-BSCHL = '50'.
      TDSAMT = WA_FINAL-DMBTR.
    ENDIF.
    READ TABLE T_FINAL INTO WA_FINAL
      WITH KEY BELNR = WA_FINAL-BELNR.
      OTHAMT = WA_FINAL-DMBTR.
    alter this conditon i want to show the data on the smartforms as:
    srno.        docno         refno     netamt(net amt)          grsamt(gross amt)        tdsamt(tds amt)          othamt (other amt)
    Regards,

  • Smartform in web dynpro Abap

    Hi,
    I'm trying to implement a web dynpro abap with a smartform.
    I used the "How to Display a Smartform as PDF document in Web Dynpro for ABAP" document that e can find on sdn.
    My problem is that when the form is called, there is  a dump
    "Please maintain an output device in your user master data. ".
    I copied  the code in a report and the form is displayed.
    Did I miss something?
    Kr
    Karim

    This workaround solution for smartForms sends the output to the Spool and then converts the spool to PDF.  For it to work it has to have a printer id for the formatting to the spool. You must maintain a default printer in your user ID or pass in a printer into the output settings of the smartForms function module. Because all of this is occuring in the background, the smartForms function modules can't just popup a dialog asking for a printer.

  • Convert smartform as PDF from ABAP Webdynpro

    Hi,
    I want to convert smartform as pdf from ABAP webdynpro.
    Flow: SmartForm-->Generating Function Module -->Getting Output Data --> Converting OTF to PDF --> Open/Save PDF file in ABAP webdynpro.
    What are the sequence of function modules to be used for this?
    OR
    Is there any other way to convert smartform as pdf from ABAP webdynpro?
    plz give me the flow and FM'details clearly in detail.

    Look here https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f0de1eb8-0b98-2910-7996-8a3c2fcf6785
    Cheers
    Graham Robbo

  • Display Smartform Pdf output in ABAP Webdynpro application

    Hello,
    there is a solution for displaying Smartform output in Java Webdynpro application in this forum. Since i want to start an project in ABAP Webdynpro i need a solution for this technology since i don't want to recreate all the paperwork again using Adobe. Is there any solution available?
    Thanks
    Udo Ahle

    Hello,
    this is the solution which i was able to implement using the hints given by Heidi and Thomas. Thank you for the support. With this solution it is possible to reuse oldstyle sapscripts and smartforms in todays environment.  Here is the sample code which solves the problem:
    In WDA you define for example a pushbutton to start the display of the PDF.
    In the onaction method you implement:
    method ONACTIONSHOW_PDF .
      data LX_pdf type xstring.
    * get PDF from existing sapscript or smatform
      call function 'Y_PDF_GET' destination '46c'
        IMPORTING
          ex_PDF = LX_PDF.
    * append the pdf to the response
      cl_wd_runtime_services=>attach_file_to_response(
        i_filename  = 'Hello.PDF'
        i_content   = lx_pdf
        i_mime_type = 'application/pdf'
        i_in_new_window = 'X'
        i_inplace       = 'X' ).
    endmethod.
    The function 'Y_PDF_GET' is implemented as follows:
    FUNCTION Y_PDF_GET .
    *"*"Local interface:
    *"  EXPORTING
    *"     VALUE(EX_PDF) TYPE  XSTRING
    *"  TABLES
    *"      ET_OTF STRUCTURE  ITCOO OPTIONAL
      data: lf_filesize type i,
            lt_otf type table of ITCOO,
            lt_lines type table of tline,
            tline type tline.
    * start sapscript or smatforms and return
      perform make_otf.
      CALL FUNCTION 'READ_OTF_FROM_MEMORY'
        TABLES
          OTF                = lt_otf
       EXCEPTIONS
         MEMORY_EMPTY       = 1
         OTHERS             = 2
      et_otf[] = lt_otf.
      CALL FUNCTION 'CONVERT_OTF'
       EXPORTING
         FORMAT                      = 'PDF'
    *   MAX_LINEWIDTH               = 132
    *   ARCHIVE_INDEX               = ' '
       IMPORTING
         BIN_FILESIZE                = lf_filesize
        TABLES
          OTF                         = lt_otf
          LINES                       = lt_lines
       EXCEPTIONS
         ERR_MAX_LINEWIDTH           = 1
         ERR_FORMAT                  = 2
         ERR_CONV_NOT_POSSIBLE       = 3
         OTHERS                      = 4
      IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * convert tline to xstring as needed in
    * in web dynpro            
      field-symbols <X>.
      data: st(268) type c.
      data l1 type i.
      data len type i.
      data maxline type i value 134.
      l1 = 0.
      loop AT lt_lines INTO tline.
        clear st.
        st+l1(maxline) = tline.
        len = maxline + l1.
        l1 = maxline - strlen( tline ).
        ASSIGN st TO <x> TYPE 'X'.
        CONCATENATE ex_pdf <x>(len) INTO ex_pdf.
      endloop.
    ENDFUNCTION.
    The make_otf for sapscript is the following:
    * the next attribute enables the otf output.
    * no other output will be generated
    <b>options-TDGETOTF = 'X'</b>
      CALL FUNCTION 'OPEN_FORM'
           EXPORTING
    *         APPLICATION        = 'TX'
    *         ARCHIVE_INDEX      = ARCHIVE_INDEX
             ARCHIVE_PARAMS     = ARCHIVE_PARAMS
                DEVICE             = DEVICE
                DIALOG             = ' '
                FORM               = FORM
                LANGUAGE           = language
               OPTIONS            = OPTIONS
    *     IMPORTING
    *          LANGUAGE           =
    *          NEW_ARCHIVE_PARAMS =
    *          RESULT             =
           EXCEPTIONS
                CANCELED           = 1
                DEVICE             = 2
                FORM               = 3
                OPTIONS            = 4
                UNCLOSED           = 5
                OTHERS             = 6.
    *... make some write forms
      data lT_OTF     type table of     ITCOO.
    * get the otf data
      CALL FUNCTION 'CLOSE_FORM'
    *     IMPORTING
    *          RESULT   = result
           TABLES
               OTFDATA  = lt_otf
           EXCEPTIONS
                UNOPENED = 1
                OTHERS   = 2.
    * put otf into memory for later usage
      if not lt_otf is initial.
        CALL FUNCTION 'SAVE_OTF_TO_MEMORY'
    * EXPORTING
    *   MEMORY_KEY       = 'DEF_OTF_MEMORY_KEY'
          TABLES
            OTF              = lt_otf.
      endif.
    For Smartforms technology it is possible to implement the same concept.

  • Exception condition "CNTL_ERROR WD-abap Smartform to pdf

    Hii, 
    I am using a webdynpro - abap application. I am showing  a smartform as a pdf in one on the windows.
    When the link in the main window is clicked, a secondary window. Instead of the pdf, I get following exception.Kindly help me understand, where would I be going wrong. Let me know if more details required.
    **Exception condition "CNTL_ERROR" raised. **
    Form: PBO_HTML_CONTROL of program SAPLSTXBC
    Module: HTML_CONTROL of program SAPLSTXBC
    Function: SSFCOMP_PDF_PREVIEW of program SAPLSTXBC
    Method: DISPLAYPDF of program /1BCWDY/2TKFRFPNZA4CZYBGEB8F==CP
    Method: IF_COMPONENTCONTROLLER~DISPLAYPDF of program /1BCWDY/2TKFRFPNZA4CZYBGEB8F==CP
    Method: ONACTIONPDF of program /1BCWDY/2TKFRFPNZA4CZYBGEB8F==CP
    Method: IF_WDR_VIEW_DELEGATE~WD_INVOKE_EVENT_HANDLER of program /1BCWDY/2TKFRFPNZA4CZYBGEB8F==CP
    Method: INVOKE_EVENTHANDLER of program CL_WDR_DELEGATING_VIEW========CP
    Method: IF_WDR_ACTION~FIRE of program CL_WDR_ACTION=================CP
    Method: DO_HANDLE_ACTION_EVENT of program CL_WDR_WINDOW_PHASE_MODEL=====CP
    The code in the DISPLAYPDF method is as follows:
    method DISPLAYPDF .
    DATA: I_RS38L_FNAM TYPE  RS38L_FNAM.
    DATA: CTRL TYPE SSFCTRLOP.
    DATA: OUT TYPE  SSFCOMPOP.
    DATA: I_SSFCRESCL TYPE SSFCRESCL.
    DATA: LT_OTFDATA TYPE TABLE OF ITCOO.
    CTRL-GETOTF = 'X'.
    CTRL-NO_DIALOG = 'X'.
    CTRL-PREVIEW = 'X'.
    OUT-TDNEWID = 'X'.
    OUT-TDDELETE = ' '.
    data: i_tsp03 type tsp03.
    clear i_tsp03.
    select single * from tsp03 into i_tsp03.
    *OUT-TDDEST = i_tsp03-PADEST.
    OUT-TDDEST = 'TEP1'.
    ********get context data
      DATA lo_nd_zwebquestionaire TYPE REF TO if_wd_context_node.
      DATA lo_el_zwebquestionaire TYPE REF TO if_wd_context_element.
      DATA ls_zwebquestionaire TYPE wd_this->element_zwebquestionaire.
    * navigate from <CONTEXT> to <ZWEBQUESTIONAIRE> via lead selection
      lo_nd_zwebquestionaire = wd_context->get_child_node( name = wd_this->wdctx_zwebquestionaire ).
    * get element via lead selection
      lo_el_zwebquestionaire = lo_nd_zwebquestionaire->get_element(  ).
    * get all declared attributes
      lo_el_zwebquestionaire->get_static_attributes(
        IMPORTING
          static_attributes = ls_zwebquestionaire ).
    ********get context data ends
    data: itab1 type TCHAR255.
    data: itab2 type TCHAR255.
    data: itab type zprint. "addition by chandani
    data fm_name type rs38l_fnam..
    clear fm_name.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        FORMNAME             = 'ZCPESMARTFORM'
      IMPORTING
        FM_NAME              = fm_name
      EXCEPTIONS
        NO_FORM              = 1
        NO_FUNCTION_MODULE   = 2
        OTHERS               = 3.
    CALL FUNCTION fm_name
    EXPORTING
    *   ARCHIVE_INDEX              =
    *   ARCHIVE_INDEX_TAB          =
    *   ARCHIVE_PARAMETERS         =
       CONTROL_PARAMETERS         = CTRL
    *   MAIL_APPL_OBJ              =
    *   MAIL_RECIPIENT             =
    *   MAIL_SENDER                =
       OUTPUT_OPTIONS             = OUT
       USER_SETTINGS              = ' '
       NAME                       = 'test'
       ZWEBQUESTIONAIRE           = ls_ZWEBQUESTIONAIRE
    IMPORTING
    *   DOCUMENT_OUTPUT_INFO       =
       JOB_OUTPUT_INFO            = I_SSFCRESCL
    *   JOB_OUTPUT_OPTIONS         =
    TABLES                                  "addition by chandani
      itab                         = itab   "addition by chandani
    * 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.
    REFRESH LT_OTFDATA.
    LT_OTFDATA[] = I_SSFCRESCL-OTFDATA[].
    CALL FUNCTION 'SSFCOMP_PDF_PREVIEW'
      EXPORTING
        I_OTF                          = LT_OTFDATA
    * EXCEPTIONS
    *   CONVERT_OTF_TO_PDF_ERROR       = 1
    *   CNTL_ERROR                     = 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.
    DATA: PDF_DATA TYPE XSTRING,
          PDF_SIZE TYPE I.
    DATA: L_DUMMY TYPE STANDARD TABLE OF TLINE.
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
       FORMAT                      = 'PDF'
    *   MAX_LINEWIDTH               = 132
    *   ARCHIVE_INDEX               = ' '
    *   COPYNUMBER                  = 0
    *   ASCII_BIDI_VIS2LOG          = ' '
    *   PDF_DELETE_OTFTAB           = ' '
    IMPORTING
       BIN_FILESIZE                = PDF_SIZE
       BIN_FILE                    = PDF_DATA
      TABLES
        OTF                         = LT_OTFDATA
        LINES                       = L_DUMMY
    * EXCEPTIONS
    *   ERR_MAX_LINEWIDTH           = 1
    *   ERR_FORMAT                  = 2
    *   ERR_CONV_NOT_POSSIBLE       = 3
    *   ERR_BAD_OTF                 = 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.
      DATA lo_nd_pdf TYPE REF TO if_wd_context_node.
      DATA lo_el_pdf TYPE REF TO if_wd_context_element.
      DATA ls_pdf TYPE wd_this->element_pdf.
      DATA lv_sources LIKE ls_pdf-sources.
    * navigate from <CONTEXT> to <PDF> via lead selection
      lo_nd_pdf = wd_context->get_child_node( name = wd_this->wdctx_pdf ).
    * get element via lead selection
      lo_el_pdf = lo_nd_pdf->get_element(  ).
    * get single attribute
      lo_el_pdf->Set_attribute(
        EXPORTING
          name =  `SOURCES`
          value = PDF_DATA ).
    endmethod.

    Use -  with gui_download
    call method cl_gui_frontend_services=>environment_get_variable
    exporting
    variable = p_envir_name
    changing
    value = ls_envir_path
    exceptions
    cntl_error = 1
    error_no_gui = 2
    others = 3.
    call method cl_gui_cfw=>flush
    exceptions
    cntl_system_error = 1
    cntl_error = 2
    others = 3.
    And refer the below notes: 972762
    ITS 620 Patch 23 and SAPKB62061
    ITS 640 Kernel Patch 148 and SAPKB64019
    ITS 700 Kernel Patch 77 and SAPKB70010
    and also refer the link below to get more info
    http://www.sapfans.com/forums/viewtopic.php?f=13&t=325628&start=15
    thanx
    suriya

Maybe you are looking for

  • Sharper Image Projector EC-PJ10

    I know that this projector isn't going to be the best thing since sliced bread, but I'd expect more from their manufacturer. I sent an email asking their manufacturer a simple question, what's the specifications of the product, resolution, lumens out

  • Exception message 56 "shortage in planning time fence" meaningless

    Hi, I would love to use in PP R3 this message 56 "shortage in planning time fence" to detect as a matter of priority the situations where planned orders are too late or too small to meet demand and a planned shortage exists. But this message seems to

  • EWA For EP System

    Hi All, I want to generate EWA report for my Enterprise Portal system which is JAVA Based. I had read the document attached in note 976054. As per this note data will be collected using SMD. Now I want to know that from where can I start SMD? Is the

  • Move pages between documents

    Hi! How can i move a page between two documents?

  • OS X sees disconnected iPhone

    Hi, hope someone can help me out. My Mac is keeps 'seeing' an iPhone that is not connected to the system. OS X keeps on thinking it is connected, but it's not. How can I 'delete' this phantom device so that OS X knows it's not connected anymore? Ther