Problem in Automatic mail generation after shipment creation in vt01

Hi All,
In VT01 Automatic mail generation to  customer  whenver a new shipment is created & in from address user mail adderess is mentioned but in my requirements i have  to mention different mail id in user mail address.
how can i do this?
please give me ur suggestions.
Thanx

Hi...
When user close the shipment ,then he gets a mail on his id automatically generated from sap system.
he want this mail should come to the mail id of his colleague.
Pls reply asap.
Thanx
Vj

Similar Messages

  • FUNCTION MODULE FOR AUTOMATIC MAIL GENERATION

    Hello,
    I want to generate an automatic mail of a scheduled report on everyday basis.
    the output spool req of scheduled report in generated n saved inside the system.
    Could you please help me in generating automatic mail through that saved spool request?
    Regards,
    Krutika

    hi,
    use:
    DATA: lv_filesize    TYPE i,
            lv_buffer      TYPE string,
            lv_attachment  TYPE i,
            lv_testo       TYPE i.
      DATA: li_pdfdata  TYPE STANDARD TABLE OF tline,
            li_mess_att TYPE STANDARD TABLE OF solisti1,
            li_mtab_pdf TYPE STANDARD TABLE OF tline,
            li_objpack  TYPE STANDARD TABLE OF sopcklsti1,
            li_objtxt   TYPE STANDARD TABLE OF solisti1,
            li_objbin   TYPE STANDARD TABLE OF solisti1,
            li_reclist  TYPE STANDARD TABLE OF somlreci1,
            li_objhead  TYPE soli_tab.
      DATA: lwa_pdfdata  TYPE tline,
            lwa_objpack  TYPE sopcklsti1,
            lwa_mess_att TYPE solisti1,
            lwa_objtxt   TYPE solisti1,
            lwa_objbin   TYPE solisti1,
            lwa_reclist  TYPE somlreci1,
            lwa_doc_chng TYPE  sodocchgi1.
      CONSTANTS: lc_u           TYPE char1  VALUE 'U',
                 lc_0           TYPE char1  VALUE '0',
                 lc_1           TYPE char1  VALUE '1',
                 lc_pdf         TYPE char3  VALUE 'PDF',
                 lc_raw         TYPE char3  VALUE 'RAW',
                 lc_ordform     TYPE char15 VALUE 'ZORDCONFIRM_01',
                 lc_attachment  TYPE char10 VALUE 'ATTACHMENT'.
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          format                = lc_pdf
          max_linewidth         = 132
        IMPORTING
          bin_filesize          = lv_filesize
        TABLES
          otf                   = pv_otfdata
          lines                 = li_pdfdata
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          err_bad_otf           = 4
          OTHERS                = 5.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT li_pdfdata INTO lwa_pdfdata.
        TRANSLATE lwa_pdfdata USING ' ~'.
        CONCATENATE lv_buffer lwa_pdfdata INTO lv_buffer.
        CLEAR lwa_pdfdata.
      ENDLOOP.
      TRANSLATE lv_buffer USING '~ '.
      DO.
        lwa_mess_att = lv_buffer.
        APPEND lwa_mess_att TO li_mess_att.
        CLEAR lwa_mess_att.
        SHIFT lv_buffer LEFT BY 255 PLACES.
        IF lv_buffer IS INITIAL.
          EXIT.
        ENDIF.
      ENDDO.
    Object with PDF.
      REFRESH li_objbin.
      li_objbin[] = li_mess_att[].
      DESCRIBE TABLE li_objbin LINES lv_attachment.
    Object with main text of the mail.
      lwa_objtxt = space.
      APPEND lwa_objtxt TO li_objtxt.
      CLEAR lwa_objtxt.
      DESCRIBE TABLE li_objtxt LINES lv_testo.
    Create the document which is to be sent
      lwa_doc_chng-obj_name  = text-008.
      lwa_doc_chng-obj_descr = text-008.
      lwa_doc_chng-sensitivty = lc_0.
      lwa_doc_chng-obj_prio = lc_1.
      lwa_doc_chng-doc_size = lv_testo * 225.
    Pack to main body.
      CLEAR lwa_objpack-transf_bin.
    header
      lwa_objpack-head_start = 1.
    The document needs no header (head_num = 0)
      lwa_objpack-head_num   = 0.
    body
      lwa_objpack-body_start = 1.
      lwa_objpack-body_num   = lv_testo.
      lwa_objpack-doc_type   = lc_raw.
      APPEND lwa_objpack TO li_objpack.
      CLEAR lwa_objpack.
    Create the attachment.
    Fill the fields of the packing_list for the attachment:
      lwa_objpack-transf_bin = gc_x .
    header
      lwa_objpack-head_start = 1.
      lwa_objpack-head_num   = 1.
    body
      lwa_objpack-body_start = 1.
      lwa_objpack-body_num   = lv_attachment.
      lwa_objpack-doc_type   = lc_pdf.
      lwa_objpack-obj_name   = lc_attachment.
      lwa_objpack-obj_descr  = text-008.
      lwa_objpack-doc_size =  lv_attachment * 255.
      APPEND lwa_objpack TO li_objpack.
      CLEAR lwa_objpack.
      lwa_reclist-receiver   = pv_emailid.
      lwa_reclist-rec_type   = lc_u.
      lwa_reclist-notif_del  = gc_x.
      lwa_reclist-notif_ndel = gc_x.
      APPEND lwa_reclist TO li_reclist.
      IF li_reclist IS NOT INITIAL.
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = lwa_doc_chng
            put_in_outbox              = gc_x
          TABLES
            packing_list               = li_objpack
            object_header              = li_objhead
            contents_bin               = li_objbin
            contents_txt               = li_objtxt
            receivers                  = li_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 'I' NUMBER sy-msgno
                     WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.

  • HT1199 Why is mail stuck in a do-loop of "There is a problem" with the mail account after changing iCloud password?  How can it be fixed?

    After changing passwords for iCloud, Mail is stuck in a do-loop "There is a [problem..."  The error appears in less than one second after responding "Later"

    Nope.  Turns out that even though I have two Macs running 10.9.4, the one in question doesn't get the SMTP settings changed by iCloud settings when the password is changed, so I had to "Edit" the account in Mail, plow down to the password settings for the Apple SMTP server, and change the password myself.  Nothing in the System Preferences iCloud setting tab lets you change any settings on the local machine.  Apple is sure they are controlling everything when you make changes in iCloud, but they are wrong.  Identical versions of 10.9.4 are configured differently on two different Macs.

  • Problem with automatic key generation

    Hi,
    I'm getting an exception when creating entity EJB's that use automatic primary key
    generation (I'm using MS SQL Server as the db). The data is being inserted correctly
    onto the database (including the auto generated key), but the auto generated primary
    key field in the EJB is being set to zero rather than the correct value. This causes
    a NoSuchEntityException.
    The db table has an identity set on the auto generated field, but this field is not
    the primary key.
    Does anyone have an idea as to what the problem is?
    thanks,
    Andy

    Make sure you are using a TX DataSource
    "Andy Pearson" <[email protected]> wrote in message
    news:3ccead40$[email protected]..
    >
    Hi,
    I'm getting an exception when creating entity EJB's that use automaticprimary key
    generation (I'm using MS SQL Server as the db). The data is being insertedcorrectly
    onto the database (including the auto generated key), but the autogenerated primary
    key field in the EJB is being set to zero rather than the correct value.This causes
    a NoSuchEntityException.
    The db table has an identity set on the auto generated field, but thisfield is not
    the primary key.
    Does anyone have an idea as to what the problem is?
    thanks,
    Andy

  • Problems with certain mail attachments after moving them to a different folder in Mail

    I am using Mac Mail as my default email client, and every once in a while when I move a message with an attachment from one folder to another (for example from my Inbox to my Personal folder) in Mail, the attachment will no longer show up, but rather an infinite set of characters. 
    I know it's a problem with my local Mac Mail client, since:
    I can see the attachments perfectly in my webmail
    I can see the attachments perfectly in my other Mac's Mail client, as well as on my iPhone and iPad.
    This is a sample of what it looks like:
    --Apple-Mail-6-682963542
    Content-Disposition: inline;
        filename="Opcion 1.png"
    Content-Type: image/png;
        x-mac-hide-extension=yes;
        x-unix-mode=0777;
        name="Opcion 1.png"
    Content-Transfer-Encoding: base64
    iVBORw0KGgoAAAANSUhEUgAAAyMAAARYCAIAAACd85seAAAWdmlDQ1BJQ0MgUHJvZmlsZQAAeAGt
    WHdUFM+y7tnMEpacc84558ySM0hmWXISyRIFkawoIJIRDCQFBAVBVEQUFERARARUkgqKigGRoLxB
    78973zn3/ff6nOn5pqa6Zqa/mq6uAoCVkxQREYqgBSAsPDrSzkSf94CLKy92DkCAGuCBLGAmkaMi
    9GxsLMD/2b5PwdpweyK1b+v/VPvvN+h8/aLIAEA28G0f3yhyGIyvwgcvOSIyGgDEJCwXjIuO2Mc/
    YMwYCb8gAEiqfRzwB/PuY58/WPG3joOdAaxDBABHRSJFBgBA6QDLeWPJAbAdSvjA0If7BoUDQJcN
    Y21yIMkXAJYhWEcyLOzgPv4GY1Gf/7AT8B+YRPL5a5NECviL/3wLPBJ+sGFQVEQo6fDvi//PLiw0
    Bp6v340Z7qkiovXt4DMOnjPWoGjT/e/8jQNjiI7/4IRAB+d/cLiPlfU/mBxlAM/lH/2Qg+Z/7fj6
    GRr9I4+Ktf+LEwINrP6RB5PM9jn7/SxSJIz+hSOibf6+Q3io1b7f/NbxjzT+a98vysj+H3l0pMNf
    uX+Qsek/8ojQ3z73e2xkjN3fb/ELd/w71pdkaP6PPggCloAEyNF+8TC/ABgcjDgcGRQQGM2rB3ul
    nySvaThZWpJXXlZOHuz7+L4OAF/tfvsuxPz437IkEwB02+H5vP5vmUM/AI13AWDw/7dMaAQApjwA
    btGQYyJj/9hD7Z/Q8J9DAIyADXADASAKpIA8UAYaQBcYATNgDRyAC/AEZBAIwkAkiANJIA1kgjxw
    EpwG5aAGnAMN4DJoB12gF9wB98EwGANPwSyYB6/Be7AOvoMdCIKwEDXEALFBPJAQJAHJQ6qQNmQE
    WUB2kAvkDQVA4VAMlAQdhfKgQqgcqoUaoStQN3QHegCNQ8+hBWgV+gJtI5AIKgQjggshjJBBqCL0
    EOYIB4QHIgBxCJGAyECcQJQi6hCXEJ2IO4hhxFPEPOI9YgMJkJRIZiQfUgqpijRAWiNdkf7ISGQK
    MhdZgqxDtiB7kIPIJ8h55BpyC4VBMaB4UVIoDRQR5Ygiow6hUlD5qHJUA6oTNYB6glpAraN+oanR
    nGgJtDraFH0AHYCOQ2eiS9AX0dfQ99BP0a/R3zEYDDNGBKOCIWJcMMGYREw+pgrTiunDjGOWMBtY
    LJYNK4HVwlpjSdhobCa2DHsJexs7gX2N/YGjxPHg5HHGOFdcOC4dV4Jrwt3CTeDe4nYoaCmEKNQp
    rCl8KQ5TFFCcp+iheEzxmmIHT4cXwWvhHfDB+DR8Kb4Ffw8/h/9KSUnJT6lGaUsZRHmEspSyjXKI
    coFyi4qeSpzKgMqdKobqBFU9VR/Vc6qv1NTUwtS61K7U0dQnqBup71K/pP5Bw0AjTWNK40uTSlNB
    00kzQfORQEEQIugRPAkJhBJCB+ExYY2WglaY1oCWRJtCW0HbTfuMdoOOgU6OzpoujC6fronuAd0K
    PZZemN6I3pc+g/4c/V36JQYkgwCDAQOZ4SjDeYZ7DK8ZMYwijKaMwYx5jJcZRxnXmeiZFJmcmOKZ
    KphuMs0zI5mFmU2ZQ5kLmNuZp5i3WbhY9Fj8WHJYWlgmWDZZOVh1Wf1Yc1lbWZ+ybrPxshmxhbCd
    Yutie8GOYhdnt2WPY69mv8e+xsHIocFB5sjlaOeY4URwinPacSZynuMc4dzg4uYy4YrgKuO6y7XG
    Any ideas?

    Get info on the drive.  What format?  FAT drives may be behave erratically for heavy-duty use of the kind you are doing. It's okay to leave a flash drive FAT formatted for light use but for heavy-duty file transfer I think you can encounter issues.
    iTunes does not look at files directly.  It maintains a database (library.itl) of the files in its collection.  When you play a track it looks up where that file is located and goes and plays the file in that location.  If you manually move a file or folder used by iTunes that database is no longer correct and you get broken links ( ! ).  If you want to move files or folders with iTunes you have to let iTunes do it.  Since iTunes is organizing your library there isn't much flexibility in what you can do other than move the whole collection to a different folder by changing the media location preference in preferences.
    Lion - Disk Utility - https://discussions.apple.com/message/16925522 - repairing your drive using Disk Utility on Lion's recovery partition.

  • Problem with the mail generation for the CCMS alert

    HI ,
    I have created CCMS alert for the RFCdestination  in the system and is working fine, and now i would like to configure mail for the same alert for that i have did the following
    1.copied the method CCMS_ONALERT_EMAIL_v2 in RZ21 and created the new method .
    2. And then assigned the same in the CCMS alert in the autoreaction tab.
    But still iam unable to generate mails.Mail configutation is ok and am able send mails to external addresses.
    Can any one please let me know if iam missing anything and guide me .
    Any help is appreciated

    Hi Vamsi,
    Please check below thread and go through suggested documentation.
    Automatic Email for CCMS Alerts
    Revert for any queries.
    Regards,
    Rajesh

  • Has anyone had a problem losing e-mail messages after viewing on the iphone

    Recently, I have lost a small handful of Yahoo messages. Seriously, they just vanished into thin air. The message would be there in my list of messages, but when I would open it on the iPhone, it would be a completely different message.
    Initially I thought I had accidentally deleted them, but after searching once on an actual computer, I discovered that they were truly gone. I finally contacted Yahoo about the problem, and they said that it is a known issue - the issue being a user has a message, views the inbox on ios5, tries to view the message, but then the message disappears completely..."completely" being verified by use when logged in on a non-ios5 device such as computer.
    So now I'm just careful. Fine.
    Now my boss is telling me that he has had some of his messages disappear from our company domain through MSExchange. WTH?? We're having our Exchange host look into the issue, but I thought I'd do some investigating of my own in the meantime.
    Has anyone else experienced this?
    For the record, both of the phones in question are 4s iPhones running ios5 (naturally) on Verizon. Mine is a 64GB, acquired in November 2010, and my boss' phone is a 32GB, acquired in December 2010.
    Any insight is greatly appreciated..

    Clean iPhone charging port with clean dry toothbrush.

  • Automatic Mail generation

    Hi all,
    IF the Difference between the Purchase requisition date and system date is 10days then i need to send a mail automatically to the mail ID of the Purchase requisition(PR) creator (EBAN-ERNAM) with the details of the Purchase requisition number , Purchase requisition item number and also with thes ome  message like (ex:-Your PR will be deleted in the next two days)
    I have to do a Report only not a work flow
    This Program is an Batch program and will be scheduled every day Morning
    Please suggest me how to solve this and if possible please give me the Sample program
    Thansk & Regards
    Ajay

    FORM sub_send_mail USING p_string1  TYPE string
                             p_string2  TYPE string
                             p_string3  TYPE string.
    DATA :   l_i_objtxt   TYPE STANDARD TABLE OF solisti1   INITIAL SIZE 0,
                                                           "Contents
              l_wa_objtxt TYPE solisti1,
             l_wa_doc_chng type sodocchgi1 ,           "Attributes of Mail
              l_i_objpack  TYPE STANDARD TABLE OF sopcklsti1 INITIAL SIZE 0,
                                                           "Packing list
              l_wa_objpack TYPE  sopcklsti1,
              l_i_reclist  TYPE STANDARD TABLE OF somlreci1  INITIAL SIZE 0,
                                                           "Receivers list
              l_wa_reclist TYPE somlreci1 ,
              l_tab_lines  LIKE sy-tabix.                "No. of lines
      CONCATENATE p_string1 p_string2
                  INTO l_wa_doc_chng-obj_descr SEPARATED BY space.
      IF p_string3 IS NOT INITIAL.
        CONCATENATE l_wa_doc_chng-obj_descr p_string3
                  INTO l_wa_doc_chng-obj_descr SEPARATED BY space.
      ENDIF.
      l_wa_objtxt-line = l_wa_doc_chng-obj_descr.
      APPEND l_wa_objtxt TO l_i_objtxt.
      CLEAR l_wa_objtxt .
      l_tab_lines = LINES( l_i_objtxt ) .
      READ TABLE l_i_objtxt INTO l_wa_objtxt INDEX l_tab_lines.
      IF sy-subrc = 0.
        l_wa_doc_chng-doc_size = ( l_tab_lines - 1 ) * 255 +
                                       STRLEN( l_wa_objtxt ).
      ENDIF.
    Creating the entry for the compressed document
      CLEAR l_wa_objpack-transf_bin.
      l_wa_objpack-head_start = 1.
      l_wa_objpack-head_num   = 0.
      l_wa_objpack-body_start = 1.
      l_wa_objpack-body_num   = l_tab_lines.
      l_wa_objpack-doc_type   = 'RAW'.
      APPEND l_wa_objpack TO l_i_objpack.
      CLEAR l_wa_objpack .
      CALL FUNCTION 'EFG_GEN_GET_USER_EMAIL'
        EXPORTING
          i_uname        = sy-uname
       IMPORTING
         E_EMAIL_ADDRESS = l_wa_reclist-receiver.
      l_wa_reclist-rec_type = 'U'.
      APPEND l_wa_reclist TO l_i_reclist.
      CLEAR l_wa_reclist .
    Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = l_wa_doc_chng
          put_in_outbox              = c_check
          commit_work                = c_check
        TABLES
          packing_list               = l_i_objpack
          contents_txt               = l_i_objtxt
          receivers                  = l_i_reclist
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          OTHERS                     = 99.
      IF sy-subrc <> 0 .
      write: 'Notification not send'.
      ENDIF.
    Reward point if helpful

  • Problem with voice mail notification after 8107.79...

    i have a nokie lumia 800 and there was an update of the OS to 8107.79 from une, when i updated my phone, there were problems i have encountered, first was the voice mail notification. I did not subscribe myself to my network providers voice mail service (since they dont have that service as well) but there was a notification on my phone about a voice mail to which i wonder how did i get a notification when i dont even have a voice mail account.
    Second was the lights at the three buttons below the screen, it does not illuminate on most of the time.
    Has anyone encountered these problems?

    Not sure about the voicemail thing but 8107 shouldn't affecting the buttons at the bottom of the phone that issue arose afte 1500 firmware update from Nokia.
    If you have your display set to auto then the the buttons will light up normally.

  • P.O automatic mail genration pdf to word/text.

    Hi  everyone,
    this is regarding the automatic mail generation in smartforms. Its like when you process the smartforms the mails are automatically shooted to the address maintained for eg usually to the vendors. So what I need is incase I proces my smartforms the mail shouldnt be in the pdf format but in normal text format.
    I dont want to take that pdf convert to word/text by external sofware and attch it to the mail. I want it to be automatic.
    Plz suggest the possible ways of doing it. Thanks to all in advance.
    Rgds,
    Anuc.

    *& Report  ZCS_IRN
    report  zpo_spool no standard page heading line-size 260.
    Table Declaration *******************************
    tables : zptreg,zpoinb,dd07t,nase.
    Data Declaration ********************************
    type-pools: slis.
    data :   report_id  like sy-repid.
    data :   ws_title   type lvc_title value 'Reprint PT Inbound Register'.
    data :   i_layout   type slis_layout_alv.
    data :   i_fieldcat type slis_t_fieldcat_alv.
    data :   lf_fm_name            type rs38l_fnam.
    data :   ls_control_param      type ssfctrlop.
    data :   ls_composer_param     type ssfcompop.
    data :   ls_recipient type swotobjid.
    data :   ls_sender    type swotobjid.
    data : control_parameters type ssfctrlop.
    data :   output_options type ssfcompop.
    Internal Table Declaration *******************************
    data: begin of itab occurs 0,
            chk,
            indno type zptreg-indno,
            dtype type zptreg-dtype,
            ernam type zptreg-ernam,
            erzet type zptreg-erzet,
            aedat type zptreg-aedat,
            traid type zptreg-traid,
            traty type zptreg-traty,
            vehnum type zptreg-vehnum,
            bolnr type zptreg-bolnr,
            lrdat type zptreg-lrdat,
            lrdelv type zptreg-lrdelv,
            lrtime type zptreg-lrtime,
            datia type zptreg-datia,
            uhria type zptreg-uhria,
            lifnr type zptreg-lifnr,
            werks type zptreg-werks,
            anzpk type zptreg-anzpk,
            btgew type zptreg-btgew,
            gewei type zptreg-gewei,
            ntgew type zptreg-ntgew,
            idtxt type zptreg-idtxt,
            waybl type zptreg-waybl,
            dpack type zptreg-dpack,
            ebeln type zpoinb-ebeln,
            vbeln type zpoinb-vbeln,
             menge type eket-menge,
            wemng type eket-wemng,
            wemng1 type eket-wemng,
            chaln type zptreg-chaln,
            paymt type zptreg-paymt,
            zchquan type zptreg-zchquan,
            rdesc(60) type c,
            trdesc(60) type c,
            tydesc(60) type c,
            pdesc(60) type c,
            name1 type lfa1-name1,
         end of itab.
    data : itab1 like itab occurs 0 with header line.
    data : itab2 like itab occurs 0 with header line.
    data: begin of ieket occurs 0,
            ebeln type eket-ebeln,
            ebelp type eket-ebelp,
            menge type eket-menge,
            wemng type eket-wemng,
          end of ieket.
    data : ieket1 like ieket occurs 0 with header line.
    data : ieket2 like ieket occurs 0 with header line.
    data : flag type c.
    Selection Screen *******************************
    selection-screen : begin of block b1 with frame title text-001.
    select-options : x_indno for zptreg-indno matchcode object zindnohelp2.
    select-options : x_aedat for zptreg-aedat.
    select-options : x_werks for zptreg-werks .
    select-options : x_lrdat for zptreg-lrdat.
    select-options : x_lifnr for zptreg-lifnr no intervals no-extension.
    select-options : x_ebeln for zpoinb-ebeln no intervals no-extension.
    select-options : x_bolnr for zptreg-bolnr no intervals no-extension.
    select-options : x_traid for zptreg-traid no intervals no-extension.
    selection-screen : end of block b1.
    Start of Selection  *****************************
    start-of-selection.
      set pf-status 'STATUS'.
      perform get_data.
      perform display_data.
    *&      Form  get_data
    form get_data .
      select * from zptreg into corresponding fields of table itab1
                              where indno in x_indno
                                and aedat in x_aedat
                                and werks in x_werks
                                and lrdat in x_lrdat
                                and lifnr in x_lifnr
                                and bolnr in x_bolnr
                                and traid in x_traid.
      if sy-subrc ne 0.
        message i001(zmsg).
        stop.
      endif.
      select * from zpoinb into corresponding fields of table itab
                           for all entries in itab1
                             where indno = itab1-indno
                             and ebeln in x_ebeln.
      if sy-subrc ne 0.
        message i001(zmsg).
        stop.
      endif.
      loop at itab.
        at new indno.
          flag = 1.
        endat.
        if flag = 1.
          read table itab1 with key indno = itab-indno.
          move itab1-traid to itab-traid.
          move itab1-lifnr to itab-lifnr.
          move itab1-traty to itab-traty.
          move itab1-bolnr to itab-bolnr.
          move itab1-traid to itab-traid.
          move itab1-werks to itab-werks.
          move itab1-vehnum to itab-vehnum.
          move itab1-lifnr to itab-lifnr.
          move itab1-btgew to itab-btgew.
          move itab1-gewei to itab-gewei.
          move itab1-ntgew to itab-ntgew.
          move itab1-idtxt to itab-idtxt.
          move itab1-waybl to itab-waybl.
          move itab1-anzpk to itab-anzpk.
          move itab1-aedat to itab-aedat.
          move itab1-dpack to itab-dpack.
          move itab1-erzet to itab-erzet.
          move itab1-ernam to itab-ernam.
          move itab1-zchquan to itab-zchquan.
          move itab1-paymt to itab-paymt.
          move itab1-chaln to itab-chaln.
          move itab1-lrdat to itab-lrdat.
          move itab1-lrdelv to itab-lrdelv.
          move itab1-lrtime to itab-lrtime.
          move itab1-datia to itab-datia.
          move itab1-uhria to itab-uhria.
          clear flag.
        endif.
        modify itab.
      endloop.
      delete itab where indno not in x_indno.
      select * from eket into corresponding fields of table ieket for all entries in itab
        where ebeln = itab-ebeln.
      loop at ieket.
        move ieket-ebeln to ieket1-ebeln.
        move ieket-menge to ieket1-menge.
        collect ieket1.
      endloop.
      loop at ieket.
        move ieket-ebeln to ieket2-ebeln.
        move ieket-wemng to ieket2-wemng.
        collect ieket2.
      endloop.
      loop at itab.
        read table ieket1 with key ebeln = itab-ebeln.
        move ieket1-menge to itab-menge.
        read table ieket2 with key ebeln = itab-ebeln.
        move ieket2-wemng to itab-wemng.
        itab-wemng1 = itab-menge - itab-wemng.
        select ddtext from dd07t into itab-rdesc where domvalue_l = itab-idtxt and domname = 'ZIDTXT'.
        endselect.
        select ddtext from dd07t into itab-trdesc where domvalue_l = itab-traid and domname = 'ZTRAID'.
        endselect.
        select ddtext from dd07t into itab-tydesc where domvalue_l = itab-traty and domname = 'ZTRATY'.
        endselect.
        select ddtext from dd07t into itab-pdesc where domvalue_l = itab-paymt and domname = 'ZPAYMT'.
        endselect.
        select name1 from lfa1 into itab-name1 where lifnr = itab-lifnr.
        endselect.
        modify itab.
        clear itab.
      endloop.
      if itab[] is initial.
        message i001(zmsg).
        stop.
      endif.
    endform.                    " get_data
    *&      Form  display_data
    form display_data .
      report_id = sy-repid.
      perform f1000_layout_init changing i_layout.
      perform f2000_fieldcat_init changing i_fieldcat.
      call function 'REUSE_ALV_LIST_DISPLAY'
       exporting
        I_INTERFACE_CHECK              = ' '
        I_BYPASSING_BUFFER             =
        I_BUFFER_ACTIVE                = ' '
         i_callback_program              = report_id
         i_callback_pf_status_set       = 'STATUS'
         i_callback_user_command        = 'USER_COMMAND'
        I_STRUCTURE_NAME               =
         is_layout                       = i_layout
         it_fieldcat                     = i_fieldcat
        IT_EXCLUDING                   =
        IT_SPECIAL_GROUPS              =
        IT_SORT                        =
        IT_FILTER                      =
        IS_SEL_HIDE                    =
         i_default                      = 'X'
         i_save                         = 'A'
        IS_VARIANT                     =
        IT_EVENTS                      =
        IT_EVENT_EXIT                  =
        IS_PRINT                       =
        IS_REPREP_ID                   =
        I_SCREEN_START_COLUMN          = 0
        I_SCREEN_START_LINE            = 0
        I_SCREEN_END_COLUMN            = 0
        I_SCREEN_END_LINE              = 0
        IR_SALV_LIST_ADAPTER           =
        IT_EXCEPT_QINFO                =
        I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER        =
        ES_EXIT_CAUSED_BY_USER         =
        tables
          t_outtab                       = itab
      EXCEPTIONS
        PROGRAM_ERROR                  = 1
        OTHERS                         = 2
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    " display_data
    *&      Form  f1000_layout_init
    form f1000_layout_init using i_layout type slis_layout_alv.
      clear i_layout.
      i_layout-colwidth_optimize = 'X'.
      i_layout-edit = ''.
      i_layout-box_fieldname = 'CHK'.
    endform.                    " F1000_Layout_Init
    *&      Form  f2000_fieldcat_init
    form f2000_fieldcat_init changing i_fieldcat type slis_t_fieldcat_alv.
      data: line_fieldcat type slis_fieldcat_alv.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'CHK'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_l = 'Checkbox'.
      line_fieldcat-checkbox  = 'X'.      " Display this field as a checkbox
      line_fieldcat-outputlen = '8'.
      line_fieldcat-edit      =  'X'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'INDNO'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = ' PT Register No '.
      line_fieldcat-outputlen = '15'.
    line_fieldcat-hotspot       = 'X' .
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'AEDAT'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = ' Creation Date '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'TRDESC'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = ' Transporter Name    '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'TYDESC'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = ' Transport Type  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'VEHNUM'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = ' Vehicle Number   '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'BOLNR'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = ' L .R Number  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'NAME1'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = ' Vendor / Supplier'.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'WERKS'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Site   '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'EBELN'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Purchasing Document '.
      line_fieldcat-outputlen = '15'.
      line_fieldcat-hotspot       = 'X' .
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'WEMNG1'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Still To Be Delivered '.
      line_fieldcat-outputlen = '20'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'VBELN'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Sales Document  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'ANZPK'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'No.of Packages  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'DPACK'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Damaged Packages  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'BTGEW'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Total Weight   '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'GEWEI'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Weight Unit   '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'NTGEW'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = ' Net Weight   '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'RDESC'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Remarks   '.
      line_fieldcat-outputlen = '60'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'WAYBL'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Weigh Bill Number  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'ERNAM'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Created By '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'ERZET'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Created At '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'LRDAT'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'L.R Date  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'LRDELV'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'L.R Delivery Date  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'LRTIME'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'L.R Time  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'DATIA'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_l = 'Appointments: From date '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'UHRIA'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_l = 'Appointments: Time from  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'CHALN'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Challan No  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'PDESC'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Payment method  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'ZCHQUAN'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Challan Quantity '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
    endform.                    "f2000_fieldcat_init
    *&      Form  user_command
    form user_command using r_ucomm like sy-ucomm
                          rs_selfield type slis_selfield.
      data: wa_job_output_info type ssfcrescl.
    data wa_spoolids type  tsfspoolid.
    data wa_spoolnum type rspoid.
    data: objpack like sopcklsti1 occurs  2 with header line,
          objhead1 like solisti1   occurs  1 with header line,
          objbin  like solisti1   occurs 10 with header line,
          objtxt  like solisti1   occurs 10 with header line,
          reclist like somlreci1  occurs  5 with header line,
          doc_chng like sodocchgi1,
          tab_lines like sy-tabix.
      data : wa_itab like itab.
      data : line type c.
      case r_ucomm.
        when 'SAVE'.
          clear line.
          refresh itab2.
          read table itab index rs_selfield-tabindex.
          loop at itab where chk ne space.
            move-corresponding itab to itab2.
            collect itab2.
          endloop.
          describe table itab2 lines line.
          if line ge 2.
            message 'Please Select Only Document for Print Output ' type 'E'.
          endif.
          set parameter id : 'ZIN' field itab-indno.
          call function 'SSF_FUNCTION_MODULE_NAME'
            exporting
              formname = 'ZPTREG_NEW'
            importing
              fm_name  = lf_fm_name.
          if sy-subrc <> 0.
          endif.
          control_parameters-no_dialog = 'X'.
          control_parameters-preview   =  'X'.
          output_options-tddest = 'LOCL'.
          output_options-tdcopies = '2'.
          call function lf_fm_name
            exporting
              control_parameters = ls_control_param
              output_options     = ls_composer_param
              mail_recipient     = ls_recipient
              mail_sender        = ls_sender
              user_settings      = 'X'
              p_indno            = itab-indno
              importing
      DOCUMENT_OUTPUT_INFO       =
       job_output_info            = wa_job_output_info
      JOB_OUTPUT_OPTIONS         =
            exceptions
              formatting_error   = 1
              internal_error     = 2
              send_error         = 3
              user_canceled      = 4
              others             = 5.
          if sy-subrc <> 0.
          endif.
    move wa_job_output_info-spoolids[] to wa_spoolids[].
    read table wa_spoolids into wa_spoolnum index 1.
    if sy-subrc = 0.
    data :id like tsp01-rqident.
    move wa_spoolnum to id.
    endif. .
    *loop at wa_spoolids INTO wa_spoolnum .
    write : id.
    *endloop.
    data i_soli like soli occurs 0 with header line.
    call function 'RSPO_RETURN_SPOOLJOB'
    exporting
    rqident = id
    desired_type = 'OTF'
    tables
    buffer = i_soli
    exceptions
    no_such_job = 1
    job_contains_no_data = 2
    selection_empty = 3
    no_permission = 4
    can_not_access = 5
    read_error = 6
    type_no_match = 7
    others = 8.
    data content_bin type solix_tab.
    data objhead type soli_tab.
    data i_soli_tab type soli_tab.
    data boolean type sx_boolean.
    data length type so_obj_len.
    loop at i_soli.
    append i_soli to i_soli_tab[].
    endloop.
    call function 'SX_OBJECT_CONVERT_OTF_RAW'
    exporting
    format_src = 'OTF'
    format_dst = 'RAW'
    changing
    transfer_bin = boolean
    content_txt = i_soli_tab
    content_bin = content_bin
    objhead = objhead
    len = length
    exceptions
    err_conv_failed = 1
    others = 2.
      endcase.
    *describe table objbin lines tab_lines.
          objpack-transf_bin = 'X'.
          objpack-head_start = 1.
          objpack-head_num = 1.
          objpack-body_start = 1.
          objpack-body_num =  '100'. "tab_lines.
    * objpack-doc_type = c_asc.
          objpack-doc_type = 'DOC'.
          objpack-obj_name = 'ATTACHMENT'.
          objpack-obj_descr = 'ATTACH'. "p_attach.
    "Name of Attachment
          objpack-doc_size = tab_lines  * 255.
          append objpack..
    reclist-receiver = '[email protected]'.
            reclist-rec_type = 'U'.
            append reclist.
    objbin[] = i_soli_tab[].
          call function 'SO_RAW_TO_RTF'
            tables
              objcont_old = objbin
              objcont_new = objbin
            exceptions
              others      = 0.
          call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
            exporting
              document_data              = doc_chng
              put_in_outbox              = 'X'
              commit_work                = 'X'
            tables
              packing_list               = objpack
              object_header              = objhead1
              contents_bin               = objbin
              contents_txt               = objtxt
              receivers                  = reclist
            exceptions
              too_many_receivers         = 1
              document_not_sent          = 2
              operation_no_authorization = 4
              others                     = 99.
    endform.                    "user_command
    Message was edited by:
            anu c

  • P.O auto mail generation pdf to word

    Hi  everyone,
    this is regarding the automatic mail generation in smartforms. Its like when you process the smartforms the mails are automatically shooted to the address maintained for eg usually to the vendors. So what I need is incase I proces my smartforms the mail shouldnt be in the pdf format but in normal text format.
    I dont want to take that pdf convert to word/text by external sofware and attch it to the mail. I want it to be automatic.
    Plz suggest the possible ways of doing it. Thanks to all in advance.
    Rgds,
    Anuc.

    *& Report  ZCS_IRN
    report  zpo_spool no standard page heading line-size 260.
    Table Declaration *******************************
    tables : zptreg,zpoinb,dd07t,nase.
    Data Declaration ********************************
    type-pools: slis.
    data :   report_id  like sy-repid.
    data :   ws_title   type lvc_title value 'Reprint PT Inbound Register'.
    data :   i_layout   type slis_layout_alv.
    data :   i_fieldcat type slis_t_fieldcat_alv.
    data :   lf_fm_name            type rs38l_fnam.
    data :   ls_control_param      type ssfctrlop.
    data :   ls_composer_param     type ssfcompop.
    data :   ls_recipient type swotobjid.
    data :   ls_sender    type swotobjid.
    data : control_parameters type ssfctrlop.
    data :   output_options type ssfcompop.
    Internal Table Declaration *******************************
    data: begin of itab occurs 0,
            chk,
            indno type zptreg-indno,
            dtype type zptreg-dtype,
            ernam type zptreg-ernam,
            erzet type zptreg-erzet,
            aedat type zptreg-aedat,
            traid type zptreg-traid,
            traty type zptreg-traty,
            vehnum type zptreg-vehnum,
            bolnr type zptreg-bolnr,
            lrdat type zptreg-lrdat,
            lrdelv type zptreg-lrdelv,
            lrtime type zptreg-lrtime,
            datia type zptreg-datia,
            uhria type zptreg-uhria,
            lifnr type zptreg-lifnr,
            werks type zptreg-werks,
            anzpk type zptreg-anzpk,
            btgew type zptreg-btgew,
            gewei type zptreg-gewei,
            ntgew type zptreg-ntgew,
            idtxt type zptreg-idtxt,
            waybl type zptreg-waybl,
            dpack type zptreg-dpack,
            ebeln type zpoinb-ebeln,
            vbeln type zpoinb-vbeln,
             menge type eket-menge,
            wemng type eket-wemng,
            wemng1 type eket-wemng,
            chaln type zptreg-chaln,
            paymt type zptreg-paymt,
            zchquan type zptreg-zchquan,
            rdesc(60) type c,
            trdesc(60) type c,
            tydesc(60) type c,
            pdesc(60) type c,
            name1 type lfa1-name1,
         end of itab.
    data : itab1 like itab occurs 0 with header line.
    data : itab2 like itab occurs 0 with header line.
    data: begin of ieket occurs 0,
            ebeln type eket-ebeln,
            ebelp type eket-ebelp,
            menge type eket-menge,
            wemng type eket-wemng,
          end of ieket.
    data : ieket1 like ieket occurs 0 with header line.
    data : ieket2 like ieket occurs 0 with header line.
    data : flag type c.
    Selection Screen *******************************
    selection-screen : begin of block b1 with frame title text-001.
    select-options : x_indno for zptreg-indno matchcode object zindnohelp2.
    select-options : x_aedat for zptreg-aedat.
    select-options : x_werks for zptreg-werks .
    select-options : x_lrdat for zptreg-lrdat.
    select-options : x_lifnr for zptreg-lifnr no intervals no-extension.
    select-options : x_ebeln for zpoinb-ebeln no intervals no-extension.
    select-options : x_bolnr for zptreg-bolnr no intervals no-extension.
    select-options : x_traid for zptreg-traid no intervals no-extension.
    selection-screen : end of block b1.
    Start of Selection  *****************************
    start-of-selection.
      set pf-status 'STATUS'.
      perform get_data.
      perform display_data.
    *&      Form  get_data
    form get_data .
      select * from zptreg into corresponding fields of table itab1
                              where indno in x_indno
                                and aedat in x_aedat
                                and werks in x_werks
                                and lrdat in x_lrdat
                                and lifnr in x_lifnr
                                and bolnr in x_bolnr
                                and traid in x_traid.
      if sy-subrc ne 0.
        message i001(zmsg).
        stop.
      endif.
      select * from zpoinb into corresponding fields of table itab
                           for all entries in itab1
                             where indno = itab1-indno
                             and ebeln in x_ebeln.
      if sy-subrc ne 0.
        message i001(zmsg).
        stop.
      endif.
      loop at itab.
        at new indno.
          flag = 1.
        endat.
        if flag = 1.
          read table itab1 with key indno = itab-indno.
          move itab1-traid to itab-traid.
          move itab1-lifnr to itab-lifnr.
          move itab1-traty to itab-traty.
          move itab1-bolnr to itab-bolnr.
          move itab1-traid to itab-traid.
          move itab1-werks to itab-werks.
          move itab1-vehnum to itab-vehnum.
          move itab1-lifnr to itab-lifnr.
          move itab1-btgew to itab-btgew.
          move itab1-gewei to itab-gewei.
          move itab1-ntgew to itab-ntgew.
          move itab1-idtxt to itab-idtxt.
          move itab1-waybl to itab-waybl.
          move itab1-anzpk to itab-anzpk.
          move itab1-aedat to itab-aedat.
          move itab1-dpack to itab-dpack.
          move itab1-erzet to itab-erzet.
          move itab1-ernam to itab-ernam.
          move itab1-zchquan to itab-zchquan.
          move itab1-paymt to itab-paymt.
          move itab1-chaln to itab-chaln.
          move itab1-lrdat to itab-lrdat.
          move itab1-lrdelv to itab-lrdelv.
          move itab1-lrtime to itab-lrtime.
          move itab1-datia to itab-datia.
          move itab1-uhria to itab-uhria.
          clear flag.
        endif.
        modify itab.
      endloop.
      delete itab where indno not in x_indno.
      select * from eket into corresponding fields of table ieket for all entries in itab
        where ebeln = itab-ebeln.
      loop at ieket.
        move ieket-ebeln to ieket1-ebeln.
        move ieket-menge to ieket1-menge.
        collect ieket1.
      endloop.
      loop at ieket.
        move ieket-ebeln to ieket2-ebeln.
        move ieket-wemng to ieket2-wemng.
        collect ieket2.
      endloop.
      loop at itab.
        read table ieket1 with key ebeln = itab-ebeln.
        move ieket1-menge to itab-menge.
        read table ieket2 with key ebeln = itab-ebeln.
        move ieket2-wemng to itab-wemng.
        itab-wemng1 = itab-menge - itab-wemng.
        select ddtext from dd07t into itab-rdesc where domvalue_l = itab-idtxt and domname = 'ZIDTXT'.
        endselect.
        select ddtext from dd07t into itab-trdesc where domvalue_l = itab-traid and domname = 'ZTRAID'.
        endselect.
        select ddtext from dd07t into itab-tydesc where domvalue_l = itab-traty and domname = 'ZTRATY'.
        endselect.
        select ddtext from dd07t into itab-pdesc where domvalue_l = itab-paymt and domname = 'ZPAYMT'.
        endselect.
        select name1 from lfa1 into itab-name1 where lifnr = itab-lifnr.
        endselect.
        modify itab.
        clear itab.
      endloop.
      if itab[] is initial.
        message i001(zmsg).
        stop.
      endif.
    endform.                    " get_data
    *&      Form  display_data
    form display_data .
      report_id = sy-repid.
      perform f1000_layout_init changing i_layout.
      perform f2000_fieldcat_init changing i_fieldcat.
      call function 'REUSE_ALV_LIST_DISPLAY'
       exporting
        I_INTERFACE_CHECK              = ' '
        I_BYPASSING_BUFFER             =
        I_BUFFER_ACTIVE                = ' '
         i_callback_program              = report_id
         i_callback_pf_status_set       = 'STATUS'
         i_callback_user_command        = 'USER_COMMAND'
        I_STRUCTURE_NAME               =
         is_layout                       = i_layout
         it_fieldcat                     = i_fieldcat
        IT_EXCLUDING                   =
        IT_SPECIAL_GROUPS              =
        IT_SORT                        =
        IT_FILTER                      =
        IS_SEL_HIDE                    =
         i_default                      = 'X'
         i_save                         = 'A'
        IS_VARIANT                     =
        IT_EVENTS                      =
        IT_EVENT_EXIT                  =
        IS_PRINT                       =
        IS_REPREP_ID                   =
        I_SCREEN_START_COLUMN          = 0
        I_SCREEN_START_LINE            = 0
        I_SCREEN_END_COLUMN            = 0
        I_SCREEN_END_LINE              = 0
        IR_SALV_LIST_ADAPTER           =
        IT_EXCEPT_QINFO                =
        I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
      IMPORTING
        E_EXIT_CAUSED_BY_CALLER        =
        ES_EXIT_CAUSED_BY_USER         =
        tables
          t_outtab                       = itab
      EXCEPTIONS
        PROGRAM_ERROR                  = 1
        OTHERS                         = 2
      if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
    endform.                    " display_data
    *&      Form  f1000_layout_init
    form f1000_layout_init using i_layout type slis_layout_alv.
      clear i_layout.
      i_layout-colwidth_optimize = 'X'.
      i_layout-edit = ''.
      i_layout-box_fieldname = 'CHK'.
    endform.                    " F1000_Layout_Init
    *&      Form  f2000_fieldcat_init
    form f2000_fieldcat_init changing i_fieldcat type slis_t_fieldcat_alv.
      data: line_fieldcat type slis_fieldcat_alv.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'CHK'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_l = 'Checkbox'.
      line_fieldcat-checkbox  = 'X'.      " Display this field as a checkbox
      line_fieldcat-outputlen = '8'.
      line_fieldcat-edit      =  'X'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'INDNO'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = ' PT Register No '.
      line_fieldcat-outputlen = '15'.
    line_fieldcat-hotspot       = 'X' .
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'AEDAT'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = ' Creation Date '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'TRDESC'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = ' Transporter Name    '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'TYDESC'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = ' Transport Type  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'VEHNUM'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = ' Vehicle Number   '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'BOLNR'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = ' L .R Number  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'NAME1'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = ' Vendor / Supplier'.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'WERKS'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Site   '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'EBELN'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Purchasing Document '.
      line_fieldcat-outputlen = '15'.
      line_fieldcat-hotspot       = 'X' .
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'WEMNG1'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Still To Be Delivered '.
      line_fieldcat-outputlen = '20'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'VBELN'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Sales Document  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'ANZPK'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'No.of Packages  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'DPACK'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Damaged Packages  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'BTGEW'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Total Weight   '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'GEWEI'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Weight Unit   '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'NTGEW'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = ' Net Weight   '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'RDESC'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Remarks   '.
      line_fieldcat-outputlen = '60'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'WAYBL'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Weigh Bill Number  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'ERNAM'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Created By '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'ERZET'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Created At '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'LRDAT'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'L.R Date  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'LRDELV'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'L.R Delivery Date  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'LRTIME'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'L.R Time  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'DATIA'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_l = 'Appointments: From date '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'UHRIA'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_l = 'Appointments: Time from  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'CHALN'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Challan No  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'PDESC'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Payment method  '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
      clear line_fieldcat.
      line_fieldcat-fieldname = 'ZCHQUAN'.
      line_fieldcat-tabname   = 'ITAB'.
      line_fieldcat-seltext_m = 'Challan Quantity '.
      line_fieldcat-outputlen = '15'.
      append line_fieldcat to i_fieldcat.
    endform.                    "f2000_fieldcat_init
    *&      Form  user_command
    form user_command using r_ucomm like sy-ucomm
                          rs_selfield type slis_selfield.
      data: wa_job_output_info type ssfcrescl.
    data wa_spoolids type  tsfspoolid.
    data wa_spoolnum type rspoid.
    data: objpack like sopcklsti1 occurs  2 with header line,
          objhead1 like solisti1   occurs  1 with header line,
          objbin  like solisti1   occurs 10 with header line,
          objtxt  like solisti1   occurs 10 with header line,
          reclist like somlreci1  occurs  5 with header line,
          doc_chng like sodocchgi1,
          tab_lines like sy-tabix.
      data : wa_itab like itab.
      data : line type c.
      case r_ucomm.
        when 'SAVE'.
          clear line.
          refresh itab2.
          read table itab index rs_selfield-tabindex.
          loop at itab where chk ne space.
            move-corresponding itab to itab2.
            collect itab2.
          endloop.
          describe table itab2 lines line.
          if line ge 2.
            message 'Please Select Only Document for Print Output ' type 'E'.
          endif.
          set parameter id : 'ZIN' field itab-indno.
          call function 'SSF_FUNCTION_MODULE_NAME'
            exporting
              formname = 'ZPTREG_NEW'
            importing
              fm_name  = lf_fm_name.
          if sy-subrc <> 0.
          endif.
          control_parameters-no_dialog = 'X'.
          control_parameters-preview   =  'X'.
          output_options-tddest = 'LOCL'.
          output_options-tdcopies = '2'.
          call function lf_fm_name
            exporting
              control_parameters = ls_control_param
              output_options     = ls_composer_param
              mail_recipient     = ls_recipient
              mail_sender        = ls_sender
              user_settings      = 'X'
              p_indno            = itab-indno
              importing
      DOCUMENT_OUTPUT_INFO       =
       job_output_info            = wa_job_output_info
      JOB_OUTPUT_OPTIONS         =
            exceptions
              formatting_error   = 1
              internal_error     = 2
              send_error         = 3
              user_canceled      = 4
              others             = 5.
          if sy-subrc <> 0.
          endif.
    move wa_job_output_info-spoolids[] to wa_spoolids[].
    read table wa_spoolids into wa_spoolnum index 1.
    if sy-subrc = 0.
    data :id like tsp01-rqident.
    move wa_spoolnum to id.
    endif. .
    *loop at wa_spoolids INTO wa_spoolnum .
    write : id.
    *endloop.
    data i_soli like soli occurs 0 with header line.
    call function 'RSPO_RETURN_SPOOLJOB'
    exporting
    rqident = id
    desired_type = 'OTF'
    tables
    buffer = i_soli
    exceptions
    no_such_job = 1
    job_contains_no_data = 2
    selection_empty = 3
    no_permission = 4
    can_not_access = 5
    read_error = 6
    type_no_match = 7
    others = 8.
    data content_bin type solix_tab.
    data objhead type soli_tab.
    data i_soli_tab type soli_tab.
    data boolean type sx_boolean.
    data length type so_obj_len.
    loop at i_soli.
    append i_soli to i_soli_tab[].
    endloop.
    call function 'SX_OBJECT_CONVERT_OTF_RAW'
    exporting
    format_src = 'OTF'
    format_dst = 'RAW'
    changing
    transfer_bin = boolean
    content_txt = i_soli_tab
    content_bin = content_bin
    objhead = objhead
    len = length
    exceptions
    err_conv_failed = 1
    others = 2.
      endcase.
    *describe table objbin lines tab_lines.
          objpack-transf_bin = 'X'.
          objpack-head_start = 1.
          objpack-head_num = 1.
          objpack-body_start = 1.
          objpack-body_num =  '100'. "tab_lines.
    * objpack-doc_type = c_asc.
          objpack-doc_type = 'DOC'.
          objpack-obj_name = 'ATTACHMENT'.
          objpack-obj_descr = 'ATTACH'. "p_attach.
    "Name of Attachment
          objpack-doc_size = tab_lines  * 255.
          append objpack..
    reclist-receiver = '[email protected]'.
            reclist-rec_type = 'U'.
            append reclist.
    objbin[] = i_soli_tab[].
          call function 'SO_RAW_TO_RTF'
            tables
              objcont_old = objbin
              objcont_new = objbin
            exceptions
              others      = 0.
          call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
            exporting
              document_data              = doc_chng
              put_in_outbox              = 'X'
              commit_work                = 'X'
            tables
              packing_list               = objpack
              object_header              = objhead1
              contents_bin               = objbin
              contents_txt               = objtxt
              receivers                  = reclist
            exceptions
              too_many_receivers         = 1
              document_not_sent          = 2
              operation_no_authorization = 4
              others                     = 99.
    endform.                    "user_command
    Message was edited by:
            anu c

  • I've a problem with my mail app

    I have a problem with my mail app, after upgrading mavericks.
    My mail app was worked well, before I upgrade.
    Now, my mail app is working only with icloud account.
    I can use my gmail account with safari or other web browsers, but not in the mail app.
    That was happening both of my macbook pro, and macbook air, but not on my iPad and iPhone.
    I tried deleting account and re added it, but that doesn't solve the problem.
    what should i do..??

    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Console in the icon grid.
    Make sure the title of the Console window is All Messages. If it isn't, select All Messages from the SYSTEM LOG QUERIES menu on the left. If you don't see that menu, select
    View ▹ Show Log List
    from the menu bar.
    Click the Clear Display icon in the toolbar. Then try the action that you're having trouble with again. Select any messages that appear in the Console window. Copy them to the Clipboard (command-C). Paste into a reply to this message (command-V).
    When posting a log extract, be selective. In most cases, a few dozen lines are more than enough.
    Please do not indiscriminately dump thousands of lines from the log into this discussion.
    Important: Some private information, such as your name, may appear in the log. Anonymize before posting.

  • Trigger Automatic Mail

    Hi All,
    Pls guide me where the settings can be done to trigger an internal mail (SAP Business Workplace) at any user exit, like UD, QI01 Save, GR (MIGO) save etc.
    And what to do if I want to mark the same to MS Out look E-mail ID.
    With Best Regards,
    Shyamal H. Joshi.

    Hi,
    For which type of business functionality you want to send automatic mails.
    After the batch job finish you can set the automatic mail in transaction SM36.
    in the user defination you have to do the settings related to automatic mail of SAP office mail.
    If you are using SCM then try to use SCM's event management.
    Most of the places Work flow used to send the automatic mails as per the business event happens.

  • I'm looking for a voicemail app that will automatically switch over after normal business hours and play an alternate voice-mail message. Does this currently exist?

    I’m looking for a voicemail app that will automatically switch over after normal business hours and play an alternate voice-mail message. Does this currently exist?

    Voicemail is through your carrier and on their equipment.
    It's function and features is set by them, not your phone.

  • Automatic form generation on creation transfer order for delivery note?

    Hi,
    I have to create a form that should automatically be generated on the creation of a transfer order for delivery note. How do I trigger this automatic creation of the form? And how can the transfer order number be passed to my print program?
    Thx!

    hi christophe,
    To issue the delivery output, go to transaction VL02N.
    Then go to EXTRAS-> OUTPUT->HEADER->EDIT
    In the Message output screen enter the relevant output type created for the delivery.
    Choose the relevant medium of output.
    Choose Simple Mail, in this case the field NAST-NACHA will be having a value of 7.
    Specify the Partner Function; in this case it is MA -> Mail partner address
    Select the Communication Method for the output type maintained.
    This will take you to the SAPOFFICE screen.
    Enter there the  E-Mail Address to which you want to send the delivery document as PDF.
    A mail will be sent to the e-mail address of the E-Mail Address specified, with the delivery output form as a PDF attachment.
    hope it will help u ..
    *& Report  ZZ_TEST                                                     *
    REPORT  zz_test                                 .
    INCLUDE zz_test_top.
    INCLUDE zz_test01.
          FORM entry                                                    *
    -->  RETURN_CODE                                                   *
    -->  US_SCREEN                                                     *
    FORM entry USING return_code us_screen.
      CLEAR retcode.
      xscreen = us_screen.
      PERFORM processing USING us_screen.
      CASE retcode.
        WHEN 0.
          return_code = 0.
        WHEN 3.
          return_code = 3.
        WHEN OTHERS.
          return_code = 1.
      ENDCASE.
    ENDFORM.                    "entry
    *&  Include           ZZ_TEST_TOP                                      *
      TABLES : nast,
               tnapr.
    TYPES : BEGIN OF t_SOUDNAMEI1.
            INCLUDE STRUCTURE SOUDNAMEI1.
    TYPES : END OF t_SOUDNAMEI1.
    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,
      i_lips LIKE lips OCCURS 0 WITH HEADER LINE,
      i_SOUDNAMEI1 TYPE STANDARD TABLE OF t_SOUDNAMEI1.
    Work Area declarations
      DATA:w_objhead TYPE soli_tab,
      wa_control_parameters TYPE ssfctrlop,
      wa_output_options TYPE ssfcompop,
      w_return TYPE ssfcrescl,
      w_doc_chng TYPE sodocchgi1,
      w_data TYPE sodocchgi1,
      w_buffer TYPE string,"To convert from 132 to 255
      wa_SOUDNAMEI1 TYPE t_SOUDNAMEI1,
    Variables declarations
      w_form_name TYPE rs38l_fnam,
      w_len_in LIKE sood-objlen,
      w_len_out LIKE sood-objlen,
      w_len_outn TYPE i,
      w_lines_txt TYPE i,
      w_lines_bin TYPE i,
      retcode      TYPE sy-subrc,
      xscreen      TYPE c,
      w_spld TYPE usr01-spld,
      w_receiver TYPE SOXNA-FULLNAME,
      w_OBJ_RECORD TYPE OBJ_RECORD,
      w_user type sy-uname,
      w_email TYPE ad_smtpadr.
    Constants Declaration
      CONSTANTS : c_x TYPE c VALUE 'X',
                  c_atrate(1) TYPE c VALUE '@'.
    *&  Include           ZZ_TEST01                                        *
          FORM PROCESSING                                               *
    FORM processing USING proc_screen.
      SELECT * FROM lips
        INTO TABLE i_lips
        WHERE vbeln = nast-objky.
    Call Function module to Getfunction Module name Generated by Smartform
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = tnapr-sform
        IMPORTING
          fm_name            = w_form_name
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc <> 0.
        retcode = sy-subrc.
      ENDIF.
      CLEAR : wa_control_parameters,
              wa_output_options.
      CASE nast-nacha.
        WHEN '1'.
          wa_control_parameters-device    = 'PRINTER'.
        WHEN '7'.
          DATA: l_email TYPE ad_smtpadr.
          wa_output_options-tdnoprev = c_x.
          wa_control_parameters-getotf  = c_x.
    To get the default output device maintained in the
    User profile
         SELECT SINGLE spld FROM usr01
          INTO w_spld
          WHERE bname EQ nast-usnam.
          IF sy-subrc EQ 0.
            MOVE w_spld TO  wa_output_options-tddest   .
          ENDIF.
          wa_output_options-tdnoprev = c_x.
          wa_control_parameters-getotf  = c_x.
    To get the email address maintained for the particular output
          CALL FUNCTION 'NAST_GET_MESSAGE_OBJECT_RECV'
            EXPORTING
              pi_objkey             = nast-tdname
            IMPORTING
              pe_addr               = w_receiver
            CHANGING
              pc_objhandle          = w_obj_record
            EXCEPTIONS
              maildata_not_readable = 1
              OTHERS                = 2.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
           WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
          IF w_receiver NA c_atrate.
    To retrieve the E-Mail Id in case we get the User name from NAST
            CLEAR wa_soudnamei1.
            REFRESH i_soudnamei1.
            MOVE w_receiver TO wa_soudnamei1-fullname.
    To get the user name
            CALL FUNCTION 'SO_NAME_CONVERT_API1'
              EXPORTING
                name            = wa_soudnamei1
              TABLES
                names           = i_soudnamei1
              EXCEPTIONS
                user_not_exist  = 1
                parameter_error = 2
                x_error         = 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.
            CLEAR wa_soudnamei1.
            READ TABLE i_soudnamei1 INTO wa_soudnamei1 INDEX 1.
            MOVE wa_soudnamei1-sapname TO w_user.
    To get the e-mail Id maintained in the user profile
            CALL FUNCTION 'FTR_CORR_CHECK_EMAIL_SAP_USER'
              EXPORTING
                i_user              = w_user
              IMPORTING
                e_email_address     = l_email
              EXCEPTIONS
                mail_address        = 1
                determination_error = 2
                OTHERS              = 3.
            IF sy-subrc <> 0.
              MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
               WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
            ENDIF.
            MOVE l_email TO w_receiver.
          ENDIF.
          MOVE  w_receiver TO w_email.
      ENDCASE.
      wa_control_parameters-no_dialog = c_x.
      wa_control_parameters-langu     = nast-spras .
      wa_output_options-tdteleland    = nast-tland.
      wa_output_options-tdtelenum     = nast-telfx .
      wa_output_options-tdsenddate    = nast-erdat .
      wa_output_options-tdsendtime    = nast-eruhr .
      wa_output_options-tddataset     = nast-dsnam .
      wa_output_options-tdsuffix1     = nast-dsuf1 .
      wa_output_options-tdsuffix2     = nast-dsuf2 .
      wa_output_options-tdimmed       = nast-dimme .
      wa_output_options-tddelete      = nast-delet .
      wa_output_options-tdautority    = nast-tdautority.
      wa_output_options-tdcovtitle    = nast-tdcovtitle .
      wa_output_options-tdcover       = nast-tdocover .
      wa_output_options-tdreceiver    = nast-tdreceiver.
      wa_output_options-tddivision    = nast-tddivision.
      wa_output_options-tdcopies      = nast-anzal .
      wa_output_options-tdnewid       = c_x.
      wa_output_options-tdarmod       = nast-tdarmod.
      wa_output_options-tdnoarmch     = c_x.
      CALL FUNCTION w_form_name
        EXPORTING
         archive_index      = toa_dara
         archive_parameters = arc_params
          control_parameters = wa_control_parameters
          output_options     = wa_output_options
          user_settings      = ' '
        IMPORTING
          job_output_info    = w_return
        TABLES
          it_lips            = i_lips
        EXCEPTIONS
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 4
          OTHERS             = 5.
      IF nast-nacha EQ 7 AND sy-subrc EQ 0.
        i_otf[] = w_return-otfdata[].
        CALL FUNCTION 'CONVERT_OTF'
          EXPORTING
            format                = 'PDF'
            max_linewidth         = 132
          IMPORTING
            bin_filesize          = w_len_in
          TABLES
            otf                   = i_otf
            lines                 = i_tline
          EXCEPTIONS
            err_max_linewidth     = 1
            err_format            = 2
            err_conv_not_possible = 3
            OTHERS                = 4.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
    Convert PDF from 132 to 255.
        LOOP AT i_tline.
    Replacing space by ~
          TRANSLATE i_tline USING ' ~'.
          CONCATENATE w_buffer i_tline INTO w_buffer.
        ENDLOOP.
    Replacing ~ by space
        TRANSLATE w_buffer USING '~ '.
        DO.
          i_record = w_buffer.
    Appending 255 characters as a record
          APPEND i_record.
          SHIFT w_buffer LEFT BY 255 PLACES.
          IF w_buffer IS INITIAL.
            EXIT.
          ENDIF.
        ENDDO.
        REFRESH: i_reclist,
        i_objtxt,
        i_objbin,
        i_objpack.
        CLEAR w_objhead.
    Object with PDF.
        i_objbin[] = i_record[].
        DESCRIBE TABLE i_objbin LINES w_lines_bin.
    Document information.
        w_doc_chng-obj_name = 'Smartform'.
        w_doc_chng-expiry_dat = sy-datum + 10.
        CONCATENATE 'Delivery' 'Note'
        INTO w_doc_chng-obj_descr.
    *w_doc_chng-obj_descr = 'Smart form output'.
        w_doc_chng-sensitivty = 'F'. "Functional object
        w_doc_chng-doc_size = w_lines_txt * 255.
    Pack to main body as RAW.
    Obj. to be transported not in binary form
        CLEAR i_objpack-transf_bin.
    Start line of object header in transport packet
        i_objpack-head_start = 1.
    Number of lines of an object header in object packet
        i_objpack-head_num = 0.
    Start line of object contents in an object packet
        i_objpack-body_start = 1.
    Number of lines of the object contents in an object packet
        i_objpack-body_num = w_lines_txt.
    Code for document class
        i_objpack-doc_type = 'RAW'.
        APPEND i_objpack.
    Packing as PDF.
        i_objpack-transf_bin = 'X'.
        i_objpack-head_start = 1.
        i_objpack-head_num = 1.
        i_objpack-body_start = 1.
        i_objpack-body_num = w_lines_bin.
        i_objpack-doc_type = 'PDF'.
        i_objpack-obj_name = 'Smartform'.
        CONCATENATE 'Delivery' 'Note' '.pdf'
        INTO i_objpack-obj_descr.
        i_objpack-doc_size = w_lines_bin * 255.
        APPEND i_objpack.
    Document information.
        CLEAR i_reclist.
    e-mail receivers.
        i_reclist-receiver = w_email.
        i_reclist-express = 'X'.
        i_reclist-rec_type = 'U'. "Internet address
        APPEND i_reclist.
    sending mail.
        CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
          EXPORTING
            document_data              = w_doc_chng
            put_in_outbox              = 'X'
          TABLES
            packing_list               = i_objpack
            object_header              = w_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.
        IF sy-subrc <> 0.
          MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
          WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        ENDIF.
      ENDIF.
    ENDFORM.                    "processing

Maybe you are looking for

  • Get First and last day of Month..

    Hi Friends, I am trying to fetch First and Last day of a month and would like to implement that in the following code: SELECT COALESCE(Date_A, Date_B, Date_C) FROM dual Here Date A and B are in Format of MM DD YYYY (March 14, 2008) and Date C is like

  • Two Computers on internet at same time?

    I'm trying to help a friend with 2 Dell laptops who wants to set up a home network with one wireless router. He asked me if both laptops could be on the internet simultaniously visiting different sites. I said I thought he could but I'm not positive.

  • How to save a JPG in 256 colors?

    I'm using Photoshop CS2. 1. How to save a JPG in 256 colors? 2. Is there a way to see an image properties? -- I want to know if that image is in 256 color or not...

  • Random websites shut down when i open them

    hi, i was wondering if anyone could help me. there are certain websites (well a majority) that just shut down completely when i go to them. I tried this on firefox and safari. In the past they use to work out fine. I use to be able to go to websites

  • Translation text for ESS MSS

    Hi  , I am having issues with translation in the WD Java files ,in the ESS MSS Business package. After transport , some of the texts are coming in English and soome in German. e.g in personal information - some texts are coming in english and some in