Calling a Smartform and attaching it to an email

Hi,
I have two programs. Program 1 is an ABAP program which creates a PDF from the output using SUBMIT TO SAP-SPOOL then CONVERT_ABAPSPOOLJOB_TO_PDF. It then attaches the PDF to an email and sends the mail. Program 2 produces a Smartform. When sending the email from program 1 I would like to call program 2 and automatically attach the smartform to my email before sending it.
I have tried using SUBMIT_TO_SAP-SPOOL but this fails because there is no spool output - even when I print the smartform.
I think I may be able to do it by using SUBMIT and EXPORT LIST TO MEMORY, bringing back the list using LIST_FROM_MEMORY and maybe using the returned list to create the smartform internally in program 1.
I haven't yet tried this because it seems a long winded way of going about things and I thought I would ask and see if anyone had achieved this in a less contrived way. Any suggestions?

Thanks Abhinab, this works well.
Just to flesh it out a bit for future reference.
Use  SUBMIT TO SAP-SPOOL WITHOUT SPOOL DYNPRO AND RETURN.
In the called program, when calling the smartform fm, set control_parameters-getotf = 'X'. This returns the otf data to job_output_info-otfdata. Export this to memory.
Back in the calling program. Import the otfdata from memory. Use function 'CONVERT_OTF' or CONVERT_OTF_2_PDF to convert teh smartform otf to PDF format.
Attach the PDF to email in the ususal way.

