Add text field into the 'subject' of a email submit button

I have a form where the client will enter their name, organisation, query and details of their query into text fields.  I would like the text in the 'query' field to be added to the 'subject' of the email submit button.  This will identify different queries submitted by other clients before opening up the completed pdf form attachment.

Hi,
if you use ES3 or ES4 you can use my macro to create email scripts with values from form fields.
http://thelivecycle.blogspot.de/2012/05/mailto-maker-marco-v1.html

Similar Messages

  • Insert data from a field into the subject of an email generated form a form

    Hi,
    Is there a way to have the contents of a field come up in the subject of an email that is made when a submit by email button is clicked.
    The data we want is from a date field for a 'week commencing'.
    We have a text string that is entered on the button's properties - email subject, but we'd like to add the contents of a field on the form onto this.
    any ideas?
    thanks,
    declan.

    Try this code in the click-event of the mail-button (you will have to adjust it of course):
    var anrede;
    if (xfa.form.Formular.Beratungsprotokoll.Kunde.Anrede.rawValue == "Herr") {
    anrede = "Sehr geehrter Herr "; }
    else {
    anrede = "Sehr geehrter Frau "; }
    var mailText = anrede + xfa.form.Formular.Beratungsprotokoll.Kunde.Name.rawValue +
    "\nPlease print this form and mail it to me!" +
    "\n\nTo speed up processing you can also click on the button 'ok'. " +
    "This will generate an e-mail. Please send this e-mail to me." +
    "\n\nThank you" +
    "\nYour agent";
    event.target.submitForm({cURL:"mailto:" +
    Formular.Beratungsprotokoll.Kunde.EMail.rawValue +
    "?subject=consulting minutes&body=" + mailText,
    cSubmitAs:"PDF",cCharset:"utf-8"});

  • Javascript to pull a PDF field into the Subject line of email?

    I've created a fillable PDF form using Pro X.  I'd like to program the Submit button so that once in the email portion, the subject line would automatically pull 3 specific fields from the PDF file.
    Example:  After hitting "Submit"....once in the email, I'd like the Date, Vendor Name, and PO # from the PDF form to automatically pull into the Subject line.
    I have to PDF the complete document and go through the Desktop Email Application on my PC.
    Thank you!

    Hello Everyone,
    I am having the same issue as tlg814 with needing three fields to pull into the subject, and I followed the blue print of the code as well, but I am only getting one field to populate in the subject line.  I am using Acrobat XI. Here is my code:
    Mouse up> Run a JavaScript
    var parts = getField("SR#", "Urgency", "Ship To").value
    this.mailDoc({
    cTo: "[email protected]",
    cCc: "[email protected]",
    cSubject: parts,
    cMsg: "Please create a Parts Request for the items in this email. Thanks"
    Any thoughts as to why it is not pulling all three fields?
    Thanks

  • How can i add Custom fields into the

    Dear Experts
    We have Ecc6.0 system,
    How can i add Custom fields into the Infotype Screen(PA30),i heard that we do it by PM01 Tcode.
    But in PM01 i am unable to find the enhance infotype tab.
    How can i do it ....pls help.....
    Regards
    Sajid

    Hi,
    Do it thru the third tab : Single Screen.
    There write down the infotype number (e.g. 0022) and say generate objects.
    Regards,
    Dilek

  • Is there a way to add the information from a custom field into the subject line of notification email

    I have a field in my form that I would like to add to the Subject line in the email notification form. Is there a way to pull that out of the form and add it?

    Try with t.code AUT10 -Audit trail using which you can see the change histories.
    Regards,

  • Trying to add a flowable/expandable text field to the end of a form

    I have created a form in LiveCycle Designer.  At the end of that form, I would like a Summary text box that expands to allow the person who is filling out the form to type as much information as is necessary and it will all be visible/print when they are done.  I have the field to the point where it will expand (finally!) but I have requested that the field allow page breaks (including all subforms it is contained within) but when it expands, it all carries over to the next page and doesn't allow us to go beyond one page of typing.  Is there anyway to remedy this situation so the text will actually "flow" from one page to another instead of just carrying it over?

    I appreciate you replying to my post and maybe this is just that I have never used the forum before but your reply said that you hoped the sample document would help me and I don't see a sample document attached to the reply.  Am I missing something?
    Date: Wed, 24 Nov 2010 18:32:12 -0700
    From: [email protected]
    To: [email protected]
    Subject: Trying to add a flowable/expandable text field to the end of a form
    I hope this sample file solve your issue too.
    >

  • How to add a function field into the existing matrix report

    Hi,
    I have a matrix report , now i wanted to add one moe field into the matrix which is getting the value from a function , this function is a part of the ref cursor query(group) , i'm able to get the value from the function but it cannot display on the existing matrix report. i wanted to add this in the repeating frame which is printing down. how could i do this , looking for your help. thanks . bcj

    Here the scenario like,
    Data from Table_1
    NAME UNITS DAYS RATE
    AAA 10 1 1.2
    BBB 12 2 3.1
    AAA 20 2 4.1
    CCC 23 1 5.2
    Here, In the matrix report the NAME and UNITS are row fields and 'DAYS' is column field , RATE would be the cell field, and
    Data from Table_2 ,
    NAME BASIC
    AAA 2
    AAA 2
    BBB 2
    CCC 3
    In the report i have to display the 'BASIC' along with the NAME in row level ( repeating frame printing down),
    To get the multiple 'Basic' for each 'Name' using a ref cursor .
    and, using a function to do further calculation based on the basic value
    begin
    select basic into v_basic where name =:name;
    return(caluculated_value);
    end;
    and return the calculated value to the report. But at that time cannot accommodate the value in the matrix report with other groups frequency.
    looking for your valuable help. Thanks Bcj

  • Need to add senders email address into the subject header of my PHP form (somehow)

    Hello one and all,
    I have a PHP form which is working fine and sends our support team an email with the subject header 'Support'.
    I have been asked to fix this form to include the senders email address into the Subject header so that the support team can filter them easier and reply quicker.
    Any help would be very much appreciated indeed. The form code is below, let me know if you need the whole page.
    Thanks in advance,
    Bradley
    My current form PHP part looks like this: (and the HTML part is below in blue)
    <?php
        if($_GET["action"] == "email")
            $msg = "The following person need support:\n\n";
            $msg = $msg . "First Name: " . $_POST["FirstName"] . " " . $_POST["LastName"] . "\n";
            $msg = $msg . "Tel: " . $_POST["Tel"] . "\n";
            $msg = $msg . "Email: " . $_POST["FROM"] . "\n";
            $msg = $msg . "Support: " . $_POST["Support"] . "\n";
            $msg = $msg . "Model: " . $_POST["Model"] . "\n";
            $msg = $msg . "Comments: " . $_POST["Comments"] . "\n";
            $to ="[email protected]";
            $subject = "Support";
            $from = "From: " . $_POST["FROM"];
            mail($to, $subject, $msg, $emailFrom, $from);
            header("Location:support2.php");
    ?>
    and the HTML part of the fom is like this:
    <form id="form1" name="form1" method="post" action="support.php?action=email">
      <table width="700" border="0" cellspacing="10" cellpadding="10">
        <tr>
          <td valign="middle" class="formtext">*First name:</td>
          <td width="455" valign="middle"><label>
            <input name="FirstName" type="text" class="form-textbox" id="FirstName" />
          </label></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">*Last name:</td>
          <td valign="middle"><input name="LastName" type="text" class="form-textbox" id="LastName" /></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">*Email:</td>
          <td valign="middle"><input name="FROM" type="text" class="form-textbox" id="FROM" /></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">*Telephone:</td>
          <td valign="middle"><input name="Tel" type="text" class="form-textbox" id="Tel" /></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext"> </td>
          <td valign="middle"> </td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">*Support required:</td>
          <td valign="middle"><label>
            <select name="Support" class="form-dropdown" id="Support">
              <option selected="selected">Please select...</option>
              <option value="Connection Issues">Connection Issues</option>
              <option value="Technical Issues">Technical Issues</option>
              <option value="Furniture Faults">Furniture Faults</option>
              <option value="Other">Other</option>
            </select>
          </label></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">Chair model:</td>
          <td valign="middle"><input name="Model" type="text" class="form-textbox" id="Model" /></td>
        </tr>
        <tr>
          <td valign="middle" class="formtext">*Please describe your issue:</td>
          <td valign="middle"><textarea name="Comments" rows="5" class="form-textarea" id="Comments"></textarea></td>
        </tr>
        <tr>
          <td valign="middle" class="maintext"> </td>
          <td valign="middle" class="maintext"></td>
        </tr>
        <tr>
          <td valign="middle"> </td>
          <td valign="middle"><label>
            <input name="Submit" type="submit" class="form-submit-button" value="Submit" />
          </label></td>
        </tr>
      </table>
      </form>

    MurraySummers you sir, are an absolute legend! This worked perfect straight off the bat!
    I really apreciate your lightning fast reply!
    Thanks again.
    Bradley

  • I want to be able to paste a bunch of text into the subject line buit to only keep the first maybe 50 characters. How can I limit the size of the subject line?

    I need the ability to paste a bunch of text into the subject line but for it only to capture the first 50 or x number of characters. Can I limit the size of the subject line characters somehow in an ini or profile setting?

    If your problem is with Mozilla Thunderbird, see this forum for support.
    [https://support.mozillamessaging.com/en-US/home] <br />
    or this one <br />
    [http://forums.mozillazine.org/viewforum.php?f=39]

  • How to convert the text field into currency field

    Hi,
    I have an requirement to converting the text field into currency.
    If I convert directly it gives dump.
    If I convert this to Numeric means it takes the decimals also as whole value.
    Is there any FM to convert the text field into Currency field.
    Please advice me.
    Thanks in advance.

    Hi,
    I am on an SRM sytem, which unfortunately does not have th FM: PSSV_TEXT_INTO_FIELD_CURRENCY.
    But I also need to transfer a string value like '12,99' to a field with type curr.
    Can i Do that manually, or is there another FM?
    I have already checked code with write to or pack/unpack.
    But without success yet.
    Something like this:
    DATA: g_str(11) type c.
    DATA: g_p type p.
    WRITE '12,99' TO g_str CURRENCY 'EUR'.
    is no use for me. Finally I need to move g_str to my curr-field, which causes st22.
    also: PACK g_str to <curr-field or g_p> dumps.
    Help appreciated.
    regards, matthias

  • How to add a report into the SAP-SCRIPT .using PERFORM ......ENDPERFORM

    My question is that How to add a report into the SAP-SCRIPT .
    by using PERFORM ......ENDPERFORM
    I don't know how to used it .

    Hi Sandeep,
    Please check this link
    http://help.sap.com/saphelp_40b/helpdata/en/d1/803279454211d189710000e8322d00/content.htm
    http://www.allinterview.com/showanswers/37425.html
    Calling ABAP Subroutines: PERFORM
    You can use the PERFORM command to call an ABAP subroutine (form) from any program, subject to the normal ABAP runtime authorization checking. You can use such calls to subroutines for carrying out calculations, for obtaining data from the database that is needed at display or print time, for formatting data, and so on.
    PERFORM commands, like all control commands, are executed when a document is formatted for display or printing. Communication between a subroutine that you call and the document is by way of symbols whose values are set in the subroutine.
    Syntax in a form window:
    /: PERFORM <form> IN PROGRAM <prog>
    /: USING &INVAR1&
    /: USING &INVAR2&
    /: CHANGING &OUTVAR1&
    /: CHANGING &OUTVAR2&
    /: ENDPERFORM
    INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
    OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
    The ABAP subroutine called via the command line stated above must be defined in the ABAP report prog as follows:
    FORM <form> TABLES IN_TAB STRUCTURE ITCSY
    OUT_TAB STRUCTURE ITCSY.
    ENDFORM.
    The values of the SAPscript symbols passed with /: USING... are now stored in the internal table IN_TAB . Note that the system passes the values as character string to the subroutine, since the field Feld VALUE in structure ITCSY has the domain TDSYMVALUE (CHAR 80). See the example below on how to access the variables.
    The internal table OUT_TAB contains names and values of the CHANGING parameters in the PERFORM statement. These parameters are local text symbols, that is, character fields. See the example below on how to return the variables within the subroutine.
    From within a SAPscript form, a subroutine GET_BARCODE in the ABAP program QCJPERFO is called. Then the simple barcode contained there (u2018First pageu2019, u2018Next pageu2019, u2018Last pageu2019) is printed as local variable symbol.
    Definition in the SAPscript form:
    /: PERFORM GET_BARCODE IN PROGRAM QCJPERFO
    /: USING &PAGE&
    /: USING &NEXTPAGE&
    /: CHANGING &BARCODE&
    /: ENDPERFORM
    / &BARCODE&
    Coding of the calling ABAP program:
    REPORT QCJPERFO.
    FORM GET_BARCODE TABLES IN_PAR STUCTURE ITCSY
    OUT_PAR STRUCTURE ITCSY.
    DATA: PAGNUM LIKE SY-TABIX, "page number
    NEXTPAGE LIKE SY-TABIX. "number of next page
    READ TABLE IN_PAR WITH KEY u2018PAGEu2019.
    CHECK SY-SUBRC = 0.
    PAGNUM = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY u2018NEXTPAGEu2019.
    CHECK SY-SUBRC = 0.
    NEXTPAGE = IN_PAR-VALUE.
    READ TABLE IN_PAR WITH KEY u2018BARCODEu2019.
    CHECK SY-SUBRC = 0.
    IF PAGNUM = 1.
    OUT_PAR-VALUE = u2018|u2019. "First page
    ELSE.
    OUT_PAR-VALUE = u2018||u2019. "Next page
    ENDIF.
    IF NEXTPAGE = 0.
    OUT_PAR-VALUE+2 = u2018Lu2019. "Flag: last page
    ENDIF.
    MODIFY OUT_PAR INDEX SY-TABIX.
    ENDFORM.
    Best regards,
    raam

  • How to place two text fields on the same line in adobe

    I am trying to create a form on adobe and I would like to have two unique text fields on the same line. Is this posible? 

    If you are using FormsCentral it is, the fields can be placed "side by side" in a row.  There is a "+" sign on the right side of the field that brings up a toolbar to add a field adjacent.  You can also right click on a field and select "Insert beside", or you can "drag and drop" fields next to one another or to a new row.
    Thanks,
    Josh
    PS - One note, if you are using the "desktop" application of FormsCentral that comes with Acroat Pro XI make sure the application is up to date by either using the "Help" - "Check for updates" menu item or by signing into the application so that you have the latest features including the side by side layout.

  • How to add a report into the tree??

    Hi all,
    Pls help me add a report into the tree same as standard report that we can click icon on tree to run.
    Thank you!

    Hi,
    use FM HR_ALV_HIERSEQ_LIST_DISPLAY
    there are 2 internal table , one for header and one for detail
    below is code for reference
    REPORT zinsd_quot_cont.
    TYPES : BEGIN OF ty_vbak,
    vbeln TYPE vbeln_va,
    vkorg TYPE vkorg,
    vtweg TYPE vtweg,
    spart TYPE spart,
    vkbur TYPE vkbur,
    vkgrp TYPE vkgrp,
    angdt TYPE angdt_v,
    bnddt TYPE bnddt,
    kunnr TYPE kunnr,
    kwmeng TYPE kwmeng,
    meins TYPE meins,
    kunwe TYPE kunnr,
    name1 TYPE name1_gp ,
    name2 TYPE name1_gp ,
    sel(1),
    expand(1),
    salesdocument TYPE bapivbeln-vbeln,
    message TYPE bapi_msg,
    END OF ty_vbak.
    DATA : w_vbak TYPE ty_vbak,
    t_vbak TYPE TABLE OF ty_vbak.
    DATA : w_update TYPE ty_vbak,
    t_update TYPE TABLE OF ty_vbak.
    TYPES : BEGIN OF ty_kna1,
    kunnr TYPE kunnr,
    name1 TYPE name1_gp ,
    END OF ty_kna1.
    DATA : w_kna1 TYPE ty_kna1,
    t_kna1 TYPE TABLE OF ty_kna1.
    TYPES : BEGIN OF ty_vbap,
    vbeln TYPE vbeln_va,
    posnr TYPE posnr_va,
    matnr TYPE matnr,
    matkl TYPE matkl,
    werks TYPE werks_ext,
    kwmeng TYPE kwmeng,
    meins TYPE meins,
    mvgr5 TYPE mvgr5,
    maktx TYPE maktx,
    END OF ty_vbap.
    DATA : w_vbap TYPE ty_vbap,
    t_vbap TYPE TABLE OF ty_vbap.
    TYPES : BEGIN OF ty_makt,
    matnr TYPE matnr,
    maktx TYPE maktx,
    END OF ty_makt.
    DATA : w_makt TYPE ty_makt,
    t_makt TYPE TABLE OF ty_makt.
    TYPES : BEGIN OF ty_sum,
    vbeln TYPE vbeln_va,
    kwmeng TYPE kwmeng,
    END OF ty_sum.
    DATA : w_sum TYPE ty_sum,
    t_sum TYPE TABLE OF ty_sum.
    TYPES : BEGIN OF ty_vbpa,
    vbeln TYPE vbeln,
    posnr TYPE posnr,
    parvw TYPE parvw,
    kunnr TYPE kunnr,
    END OF ty_vbpa.
    DATA : w_vbpa TYPE ty_vbpa,
    t_vbpa TYPE TABLE OF ty_vbpa.
    TYPES : BEGIN OF ty_vbup,
    vbeln TYPE vbeln,
    posnr TYPE posnr ,
    gbsta TYPE gbsta ,
    END OF ty_vbup.
    DATA : w_vbup TYPE ty_vbup,
    t_vbup TYPE TABLE OF ty_vbup.
    TYPE-POOLS slis.
    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv,
    w_fieldcatalog TYPE slis_fieldcat_alv,
    w_layout TYPE slis_layout_alv,
    gs_keyinfo TYPE slis_keyinfo_alv.
    DATA: g_tabname_header TYPE slis_tabname,
    g_tabname_item TYPE slis_tabname.
    data definition
    Batchinputdata of single transaction
    DATA: bdcdata LIKE bdcdata OCCURS 0 WITH HEADER LINE.
    messages of call transaction
    DATA: messtab LIKE bdcmsgcoll OCCURS 0 WITH HEADER LINE.
    DATA : g_lines TYPE i.
    *Selection Screen
    TABLES : vbak,vbap.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
    SELECT-OPTIONS s_vkorg FOR vbak-vkorg. " Sales Org
    SELECT-OPTIONS s_vtweg FOR vbak-vtweg. " Dist Channel
    SELECT-OPTIONS s_spart FOR vbak-spart. " Division
    SELECT-OPTIONS s_vkbur FOR vbak-vkbur. " Sales Off
    SELECT-OPTIONS s_vkgrp FOR vbak-vkgrp. " Sales Grp
    SELECT-OPTIONS s_matkl FOR vbap-matkl. " Mat Grp
    SELECT-OPTIONS s_werks FOR vbap-werks. " Plant
    SELECT-OPTIONS s_period FOR vbak-angdt. " Sales Off
    SELECTION-SCREEN END OF BLOCK b1.
    START-OF-SELECTION.
    PERFORM f_getdata.
    PERFORM f_initdata.
    END-OF-SELECTION.
    PERFORM f_createalv.
    PERFORM f_dispalv.
    *& Form f_getdata
    text
    --> p1 text
    <-- p2 text
    FORM f_getdata .
    *Sales Header
    SELECT
    vbeln
    vkorg
    vtweg
    spart
    vkbur
    vkgrp
    angdt
    bnddt
    kunnr
    INTO TABLE t_vbak
    FROM vbak
    WHERE
    vkorg IN s_vkorg " Sales Org
    AND vtweg IN s_vtweg " Dist Channel
    AND spart IN s_spart " Division
    AND vkbur IN s_vkbur " Sales Off
    AND vkgrp IN s_vkgrp " Sales Grp
    AND angdt IN s_period
    AND bnddt IN s_period
    AND auart = 'ZQMO'
    AND vbtyp = 'B'.
    *CUST NAME
    SELECT
    kunnr
    name1
    INTO TABLE t_kna1
    FROM kna1
    FOR ALL ENTRIES IN t_vbak
    WHERE
    kunnr = t_vbak-kunnr
    *Sales Item
    SELECT
    vbeln
    posnr
    matnr
    matkl
    werks
    kwmeng
    meins
    mvgr5
    INTO TABLE t_vbap
    FROM vbap
    FOR ALL ENTRIES IN t_vbak
    WHERE
    vbeln = t_vbak-vbeln
    AND matkl IN s_matkl " Mat Grp
    AND werks IN s_werks " Plant
    *Partners
    SELECT
    vbeln
    posnr
    parvw
    kunnr
    INTO TABLE t_vbpa
    FROM vbpa
    FOR ALL ENTRIES IN t_vbak
    WHERE
    vbeln = t_vbak-vbeln.
    IF t_vbpa[] IS NOT INITIAL.
    SELECT
    kunnr
    name1
    APPENDING TABLE t_kna1
    FROM kna1
    FOR ALL ENTRIES IN t_vbpa
    WHERE
    kunnr = t_vbpa-kunnr
    ENDIF.
    *Status - Sales Doc
    SELECT
    vbeln
    posnr
    gbsta
    INTO TABLE t_vbup
    FROM vbup
    FOR ALL ENTRIES IN t_vbap
    WHERE
    vbeln = t_vbap-vbeln
    AND posnr = t_vbap-posnr
    AND gbsta NE 'C'.
    SELECT
    matnr
    maktx
    INTO TABLE t_makt
    FROM makt
    FOR ALL ENTRIES IN t_vbap
    WHERE
    matnr = t_vbap-matnr
    AND spras = 'E'.
    ENDFORM. " f_getdata
    *& Form f_initdata
    text
    --> p1 text
    <-- p2 text
    FORM f_initdata .
    SORT t_vbap BY vbeln DESCENDING.
    *delete all closed stat items
    LOOP AT t_vbap INTO w_vbap.
    READ TABLE t_vbup INTO w_vbup
    WITH KEY
    vbeln = w_vbap-vbeln
    posnr = w_vbap-posnr.
    IF sy-subrc <> 0.
    DELETE t_vbap.
    CONTINUE.
    ELSE.
    READ TABLE t_makt INTO w_makt
    WITH
    KEY matnr = w_vbap-matnr.
    IF sy-subrc = 0.
    w_vbap-maktx = w_makt-maktx.
    MODIFY t_vbap FROM w_vbap.
    ENDIF.
    ENDIF.
    ENDLOOP.
    *find the total quantity
    LOOP AT t_vbap INTO w_vbap.
    w_sum-vbeln = w_vbap-vbeln.
    w_sum-kwmeng = w_vbap-kwmeng.
    COLLECT w_sum INTO t_sum.
    CLEAR w_sum.
    ENDLOOP.
    *populate header
    LOOP AT t_vbak INTO w_vbak.
    Quantity - Total
    READ TABLE t_sum INTO w_sum
    WITH KEY
    vbeln = w_vbak-vbeln.
    IF sy-subrc = 0.
    w_vbak-kwmeng = w_sum-kwmeng.
    ELSE.
    CLEAR w_vbak-kwmeng.
    ENDIF.
    UoM
    READ TABLE t_vbap INTO w_vbap
    WITH KEY
    vbeln = w_vbak-vbeln.
    IF sy-subrc = 0.
    w_vbak-meins = w_vbap-meins.
    ELSE.
    CLEAR w_vbak-meins.
    ENDIF.
    Partner
    READ TABLE t_vbpa INTO w_vbpa
    WITH KEY
    vbeln = w_vbak-vbeln
    parvw = 'WE'.
    IF sy-subrc = 0.
    w_vbak-kunwe = w_vbpa-kunnr.
    ELSE.
    CLEAR w_vbak-kunwe.
    ENDIF.
    SHIP TO PARTY NAME
    READ TABLE t_kna1 INTO w_kna1
    WITH KEY
    kunnr = w_vbak-kunwe.
    IF sy-subrc = 0.
    w_vbak-name2 = w_kna1-name1.
    ENDIF.
    CUST NAM - SOLD TO PARTY
    READ TABLE t_kna1 INTO w_kna1
    WITH KEY
    kunnr = w_vbak-kunnr.
    IF sy-subrc = 0.
    w_vbak-name1 = w_kna1-name1.
    ENDIF.
    MODIFY t_vbak FROM w_vbak.
    ENDLOOP.
    DELETE t_vbak WHERE kwmeng IS INITIAL.
    SORT t_vbak BY vbeln DESCENDING.
    SORT t_vbap BY vbeln DESCENDING posnr ASCENDING.
    ENDFORM. " f_initdata
    *& Form f_createalv
    Create Field Cat.
    --> p1 text
    <-- p2 text
    FORM f_createalv .
    g_tabname_header = 't_vbak'.
    g_tabname_item = 't_vbap' .
    CLEAR gs_keyinfo.
    gs_keyinfo-header01 = 'VBELN'.
    gs_keyinfo-item01 = 'VBELN'.
    *VBAK
    w_fieldcatalog-fieldname = 'VBELN'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Sales Document'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'VKORG'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Sales Org'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'VTWEG'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Dist Channel'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'SPART'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Division'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'VKBUR'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Sales Office'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'VKGRP'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Sales GRP'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'KUNNR'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Sold to Party'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'NAME1'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-outputlen = 35.
    w_fieldcatalog-seltext_l = 'Sold to Party Code - Name'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'KUNWE'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Ship to Party'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'NAME2'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Ship Party Code - Name'.
    w_fieldcatalog-outputlen = 35.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'KWMENG'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Quantity'.
    w_fieldcatalog-outputlen = 25.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'MEINS'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'UoM'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'SALESDOCUMENT'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Document'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'MESSAGE'.
    w_fieldcatalog-tabname = 't_vbak'.
    w_fieldcatalog-seltext_l = 'Log'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    *VBAP
    w_fieldcatalog-fieldname = 'POSNR'.
    w_fieldcatalog-tabname = 't_vbap'.
    w_fieldcatalog-seltext_l = 'POS'.
    w_fieldcatalog-outputlen = 6.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'MATNR'.
    w_fieldcatalog-tabname = 't_vbap'.
    w_fieldcatalog-seltext_l = 'Material'.
    w_fieldcatalog-outputlen = 18.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'MAKTX'.
    w_fieldcatalog-tabname = 't_vbap'.
    w_fieldcatalog-seltext_l = 'Material Desc'.
    w_fieldcatalog-outputlen = 40.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'MATKL'.
    w_fieldcatalog-tabname = 't_vbap'.
    w_fieldcatalog-seltext_l = 'Material Grp'.
    w_fieldcatalog-outputlen = 9.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'MVGR5'.
    w_fieldcatalog-tabname = 't_vbap'.
    w_fieldcatalog-seltext_l = 'MCNO'.
    w_fieldcatalog-outputlen = 4.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'WERKS'.
    w_fieldcatalog-tabname = 't_vbap'.
    w_fieldcatalog-seltext_l = 'Plant'.
    w_fieldcatalog-outputlen = 91.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'KWMENG'.
    w_fieldcatalog-tabname = 't_vbap'.
    w_fieldcatalog-seltext_l = 'Quantity'.
    w_fieldcatalog-outputlen = 25.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    w_fieldcatalog-fieldname = 'MEINS'.
    w_fieldcatalog-tabname = 't_vbap'.
    w_fieldcatalog-seltext_l = 'UoM'.
    APPEND w_fieldcatalog TO t_fieldcatalog.
    CLEAR: w_fieldcatalog.
    LAYOUT
    w_layout-colwidth_optimize = 'X'.
    w_layout-zebra = 'X'.
    w_layout-expand_fieldname = 'EXPAND'.
    w_layout-box_fieldname = 'SEL'.
    w_layout-box_tabname = 't_vbak'.
    ENDFORM. " f_createalv
    *& Form f_dispalv
    Call ALV
    --> p1 text
    <-- p2 text
    FORM f_dispalv .
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    EXPORTING
    i_callback_program = sy-repid
    i_callback_pf_status_set = 'SET_PF_STATUS'
    i_callback_user_command = 'USER_COMMAND'
    is_layout = w_layout
    it_fieldcat = t_fieldcatalog
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    i_tabname_header = g_tabname_header
    i_tabname_item = g_tabname_item
    is_keyinfo = gs_keyinfo
    TABLES
    t_outtab_header = t_vbak
    t_outtab_item = t_vbap
    EXCEPTIONS
    program_error = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    ENDIF.
    ENDFORM. " f_dispalv
    *& Form set_pf_status
    PF stat
    -->RT_EXTAB text
    FORM set_pf_status USING rt_extab TYPE slis_t_extab.
    SET PF-STATUS 'ZINSD_QUOT_CONT_ST'.
    ENDFORM. "set_pf_status
    *& Form user_command
    Process List UCOMM
    -->R_UCOMM text
    -->RS_SELFIELD text
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
    REFRESH t_update.
    IF r_ucomm = 'EXIT'.
    LEAVE PROGRAM.
    ENDIF.
    IF r_ucomm = 'EXECUTE'.
    LOOP AT t_vbak INTO w_update
    WHERE
    sel = 'X'
    AND salesdocument = ' '.
    APPEND w_update TO t_update.
    ENDLOOP.
    IF t_update[] IS NOT INITIAL.
    LOOP AT t_update INTO w_update.
    PERFORM f_bapi_contract_createfromdata USING w_update.
    PERFORM f_bdc_contract_from_quotation.
    MODIFY t_update FROM w_update.
    ENDLOOP.
    ELSE.
    ENDIF.
    PERFORM f_dispalv.
    ENDIF.
    IF r_ucomm = '&IC1'.
    IF rs_selfield-sel_tab_field = 't_vbak-VBELN'.
    SET PARAMETER ID 'AGN' FIELD rs_selfield-value.
    CALL TRANSACTION 'VA23' AND SKIP FIRST SCREEN.
    ENDIF.
    IF rs_selfield-sel_tab_field = 't_vbak-SALESDOCUMENT' AND
    rs_selfield-value NE ' '.
    SET PARAMETER ID 'KTN' FIELD rs_selfield-value.
    CALL TRANSACTION 'VA43' AND SKIP FIRST SCREEN.
    ENDIF.
    ENDIF.
    ENDFORM. "user_command
    *& Form F_BAPI_CONTRACT_CREATEFROMDATA
    BAPI CALL
    -->P_W_UPDATE text
    FORM f_bapi_contract_createfromdata USING p_w_update STRUCTURE w_update .
    DATA : w_contract_header_in TYPE bapisdhd1 ,
    w_contract_header_inx TYPE bapisdhd1x ,
    t_contract_items_in TYPE TABLE OF bapisditm WITH HEADER LINE,
    t_contract_items_inx TYPE TABLE OF bapisditmx WITH HEADER LINE,
    t_contract_partners TYPE TABLE OF bapiparnr WITH HEADER LINE,
    t_return TYPE TABLE OF bapiret2 WITH HEADER LINE.
    CLEAR : w_contract_header_in,
    w_contract_header_inx.
    REFRESH : t_contract_items_in,
    t_contract_items_inx,
    t_contract_partners,
    t_return.
    w_contract_header_in-doc_type = 'ZCNT'.
    w_contract_header_in-sales_org = p_w_update-vkorg.
    w_contract_header_in-distr_chan = p_w_update-vtweg.
    w_contract_header_in-division = p_w_update-spart.
    w_contract_header_in-ct_valid_f = p_w_update-angdt.
    w_contract_header_in-ct_valid_t = p_w_update-bnddt.
    w_contract_header_inx-doc_type = 'X'.
    w_contract_header_inx-sales_org = 'X'.
    w_contract_header_inx-distr_chan = 'X'.
    w_contract_header_inx-division = 'X'.
    w_contract_header_inx-ct_valid_f = 'X'.
    w_contract_header_inx-ct_valid_t = 'X'.
    LOOP AT t_vbap INTO w_vbap
    WHERE
    vbeln = p_w_update-vbeln.
    t_contract_items_in-material = w_vbap-matnr.
    t_contract_items_in-plant = w_vbap-werks.
    t_contract_items_in-target_qty = w_vbap-kwmeng.
    t_contract_items_in-target_qu = w_vbap-meins.
    t_contract_items_in-ref_doc = w_vbap-vbeln.
    t_contract_items_in-ref_doc_it = w_vbap-posnr.
    t_contract_items_in-ref_doc_ca = 'B'.
    t_contract_items_in-prc_group5 = w_vbap-mvgr5.
    t_contract_items_inx-material = 'X'.
    t_contract_items_inx-plant = 'X'.
    t_contract_items_inx-target_qty = 'X'.
    t_contract_items_inx-target_qu = 'X'.
    t_contract_items_inx-ref_doc = 'X'.
    t_contract_items_inx-ref_doc_it = 'X'.
    t_contract_items_inx-ref_doc_ca = 'X'.
    t_contract_items_inx-prc_group5 = 'X'.
    APPEND t_contract_items_in.
    APPEND t_contract_items_inx.
    ENDLOOP.
    LOOP AT t_vbpa INTO w_vbpa
    WHERE
    vbeln = p_w_update-vbeln.
    AND posnr = w_vbap-posnr.
    t_contract_partners-partn_role = w_vbpa-parvw.
    t_contract_partners-partn_numb = w_vbpa-kunnr.
    t_contract_partners-itm_number = w_vbpa-posnr.
    APPEND t_contract_partners.
    ENDLOOP.
    CALL FUNCTION 'BAPI_CONTRACT_CREATEFROMDATA'
    EXPORTING
    SALESDOCUMENTIN =
    contract_header_in = w_contract_header_in
    contract_header_inx = w_contract_header_inx
    SENDER =
    BINARY_RELATIONSHIPTYPE = ' '
    INT_NUMBER_ASSIGNMENT = ' '
    BEHAVE_WHEN_ERROR = ' '
    LOGIC_SWITCH =
    TESTRUN =
    CONVERT = ' '
    IMPORTING
    salesdocument = p_w_update-salesdocument
    TABLES
    return = t_return
    contract_items_in = t_contract_items_in
    contract_items_inx = t_contract_items_inx
    contract_partners = t_contract_partners
    CONTRACT_CONDITIONS_IN =
    CONTRACT_CONDITIONS_INX =
    CONTRACT_CFGS_REF =
    CONTRACT_CFGS_INST =
    CONTRACT_CFGS_PART_OF =
    CONTRACT_CFGS_VALUE =
    CONTRACT_CFGS_BLOB =
    CONTRACT_CFGS_VK =
    CONTRACT_CFGS_REFINST =
    CONTRACT_DATA_IN =
    CONTRACT_DATA_INX =
    CONTRACT_TEXT =
    CONTRACT_KEYS =
    EXTENSIONIN =
    PARTNERADDRESSES =
    IF p_w_update-salesdocument NE ' ' .
    p_w_update-message = 'SUCCESS'.
    ELSE.
    READ TABLE t_return INDEX 1.
    p_w_update-message = t_return-message.
    ENDIF.
    READ TABLE t_vbak INTO w_vbak
    WITH KEY
    vbeln = p_w_update-vbeln.
    IF sy-subrc = 0.
    MODIFY t_vbak INDEX sy-tabix FROM p_w_update .
    ENDIF.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    wait = 'X'.
    ENDFORM. " F_BAPI_CONTRACT_CREATEFROMDATA
    *& Form f_bdc_contract_from_Quotation
    BAPI CALL
    -->P_W_UPDATE text
    FORM f_bdc_contract_from_quotation.
    DATA : l_date TYPE char10.
    REFRESH : messtab, bdcdata.
    CLEAR : messtab, bdcdata.
    PERFORM bdc_dynpro USING 'SAPMV45A' '0101'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=COPY'.
    PERFORM bdc_field USING 'VBAK-AUART'
    'ZCNT'.
    PERFORM bdc_dynpro USING 'SAPLV45C' '0100'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=RANG'.
    PERFORM bdc_dynpro USING 'SAPLV45C' '0100'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=UEBR'.
    PERFORM bdc_field USING 'LV45C-VBELN'
    w_update-vbeln.
    PERFORM bdc_dynpro USING 'SAPMV45A' '4001'.
    PERFORM bdc_field USING 'BDC_OKCODE'
    '=SICH'.
    IF NOT w_update-angdt IS INITIAL.
    CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
    EXPORTING
    date_internal = w_update-angdt
    IMPORTING
    date_external = l_date
    EXCEPTIONS
    date_internal_is_invalid = 1
    OTHERS = 2.
    PERFORM bdc_field USING 'VBAK-GUEBG'
    l_date.
    ENDIF.
    IF NOT w_update-bnddt IS INITIAL.
    CALL FUNCTION 'CONVERT_DATE_TO_EXTERNAL'
    EXPORTING
    date_internal = w_update-bnddt
    IMPORTING
    date_external = l_date
    EXCEPTIONS
    date_internal_is_invalid = 1
    OTHERS = 2.
    PERFORM bdc_field USING 'VBAK-GUEEN'
    l_date.
    ENDIF.
    CALL TRANSACTION 'VA41' USING bdcdata
    MODE 'E'
    UPDATE 'S'
    MESSAGES INTO messtab.
    break abap.
    READ TABLE messtab WITH KEY msgid = 'V1'
    msgnr = '311'.
    IF sy-subrc EQ 0.
    w_update-message = 'SUCCESS'.
    w_update-salesdocument = messtab-msgv2.
    ELSE.
    READ TABLE messtab WITH KEY msgtyp = 'E'.
    IF sy-subrc EQ 0.
    DATA : l_info TYPE einfo.
    CLEAR l_info.
    l_info-msgid = messtab-msgid.
    l_info-msgty = messtab-msgtyp.
    l_info-msgno = messtab-msgnr.
    l_info-msgv1 = messtab-msgv1.
    l_info-msgv2 = messtab-msgv2.
    l_info-msgv3 = messtab-msgv3.
    l_info-msgv4 = messtab-msgv4.
    CALL FUNCTION 'MESSAGE_GET_TEXT'
    EXPORTING
    ieinfo = l_info
    ilangu = sy-langu
    IMPORTING
    etext = w_update-message
    EXCEPTIONS
    no_t100_found = 1
    OTHERS = 2.
    ENDIF.
    ENDIF.
    READ TABLE t_vbak INTO w_vbak WITH KEY vbeln = w_update-vbeln.
    IF sy-subrc = 0.
    MODIFY t_vbak INDEX sy-tabix FROM w_update transporting message
    salesdocument.
    ENDIF.
    ENDFORM. " f_bdc_contract_from_Quotation
    Start new screen *
    FORM bdc_dynpro USING program dynpro.
    CLEAR bdcdata.
    bdcdata-program = program.
    bdcdata-dynpro = dynpro.
    bdcdata-dynbegin = 'X'.
    APPEND bdcdata.
    ENDFORM. "bdc_dynpro
    Insert field *
    FORM bdc_field USING fnam fval.
    CLEAR bdcdata.
    bdcdata-fnam = fnam.
    bdcdata-fval = fval.
    APPEND bdcdata.
    ENDFORM. "bdc_field
    Also, check the following:
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree.htm
    You can get help as programs also.
    hope this helps.
    cheers,
    Hema.

  • Send email including the data field into the html message body

    Hi all,
    I would like to send an email to each recipient once only, and including a data field into the html body message. I am not sure how to achive that with my current stored procedure.
    USE [CallManager]
    GO
    /****** Object: StoredProcedure [dbo].[PersonalCallsReminder] Script Date: 08/27/2014 10:26:55 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author: <Author,,Name>
    -- Create date: <Create Date,,>
    -- Description: <Description,,>
    -- =============================================
    ALTER PROCEDURE [dbo].[PersonalCallsReminder]
    AS
    BEGIN
    -- SET NOCOUNT ON added to prevent extra result sets from
    -- interfering with SELECT statements.
    SET NOCOUNT ON;
    -- Email Users
    declare @email varchar(max)
    declare mycursor cursor FAST_FORWARD for
    SELECT dbo.HumersStaffExtension.email
    FROM dbo.Calls_Mobile_Header INNER JOIN
    dbo.HumersStaffExtension ON
    dbo.Calls_Mobile_Header.TelNumber = dbo.HumersStaffExtension.telnr_prv COLLATE SQL_Latin1_General_CP1_CI_AS
    GROUP BY dbo.Calls_Mobile_Header.RecordStatus, dbo.HumersStaffExtension.usr_id, dbo.HumersStaffExtension.email,
    dbo.HumersStaffExtension.res_id
    HAVING (dbo.Calls_Mobile_Header.RecordStatus = N'0') AND (NOT (dbo.HumersStaffExtension.email IS NULL))
    OPEN mycursor;
    FETCH NEXT FROM mycursor
    INTO @email
    WHILE @@FETCH_STATUS = 0
    BEGIN
    EXEC msdb.dbo.sp_send_dbmail
    @profile_name = 'CallsManagement',
    @recipients = @email ,
    @body_format = 'HTML',
    @subject = 'Personal Calls Reminder',
    @body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <title>Personal Calls Reminder</title>
    <style type="text/css">
    body {
    font-family: "Times New Roman", Times, serif;
    font-size: 11pt;
    .auto-style1 {
    background-color: #FFFF00;
    </style>
    </head>
    <body>
    <div>
    <table style="width: 800px">
    <tr>
    <td>Dear,<br />
    <br />
    Please review your phone bills and submit your personal calls using the following link:<br />
    <a href="http://companyxyz/personalcalls/">Personal Calls</a></td>
    </tr>
    </table>
    <br/>
    <table style="width: 800px">
    <tr>
    <td><strong>Kindly be informed that the deadline to process new bills is on the
    <span class="auto-style1">15th of each month</span>.</strong></td>
    </tr>
    </table>
    <br/>
    <table style="width: 800px">
    <tr>
    <td>For assistance, please contact <a href="mailto:[email protected]">[email protected]</a></td>
    </tr>
    </table>
    <br/>
    <table style="width: 800px">
    <tr>
    <td><strong>*** This is an automatically generated email, please do not reply ***</strong></td>
    </tr>
    </table>
    </div>
    </body>
    </html>
    FETCH NEXT FROM mycursor
    INTO @email
    END
    CLOSE mycursor;
    DEALLOCATE mycursor;
    END
    Changing the query to the following:
    SELECT TOP (100) PERCENT dbo.HumersStaffExtension.email, dbo.Calls_Mobile_Header.ExtractDate
    FROM dbo.Calls_Mobile_Header INNER JOIN
    dbo.HumersStaffExtension ON
    dbo.Calls_Mobile_Header.TelNumber = dbo.HumersStaffExtension.telnr_prv COLLATE SQL_Latin1_General_CP1_CI_AS
    GROUP BY dbo.Calls_Mobile_Header.RecordStatus, dbo.HumersStaffExtension.usr_id, dbo.HumersStaffExtension.email, dbo.HumersStaffExtension.res_id,
    dbo.Calls_Mobile_Header.ExtractDate
    HAVING (dbo.Calls_Mobile_Header.RecordStatus = N'0') AND (NOT (dbo.HumersStaffExtension.email IS NULL))
    ORDER BY dbo.HumersStaffExtension.email
    Will provide me with the following results:
    email ExtractDate
    [email protected]
    July-2014
    [email protected]
    August-2014
    [email protected]
    July-2014
    [email protected]
    August-2014
    Is it possible to send email to [email protected] once only including in the html message body the ExtractDate field results for July-2014 and August-2014? 
    I appreciate any assist on the issue.
    Thank you in advance.

    Refer the below code highlighted in bold.
    USE [CallManager]
    GO
    /****** Object:  StoredProcedure [dbo].[PersonalCallsReminder]    Script Date: 08/27/2014 10:26:55 ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author:  <Author,,Name>
    -- Create date: <Create Date,,>
    -- Description: <Description,,>
    -- =============================================
    ALTER PROCEDURE [dbo].[PersonalCallsReminder]
    AS
    BEGIN
     -- SET NOCOUNT ON added to prevent extra result sets from
     -- interfering with SELECT statements.
     SET NOCOUNT ON;
     -- Email Users
    declare @email varchar(max),@date datetime
    declare @temp table (email varchar(50), extractDate datetime)
    insert into @temp
      SELECT     TOP (100) PERCENT dbo.HumersStaffExtension.email, dbo.Calls_Mobile_Header.ExtractDate
      FROM         dbo.Calls_Mobile_Header INNER JOIN
             dbo.HumersStaffExtension ON
             dbo.Calls_Mobile_Header.TelNumber = dbo.HumersStaffExtension.telnr_prv COLLATE SQL_Latin1_General_CP1_CI_AS
      GROUP BY dbo.Calls_Mobile_Header.RecordStatus, dbo.HumersStaffExtension.usr_id, dbo.HumersStaffExtension.email, dbo.HumersStaffExtension.res_id,
             dbo.Calls_Mobile_Header.ExtractDate
      HAVING      (dbo.Calls_Mobile_Header.RecordStatus = N'0') AND (NOT (dbo.HumersStaffExtension.email IS NULL))
      ORDER BY dbo.HumersStaffExtension.email
    declare mycursor cursor FAST_FORWARD for SELECT DISTINCT email from @temp
    OPEN mycursor;
    FETCH NEXT FROM mycursor
    INTO @email
    WHILE @@FETCH_STATUS = 0
    BEGIN
        DECLARE @date nvarchar(200)
        SELECT @date=Stuff((SELECT ',' + [extractDate]
                  FROM   @temp  where email = @email
                  FOR xml path('')), 1, 1, '')
           EXEC msdb.dbo.sp_send_dbmail
                @profile_name = 'CallsManagement',
                @recipients = @email ,
                @body_format = 'HTML',
                @subject = 'Personal Calls Reminder',
                @body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
    <title>Personal Calls Reminder</title>
    <style type="text/css">
     body {
     font-family: "Times New Roman", Times, serif;
     font-size: 11pt;
    .auto-style1 {
     background-color: #FFFF00;
    </style>
    </head>
    <body>
    <div>Extract Date : ' + @date + '</div>
    <div>
     <table style="width: 800px">
      <tr>
       <td>Dear,<br />
       <br />
       Please review your phone bills and submit your personal calls using the following link:<br />
       <a href="Personal">http://companyxyz/personalcalls/">Personal Calls</a></td>
      </tr>
     </table> 
     <br/>
     <table style="width: 800px">
      <tr>
       <td><strong>Kindly be informed that the deadline to process new bills is on the
       <span class="auto-style1">15th of each month</span>.</strong></td>
      </tr>
     </table>
     <br/>
     <table style="width: 800px">
      <tr>
       <td>For assistance, please contact <a href="[email protected]:[email protected]">[email protected]</a></td>
      </tr>
     </table>
     <br/>
     <table style="width: 800px">
     <tr>
     <td><strong>*** This is an automatically generated email, please do not reply ***</strong></td>
     </tr>
     </table>
    </div>
    </body>
    </html>
          FETCH NEXT FROM mycursor
          INTO @email
    END
    CLOSE mycursor;
    DEALLOCATE mycursor;
    END
    Regards, RSingh

  • How can I get the "text" field from the actionEvent.getSource() ?

    I have some sample code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class JFrameTester{
         public static void main( String[] args ) {
              JFrame f = new JFrame("JFrame");
              f.setSize( 500, 500 );
              ArrayList < JButton > buttonsArr = new ArrayList < JButton > ();
              buttonsArr.add( new JButton( "first" ) );
              buttonsArr.add( new JButton( "second" ) );
              buttonsArr.add( new JButton( "third" ) );
              MyListener myListener = new MyListener();
              ( (JButton) buttonsArr.get( 0 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 1 ) ).addActionListener( myListener );
              ( (JButton) buttonsArr.get( 2 ) ).addActionListener( myListener );
              JPanel panel = new JPanel();
              panel.add( buttonsArr.get( 0 ) );
              panel.add( buttonsArr.get( 1 ) );
              panel.add( buttonsArr.get( 2 ) );
              f.getContentPane().add( BorderLayout.CENTER, panel );
              f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
              f.setVisible( true );
         public static class MyListener  implements ActionListener{
              public MyListener() {}
              public void actionPerformed( ActionEvent e ) {
                   System.out.println( "hi!! " + e.getSource() );
                   // I need to know a title of the button (which was clicked)...
    }The output of the code is something like this:
    hi! javax.swing.JButton[,140,5,60x25,alignmentX=0.0,alignmentY=0.5,
    border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@1ebcda2d,
    flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,
    disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,
    right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=true,
    rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=first,defaultCapable=true]
    I need this: "first" (from this part: "text=first" of the output above).
    Does anyone know how can I get the "text" field from the e.getSource() ?

    System.out.println( "hi!! " + ( (JButton) e.getSource() ).getText() );I think the problem is solved..If your need is to know the text of the button, yes.
    In a real-world application, no.
    In a RW application, a typical need is merely to know the "logical role" of the button (i.e., the button that validates the form, regardless of whether its text is "OK" or "Save", "Go",...). Text tends to vary much more than the structure of the UI over time.
    In this case you can get the source's name (+getName()+), which will be the name that you've set to the button at UI construction time. Or you can compare the source for equality with either button ( +if evt.getSource()==okButton) {...}+ ).
    All in all, I think the best solution is: don't use the same ActionListener for more than one action (+i.e.+ don't add the same ActionListener to all your buttons, which leads to a big if-then-else series in your actionPerformed() ).
    Eventually, if you're listening to a single button's actions, whose text change over time (e.g. "pause"/"resume" in a VCR bar), I still think it's a bad idea to rely on the text of the button - instead, this text corresponds to a logical state (resp. playing/paused), it is more maintainable to base your logic on the state - which is more resilient to the evolutions of the UI (e.g. if you happen to use 2 toggle buttons instead of one single play/pause button).

Maybe you are looking for

  • Video out Ipad interface screen

    How can I use the iPad to project out the interface screen with the video out cable ? Is there an app I can use to do so ?

  • Multiple statements from one connection causes ORA-0100 Maximum open cursor

    HI, I am creating a connection and trying to run 2 statements off the connection. The connection has autocommit as false as I want to commit only after the second statement commits successfully. Upon executing the second statement, I get the ORAC-010

  • LMS 4.2.3 End Host not found

    When I go to Troubleshooting Workflows.  Select a switch, select View the switch, then scroll to end hosts, it tells me that their is no end hosts found.  However if I search for end hosts, it shows the end hosts that are connected to the switch.

  • Single AIP-SSM in Cisco ASA Failover Active / Standby Mode

    Hi, I can add single AIP-SSM on Cisco ASA in failover active / standby mode?

  • Error in Business Object bus2000126

    Hello all, i have given a workflow issue, in customer interaction center. The issue is " When A OS Tech support case is created in business activity ( crmd_bus2000126 ), the case is open, and this case is assingned to a person ( field-assigned to) an