Debugging Smartform Email

I am trying to find the FM which sends sales document as email instead of print - and where it derives the email address of the recipient. Any help is appreciated!
Thanks,
Mark.

HI Rakesh,
I am already using std SAP program and smartform for sales order but someone has questioned if email address to which document is being sent is populating correctly since we see many failures on SOST screen. I still am unable to locate where in the output process does the email address get populated and need to see it happen.
Thanks!
Mark.

Similar Messages

  • Send Smartform Email via Action Profile

    Hello,
    We have an Action Profile with a few actisn athat a workign perfectly.  I have added a new action to send  smartform via email when the the transaction is saved.
    The Action profile is set upfor object type BUS2000115(Quotation) with the context class of CL_DOC_CONTEXT_CRM_ORDER.
    I have set up the Smartform Email action processing as follows:
    Permitted processign type fo Action - Smartform Email
    Mail Settings:
    Form Name                       YC3_SF_CRM_COMM_QUOTATION_V7
    Processing Class              CL_CRM_BP_UM_PROCESSING_PPF
    Processing Method           UM_EXEC_SMART_FORM
    Archive Mode                    Mail only
    there is no schedule or start condition as it is not required.
    When I Save the Quotation nothing is getting triggered.  If in the Quotation I Preview output and select 'Email Quotation; I get the message 'Smartform Error'.  Is there a way to debug the message further ?  I'm assuming this is the SAP standard method of achieving Smartform email as Pdf attachment, are some steps that I have missed ?
    Regards
    Chan

    The Processing class and Processing Method seem to be incorrect.
    Use the below;
    Processing Class  : CL_DOC_PROCESSING_CRM_ORDER
    Processing Method: CRM_ORDER_EXEC_SMART_FORM
    You can always refer to standard action profile for Quotations to see what SAP has delivered.

  • Hai how to debug smartforms using SFTRACE .

    how to debug smartforms using SFTRACE .

    Hi,
    Go to the FM of the Smartform and in the main Program of the FM keep a break point. Whenever the Form is triggered which will stops at that break point, from there you can debug.
    Regards,
    Satish

  • Can i Debug Smartform in Production System??

    Plz help me out in this

    Hi,
    Yes, You can debug smartforms in PRD. You have to execute the smartform, and go to the function module. Then if You know where You wish to debug, for eg. Select * from T005T. Find the code (as normally You do in the code editor) with the statement 'SELECT' and place a breakpoint over there. Similarly You can do for all other codes in the Smartform.
    Regards,
    Birendra

  • How to debug smartform in display mode?

    Hi,
    How to debug smartforms program lines in display mode? Need help on this issue?
    <MOVED BY MODERATOR TO THE CORRECT FORUM>
    Edited by: Alvaro Tejada Galindo on Jan 12, 2010 11:32 AM
    Moderator message - Cross post locked
    Edited by: Rob Burbank on Jan 12, 2010 11:57 AM

    Please search before posting
    << Cut and paste without attribution from http://it.toolbox.com/wiki/index.php/SAP_Smart_Forms removed >>
    << Please don't ask other to follow the forum rules and violate them yourself! >>
    *In simple way---follow these steps:-
    If you are in a non-modifiable client:
    Display your SmartForm.
    Go to Environment and copy the function module name.
    Go to SE37 and display the function.
    Go to Smartforms and copy the node name where you want to debugg.
    Go to the function and search for the name in main program. Put a soft break point.*
    Manas M
    Edited by: Kumar Manas Mishra on Jan 12, 2010 12:05 PM
    Edited by: Kumar Manas Mishra on Jan 12, 2010 12:06 PM
    Edited by: Rob Burbank on Jan 12, 2010 11:52 AM

  • Debuging smartforms

    how to debug the program lines / code lines of the smart forms?

    Hi,
    goto your smartforms. click on test(F8)
    function module will be generated. go inside the function module.
    create a break point.
    come out
    then give the command for print from the application which is calling the smartforms.
    Refer to these related threads
    smartforms debug
    Smartforms debug
    How to debug Smartforms?
    How to Debug the Smartforms
    Re: Smartforms Debug
    Smartforms
    Regards,
    Harish

  • How to debug smartforms

    hi
    could anybody suggest me how to debug smatforms
    thank you
    kalyan.

    Please set a break point in side the smartform:
    BREAK <USERNAME>.
    Then at the time of print/ preview the program stops there.
    Example : If you set the break point in initializationas
    BREAK <USERNAME>.
    Program stops at break point. After that use Serach and set more break points.
    >Search the program logic/Textelement/Address via search and set the break point at that code.
    1) One way to debug smartform is to debug the Function Module of that smartforms.
    If you want to debug particular smartform node that the solution would be,
    insert a "Program Line" just above the node you want to debug and this program line write a normal abap breakpoint.
    So whenever you call the smartforms, it will stop at this breakpoint and you can debug onwards.
    2) SFTRACE can be used for debugging SMARTFORMS.
    1)goto tcode SFTRACE --> click "trace on"
    2) Get the function module name and set break points in function module name.
    There is a transaction 'SMARTFORMS_TRACE' (or was it 'SMARTFORMS_TRACE') which will give you quite helpful information.
    In SAPSCRIPTS, you can 'Activate the debugger' in SE71 to start the debugging of script.
    In SMARTFORMS, you can use BREAK-POINT (coded in any code window node) to initiate debugging of SF.
    SFTRACE can be used for debugging SMARTFORMS.
    Go in smartforms, put a breakpoint where you want in the generated FM.
    Then go in you're PO, go to messages, generated you're output and make sure in further data option 1 is selected.
    Then run program rsnast00 with you're form settings, that's it!
    You could debug sapscript like that also,
    regards,
    srinivas

  • How to trace debug smartform?

    Hi
    how to debug debug smartform?

    HI manooj,
    Before posting any thred please search the thread.
    Seach by Debug Smart form u will get so amny threads.
    see the following link.
    Steps to debug smartfrom
    For debugging Smart Forms :
    1) Execute ur smartform -->> Gives Function Module
    2) Again Execute SmartForm(Function Module Screen).
    >> next screen shows.
    Execute and Debugging.

  • Debugging smartforms without hardcoding

    Dear all,
    Is there any way to debug smartforms without hardcoding breakpoint in smartforms.
    <removed by moderator>
    Regards,
    Thiru. R
    Edited by: Thomas Zloch on Dec 4, 2010 9:41 PM
    Moderator Message: Wrong forum. Easily searchable question.
    Edited by: kishan P on Dec 5, 2010 4:08 PM

    Hi
    You can debugg a smart form with out hardcoding BREAK-POINT
    to do this execute the form go to the FM generated in Display mode
    find the specific cond or statement where you need to stop.
    keep a session Break Point  and execute the program.
    regards
    S.Prabhu
    MOderator Message: Do NOT answer easily searchable questions. Points unassigned
    Edited by: kishan P on Dec 5, 2010 4:09 PM

  • Email Links In Smartforms emailed as a PDF

    All,
    I have written a program that creates a smartform as a PDF attachment which gets sent as an email. Part of the content contains URL's for the recipient to click and navigate to an page on our erecruitment system. The problem is that the url is over a line long and does not look very user friendly.
    What i would like to do is have the words "click here" appear as a link so when the user clicks on it, it will take them to the correct url. My question is how do I make those words appear with the correct URL behind it?
    thanks
    Shippy

    Hi,
    this can be achieved by using a replacement function module. This module writes the url and the link text which shall appear in the document in a global buffer. If you then write the link text in the smartform (directly or from a variable) and mark this as link the smartform processing automatically puts the ur behind the link.
    In the output_options parameter of the smartfor there is a field urlcall this field has to be filled. As function module you can use HR_RCF_SF_URL_CALLBACK. As function module to set the link texts / url pairs to the context use HR_RCF_SF_URL_PREPARE_CALLBACK.
    Best regards
    Roman

  • Variable subject for SmartForms email

    Hi All,
    At my clients SAP system (ECC 5.0), we are using SmartForms for the output of documents.
    In this case I am talking about invoices.
    Customzing is setup to use standard SAP program RLB_INVOICE and an invoice smartform which is copy of SAP invoice, but then adjusted for my clients needs. This works perfect for quite some time now.
    Since recently email was setup so these invoices can be mailed directly to the customers, but we face the problem that when invoices are sent via email, the subject is always the same.
    This makes sence because it is set in the output type (mail title and texts), But we would like to make this a variable text, e.g. Invoice_1234567890 (where 1234567890 is the SAP invoice number)
    Has anyone experience in doing this?
    - Is there a way to insert a variable in the subject of the email?
    - Which veriables can be chosen?
    - Is there a user-exit to overrule the Standard SAP behaviour (I could not find it)
    Of couse a Z program can be created to convert the OTF to PDF and sent your own created email, but I would really like to keep using the standard SAP program.
    Thanks very much.
    Kind regards,
    Dave Verkoelen

    I think OUTPUT_OPTIONS-TDCOVTITLE generate a subject in the Email.
    I have tried to update that field using field symbols in the Smartform but, I was not successful.
    * Modifying in Smartform Main program
    field-symbols: <fs> type SSFCOMPOP.
    assign ('(SAPLSTXBC)SSFPO') to <fs>.
    <fs>-TDCOVTITLE = 'test Title from Smartform'.
    * Modifying in FM's parameter
    field-symbols: <fs1> type SSFCOMPOP.
    assign ('(/1BCDWB/SAPLSF00000166)OUTPUT_OPTIONS') to <fs1>.
    <fs1>-TDCOVTITLE = 'test Title from Smartform'.
    So, I think you need to copy the RLB_INVOICE to Z and than change the title.
    Regards,
    Naimesh Patel

  • Smartforms emailed as PDF but can't be opened

    Hello all,
    Several of our SAP users will do a 'Print Preview' of a document to their screen. We are using Smartforms for this. Then they will click on the 'Send e-mail' button and send the document to their email address. It comes to their email as a PDF attachment. Some users, but not all, cannot open the PDF attachment. They get the following error:
    'Can't create file: 'filename'.pdf. Right-click the folder you want to create the file in, and then click Properties on the shortcut menu to check your permissions on the folder.'
    This does not happen to everyone. Also, when they can't open the PDF file, they can forward it to someone else who can open the file and that person will open it, save it with a different name and then email it back to the person who originally couldn't open it. Now they can open the PDF file.
    Any ideas on where to start looking for the source of the problem, SAP, Adobe, PC settings, etc?
    Thanks,
    Rick

    hi,
    Please Double check your Cording ,
    REPORT zemail_gm.
    *********Variable Declarations *****************************
    DATA: gv_form_name TYPE rs38l_fnam, " Used to store the function module generated by Smartform
    gv_bin_filesize TYPE i, " Store the file size
    gv_pos TYPE i,
    gv_len TYPE i,
    gv_tab_lines TYPE i.
    ********Constants *******************************************
    Data : gc_text(11) type c value 'Form Output',
    gc_tst(3) type c value 'TST',
    gc_testing(7) type c value 'Testing'.
    *********Work Area Declarations *****************************
    DATA: gs_docdata TYPE sodocchgi1, " Data of an object which can be changed
    gs_ctrlop TYPE ssfctrlop, " Smart Forms: Control structure
    gs_outopt TYPE ssfcompop, " SAP Smart Forms: Smart Composer (transfer) options
    gs_otfdata TYPE ssfcrescl, " Smart Forms: Return value at end of form printing
    gs_reclist TYPE somlreci1, " SAPoffice: Structure of the API Recipient List
    gs_pdf_tab TYPE tline, " Workarea for SAP Script Text Lines
    gs_objbin TYPE solisti1, " SAPoffice: Single List with Column Length 255
    gs_objpack TYPE sopcklsti1. " SAPoffice: Description of Imported Object Components
    *********Internal tables Declarations *****************************
    DATA: gt_reclist TYPE TABLE OF somlreci1, " SAPoffice: Structure of the API Recipient List
    gt_pdf_tab TYPE TABLE OF tline, " SAPscript: Text Lines
    gt_otf TYPE TABLE OF itcoo, " OTF Structure
    gt_objbin TYPE TABLE OF solisti1, " SAPoffice: Single List with Column Length 255
    gt_objpack TYPE TABLE OF sopcklsti1. " SAPoffice: Description of Imported Object Components
    CLEAR : gv_form_name,
    gs_ctrlop,
    gs_outopt,
    gs_otfdata,
    gv_bin_filesize,
    gv_pos,
    gv_len,
    gv_tab_lines.
    START-OF-SELECTION.
    u2022     Generate Function Module name
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = 'ZPDF_G'
    IMPORTING
    fm_name = gv_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.
    u2022     Assigning values to Form Control Structure and Form Composer
    gs_ctrlop-getotf = 'X'.
    gs_ctrlop-no_dialog = 'X'.
    gs_outopt-tdnoprev = 'X'.
    u2022     Getting the OTFDATA
    CALL FUNCTION gv_form_name
    EXPORTING
    control_parameters = gs_ctrlop
    output_options = gs_outopt
    user_settings = 'X'
    IMPORTING
    job_output_info = gs_otfdata
    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.
    u2022     Assigning the OTFDATA to OTF Structure table
    CLEAR gt_otf.
    gt_otf] = gs_otfdata-otfdata[.
    u2022     Convert the OTF DATA to SAP Script Text lines
    CLEAR gt_pdf_tab.
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    format = 'PDF'
    max_linewidth = 132
    IMPORTING
    bin_filesize = gv_bin_filesize
    TABLES
    otf = gt_otf
    lines = gt_pdf_tab
    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.
    u2022     Assigning the Description of the object sent in the mail
    CLEAR gs_docdata.
    gs_docdata-obj_name = gc_tst.
    gs_docdata-obj_descr = gc_testing.
    u2022     Assigning the email id to Structure of the API Recipient List table
    CLEAR : gt_reclist, gs_reclist.
    gs_reclist-receiver = 'mail id of recipent'.
    gs_reclist-rec_type = 'U'.
    APPEND gs_reclist TO gt_reclist.
    u2022     Passing the SAP Script text lines to SAPoffice: Single List with Column Length 255 table
    CLEAR : gs_objbin, gs_pdf_tab.
    LOOP AT gt_pdf_tab INTO gs_pdf_tab.
    gv_pos = 255 - gv_len.
    IF gv_pos > 134. "length of pdf_table
    gv_pos = 134.
    ENDIF.
    gs_objbin+gv_len = gs_pdf_tab(gv_pos).
    gv_len = gv_len + gv_pos.
    IF gv_len = 255. "length of out (contents_bin)
    APPEND gs_objbin TO gt_objbin.
    CLEAR: gs_objbin, gv_len.
    IF gv_pos < 134.
    gs_objbin = gs_pdf_tab+gv_pos.
    gv_len = 134 - gv_pos.
    ENDIF.
    ENDIF.
    ENDLOOP.
    IF gv_len > 0.
    APPEND gs_objbin TO gt_objbin.
    ENDIF.
    u2022     Filling the details in SAPoffice: Description of Imported Object Components table
    DESCRIBE TABLE gt_objbin LINES gv_tab_lines.
    CLEAR gs_objbin.
    READ TABLE gt_objbin INTO gs_objbin INDEX gv_tab_lines.
    IF sy-subrc = 0.
    gs_objpack-doc_size = ( gv_tab_lines - 1 ) * 255 + STRLEN( gs_objbin ).
    gs_objpack-transf_bin = 'X'.
    gs_objpack-head_start = 1.
    gs_objpack-head_num = 0.
    gs_objpack-body_start = 1.
    gs_objpack-body_num = gv_tab_lines.
    gs_objpack-doc_type = 'PDF'.
    gs_objpack-obj_name = 'ATTACHMENT'.
    gs_objpack-obj_descr = 'test'.
    APPEND gs_objpack TO gt_objpack.
    ENDIF.
    u2022     Sending the Form Output in the PDF format to email
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = gs_docdata
    put_in_outbox = 'X'
    commit_work = 'X'
    TABLES
    packing_list = gt_objpack
    contents_bin = gt_objbin
    receivers = gt_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 sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ELSE.
    WRITE 'Sent Successfully'.
    ENDIF.
    SUBMIT rsconn01
    WITH mode EQ 'INT'
    AND RETURN.
    END-OF-SELECTION.

  • How to add body text to smartform email?

    Hi,
    In release 620, how can you add text to the mail message that is generated from e-mailing a smartform.  I need to add a small message to the body of the message in addition to the attachment.
    i.e. Please find attached your invoice. [attachement.pdf]
    Thanks,
    Guy

    I don't know SmartForm so there may be another way to do it but the following approach was fine for Sapscript.
    Basically have a look at the SAP sample programs bcs_example_* where * = 1 thru 5. I think bcs_example_5 is the one to focus on. This creates a simple email and then adds an attachemnt to it. In your case you want the attachment to be your SmartForm's output.
    For the SapScript I was able to call the form from abap, receive the output into a table whose contents I could then attach to the email.
    The attachment code needs to be changed to set type to OTF:
    i_attachment_type = 'OTF'
    I'll speak in SAPscript and hope there are equivalent terms in SmartForm. I created the following abap form to run the SAPscript and get it's output into a table:
         Form  GET_OTF_CODE
    FORM  get_otf_code
    USING us_work       TYPE zsd_fet_signup_confirm
    CHANGING ch_otf_out TYPE solix_tab.
      DATA: BEGIN OF otf OCCURS 0.
              INCLUDE STRUCTURE itcoo .
      DATA: END OF otf.
      DATA: itcpo LIKE itcpo.
      DATA: itcpp LIKE itcpp.
      CLEAR itcpo.
      itcpo-tdgetotf = 'X'.
    Start writing OTF code
      CALL FUNCTION 'OPEN_FORM'
        EXPORTING
          form     = 'ZSD_FET_COVERFAX'
          language = sy-langu
          OPTIONS  = itcpo
          dialog   = ' '
        EXCEPTIONS
          OTHERS   = 1.
      CALL FUNCTION 'START_FORM'
        EXCEPTIONS
          error_message = 01
          OTHERS        = 02.
      CASE us_work-recipient_type.
        WHEN c_agent_recipient.
          w_recipient_name = us_work-agent.
        WHEN c_asm_recipient.
          w_recipient_name = us_work-asm.
        WHEN OTHERS.
          w_recipient_name = 'IPL Agent/ASM'.
      ENDCASE.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          window        = 'MAIN'
          element       = 'HEADER'
        EXCEPTIONS
          error_message = 01
          OTHERS        = 02.
      CALL FUNCTION 'WRITE_FORM'
        EXPORTING
          window        = 'MAIN'
          element       = 'TEXT'
        EXCEPTIONS
          error_message = 01
          OTHERS        = 02.
    Close up Form and get OTF code
      CALL FUNCTION 'END_FORM'
        EXCEPTIONS
          error_message = 01
          OTHERS        = 02.
      MOVE-CORRESPONDING itcpo TO itcpp.
      CALL FUNCTION 'CLOSE_FORM'
        IMPORTING
          RESULT  = itcpp
        TABLES
          otfdata = otf
        EXCEPTIONS
          OTHERS  = 1.
    Move OTF code to output structure
      REFRESH ch_otf_out.
      LOOP AT otf.
        APPEND otf TO ch_otf_out.
      ENDLOOP.
    ENDFORM.                    "GET_OTF_CODE

  • Smartforms - Email

    Hi Experts,
    Plz tell me how to send (email) the output of a purchase order when i save it in ME21n or me22n like ALE.

    hi
    chk this
    Re: How to email Smartforms
    hope this helps
    regards
    Aakash Banga

  • Smartform email

    Hello Gurus,
    My requirement is to send an invoice smartform as pdf attachment thru email to customer. I'm able to do it successfully using output determination and SCOT setting for smartform as 'pdf'. But in Production system, the SCOT setting is 'TXT' for smartform and due to some dependencies, BASIS not supposed to change the 'TXT' to 'PDF'. How can I achieve this without changing the SCOT setting? I know we can do it using an ABAP program but I don't want to go with it now. Please let me know how can I achieve it? will there be any user specific settings in scot?
    Thanks,
    Raju.

    Hi Raju,
    the SCOT setting is 'TXT' for smartform and due to some dependencies, BASIS not supposed to change the 'TXT' to 'PDF'.
    This setting makes no effect. I have changed settings in my PC in testing client, but Still even after changing to TXT, I get same same PDF in mail. (I have used CL_BCS)
    Try it yourself in testing client.
    Thanks,
    Anil

Maybe you are looking for