Similar Messages

  • I tried to sync my iPod touch to a new laptop and it deleted all of my music and videos. I called tech support and they told me to email iTunes and they would give it back to me. How do I do this??

    I  tried to sync my iPod touch to a new MacPro laptop and it deleted all of my music and videos. I called tech support and they told me to email iTunes and they would give it back to me. How do I do this??

    Correct. When you update via iTunes all synced media that is not in your iTunes library will be lost.
    As IO said before:
    You can redownload most iTunes pruchases by:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store
    I do not think it included audio books.

  • Smartform and attachment

    Hi all .,
    I would like to attach to a smartform the text of another smartform and send both of them as ONE mail .
    can some one tell if it's possible at all and if yes, in which format ? pdf , html....
    and HOW to do it .
    thanks and regards,
    liliane

    Hi
    check...
    /people/pavan.bayyapu/blog/2005/08/30/sending-html-email-from-sap-crmerp
    and the sample code
    REPORT Ztest_SEND_SMARTFORMS .
    Internal Table declarations
    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.
    call function 'SSF_FUNCTION_MODULE_NAME'
    exporting
    formname = 'ZZZ_TEST1'
    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'
    IMPORTING
    job_output_info = w_return
    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
    IMPORTING
    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.
    Fehlerhandling
    if sy-subrc <> 0.
    endif.
    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.
    Attachment
    refresh:
    i_reclist,
    i_objtxt,
    i_objbin,
    i_objpack.
    clear wa_objhead.
    i_objbin[] = i_record[].
    Create Message Body
    Title and Description
    i_objtxt = 'test with pdf-Attachment!'.
    append i_objtxt.
    describe table i_objtxt lines v_lines_txt.
    read table i_objtxt index v_lines_txt.
    wa_doc_chng-obj_name = 'smartform'.
    wa_doc_chng-expiry_dat = sy-datum + 10.
    wa_doc_chng-obj_descr = 'smartform'.
    wa_doc_chng-sensitivty = 'F'.
    wa_doc_chng-doc_size = v_lines_txt * 255.
    Main Text
    wa_doc_chng-doc_size = ( v_lines_txt - 1 ) * 255 + strlen( i_objtxt )
    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.
    Attachment
    (pdf-Attachment)
    i_objpack-transf_bin = 'X'.
    i_objpack-head_start = 1.
    i_objpack-head_num = 0.
    i_objpack-body_start = 1.
    Länge des Attachment ermitteln
    describe table i_objbin lines v_lines_bin.
    read table i_objbin index v_lines_bin.
    i_objpack-doc_size = v_lines_bin * 255 .
    i_objpack-body_num = v_lines_bin.
    i_objpack-doc_type = 'PDF'.
    i_objpack-obj_name = 'smart'.
    i_objpack-obj_descr = 'test'.
    append i_objpack.
    clear i_reclist.
    i_reclist-receiver = ‘[email protected]’.
    i_reclist-rec_type = 'U'.
    append i_reclist.
    call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = wa_doc_chng
    put_in_outbox = 'X'
    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.
    The user is provided with
    a) file name
    b) email address to send mail
    and it sends ANY FILE (.xls,.pdf .xyz..)
    Instantaneously !
    4. Make two things first :
    1. Include with the name : ZAMI_INCLFOR_MAIL
    2. Report with the name : ZAM_TEMP147 (any name will do)
    3. Activate both and execute (2)
    4. After providing filename, email adress
    5. Code for Include :
    Data
    DATA: docdata LIKE sodocchgi1,
    objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
    objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
    objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    objhex LIKE solix OCCURS 10 WITH HEADER LINE,
    reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
    DATA: tab_lines TYPE i,
    doc_size TYPE i,
    att_type LIKE soodk-objtp.
    DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
    FORM
    FORM ml_customize USING objname objdesc.
    Clear Variables
    CLEAR docdata.
    REFRESH objpack.
    CLEAR objpack.
    REFRESH objhead.
    REFRESH objtxt.
    CLEAR objtxt.
    REFRESH objbin.
    CLEAR objbin.
    REFRESH objhex.
    CLEAR objhex.
    REFRESH reclist.
    CLEAR reclist.
    REFRESH listobject.
    CLEAR listobject.
    CLEAR tab_lines.
    CLEAR doc_size.
    CLEAR att_type.
    Set Variables
    docdata-obj_name = objname.
    docdata-obj_descr = objdesc.
    ENDFORM. "ml_customize
    FORM
    FORM ml_addrecp USING preceiver prec_type.
    CLEAR reclist.
    reclist-receiver = preceiver.
    reclist-rec_type = prec_type.
    APPEND reclist.
    ENDFORM. "ml_customize
    FORM
    FORM ml_addtxt USING ptxt.
    CLEAR objtxt.
    objtxt = ptxt.
    APPEND objtxt.
    ENDFORM. "ml_customize
    FORM
    FORM ml_prepare USING bypassmemory whatatt_type whatname.
    IF bypassmemory = ''.
    Fetch List From Memory
    CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
    listobject = listobject
    EXCEPTIONS
    OTHERS = 1.
    IF sy-subrc <> 0.
    MESSAGE ID '61' TYPE 'E' NUMBER '731'
    WITH 'LIST_FROM_MEMORY'.
    ENDIF.
    CALL FUNCTION 'TABLE_COMPRESS'
    IMPORTING
    COMPRESSED_SIZE =
    TABLES
    in = listobject
    out = objbin
    EXCEPTIONS
    OTHERS = 1
    IF sy-subrc <> 0.
    MESSAGE ID '61' TYPE 'E' NUMBER '731'
    WITH 'TABLE_COMPRESS'.
    ENDIF.
    ENDIF.
    Header Data
    Already Done Thru FM
    Main Text
    Already Done Thru FM
    Packing Info For Text Data
    DESCRIBE TABLE objtxt LINES tab_lines.
    READ TABLE objtxt INDEX tab_lines.
    docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
    CLEAR objpack-transf_bin.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = 'TXT'.
    APPEND objpack.
    Packing Info Attachment
    att_type = whatatt_type..
    DESCRIBE TABLE objbin LINES tab_lines.
    READ TABLE objbin INDEX tab_lines.
    objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
    objpack-transf_bin = 'X'.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = att_type.
    objpack-obj_name = 'ATTACHMENT'.
    objpack-obj_descr = whatname.
    APPEND objpack.
    Receiver List
    Already done thru fm
    ENDFORM. "ml_prepare
    FORM
    FORM ml_dosend.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = docdata
    put_in_outbox = 'X'
    commit_work = 'X' "used from rel. 6.10
    IMPORTING
    SENT_TO_ALL =
    NEW_OBJECT_ID =
    TABLES
    packing_list = objpack
    object_header = objhead
    contents_bin = objbin
    contents_txt = objtxt
    CONTENTS_HEX = objhex
    OBJECT_PARA =
    object_parb =
    receivers = 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 <> 0.
    MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
    WITH docdata-obj_name.
    ENDIF.
    ENDFORM. "ml_customize
    FORM
    FORM ml_spooltopdf USING whatspoolid.
    DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
    Call Function
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
    EXPORTING
    src_spoolid = whatspoolid
    TABLES
    pdf = pdf
    EXCEPTIONS
    err_no_otf_spooljob = 1
    OTHERS = 12.
    Convert
    PERFORM doconv TABLES pdf objbin.
    ENDFORM. "ml_spooltopdf
    FORM
    FORM doconv TABLES
    mypdf STRUCTURE tline
    outbin STRUCTURE solisti1.
    Data
    DATA : pos TYPE i.
    DATA : len TYPE i.
    Loop And Put Data
    LOOP AT mypdf.
    pos = 255 - len.
    IF pos > 134. "length of pdf_table
    pos = 134.
    ENDIF.
    outbin+len = mypdf(pos).
    len = len + pos.
    IF len = 255. "length of out (contents_bin)
    APPEND outbin.
    CLEAR: outbin, len.
    IF pos < 134.
    outbin = mypdf+pos.
    len = 134 - pos.
    ENDIF.
    ENDIF.
    ENDLOOP.
    IF len > 0.
    APPEND outbin.
    ENDIF.
    ENDFORM. "doconv
    *---- CODE FOR PROGRAM
    REPORT zam_temp147 .
    INCLUDE zami_inclfor_mail.
    DATA
    DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
    DATA : file_name TYPE string.
    data : path like PCFILE-PATH.
    data : extension(5) type c.
    data : name(100) type c.
    SELECTION SCREEN
    PARAMETERS : receiver TYPE somlreci1-receiver lower case.
    PARAMETERS : p_file LIKE rlgrap-filename
    OBLIGATORY.
    AT SELECTION SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CLEAR p_file.
    CALL FUNCTION 'F4_FILENAME'
    IMPORTING
    file_name = p_file.
    START-OF-SELECTION
    START-OF-SELECTION.
    PERFORM ml_customize USING 'Tst' 'Testing'.
    PERFORM ml_addrecp USING receiver 'U'.
    PERFORM upl.
    PERFORM doconv TABLES itab objbin.
    PERFORM ml_prepare USING 'X' extension name.
    PERFORM ml_dosend.
    SUBMIT rsconn01
    WITH mode EQ 'INT'
    AND RETURN.
    FORM
    FORM upl.
    file_name = p_file.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = file_name
    filetype = 'BIN'
    TABLES
    data_tab = itab
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17.
    path = file_name.
    CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
    EXPORTING
    complete_filename = path
    CHECK_DOS_FORMAT =
    IMPORTING
    DRIVE =
    EXTENSION = extension
    NAME = name
    NAME_WITH_EXT =
    PATH =
    EXCEPTIONS
    INVALID_DRIVE = 1
    INVALID_EXTENSION = 2
    INVALID_NAME = 3
    INVALID_PATH = 4
    OTHERS = 5
    ENDFORM. "upl
    Reward points for useful Answers
    Regards
    Anji

  • How to call a Smartform in Report to print Production Order

    Hi all,
    Can any one tell me how to develop a smartforms when the user selects the print button in ALV report.
    i.e, The requirement is when  the user presses the print button in ALV report, at that time it has call the smartform and it has to print the Report.
    Can any one shed some light on this.
    Regards
    Yathish

    Hi Yathish
    do it this way.
    in the ALV function call
    give in
    exporting
      I_CALLBACK_USER_COMMAND           = 'user_command '
    write a subroutine
    FORM user_command USING whatcomm TYPE sy-ucomm whatrow TYPE
    slis_selfield.
    case whatcomm.
       when 'print'.
          call 2 function modules here
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
           EXPORTING  FORMNAME           = P_FORM    "Your form name
                    variant            = ' '
                    direct_call        = ' '
           IMPORTING  FM_NAME            = FM_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.
        EXIT.
      ENDIF.
    calling the generated function module
    CALL FUNCTION FM_NAME
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
    CONTROL_PARAMETERS   = CPARAM
       OUTPUT_OPTIONS       =  OUTOP
      USER_SETTINGS        = SPACE
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
    IMPORTING
      JOB_OUTPUT_INFO      = TAB_OTF_DATA
      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.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endcase.
    endform.
    This is an example in the function gereated call give you own importing and exporting parameters.
    Kindly reward points if helpful.
    Regards
    Zarina

  • Difference between Smartforms and Sapscrits.

    Hi Experts,
    I have a interview coming up next week and I was just wondering: difference between Smartforms and SAPscripts..
    So experts, can anyone please let me know what are the main differences between Smartforms and SAPScripts??
    I will really appreciate your answers.. guys..
    Regards,
       -Ashok Patel.

    Hi,
    <b>Difference with SMARTFORMS vs. SapScript(SE71)</b>
    The Following are the differences :-
    a) Multiple page formats are possible in smartforms which is not the case in SAPScripts
    b) It is possible to have a smartform without a main window .
    c) Labels cannot be created in smartforms.
    d) Routines can be written in smartforms tool.
    e) Smartforms generates a function module when activated.
    f) Unlike sapscripts (RSTXSCRP), you cannot upload/download Smartform to your local harddisk. 
    It was said that it was provided in CRM 3.0 version, but not available in R/3.  You can download smartforms into Local PC in a XML format.  In the same way you can upload this XML format into Smartform.  From the smartform editor itself you can call download option, if you are working in CRM 3.0 environment. 
    In R3 also, you can download into XML format. However, it's not sure about uploading. Refer to the program 'SF_XSF_DEMO'.
    In 4.7 Enterprise, other have seen this utlity which is completey missing in 4.6c. There is functionality to downlaod a complete form or only a particular node. (Utilities -> Download form). It will create a XML file and save it in the hard disk. 
    For others, if you want to download/upload the Smartforms source, you will need the help from the Basis people.  What you can do is to create a Transport and then FTP down to your local harddisk.   When you need the Smartform source in another system, you have FTP up the Smartforms file back to the SAP server.  Finally, the Basis team, will tp it into your system.
    g) The protect and endprotect command in sapscript doesn't work with smartforms. For example on a invoice: First data of position no 80. is printed on page one, other data of position no 80 is printed on page 2. And there's nothing you can do about it.  Actually, there is something you can do about it.  By using a folder node and checking the 'protect' checkbox, everything in that folder will be page protected.
    Check the link,
    <u>http://www.sap-img.com/smartforms/sap-smart-forms.htm</u>
    <b>Conversion of SAPSCRIPT to SMARTFORMS</b>
    SAP provides a conversion for SAPscript documents to SMARTforms.
    This is basically a function module, called FB_MIGRATE_FORM. You can  start this function module by hand (via SE37), or create a small ABAP which migrates all SAPscript forms automatically.
    You can also do this one-by-one in transaction SMARTFORMS, under 
    Utilities -> Migrate SAPscript form.
    You could also write a small batch program calling transaction SMARTFORMS and running the migration tool.
    Hope it helps u.
    Thanks&Regards,
    Ruthra.R

  • How to attach scanned doc to email? (iPad 1)

    I would like to email docs scanned in from HP AIO.  How do I do that? Note: iPad 1, with no camera or camera roll)

    Start in the Photos app and use the icon top right of the box with the arrow coming out of it to select the photo and attach it to an email - if you are in thumbnail view in the Photos app you can use the same icon to select up to 5 photos to attach to an email via the Share button at the top left of the screen

  • Attaching smartform and print prog to invoice

    hi
    ive developed a smartform and a print program.
    da program has a selection screen dat asks user for doc number(vbeln).
    it den displays data in da smartform.
    now ive to attach it to va02.
    wen i attach it using v/40 output type(RD000)  program name : zinvoice and pdf/smartform: zinv .and try to get print preview using vf03 da preview doesnt appear.also wen i click on print it shows message "output cannot be issued".
    can ny1 suggest wat da problem is and how to resolve it...
    points 'll b rewarded.
    rgds

    first call the function module name using ssf_function module _name
    and then inluce  ur fm.
    as below.
    Reading the NAST and DOC structures
      CALL FUNCTION 'ME_READ_PO_FOR_PRINTING'
        EXPORTING
          ix_nast        = nast
          ix_screen      = ent_screen
        IMPORTING
          ex_retco       = ent_retco
          ex_nast        = l_nast
          doc            = l_doc
        CHANGING
          cx_druvo       = l_druvo
          cx_from_memory = l_from_memory.
      CHECK ent_retco EQ 0.
    SmartForm from customizing table TNAPR
      gv_formname = tnapr-sform.
    Calling the layout set
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = gv_formname
        IMPORTING
          fm_name            = gv_fm_name
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc <> 0.
        PERFORM protocol_update.
      ENDIF.
    For Print output:
      IF nast-nacha = '1'.                  " Print output
        ls_control_param-preview =   'X'.
        ls_control_param-no_dialog = 'X'.
      ENDIF.
    For fax output.
      IF nast-nacha = '2'.                  " Fax
    Create the Recipient Object
        CALL FUNCTION 'CREATE_RECIPIENT_OBJ_PPF'
          EXPORTING
            ip_country        = gv_land1
            ip_faxno          = gv_telfx
            ip_type_id        = lv_fax_tp
          IMPORTING
            ep_recipient_id   = ls_recipient_id
          EXCEPTIONS
            invalid_recipient = 1
            OTHERS            = 2.
        IF sy-subrc NE 0.
       IF write_out = 'X'.
          FORMAT COLOR 6.
          WRITE AT /5 text-004.
       ENDIF.
          RAISE other.
        ENDIF.
    Create The Sender Object
        CALL FUNCTION 'CREATE_SENDER_OBJECT_PPF'
          EXPORTING
            ip_sender      = sy-uname
          IMPORTING
            ep_sender_id   = ls_sender_id
          EXCEPTIONS
            invalid_sender = 1
            OTHERS         = 2.
        IF sy-subrc NE 0.
       IF write_out = 'X'.
          FORMAT COLOR 6.
          WRITE AT /5 text-003.
       ENDIF.
          RAISE other.
        ENDIF.
    Output options
        ls_output_options-tdteleland = gv_land1.
        ls_output_options-tdtelenum  = gv_telfx.
        ls_output_options-tdfaxuser  = sy-uname.
    Control parameters
        ls_control_param-device = lc_fax.
       ls_control_param-no_dialog = 'X'.
       ls_control_param-langu  = nast-tdspras.
      ENDIF.
      IF gv_fm_name IS NOT INITIAL.
    Below function module is used to show the Smart form
        CALL FUNCTION gv_fm_name
          EXPORTING
            is_nast            = l_nast
            doc                = l_doc
            control_parameters = ls_control_param
            output_options     = ls_output_options
            user_settings      = ' '
          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.
        ELSE.
        ENDIF.
      ENDIF.

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

  • How to call ALV Report and SMARTFORMS through Pushbutton

    hi,
    i have created a report.My task is to create two buttons:
    1)ALV Report.
    2)SMARTFROMS.
    Through these button i have to call ALV Report and SMARTFORMS. i have created both button and when i execute the program,
    it shows me the button but not working when i click on it.
    this is the coding i have used in my report for calling ALV Report.
    ''Tables sscrfields,
    DATA flag(1) Type c.
    selection-screen: begin of screen 500 AS WINDOW TITLE tit,
    BEGIN OF LINE,
    PUSHBUTTON 2(18) but1 USER-COMMAND cli1,
    end of line,
    BEGIN OF LINE,
    PUSHBUTTON 2(18) but2 USER-COMMAND cli2,
    end of line,
    end of screen 500.
    SET PF-STATUS 'STATUS_0100'.
    at selection-screen.
    case sscrfields.
    WHEN 'cli1'.
    flag = '1'.
    WHEN 'cli2'.
    flag = '2'.
    endcase.
    at USER-COMMAND.
    CASE SY-UCOMM.
    WHEN 'Detail'.
    select vbakkunnr VBakernam VBAkaudat vbakaufnr vbapKWMENG vbapmatnr vbap~ARKTX
    into but1
    from vbak inner join vbap
    on vbakvbeln = vbapvbeln.
    ENDSELECT.
    ENDCASE.
    START-OF-SELECTION.
    tit = 'Format'.
    but1 = 'ALV Report'.
    but2 = 'SMARTFORMS'.
    CALL SELECTION-SCREEN 500.
    and i also use in my report
    ''case sscrfields-ucomm'' and ''submit my_report'' but the still button doesn't show the result.
    Thanks & Regards,

    Hi,
             I  understood your requirement. What i found is,  you are creating screen 500 and call it after START-OF-SELECTION,
    at that time your AT USER-COMMAND doesn't work.
    So what i would suggest , u should create GUI STATUS named ' PFSTAT' 
    having one functional key 'EXIT'  that is standard u can just name it
    and
    other two u can assign in Freely assigned Function keys as 'BUT1' & 'BUT2'.  and than in Application Toolbar u jst have it in ITEM LIST by typing BUT1 and BUT2.
    For 'BUT1'  text would be 'ALV'  and 'BUT2' text would be 'SMARTFORMS'.
    Now in Program you can code,,,
    START-OF-SELECTION.
    SET PF-STATUS 'PFSTAT'.
    WRITE:/ 'TEST'.
    at user-command.
      case SY-UCOMM.
        WHEN 'BUT1'.
        WHEN 'BUT2'.
        WHEN 'EXIT'.
           LEAVE PROGRAM.
      endcase.
    In Program u set PF STATUS and use at user-command event, whcih gets triggered when u click on button . When u execute program you get two button in application tooldbar.
    Please do needful.
    Thanks,
    Saurin SHah

  • Attaching smartforms and print prog to invoice

    hi
    ive developed a smartform and a print program.
    da program has a selection screen dat asks user for doc number(vbeln).
    it den displays data in da smartform.
    now ive to attach it to va02.
    wen i attach it using v/40 output type(RD000) program name : zinvoice and pdf/smartform: zinv .and try to get print preview using vf03 da preview doesnt appear.also wen i click on print it shows message "output cannot be issued".
    can ny1 suggest wat da problem is and how to resolve it...
    points 'll b rewarded...
    rgds
    Message was edited by:
            abapuser

    1.
    How did u assigned the output type in NACE.
    2.
    did u go through the form routines of data/transfer copy controls in VOFM .
    if its VA02 and VF02 then VTFA has to be used for the same in setting the output type .
    if option 2 is not ur case then check with ur functional consultant as to which requirement this output is configured in the nace and in procedures.
    o/p cannot be issued is not able to pick the output type for the form and the print program.
    This output type has to be configured in NACE first of all.
    Then to test the invoice enable this output type for that vbeln number in GOTo-_header->output -> and enable the output type.
    regards,
    vijay

  • Submit Statement for calling smartform and using its data in another report

    Hello Everybody
    There is one report which display smartform as an output.  My requirement is to call that report and return back without showing its output and use its data for futher use in the report. i Hope i m clear with my query. Plzz reply its urgent.
    Currectly i m using this statement :
    SUBMIT  ZPOPRINT  WITH PO_NUM EQ IT_EKKO1-EBELN exporting list to memory and return.
    while executing the program, after this statement i m getting an output.  but i need to store it in memory, not to display the output.
    Waiting for ur reply..
    Thanks and Regards
    Virendra

    Hi.
    I have not done this kind of requirement. What i said was just an option which came to my mind. Also not sure whether it will work for you. While submitting ,instead of exporting list to memory do submit to SAP-SPOOL. Then later read the spool content to internal table.
    I am referring you two links for this.
    [Submit to SAP-SPOOL|http://help.sap.com/abapdocu_70/en/ABAPSUBMIT_LIST_OPTIONS.htm]
    [Spool to Internal table|spool file data to internal table].
    Also search for related topic in SCN.
    Regards
    Kesav

  • Print preview + sending smartform through attachment

    Hello experts,
    I have one smartform whose output is to be sent as email attachment.
    THe porblem is that i need to have preveiw also with email funtionality.
    When i give GETOTF paramter as 'X',it doesnot show preview and when i m passing it as blank,then it is not triggering a mail.
    May we have both functionalities at the same time.
    If yes ,how?

    Hi Anurodh,
    1. First call the smartform passing GETOTF as X and  NO_DIALOG as X, by doing this you get the the OTF table which you can send as an attachment.
    2. next once you are done with your mail send logic, call the smartform again only for preview
    even this looks like a redundant one but there is no way out.
    hope this helps.
    venkatesh.

  • Create a PDF document and attach it to a service order business transaction

    Hi all,
    I have following requirement. For a particular service order, i am reading the entire survey details and then my requirement is that i want to convert this details into a PDF document and then attach the document to the same service order.
    Right now, i have created a SMARTFORM which prints the required details. I got the OTFDATA of the smartform and now my problem is to convert it into PDF and then attach it to the service order .
    Kindly help.
    Points will be rewarded.
    Thanks in advance,
    Karan

    business object
    business_object-instid = guid.
    business_object-typeid = 'BUS2000116'.
    business_object-catid = 'BO'.
    PROPERTIES
    ls_loio_properties-name = 'DESCRIPTION'.
    APPEND ls_loio_properties TO l_loio_properties.
    ls_loio_properties-name = 'KW_RELATIVE_URL'.
    ls_loio_properties-value = 'Test'.
    APPEND ls_loio_properties TO l_loio_properties.
    CLEAR ls_loio_properties.
    ls_loio_properties-name = 'DESCRIPTION'.
    APPEND ls_loio_properties TO l_phio_properties.
    ls_loio_properties-name = 'KW_RELATIVE_URL'.
    ls_loio_properties-value = 'any name'.
    APPEND ls_loio_properties TO l_phio_properties.
    ls_loio_properties-name = 'LANGUAGE'.
    ls_loio_properties-value = 'EN'.
    APPEND ls_loio_properties TO l_phio_properties.
    FILE_ACCESS_INFO
    FILE_SIZE = l_filesize.
    mimetype = 'application/pdf'.
    file_name = 'any name'.
    binary_flg = 'X'.
    FILE_CONTENT_BINARY
    pass the binary content
    RAW_MODE
    X
    package_id  -> to create package id
    CONSTANTS: c_objtype   TYPE skwf_ioty VALUE 'P',
               c_sign      TYPE sdok_qusgn VALUE 'I',
               c_op        TYPE sdok_cxop VALUE 'NX'.
               c_class     TYPE sdok_class VALUE 'BDS_POC1'.
    DATA: appl TYPE skwf_appl.
    DATA: cspc TYPE sdok_ent VALUE 'CRM'.
            CALL FUNCTION 'CRM_KW_BOR_SET'
              EXPORTING
                iv_business_object = business_object.
            ls_selectors-type = c_objtype.
            ls_selectors-attribute = 'LANGUAGE'.
            ls_selectors-sign      = c_sign.
            ls_selectors-op        = c_op.
            APPEND ls_selectors TO lt_selectors.
            ls_selectors-type = c_objtype.
            ls_selectors-attribute = 'BDS_DOCUMENTTYPE'.
            ls_selectors-sign      = c_sign.
            ls_selectors-op        = c_op.
            APPEND ls_selectors TO lt_selectors.
    KW Framework: Context Treatment
            CALL FUNCTION 'SKWF_CTX_CREATE'
              EXPORTING
                context_class      = 'CRM_CTXCL'
                x_reduce_to_one    = reduce_to_one
                description        = 'Default Context'
                x_transient        = 'X'
              IMPORTING
                context_id         = lv_context_id
              TABLES
                instance_selectors = lt_selectors.
    KW Framework: Package Handling
            CALL FUNCTION 'SKWF_PKG_DYNAMIC_CREATE'
              EXPORTING
                package_desc   = 'PAKET'
                x_transient    = 'X'
                appl           = appl
                cspc           = cspc
                context_id     = lv_context_id
              IMPORTING
                new_package_id = l_pkgid
                error          = l_error.

  • How to?? show smartform and generate pdf at the same time

    hi experts,
    how can i show the smartform and generate  a pdf at the same time?? i have a control parameter gtotf in X and i generate the pdf but i want to show the smartform at the same time??
    thx in advance

    Hi...
    call fm <sf function name>
    exporting...
    importing..
    tables..
    now in the outputparam set the getotf as 'X'.
    call the same FM again and get the otf data.
    call fm <sf fm name>

  • Using what I believe is image capture, how do I go about pulling up a scanned document and attaching it to send it via email?

    Using what I believe is the app Image Capture, exactly how do I go about scanning and attaching a PDF document in order to email it?  After scanning it I'm having trouble locating it while attempting to attach it to an email.  Thanks.

    At the bottom left of the Image Capture window is a drop down menu called Scan To which will let you choose where your scan will be sent. Create a folder on your desktop named Scans and send your scans to it. Then rename the scan to whatever will help you remember what it is.
    Then when in Mail you can click on Attach and find the Scans folder and attach your scan.

Maybe you are looking for

  • XML registration problem In Oracle

    Hi Friends, First of all thanks in advance for reading my post. Also, congratulate you all to this modified forum. AS redirected from Oracle SQL/PLSQL forum i've to post it here once again. Sorry for the duplicate posting in this forum. :( My main ob

  • OC4J 9.0.2 on Oracle9iAS 1.0.2.2a

    Hi everyone, I've installed an Oracle9iAS 1.0.2.2a Enterprise Edition on my server. How can I upgrade internal OC4J to version 9.0.2? Or should I install an Oracle9iAS 9.0.2 Core Edition (HTTP Server + Web Cache + OC4J) on a new machine and reference

  • Dynamic file name using reciver file adpater if no Mapping  involved

    Hi XI/PI experts, I am working on one scenerion where I have to poll the files from one server and send them to target FTP server with no content conversion( no Mapping involved). for example: if the source file is ABC_Invoice_item.csv then the targe

  • My iphone won't sync

    my iphone wont sync

  • Can't find "services" folder in Library

    Hi, is this folder hidden ? I'm looking for the services folder in finder.. I just click on "Go" on the top menu, hold down the alt key, and select Library but I can't see the services folder .