Aliases and Sending Mail

I'm running iMS 5.1. I'm wanting to be able to allow webmail users to specify an alias address without the domain for sending mail. I.E... user zzUser is aliased to some.user. In the webmail client I want someone to be able to type in just "zzUser" instead of "[email protected]". Is this possible?
Thanks,
Patrick Danko

Not completely sure I understand what your asking, but if you Enabled virtual hosts in server admin>Mail>Advanced>Hosting and entered domain1.com, domain2.com, etc., The only thing you have to do is enter the short name in the Workgroup Manager like johndomain1com, and enter an alias underneath [email protected], and so on for the rest.The mail server resolves the alias from there on.
We usually, to keep things organized by domain in WGM, enter the short name like domain1-com-john, and add an alias of [email protected], then domain2-com-john, and alias [email protected]

Similar Messages

  • Need to choose fields from alv grid output and send mail

    Hi,
    I need to choose few orders from alv grid output and send mail as PDF for chosen orders.
    Suggest if possible and how.

    Moderator message - Please do not post your requirements and ask the forum to do your work for you - post locked
    Rob

  • Convertion of Smart form to pdf and sending mail to vendor for PO

    Hello all,
    I have modified a standard PO Smartform and running it through ME23N.
    In this i have to convert it to a pdf file and then send it through mail to the vendor.
    I have found out FMs'CONVERT_OTF'and
    'SO_NEW_DOCUMENT_ATT_SEND_API1'
    to convert it and send mail. But can u tell me how to go about using it.
    As i am using a standard program do i have to copy this prog to zprog and then call the fm out there. I am not sure.
    Thanks
    Salil

    Hi,
    Here is the sample code.If you find this as useful,kindly reward points by clicking the star on the left of reply.
    Internal Table declarations
    DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
          i_tline TYPE TABLE OF tline WITH HEADER LINE,
          i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
          i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    Objects to send mail.
          i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
          i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
    Work Area declarations
          w_objhead TYPE soli_tab,
          w_ctrlop TYPE ssfctrlop,
          w_compop 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
    Variables declarations
          v_form_name TYPE rs38l_fnam,
          v_len_in LIKE sood-objlen,
          v_len_out LIKE sood-objlen,
          v_len_outn TYPE i,
          v_lines_txt TYPE i,
          v_lines_bin TYPE i.
    call function 'SSF_FUNCTION_MODULE_NAME'
         exporting
              formname           = 'ZZZ_TEST2'
         importing
              fm_name            = v_form_name
         exceptions
              no_form            = 1
              no_function_module = 2
              others             = 3.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    w_ctrlop-getotf = 'X'.
    w_ctrlop-no_dialog = 'X'.
    w_compop-tdnoprev = 'X'.
    CALL FUNCTION v_form_name
         EXPORTING
              control_parameters = w_ctrlop
              output_options     = w_compop
              user_settings      = 'X'
         IMPORTING
              job_output_info    = w_return
         EXCEPTIONS
              formatting_error   = 1
              internal_error     = 2
              send_error         = 3
              user_canceled      = 4
              OTHERS             = 5.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    i_otf[] = w_return-otfdata[].
    CALL FUNCTION 'CONVERT_OTF'
         EXPORTING
              format                = 'PDF'
              max_linewidth         = 132
         IMPORTING
              bin_filesize          = v_len_in
         TABLES
              otf                   = i_otf
              lines                 = i_tline
         EXCEPTIONS
              err_max_linewidth     = 1
              err_format            = 2
              err_conv_not_possible = 3
              OTHERS                = 4.
    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 v_lines_bin.
    Object with main text of the mail.
    i_objtxt = 'Find attached the output of the smart form.'.
    APPEND i_objtxt.
    i_objtxt = 'Regards,'.
    APPEND i_objtxt.
    i_objtxt = 'J.Jayanthi'.
    APPEND i_objtxt.
    DESCRIBE TABLE i_objtxt LINES v_lines_txt.
    Document information.
    w_doc_chng-obj_name = 'Smartform'.
    w_doc_chng-expiry_dat = sy-datum + 10.
    w_doc_chng-obj_descr = 'Smart form output'.
    w_doc_chng-sensitivty = 'F'. "Functional object
    w_doc_chng-doc_size = v_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 = v_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 = v_lines_bin.
    i_objpack-doc_type = 'PDF'.
    i_objpack-obj_name = 'Smartform'.
    CONCATENATE 'Smartform_output' '.pdf'
    INTO i_objpack-obj_descr.
    i_objpack-doc_size = v_lines_bin * 255.
    APPEND i_objpack.
    Document information.
    CLEAR i_reclist.
    e-mail receivers.
    i_reclist-receiver = '[email protected]'.
    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_hex               = 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.

  • How to create job to run daily based on form values entered and send mail.

    Hi,
    In DB we have 3 columns: creation_date, name, approved_or_not. Default for approved_or_not is 'No'.
    In the application form page suppose I fill in sysdate for creation_date and leave default for approved_or_not and click [create] button.
    Now a job should run everyday and check for where (approved_or_not='No' & creation_date = 'sysdate - 1') and send mail to the person in 'name' field mentioning: 'Approval pending. click on link <some_link> for details on approval'.
    Could anyone give me pointers to example on such job? (Working on APEX 3.0)
    Thanks,
    Priyanka

    create a DBMS JOB
    check out this forum link.
    dbms_job

  • Oracle Zip and Send Mail

    Hi,
    I was just wondering if there is a pl/sql code that would do the following:
    1. Zip a file (originally generated from DB query written to Unix OS using UTL_FILE package).
    2. Place a password on the file.
    3. Send the file as an attachment in mail.
    Thanks in advance.

    For compression, you can use UTL_COMPRESS package.
    [oracle@db11ghost ~]$ cat compress_data.txt
    aaaaaaaaaaaaaaaaaaaaaaaaaaaa
    bbbbbbbbbbbbbbbbbbbbbbbbbbbb
    cccccccccccccccccccccccccccc
    [oracle@db11ghost ~]$
    Below is example how to load file to table as compressed blob. Later you can save this blob to file (pls, search google there are many examples how to do it) and send mail as attach.
    SQL> create directory MYDIR as '/home/oracle/';
    Directory created.
    declare
      ablob blob;
      abfile bfile := bfilename('MYDIR', 'compress_data.txt');
      amount integer;
      asize integer;
      a_compressed_blob blob;
      q integer := 1; ---- The level of compression from 1-9
      cursor blob_cur is select * from myt1;
    begin
      insert into myt1 values (1, empty_blob());
      select y into ablob from myt1 where x = 1;
      dbms_lob.fileopen(abfile);
      asize := dbms_lob.getlength(abfile);
      dbms_output.put_line('Size of input file: ' || asize);
      -- load the file (txt file) into the blob column and look at the size
      dbms_lob.loadfromfile(ablob, abfile, asize);
      asize := dbms_lob.getlength(ablob);
      dbms_output.put_line('Size of blob after loading fromfile: ' || asize);
      -- compress the blob
      a_compressed_blob := utl_compress.lz_compress(ablob, q);
      -- insert the compressed blob into the table in another row
      insert into myt1 values (2, a_compressed_blob);
      -- compare the sizes of the blob contents that are in the table now
      dbms_output.put_line('Sizes are -->');
      for c1_rec in blob_cur
        loop
        asize := dbms_lob.getlength(c1_rec.y);
        dbms_output.put_line(asize);
      end loop;
    end;
    Size of input file: 87
    Size of blob after loading fromfile: 87
    Sizes are -->
    87
    32
    PL/SQL procedure successfully completed.For sending you can use UTL_MAIL (http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_mail.htm#i1001258)

  • Mine is Yahoo where POP is used .TB is IMAP . i can receive and send mails , but when making action on TB (Del or send) no reflection on main server

    Hello there,
    My e-mail is Yahoo, and Yahoo by default is POP user .
    I understood from your help file that synchronization is compatible only with IMAP mail provider
    I can receive and send mails from TB , but when making action on TB (Del or send) no reflection on main server, same when make the action on the main server (Del or send), no change on TB
    from yahoo help I managed to find configuration for IMAP , but could not apply them on TB , as TB have already Yahoo as POP in the configuration list
    please your help on this
    best regards
    Mohamad

    You cannot convert an existing account, but you can set up your Yahoo account as IMAP in parallel to the existing POP account. See
    http://kb.mozillazine.org/Convert_a_POP_account_to_a_IMAP_account

  • How to setup and send mails using utl_mail on Oracle E-Biz R12

    Dear All
    There is a new requirement from client to setup and send mails using utl_mail utility on Oracle EBS R12.1.1
    What is utl_mail utility ? what is the difference between Workflow Notification Mailer and this utility/tool?
    What are etiquette's to pursue mail functionality in apps / db?
    - Chetan

    What is utl_mail utility
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_mail.htm
    How to Use the UTL_MAIL Package [ID 269375.1]
    FAQ and Known Issues While Using UTL_SMTP and UTL_MAIL [ID 730746.1]
    Master Note For PL/SQL UTL_SMTP and UTL_MAIL Packages [ID 1137673.1]
    Workflow Notification Mailer:
    you can send email using workflow notification email procedures,These ar built into the system and only need some minor configuration. check Workflow Administrator's Guide, Chapter 2, Section: Setting Up Notification Mailers for more detail.

  • How to read email IDs from DB and send mails

    Hi,
    i m trying to read a set of e-mail IDs from the DB and sending mails to all those email ids.
    i am getting "null pointer exception". kindly suggest how can i able to send mails to mails to those users
    registered in the db.
    I am reading the e-mail from the db like this :
    Connection con = DriverManager.getConnection("jdbc:oracle:thin:@10.2.0.100:1521:eprocure", "uid",
    "pwd");     
    I am using oracle9iAS.
    Error i m getting :
    java.lang.NullPointerException7/16/04 2:25 PM:
         at javax.mail.internet.InternetAddress.parse(InternetAddress.java:534)
         at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:61)
         at com.ep.util.MailUtility.sendMail(MailUtility.java:163)
         at login.SendMsg._jspService(_SendMsg.java:121)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:508)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:255)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:684)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)7/
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:151)
         at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    pls advise.
    keep smiling....
    Debasis

    Based on your stack trace I would say you have a line of code like... = new InternetAddress(something)...and that something is null.
    PC&#178;

  • Thunderbird can download and send mail with Cox POP Mail, Mail cannot?

    I have Thunderbird and Mail installed.
    I can download and send mail with Thunderbird.
    I can't even set-up an account with Mail because it cannot find the POP Mail server.
    I have Firewall on with ports 25, 110 and 587 open.
    This really seems strange that I can use Thunderbird to set up and use POP Mail access to Cox, but not Mail.
    My servers are:
    pop.central.cox.net
    smtp.central.cox.net
    I've followed the steps on Cox's support web site, no success.
    I've already called Cox, they're clueless.
    Thoughts or suggestions are greatly appreciated.
    Thanks,
    --Todd
    Mini   Mac OS X (10.4.6)  

    Hi Todd,
    Well since Tbird works, we can rule out lots of things.
    Mail cannot find the POP server
    You are using the Welcome to Mail assistant to do this, and when you type in your incoming mail server info it spins the gear a bit, gives an error, and says that if you continue Mail may not work -- yes? What does the error say specifically?
    No disrespect at all, but the most likely problem is a typo somewhere / mis-specified username. Please go 'round once more.
    Good luck,
    John

  • HT1338 Why I cannot open Mai and send mail via yahoo?

    I now cannot open my mail and send mail. I try sending photos and It says yahoo server is not available
    There shows as well MF Message Error Domain error 1032.
    No idea please help.
    Thanks

    If the app doesn't work, try removing and then re adding your mail info. Sometimes Yahoo gets their wires crossed and starting over is usually the only way to fix it.

  • Setting Up Mailserver to received and Send Mail for external Network

    I have a G5 currenty running 10.3.9 Server with Mail services run and working fine, we are upgrading to 10.4 Server and would like our Sales Reps the ability to send and Receive mail from outside the office. How do I configure my server, Router, ISP and/or Mail clients to do this??? we are currently able to recieve mail from outside just not send.

    I cannot find the Line #submission inet n - n -- smtpd in the Main.CF file...here is what I get when I open it
    # Global Postfix configuration file. This file lists only a subset
    # of all 250+ parameters. See the sample-xxx.cf files for a full list.
    # The general format is lines with parameter = value pairs. Lines
    # that begin with whitespace continue the previous line. A value can
    # contain references to other $names or ${name}s.
    # NOTE - CHANGE NO MORE THAN 2-3 PARAMETERS AT A TIME, AND TEST IF
    # POSTFIX STILL WORKS AFTER EVERY CHANGE.
    # SOFT BOUNCE
    # The soft_bounce parameter provides a limited safety net for
    # testing. When soft_bounce is enabled, mail will remain queued that
    # would otherwise bounce. This parameter disables locally-generated
    # bounces, and prevents the SMTP server from rejecting mail permanently
    # (by changing 5xx replies into 4xx replies). However, soft_bounce
    # is no cure for address rewriting mistakes or mail routing mistakes.
    #soft_bounce = no
    # LOCAL PATHNAME INFORMATION
    # The queue_directory specifies the location of the Postfix queue.
    # This is also the root directory of Postfix daemons that run chrooted.
    # See the files in examples/chroot-setup for setting up Postfix chroot
    # environments on different UNIX systems.
    queue_directory = /private/var/spool/postfix
    # The command_directory parameter specifies the location of all
    # postXXX commands.
    command_directory = /usr/sbin
    # The daemon_directory parameter specifies the location of all Postfix
    # daemon programs (i.e. programs listed in the master.cf file). This
    # directory must be owned by root.
    daemon_directory = /usr/libexec/postfix
    # QUEUE AND PROCESS OWNERSHIP
    # The mail_owner parameter specifies the owner of the Postfix queue
    # and of most Postfix daemon processes. Specify the name of a user
    # account THAT DOES NOT SHARE ITS USER OR GROUP ID WITH OTHER ACCOUNTS
    # AND THAT OWNS NO OTHER FILES OR PROCESSES ON THE SYSTEM. In
    # particular, don't specify nobody or daemon. PLEASE USE A DEDICATED
    # USER.
    mail_owner = postfix
    # The default_privs parameter specifies the default rights used by
    # the local delivery agent for delivery to external file or command.
    # These rights are used in the absence of a recipient user context.
    # DO NOT SPECIFY A PRIVILEGED USER OR THE POSTFIX OWNER.
    #default_privs = nobody
    # INTERNET HOST AND DOMAIN NAMES
    # The myhostname parameter specifies the internet hostname of this
    # mail system. The default is to use the fully-qualified domain name
    # from gethostname(). $myhostname is used as a default value for many
    # other configuration parameters.
    #myhostname = host.domain.tld
    #myhostname = virtual.domain.tld
    # The mydomain parameter specifies the local internet domain name.
    # The default is to use $myhostname minus the first component.
    # $mydomain is used as a default value for many other configuration
    # parameters.
    #mydomain = domain.tld
    # SENDING MAIL
    # The myorigin parameter specifies the domain that locally-posted
    # mail appears to come from. The default is to append $myhostname,
    # which is fine for small sites. If you run a domain with multiple
    # machines, you should (1) change this to $mydomain and (2) set up
    # a domain-wide alias database that aliases each user to
    # [email protected].
    # For the sake of consistency between sender and recipient addresses,
    # myorigin also specifies the default domain name that is appended
    # to recipient addresses that have no @domain part.
    #myorigin = $myhostname
    #myorigin = $mydomain
    # RECEIVING MAIL
    # The inet_interfaces parameter specifies the network interface
    # addresses that this mail system receives mail on. By default,
    # the software claims all active interfaces on the machine. The
    # parameter also controls delivery of mail to user@[ip.address].
    # See also the proxy_interfaces parameter, for network addresses that
    # are forwarded to us via a proxy or network address translator.
    # Note: you need to stop/start Postfix when this parameter changes.
    #inet_interfaces = all
    #inet_interfaces = $myhostname
    #inet_interfaces = $myhostname, localhost
    # The proxy_interfaces parameter specifies the network interface
    # addresses that this mail system receives mail on by way of a
    # proxy or network address translation unit. This setting extends
    # the address list specified with the inet_interfaces parameter.
    # You must specify your proxy/NAT addresses when your system is a
    # backup MX host for other domains, otherwise mail delivery loops
    # will happen when the primary MX host is down.
    #proxy_interfaces =
    #proxy_interfaces = 1.2.3.4
    # The mydestination parameter specifies the list of domains that this
    # machine considers itself the final destination for.
    # These domains are routed to the delivery agent specified with the
    # local_transport parameter setting. By default, that is the UNIX
    # compatible delivery agent that lookups all recipients in /etc/passwd
    # and /etc/aliases or their equivalent.
    # The default is $myhostname + localhost.$mydomain. On a mail domain
    # gateway, you should also include $mydomain.
    # Do not specify the names of virtual domains - those domains are
    # specified elsewhere (see sample-virtual.cf).
    # Do not specify the names of domains that this machine is backup MX
    # host for. Specify those names via the relay_domains settings for
    # the SMTP server, or use permit_mx_backup if you are lazy (see
    # sample-smtpd.cf).
    # The local machine is always the final destination for mail addressed
    # to user@[the.net.work.address] of an interface that the mail system
    # receives mail on (see the inet_interfaces parameter).
    # Specify a list of host or domain names, /file/name or type:table
    # patterns, separated by commas and/or whitespace. A /file/name
    # pattern is replaced by its contents; a type:table is matched when
    # a name matches a lookup key (the right-hand side is ignored).
    # Continue long lines by starting the next line with whitespace.
    # See also below, section "REJECTING MAIL FOR UNKNOWN LOCAL USERS".
    #mydestination = $myhostname, localhost.$mydomain
    #mydestination = $myhostname, localhost.$mydomain $mydomain
    #mydestination = $myhostname, localhost.$mydomain, $mydomain,
    # mail.$mydomain, www.$mydomain, ftp.$mydomain
    # REJECTING MAIL FOR UNKNOWN LOCAL USERS
    # The local_recipient_maps parameter specifies optional lookup tables
    # with all names or addresses of users that are local with respect
    # to $mydestination and $inet_interfaces.
    # If this parameter is defined, then the SMTP server will reject
    # mail for unknown local users. This parameter is defined by default.
    # To turn off local recipient checking in the SMTP server, specify
    # local_recipient_maps = (i.e. empty).
    # The default setting assumes that you use the default Postfix local
    # delivery agent for local delivery. You need to update the
    # local_recipient_maps setting if:
    # - You define $mydestination domain recipients in files other than
    # /etc/passwd, /etc/aliases, or the $virtual_alias_maps files.
    # For example, you define $mydestination domain recipients in
    # the $virtual_mailbox_maps files.
    # - You redefine the local delivery agent in master.cf.
    # - You redefine the "local_transport" setting in main.cf.
    # - You use the "luser_relay", "mailbox_transport", or "fallback_transport"
    # feature of the Postfix local delivery agent (see sample-local.cf).
    # Details are described in the LOCAL_RECIPIENT_README file.
    # Beware: if the Postfix SMTP server runs chrooted, you probably have
    # to access the passwd file via the proxymap service, in order to
    # overcome chroot restrictions. The alternative, having a copy of
    # the system passwd file in the chroot jail is just not practical.
    # The right-hand side of the lookup tables is conveniently ignored.
    # In the left-hand side, specify a bare username, an @domain.tld
    # wild-card, or specify a [email protected] address.
    #local_recipient_maps = unix:passwd.byname $alias_maps
    #local_recipient_maps = proxy:unix:passwd.byname $alias_maps
    #local_recipient_maps =
    # The unknown_local_recipient_reject_code specifies the SMTP server
    # response code when a recipient domain matches $mydestination or
    # $inet_interfaces, while $local_recipient_maps is non-empty and the
    # recipient address or address local-part is not found.
    # The default setting is 550 (reject mail) but it is safer to start
    # with 450 (try again later) until you are certain that your
    # local_recipient_maps settings are OK.
    #unknown_local_recipient_reject_code = 550
    unknown_local_recipient_reject_code = 450
    # TRUST AND RELAY CONTROL
    # The mynetworks parameter specifies the list of "trusted" SMTP
    # clients that have more privileges than "strangers".
    # In particular, "trusted" SMTP clients are allowed to relay mail
    # through Postfix. See the smtpd_recipient_restrictions parameter
    # in file sample-smtpd.cf.
    # You can specify the list of "trusted" network addresses by hand
    # or you can let Postfix do it for you (which is the default).
    # By default (mynetworks_style = subnet), Postfix "trusts" SMTP
    # clients in the same IP subnetworks as the local machine.
    # On Linux, this does works correctly only with interfaces specified
    # with the "ifconfig" command.
    # Specify "mynetworks_style = class" when Postfix should "trust" SMTP
    # clients in the same IP class A/B/C networks as the local machine.
    # Don't do this with a dialup site - it would cause Postfix to "trust"
    # your entire provider's network. Instead, specify an explicit
    # mynetworks list by hand, as described below.
    # Specify "mynetworks_style = host" when Postfix should "trust"
    # only the local machine.
    #mynetworks_style = class
    #mynetworks_style = subnet
    #mynetworks_style = host
    # Alternatively, you can specify the mynetworks list by hand, in
    # which case Postfix ignores the mynetworks_style setting.
    # Specify an explicit list of network/netmask patterns, where the
    # mask specifies the number of bits in the network part of a host
    # address.
    # You can also specify the absolute pathname of a pattern file instead
    # of listing the patterns here. Specify type:table for table-based lookups
    # (the value on the table right-hand side is not used).
    #mynetworks = 168.100.189.0/28, 127.0.0.0/8
    #mynetworks = $config_directory/mynetworks
    #mynetworks = hash:/etc/postfix/network_table
    # The relay_domains parameter restricts what destinations this system will
    # relay mail to. See the smtpd_recipient_restrictions restriction in the
    # file sample-smtpd.cf for detailed information.
    # By default, Postfix relays mail
    # - from "trusted" clients (IP address matches $mynetworks) to any destination,
    # - from "untrusted" clients to destinations that match $relay_domains or
    # subdomains thereof, except addresses with sender-specified routing.
    # The default relay_domains value is $mydestination.
    # In addition to the above, the Postfix SMTP server by default accepts mail
    # that Postfix is final destination for:
    # - destinations that match $inet_interfaces,
    # - destinations that match $mydestination
    # - destinations that match $virtual_alias_domains,
    # - destinations that match $virtual_mailbox_domains.
    # These destinations do not need to be listed in $relay_domains.
    # Specify a list of hosts or domains, /file/name patterns or type:name
    # lookup tables, separated by commas and/or whitespace. Continue
    # long lines by starting the next line with whitespace. A file name
    # is replaced by its contents; a type:name table is matched when a
    # (parent) domain appears as lookup key.
    # NOTE: Postfix will not automatically forward mail for domains that
    # list this system as their primary or backup MX host. See the
    # permit_mx_backup restriction in the file sample-smtpd.cf.
    #relay_domains = $mydestination
    # INTERNET OR INTRANET
    # The relayhost parameter specifies the default host to send mail to
    # when no entry is matched in the optional transport(5) table. When
    # no relayhost is given, mail is routed directly to the destination.
    # On an intranet, specify the organizational domain name. If your
    # internal DNS uses no MX records, specify the name of the intranet
    # gateway host instead.
    # In the case of SMTP, specify a domain, host, host:port, [host]:port,
    # [address] or [address]:port; the form [host] turns off MX lookups.
    # If you're connected via UUCP, see also the default_transport parameter.
    #relayhost = $mydomain
    #relayhost = gateway.my.domain
    #relayhost = uucphost
    #relayhost = [an.ip.add.ress]
    # REJECTING UNKNOWN RELAY USERS
    # The relay_recipient_maps parameter specifies optional lookup tables
    # with all addresses in the domains that match $relay_domains.
    # If this parameter is defined, then the SMTP server will reject
    # mail for unknown relay users. This feature is off by default.
    # The right-hand side of the lookup tables is conveniently ignored.
    # In the left-hand side, specify an @domain.tld wild-card, or specify
    # a [email protected] address.
    #relay_recipient_maps = hash:/etc/postfix/relay_recipients
    # INPUT RATE CONTROL
    # The in_flow_delay configuration parameter implements mail input
    # flow control. This feature is turned on by default, although it
    # still needs further development (it's disabled on SCO UNIX due
    # to an SCO bug).
    # A Postfix process will pause for $in_flow_delay seconds before
    # accepting a new message, when the message arrival rate exceeds the
    # message delivery rate. With the default 50 SMTP server process
    # limit, this limits the mail inflow to 50 messages a second more
    # than the number of messages delivered per second.
    # Specify 0 to disable the feature. Valid delays are 0..10.
    #in_flow_delay = 1s
    # ADDRESS REWRITING
    # Insert text from sample-rewrite.cf if you need to do address
    # masquerading.
    # Insert text from sample-canonical.cf if you need to do address
    # rewriting, or if you need username->Firstname.Lastname mapping.
    # ADDRESS REDIRECTION (VIRTUAL DOMAIN)
    # Insert text from sample-virtual.cf if you need virtual domain support.
    # "USER HAS MOVED" BOUNCE MESSAGES
    # Insert text from sample-relocated.cf if you need "user has moved"
    # style bounce messages. Alternatively, you can bounce recipients
    # with an SMTP server access table. See sample-smtpd.cf.
    # TRANSPORT MAP
    # Insert text from sample-transport.cf if you need explicit routing.
    # ALIAS DATABASE
    # The alias_maps parameter specifies the list of alias databases used
    # by the local delivery agent. The default list is system dependent.
    # On systems with NIS, the default is to search the local alias
    # database, then the NIS alias database. See aliases(5) for syntax
    # details.
    # If you change the alias database, run "postalias /etc/aliases" (or
    # wherever your system stores the mail alias file), or simply run
    # "newaliases" to build the necessary DBM or DB file.
    # It will take a minute or so before changes become visible. Use
    # "postfix reload" to eliminate the delay.
    #alias_maps = dbm:/etc/aliases
    #alias_maps = hash:/etc/aliases
    #alias_maps = hash:/etc/aliases, nis:mail.aliases
    #alias_maps = netinfo:/aliases
    # The alias_database parameter specifies the alias database(s) that
    # are built with "newaliases" or "sendmail -bi". This is a separate
    # configuration parameter, because alias_maps (see above) may specify
    # tables that are not necessarily all under control by Postfix.
    #alias_database = dbm:/etc/aliases
    #alias_database = dbm:/etc/mail/aliases
    #alias_database = hash:/etc/aliases
    #alias_database = hash:/etc/aliases, hash:/opt/majordomo/aliases
    # ADDRESS EXTENSIONS (e.g., user+foo)
    # The recipient_delimiter parameter specifies the separator between
    # user names and address extensions (user+foo). See canonical(5),
    # local(8), relocated(5) and virtual(5) for the effects this has on
    # aliases, canonical, virtual, relocated and .forward file lookups.
    # Basically, the software tries user+foo and .forward+foo before
    # trying user and .forward.
    #recipient_delimiter = +
    # DELIVERY TO MAILBOX
    # The home_mailbox parameter specifies the optional pathname of a
    # mailbox file relative to a user's home directory. The default
    # mailbox file is /var/spool/mail/user or /var/mail/user. Specify
    # "Maildir/" for qmail-style delivery (the / is required).
    #home_mailbox = Mailbox
    #home_mailbox = Maildir/
    # The mail_spool_directory parameter specifies the directory where
    # UNIX-style mailboxes are kept. The default setting depends on the
    # system type.
    #mail_spool_directory = /var/mail
    #mail_spool_directory = /var/spool/mail
    # The mailbox_command parameter specifies the optional external
    # command to use instead of mailbox delivery. The command is run as
    # the recipient with proper HOME, SHELL and LOGNAME environment settings.
    # Exception: delivery for root is done as $default_user.
    # Other environment variables of interest: USER (recipient username),
    # EXTENSION (address extension), DOMAIN (domain part of address),
    # and LOCAL (the address localpart).
    # Unlike other Postfix configuration parameters, the mailbox_command
    # parameter is not subjected to $parameter substitutions. This is to
    # make it easier to specify shell syntax (see example below).
    # Avoid shell meta characters because they will force Postfix to run
    # an expensive shell process. Procmail alone is expensive enough.
    # IF YOU USE THIS TO DELIVER MAIL SYSTEM-WIDE, YOU MUST SET UP AN
    # ALIAS THAT FORWARDS MAIL FOR ROOT TO A REAL USER.
    #mailbox_command = /some/where/procmail
    #mailbox_command = /some/where/procmail -a "$EXTENSION"
    # The mailbox_transport specifies the optional transport in master.cf
    # to use after processing aliases and .forward files. This parameter
    # has precedence over the mailbox_command, fallback_transport and
    # luser_relay parameters.
    # Specify a string of the form transport:nexthop, where transport is
    # the name of a mail delivery transport defined in master.cf. The
    # :nexthop part is optional. For more details see the sample transport
    # configuration file.
    # NOTE: if you use this feature for accounts not in the UNIX password
    # file, then you must update the "local_recipient_maps" setting in
    # the main.cf file, otherwise the SMTP server will reject mail for
    # non-UNIX accounts with "User unknown in local recipient table".
    #mailbox_transport = lmtp:unix:/file/name
    #mailbox_transport = cyrus
    # The fallback_transport specifies the optional transport in master.cf
    # to use for recipients that are not found in the UNIX passwd database.
    # This parameter has precedence over the luser_relay parameter.
    # Specify a string of the form transport:nexthop, where transport is
    # the name of a mail delivery transport defined in master.cf. The
    # :nexthop part is optional. For more details see the sample transport
    # configuration file.
    # NOTE: if you use this feature for accounts not in the UNIX password
    # file, then you must update the "local_recipient_maps" setting in
    # the main.cf file, otherwise the SMTP server will reject mail for
    # non-UNIX accounts with "User unknown in local recipient table".
    #fallback_transport = lmtp:unix:/file/name
    #fallback_transport = cyrus
    #fallback_transport =
    # The luser_relay parameter specifies an optional destination address
    # for unknown recipients. By default, mail for unknown@$mydestination
    # and unknown@[$inet_interfaces] is returned as undeliverable.
    # The following expansions are done on luser_relay: $user (recipient
    # username), $shell (recipient shell), $home (recipient home directory),
    # $recipient (full recipient address), $extension (recipient address
    # extension), $domain (recipient domain), $local (entire recipient
    # localpart), $recipient_delimiter. Specify ${name?value} or
    # ${name:value} to expand value only when $name does (does not) exist.
    # luser_relay works only for the default Postfix local delivery agent.
    # NOTE: if you use this feature for accounts not in the UNIX password
    # file, then you must specify "local_recipient_maps =" (i.e. empty) in
    # the main.cf file, otherwise the SMTP server will reject mail for
    # non-UNIX accounts with "User unknown in local recipient table".
    #luser_relay = [email protected]
    #luser_relay = [email protected]
    #luser_relay = admin+$local
    # JUNK MAIL CONTROLS
    # The controls listed here are only a very small subset. See the file
    # sample-smtpd.cf for an elaborate list of anti-UCE controls.
    # The header_checks parameter specifies an optional table with patterns
    # that each logical message header is matched against, including
    # headers that span multiple physical lines.
    # By default, these patterns also apply to MIME headers and to the
    # headers of attached messages. With older Postfix versions, MIME and
    # attached message headers were treated as body text.
    # For details, see the sample-filter.cf file.
    #header_checks = regexp:/etc/postfix/header_checks
    # FAST ETRN SERVICE
    # Postfix maintains per-destination logfiles with information about
    # deferred mail, so that mail can be flushed quickly with the SMTP
    # "ETRN domain.tld" command, or by executing "sendmail -qRdomain.tld".
    # By default, Postfix maintains deferred mail logfile information
    # only for destinations that Postfix is willing to relay to (as
    # specified in the relay_domains parameter). For other destinations,
    # Postfix attempts to deliver ALL queued mail after receiving the
    # SMTP "ETRN domain.tld" command, or after execution of "sendmail
    # -qRdomain.tld". This can be slow when a lot of mail is queued.
    # The fast_flush_domains parameter controls what destinations are
    # eligible for this "fast ETRN/sendmail -qR" service.
    #fast_flush_domains = $relay_domains
    #fast_flush_domains =
    # SHOW SOFTWARE VERSION OR NOT
    # The smtpd_banner parameter specifies the text that follows the 220
    # code in the SMTP server's greeting banner. Some people like to see
    # the mail version advertised. By default, Postfix shows no version.
    # You MUST specify $myhostname at the start of the text. That is an
    # RFC requirement. Postfix itself does not care.
    #smtpd_banner = $myhostname ESMTP $mail_name
    #smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
    # PARALLEL DELIVERY TO THE SAME DESTINATION
    # How many parallel deliveries to the same user or domain? With local
    # delivery, it does not make sense to do massively parallel delivery
    # to the same user, because mailbox updates must happen sequentially,
    # and expensive pipelines in .forward files can cause disasters when
    # too many are run at the same time. With SMTP deliveries, 10
    # simultaneous connections to the same domain could be sufficient to
    # raise eyebrows.
    # Each message delivery transport has its XXX_destination_concurrency_limit
    # parameter. The default is $default_destination_concurrency_limit for
    # most delivery transports. For the local delivery agent the default is 2.
    #local_destination_concurrency_limit = 2
    #default_destination_concurrency_limit = 10
    # DEBUGGING CONTROL
    # The debug_peer_level parameter specifies the increment in verbose
    # logging level when an SMTP client or server host name or address
    # matches a pattern in the debug_peer_list parameter.
    debug_peer_level = 2
    # The debug_peer_list parameter specifies an optional list of domain
    # or network patterns, /file/name patterns or type:name tables. When
    # an SMTP client or server host name or address matches a pattern,
    # increase the verbose logging level by the amount specified in the
    # debug_peer_level parameter.
    #debug_peer_list = 127.0.0.1
    #debug_peer_list = some.domain
    # The debugger_command specifies the external command that is executed
    # when a Postfix daemon program is run with the -D option.
    # Use "command .. & sleep 5" so that the debugger can attach before
    # the process marches on. If you use an X-based debugger, be sure to
    # set up your XAUTHORITY environment variable before starting Postfix.
    debugger_command =
    PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
    xxgdb $daemon_directory/$process_name $process_id & sleep 5
    # If you don't have X installed on the Postfix machine, try:
    # debugger_command =
    # PATH=/bin:/usr/bin:/usr/local/bin; export PATH; (echo cont;
    # echo where) | gdb $daemon_directory/$process_name $process_id 2>&1
    # >$config_directory/$process_name.$process_id.log & sleep 5
    # INSTALL-TIME CONFIGURATION INFORMATION
    # The following parameters are used when installing a new Postfix version.
    # sendmail_path: The full pathname of the Postfix sendmail command.
    # This is the Sendmail-compatible mail posting interface.
    sendmail_path = /usr/sbin/sendmail
    # newaliases_path: The full pathname of the Postfix newaliases command.
    # This is the Sendmail-compatible command to build alias databases.
    newaliases_path = /usr/bin/newaliases
    # mailq_path: The full pathname of the Postfix mailq command. This
    # is the Sendmail-compatible mail queue listing command.
    mailq_path = /usr/bin/mailq
    # setgid_group: The group for mail submission and queue management
    # commands. This must be a group name with a numerical group ID that
    # is not shared with other accounts, not even with the Postfix account.
    setgid_group = postdrop
    # manpage_directory: The location of the Postfix on-line manual pages.
    manpage_directory = /usr/share/man
    # sample_directory: The location of the Postfix sample configuration files.
    sample_directory = /usr/share/doc/postfix/examples
    # readme_directory: The location of the Postfix README files.
    readme_directory = /usr/share/doc/postfix
    # THE FOLLOWING DEFAULTS ARE SET BY APPLE
    # bind to localhost only
    inet_interfaces = all
    # turn off relaying for local subnet
    mynetworks_style = host
    # mydomain_fallback: optional domain to use if mydomain is not set and
    # myhostname is not fully qualified. It is ignored if neither are true.
    mydomain_fallback = localhost
    myhostname = jamestownpress.com
    mailbox_transport = cyrus
    enable_server_options = yes
    luser_relay =
    maps_rbl_domains = dun.dnsrbl.net
    message_size_limit = 0
    mydestination = $myhostname,localhost.$mydomain
    smtpd_use_tls = no
    smtpd_enforce_tls = no
    smtpd_tls_loglevel = 0
    smtpd_sasl_auth_enable = yes
    smtpd_use_pw_server = yes
    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination,permit
    smtpd_pw_server_security_options = plain
    server_enabled = 1
    relayhost =
    smtpd_client_restrictions = permit_mynetworks reject_rbl_client dun.dnsrbl.net permit
    always_bcc =
    mynetworks = 127.0.0.1/32,192.168.0.0/16,192.168.1.98,192.168.1.3,192.168.1.13,192.168.1.5,1 92.168.1.22,192.168.1.18,192.168.1.41
    content_filter = smtp-amavis:[127.0.0.1]:10024
    so what do I need to change

  • Smartform to convert as pdf attachment and sending mail.

    Program to convert smartform as PDF and send PDF as an atachment to email id.
    ********Variable Declarations ****************************
    DATA: gv_form_name TYPE rs38l_fnam, " Used to store the function module generated by Smartform
    gv_bin_filesize TYPE i, " Store the file size
    gv_pos TYPE i,
    gv_len TYPE i,
    gv_tab_lines TYPE i.
    *******Constants ******************************************
    DATA : gc_text(11) TYPE c VALUE 'Form Output',
    gc_tst(3) TYPE c VALUE 'TST',
    gc_testing(7) TYPE c VALUE 'Testing'.
    CONSTANTS : c_formname           TYPE tdsfname VALUE 'ZSMART_T'.     "Zsmart_t is the smartform name.
    ********Work Area Declarations ****************************
    DATA: gs_docdata TYPE sodocchgi1, " Data of an object which can be changed
    gs_ctrlop TYPE ssfctrlop, " Smart Forms: Control structure
    gs_outopt TYPE ssfcompop, " SAP Smart Forms: Smart Composer (transfer) options
    gs_otfdata TYPE ssfcrescl, " Smart Forms: Return value at end of form printing
    gs_reclist TYPE somlreci1, " SAPoffice: Structure of the API Recipient List
    gs_pdf_tab TYPE tline, " Workarea for SAP Script Text Lines
    gs_objbin TYPE solisti1, " SAPoffice: Single List with Column Length 255
    gs_objpack TYPE sopcklsti1. " SAPoffice: Description of Imported Object Components
    ********Internal tables Declarations ****************************
    DATA: gt_reclist TYPE TABLE OF somlreci1, " SAPoffice: Structure of the API Recipient List
    gt_pdf_tab TYPE TABLE OF tline, " SAPscript: Text Lines
    gt_otf TYPE TABLE OF itcoo, " OTF Structure
    gt_objbin TYPE TABLE OF solisti1, " SAPoffice: Single List with Column Length 255
    gt_objpack TYPE TABLE OF sopcklsti1. " SAPoffice: Description of Imported Object Components
    DATA: customer TYPE scustom,
          bookings TYPE ty_bookings,
          connections TYPE ty_connections.
    CLEAR : gv_form_name,
    gs_ctrlop,
    gs_outopt,
    gs_otfdata,
    gv_bin_filesize,
    gv_pos,
    gv_len,
    gv_tab_lines.
    START-OF-SELECTION.
    Generate Function Module name
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname           = c_formname
        IMPORTING
          fm_name            = gv_form_name
        EXCEPTIONS
          no_form            = 1
          no_function_module = 2
          OTHERS             = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Assigning values to Form Control Structure and Form Composer
      gs_ctrlop-getotf = 'X'.
      gs_ctrlop-device = 'PRINTER'.
      gs_ctrlop-preview = ''.
      gs_ctrlop-no_dialog = 'X'.
      gs_outopt-tddest = 'LP01'.  "or  'LOCL'.
    Getting the OTFDATA
      CALL FUNCTION gv_form_name
        EXPORTING
          control_parameters = gs_ctrlop
          output_options     = gs_outopt
          user_settings      = ' '
          customer           = customer
          bookings           = bookings
          connections        = connections
        IMPORTING
          job_output_info    = gs_otfdata
        EXCEPTIONS
          formatting_error   = 1
          internal_error     = 2
          send_error         = 3
          user_canceled      = 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.
    Assigning the OTFDATA to OTF Structure table
      CLEAR gt_otf.
      gt_otf[] = gs_otfdata-otfdata[].
    Convert the OTF DATA to SAP Script Text lines
      CLEAR gt_pdf_tab.
      CALL FUNCTION 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
          max_linewidth         = 132
        IMPORTING
          bin_filesize          = gv_bin_filesize
        TABLES
          otf                   = gt_otf
          lines                 = gt_pdf_tab
        EXCEPTIONS
          err_max_linewidth     = 1
          err_format            = 2
          err_conv_not_possible = 3
          OTHERS                = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Assigning the Description of the object sent in the mail
      CLEAR gs_docdata.
      gs_docdata-obj_name = gc_tst.
      gs_docdata-obj_descr = gc_testing.
    Assigning the email id to Structure of the API Recipient List table
      CLEAR : gt_reclist, gs_reclist.
    IF internal mail id
    gs_reclist-receiver = sy-uname.
    GS_RECLIST-REC_TYPE = 'B'.
    if external mail id
      gs_reclist-receiver = mailid.com'.
      gs_reclist-rec_type = 'U'.
      APPEND gs_reclist TO gt_reclist.
    Passing the SAP Script text lines to SAPoffice: Single List with Column Length 255 table
      CLEAR : gs_objbin, gs_pdf_tab.
      LOOP AT gt_pdf_tab INTO gs_pdf_tab.
        gv_pos = 255 - gv_len.
        IF gv_pos > 134. "length of pdf_table
          gv_pos = 134.
        ENDIF.
        gs_objbin+gv_len = gs_pdf_tab(gv_pos).
        gv_len = gv_len + gv_pos.
        IF gv_len = 255. "length of out (contents_bin)
          APPEND gs_objbin TO gt_objbin.
          CLEAR: gs_objbin, gv_len.
          IF gv_pos < 134.
            gs_objbin = gs_pdf_tab+gv_pos.
            gv_len = 134 - gv_pos.
          ENDIF.
        ENDIF.
      ENDLOOP.
      IF gv_len > 0.
        APPEND gs_objbin TO gt_objbin.
      ENDIF.
    Filling the details in SAPoffice: Description of Imported Object Components table
      DESCRIBE TABLE gt_objbin LINES gv_tab_lines.
      CLEAR gs_objbin.
      READ TABLE gt_objbin INTO gs_objbin INDEX gv_tab_lines.
      IF sy-subrc = 0.
        gs_objpack-doc_size = ( gv_tab_lines - 1 ) * 255 + STRLEN( gs_objbin ).
        gs_objpack-transf_bin = 'X'.
        gs_objpack-head_start = 1.
        gs_objpack-head_num = 0.
        gs_objpack-body_start = 1.
        gs_objpack-body_num = gv_tab_lines.
        gs_objpack-doc_type = 'PDF'.
        gs_objpack-obj_name = 'ATTACHMENT'.
        gs_objpack-obj_descr = 'test'.
        APPEND gs_objpack TO gt_objpack.
      ENDIF.
    Sending the Form Output in the PDF format to email
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = gs_docdata
          put_in_outbox              = 'X'
          commit_work                = 'X'
        TABLES
          packing_list               = gt_objpack
          contents_bin               = gt_objbin
          receivers                  = gt_reclist
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          document_type_not_exist    = 3
          operation_no_authorization = 4
          parameter_error            = 5
          x_error                    = 6
          enqueue_error              = 7
          OTHERS                     = 8.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ELSE.
        WRITE 'Sent Successfully'.
      ENDIF.
      SUBMIT rsconn01
      WITH mode EQ 'INT'
      AND RETURN.
    END-OF-SELECTION.

    Hi
    Use function modules
              CALL FUNCTION 'CONVERT_OTF'
    and  CALL FUNCTION 'SX_TABLE_LINE_WIDTH_CHANGE'  to convert as a pdf document
    for sending mail  CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    Regards,
    Gopi

  • When I try and send mail from one of two email addresses, it asks me for a password to a google e-mail account I no longer have, so now I can't send any mail

    I have x6 gmail accounts set up on my Thunderbird pop mail. When ever I try and send ANY email from 2 of these accounts ([email protected] & [email protected]) a window pops up and says the following:
    Enter your password for [email protected] on smtp.googlemail.com
    I haven't had that email address for a couple years, and I've tried every password I've ever used with no luck.
    I eventually have to hit cancel, the a new error box pops up that says the following:
    Sending of message failed.
    An error occurred sending mail: Could not get password for smtp.googlemail.com. The message was not sent.
    PLEASE PLEASE help, I need these two address to work. Every other address (x4) through Thunerbird works.
    Thank you for your time and support.

    Are you trying to send an email from "[email protected]" this address??
    Check your Thunderbird Account Settings and SMTP
    *https://support.mozilla.org/en-US/kb/manual-account-configuration
    *http://kb.mozillazine.org/Multiple_SMTP_servers_%28Thunderbird%29

  • Changing layout at runtime, executing background job and sending mail inXLS

    Hi
    When i execute my program in foregroung by manually changing value of s_job = 'X' in debugging mode it is sending the correct XLS file via mail with all the data , whereas  when i execute my program in backgroud mode it sends incomlete XLS file via mail, it has only first 2 records in any layout........can anybody please help in this regard....
    program is as follows...
    REPORT ZPMACR01_MD_MRP_100.
    *& Report :  ZPMACR01_MD_MRP_100
    TABLES : MARA, MARC, MAKT, MBEW,MARD.
    MAIL data declarations
    TABLES : adr6 , sscrfields.
    DATA: BEGIN OF mbody OCCURS 0,
          message(100),
          END OF mbody.
    DATA: BEGIN OF addresses OCCURS 0,
          addresses(100),
          END Of addresses.
    FIELD-SYMBOLS: <f> type ANY,
                   <tab> TYPE STANDARD TABLE,
                   <wa> type ANY.
    DATA: count TYPE i value 0,
          col_1 TYPE i.
    DATA: new_table TYPE REF TO data, "pointer to dynamic table
          new_line  TYPE REF TO data. "pointer to work area of dynamic table
    DATA: s_job TYPE c.
    DATA: i_data_out_text TYPE string OCCURS 0 WITH HEADER LINE.
    DATA: message TYPE string OCCURS 0 WITH HEADER LINE.
    DATA:  it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
           WITH HEADER LINE.
    DATA:  BEGIN OF it_attach OCCURS 0,
             line(2650) TYPE c,
           END OF it_attach.
    DATA:   t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            t_hex LIKE solix OCCURS 0 WITH HEADER LINE,
            t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
            w_cnt TYPE i,
            w_sent_all(1) TYPE c,
            w_doc_data LIKE sodocchgi1,
            gd_error    TYPE sy-subrc,
            gd_reciever TYPE sy-subrc.
    ALV data declarations
    TYPE-POOLS: SLIS.
    DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
           IT_FIELDCAT2 TYPE LVC_T_FCAT,
           IT_FIELDCAT_FIN TYPE LVC_T_FCAT,
           IT_FIELDCAT3 TYPE SLIS_T_FIELDCAT_ALV,
           itab1 TYPE SLIS_T_FIELDCAT_ALV,
           W_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
           W_REPID TYPE SY-REPID,
           IT_LAYOUT TYPE SLIS_LAYOUT_ALV.
    DATA: is_fieldcat LIKE LINE OF it_fieldcat.
    DATA: is_fieldcat2 LIKE LINE OF it_fieldcat2,
    Is_FIELDCAT3 LIKE LINE OF it_fieldcat3.
    Data: variant type  DISVARIANT,
          v_size LIKE sy-tabix.
    ALV Data
    DATA:
           i_sort TYPE slis_t_sortinfo_alv,
           v_lvc_title   TYPE lvc_title,
           v_repid       LIKE sy-repid,
           c_user_command TYPE slis_formname  VALUE 'ALV_USER_COMMAND',
           gt_list_top_of_page TYPE slis_t_listheader,
           gt_list_end_of_list TYPE slis_t_listheader,
           gs_layout TYPE slis_layout_alv,
           gt_events      TYPE slis_t_event,
           gs_events      type slis_alv_event,
           gt_print       TYPE slis_print_alv,
           g_top_of_page  TYPE slis_formname VALUE 'TOP_OF_PAGE'.
    Selection Parameters
    SELECTION-SCREEN BEGIN OF BLOCK B1.
    SELECT-OPTIONS : SO_MATNR FOR MARA-MATNR OBLIGATORY.
    SELECT-OPTIONS : SO_WERKS FOR MARC-WERKS.
    SELECT-OPTIONS : SO_SPRAS FOR MAKT-SPRAS.
    SELECT-OPTIONS : SO_BWKEY FOR MBEW-BWKEY.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-001.
    PARAMETERS: p_email TYPE somlreci1-receiver
                                      default '[email protected]'.
    SELECTION-SCREEN END OF BLOCK B2.
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-002.
    PARAMETERS : SO_LAY TYPE DISVARIANT-VARIANT DEFAULT '/DEFAULT'.
    SELECTION-SCREEN END OF BLOCK B3.
    DATA Declarations.
    Data : BEGIN OF ITab OCCURS 0,
           manr type mara-matnr,
           end of ITAB.
    data : BEGIN OF IT_TABLE OCCURS 0,
           MATNR TYPE MARA-MATNR,
           MATKL TYPE MARA-MATKL,
           MEINS TYPE MARA-MEINS,
           MTART TYPE MARA-MTART,
           AHDIS TYPE MARC-AHDIS,
           AUSDT TYPE MARC-AUSDT,
           AUTRU TYPE MARC-AUTRU,
           BESKZ TYPE MARC-BESKZ,
           BSTFE TYPE MARC-BSTFE,
           BSTMA TYPE MARC-BSTMA,
           BSTMI TYPE MARC-BSTMI,
           BSTRF TYPE MARC-BSTRF,
           BWSCL TYPE MARC-BWSCL,
           DIBER TYPE MARC-DIBER,
           DISGR TYPE MARC-DISGR,
           DISLS TYPE MARC-DISLS,
           DISMM TYPE MARC-DISMM,
           DISPO TYPE MARC-DISPO,
           DISPR TYPE MARC-DISPR,
           DZEIT TYPE MARC-DZEIT,
           EISBE TYPE MARC-EISBE,
           EISLO TYPE MARC-EISLO,
           EKGRP TYPE MARC-EKGRP,
           FHORI TYPE MARC-FHORI,
           FXHOR TYPE MARC-FXHOR,
           KAUTB TYPE MARC-KAUTB,
           KORDB TYPE MARC-KORDB,
           KZAUS TYPE MARC-KZAUS,
           LFGJA TYPE MARC-LFGJA,
           LFMON TYPE MARC-LFMON,
           LGRAD TYPE MARC-LGRAD,
           LVORM TYPE MARC-LVORM,
           MABST TYPE MARC-MABST,
           MINBE TYPE MARC-MINBE,
           MMSTA TYPE MARC-MMSTA,
           MMSTD TYPE MARC-MMSTD,
           MRPPP TYPE MARC-MRPPP,
           MTVFP TYPE MARC-MTVFP,
           NFMAT TYPE MARC-NFMAT,
           PERKZ TYPE MARC-PERKZ,
           PLIFZ TYPE MARC-PLIFZ,
           PLVAR TYPE MARC-PLVAR,
           PSTAT TYPE MARC-PSTAT,
           QZGTP TYPE MARC-QZGTP,
           RGEKZ TYPE MARC-RGEKZ,
           RWPRO TYPE MARC-RWPRO,
           SBDKZ TYPE MARC-SBDKZ,
           SCHGT TYPE MARC-SCHGT,
           SHFLG TYPE MARC-SHFLG,
           SHPRO TYPE MARC-SHPRO,
           SHZET TYPE MARC-SHZET,
           SOBSL TYPE MARC-SOBSL,
           STRGR TYPE MARC-STRGR,
           TRAME TYPE MARC-TRAME,
           UEETK TYPE MARC-UEETK,
           UEETO TYPE MARC-UEETO,
           UMLMC TYPE MARC-UMLMC,
           UNETO TYPE MARC-UNETO,
           USEQU TYPE MARC-USEQU,
           VINT1 TYPE MARC-VINT1,
           VINT2 TYPE MARC-VINT2,
           VRBDT TYPE MARC-VRBDT,
           VRBFK TYPE MARC-VRBFK,
           VRBMT TYPE MARC-VRBMT,
           VRBWK TYPE MARC-VRBWK,
           VRMOD TYPE MARC-VRMOD,
           WEBAZ TYPE MARC-WEBAZ,
           WERKS TYPE MARC-WERKS,
           WZEIT TYPE MARC-WZEIT,
          DISKZ TYPE MARD-DISKZ,
          LBSTF TYPE MARD-LBSTF,
          LGORT TYPE MARD-LGORT,
          LMINB TYPE MARD-LMINB,
          LSOBS TYPE MARD-LSOBS,
           MAKTX TYPE MAKT-MAKTX,
           END OF IT_TABLE.
    DATA: BEGIN OF IT_MARD OCCURS 0,
           MATNR TYPE MARA-MATNR,
           MATKL TYPE MARA-MATKL,
           MEINS TYPE MARA-MEINS,
           MTART TYPE MARA-MTART,
           DISKZ TYPE MARD-DISKZ,
           LBSTF TYPE MARD-LBSTF,
           LGORT TYPE MARD-LGORT,
           LMINB TYPE MARD-LMINB,
           LSOBS TYPE MARD-LSOBS,
          MAKTX TYPE MAKT-MAKTX,
           END OF IT_MARD.
    DATA: BEGIN OF IT_MBEW OCCURS 0,
           MATNR TYPE MBEW-MATNR,
           BKLAS TYPE MBEW-BKLAS,
           SALK3 TYPE MBEW-SALK3,
           PEINH TYPE MBEW-PEINH,
           STPRS TYPE MBEW-STPRS,
           VERPR TYPE MBEW-VERPR,
           VPRSV TYPE MBEW-VPRSV,
           END OF IT_MBEW.
    data : BEGIN OF IT_FINAL0 occurs 0,
           MATNR LIKE MARA-MATNR,
           MATKL LIKE MARA-MATKL,
           MEINS LIKE MARA-MEINS,
           MTART LIKE MARA-MTART,
           AHDIS LIKE MARC-AHDIS,
           AUSDT LIKE MARC-AUSDT,
           AUTRU LIKE MARC-AUTRU,
           BESKZ LIKE MARC-BESKZ,
           BSTFE LIKE MARC-BSTFE,
           BSTMA LIKE MARC-BSTMA,
           BSTMI LIKE MARC-BSTMI,
           BSTRF LIKE MARC-BSTRF,
           BWSCL LIKE MARC-BWSCL,
           DIBER LIKE MARC-DIBER,
           DISGR LIKE MARC-DISGR,
           DISLS LIKE MARC-DISLS,
           DISMM LIKE MARC-DISMM,
           DISPO LIKE MARC-DISPO,
           DISPR LIKE MARC-DISPR,
           DZEIT LIKE MARC-DZEIT,
           EISBE LIKE MARC-EISBE,
           EISLO LIKE MARC-EISLO,
           EKGRP LIKE MARC-EKGRP,
           FHORI LIKE MARC-FHORI,
           FXHOR LIKE MARC-FXHOR,
           KAUTB LIKE MARC-KAUTB,
           KORDB LIKE MARC-KORDB,
           KZAUS LIKE MARC-KZAUS,
           LFGJA LIKE MARC-LFGJA,
           LFMON LIKE MARC-LFMON,
           LGRAD LIKE MARC-LGRAD,
           LVORM LIKE MARC-LVORM,
           MABST LIKE MARC-MABST,
           MINBE LIKE MARC-MINBE,
           MMSTA LIKE MARC-MMSTA,
           MMSTD LIKE MARC-MMSTD,
           MRPPP LIKE MARC-MRPPP,
           MTVFP LIKE MARC-MTVFP,
           NFMAT LIKE MARC-NFMAT,
           PERKZ LIKE MARC-PERKZ,
           PLIFZ LIKE MARC-PLIFZ,
           PLVAR LIKE MARC-PLVAR,
           PSTAT LIKE MARC-PSTAT,
           QZGTP LIKE MARC-QZGTP,
           RGEKZ LIKE MARC-RGEKZ,
           RWPRO LIKE MARC-RWPRO,
           SBDKZ LIKE MARC-SBDKZ,
           SCHGT LIKE MARC-SCHGT,
           SHFLG LIKE MARC-SHFLG,
           SHPRO LIKE MARC-SHPRO,
           SHZET LIKE MARC-SHZET,
           SOBSL LIKE MARC-SOBSL,
           STRGR LIKE MARC-STRGR,
           TRAME LIKE MARC-TRAME,
           UEETK LIKE MARC-UEETK,
           UEETO LIKE MARC-UEETO,
           UMLMC LIKE MARC-UMLMC,
           UNETO LIKE MARC-UNETO,
           USEQU LIKE MARC-USEQU,
           VINT1 LIKE MARC-VINT1,
           VINT2 LIKE MARC-VINT2,
           VRBDT LIKE MARC-VRBDT,
           VRBFK LIKE MARC-VRBFK,
           VRBMT LIKE MARC-VRBMT,
           VRBWK LIKE MARC-VRBWK,
           VRMOD LIKE MARC-VRMOD,
           WEBAZ LIKE MARC-WEBAZ,
           WERKS LIKE MARC-WERKS,
           WZEIT LIKE MARC-WZEIT,
           DISKZ LIKE MARD-DISKZ,
           LBSTF LIKE MARD-LBSTF,
           LGORT LIKE MARD-LGORT,
           LMINB LIKE MARD-LMINB,
           LSOBS LIKE MARD-LSOBS,
           MAKTX LIKE MAKT-MAKTX,
           END OF IT_FINAL0.
    data : BEGIN OF IT_FINAL occurs 0,
           MATNR LIKE MARA-MATNR,
           MATKL LIKE MARA-MATKL,
           MEINS LIKE MARA-MEINS,
           MTART LIKE MARA-MTART,
           AHDIS LIKE MARC-AHDIS,
           AUSDT LIKE MARC-AUSDT,
           AUTRU LIKE MARC-AUTRU,
           BESKZ LIKE MARC-BESKZ,
           BSTFE LIKE MARC-BSTFE,
           BSTMA LIKE MARC-BSTMA,
           BSTMI LIKE MARC-BSTMI,
           BSTRF LIKE MARC-BSTRF,
           BWSCL LIKE MARC-BWSCL,
           DIBER LIKE MARC-DIBER,
           DISGR LIKE MARC-DISGR,
           DISLS LIKE MARC-DISLS,
           DISMM LIKE MARC-DISMM,
           DISPO LIKE MARC-DISPO,
           DISPR LIKE MARC-DISPR,
           DZEIT LIKE MARC-DZEIT,
           EISBE LIKE MARC-EISBE,
           EISLO LIKE MARC-EISLO,
           EKGRP LIKE MARC-EKGRP,
           FHORI LIKE MARC-FHORI,
           FXHOR LIKE MARC-FXHOR,
           KAUTB LIKE MARC-KAUTB,
           KORDB LIKE MARC-KORDB,
           KZAUS LIKE MARC-KZAUS,
           LFGJA LIKE MARC-LFGJA,
           LFMON LIKE MARC-LFMON,
           LGRAD LIKE MARC-LGRAD,
           LVORM LIKE MARC-LVORM,
           MABST LIKE MARC-MABST,
           MINBE LIKE MARC-MINBE,
           MMSTA LIKE MARC-MMSTA,
           MMSTD LIKE MARC-MMSTD,
           MRPPP LIKE MARC-MRPPP,
           MTVFP LIKE MARC-MTVFP,
           NFMAT LIKE MARC-NFMAT,
           PERKZ LIKE MARC-PERKZ,
           PLIFZ LIKE MARC-PLIFZ,
           PLVAR LIKE MARC-PLVAR,
           PSTAT LIKE MARC-PSTAT,
           QZGTP LIKE MARC-QZGTP,
           RGEKZ LIKE MARC-RGEKZ,
           RWPRO LIKE MARC-RWPRO,
           SBDKZ LIKE MARC-SBDKZ,
           SCHGT LIKE MARC-SCHGT,
           SHFLG LIKE MARC-SHFLG,
           SHPRO LIKE MARC-SHPRO,
           SHZET LIKE MARC-SHZET,
           SOBSL LIKE MARC-SOBSL,
           STRGR LIKE MARC-STRGR,
           TRAME LIKE MARC-TRAME,
           UEETK LIKE MARC-UEETK,
           UEETO LIKE MARC-UEETO,
           UMLMC LIKE MARC-UMLMC,
           UNETO LIKE MARC-UNETO,
           USEQU LIKE MARC-USEQU,
           VINT1 LIKE MARC-VINT1,
           VINT2 LIKE MARC-VINT2,
           VRBDT LIKE MARC-VRBDT,
           VRBFK LIKE MARC-VRBFK,
           VRBMT LIKE MARC-VRBMT,
           VRBWK LIKE MARC-VRBWK,
           VRMOD LIKE MARC-VRMOD,
           WEBAZ LIKE MARC-WEBAZ,
           WERKS LIKE MARC-WERKS,
           WZEIT LIKE MARC-WZEIT,
           DISKZ LIKE MARD-DISKZ,
           LBSTF LIKE MARD-LBSTF,
           LGORT LIKE MARD-LGORT,
           LMINB LIKE MARD-LMINB,
           LSOBS LIKE MARD-LSOBS,
           MAKTX LIKE MAKT-MAKTX,
           BKLAS LIKE MBEW-BKLAS,
           SALK3 LIKE MBEW-SALK3,
           PEINH LIKE MBEW-PEINH,
           STPRS LIKE MBEW-STPRS,
           VERPR LIKE MBEW-VERPR,
           VPRSV LIKE MBEW-VPRSV,
           ZXPRS LIKE MBEW-STPRS,
           END OF IT_FINAL.
    data : BEGIN OF IT_display occurs 0,
           matnr LIKE MARA-MATNR,
           maktx LIKE MAKT-MAKTX,
           meins LIKE MARA-MEINS,
           werks LIKE MARC-WERKS,
           dispo LIKE MARC-DISPO,
           dismm LIKE MARC-DISMM,
           plifz LIKE MARC-PLIFZ,
           webaz LIKE MARC-WEBAZ,
           minbe LIKE MARC-MINBE,
         shzet LIKE MARC-SHZET,
         eisbe LIKE MARC-EISBE,
         disls LIKE MARC-DISLS,
         bstmi LIKE MARC-BSTMI,
         bstma LIKE MARC-BSTMA,
         bstfe LIKE MARC-BSTFE,
         ZXPRS LIKE MBEW-STPRS,
         peinh LIKE MBEW-PEINH,
         salk3 LIKE MBEW-SALK3,
           end of it_display.
    ALV Layout Variant
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR so_lay.
      PERFORM get_alv_layout_values.
    SELECTION SCREEN.
    AT SELECTION-SCREEN.
      IF ( sscrfields-ucomm = 'SJOB' OR
      sy-batch = 'X' ).
        s_job = 'X'.
      ENDIF.
    select single matnr into itab from mara where matnr in so_matnr.
    if sy-subrc <> 0.
    message e001(zpal).
    endif.
    START-OF-SELECTION.
      IF SO_LAY <> ' '.
        VARIANT-REPORT = 'ZPMACR01_MD_MRP_100'.
        VARIANT-VARIANT = SO_LAY.
    else.
    VARIANT-VARIANT = '/DEFAULT'.
      ENDIF.
    INITIALIZATION.
      W_REPID = SY-REPID.
    START-OF-SELECTION.
    IF SO_LAY <> ' '.
        VARIANT-REPORT  = w_repid.
        VARIANT-VARIANT = SO_LAY.
    else.
    VARIANT-VARIANT = '/DEFAULT'.
    ENDIF.
      SELECT
      MARA~MATNR
      MARA~MATKL
      MARA~MEINS
      MARA~MTART
      MARC~AHDIS
      MARC~AUSDT
      MARC~AUTRU
      MARC~BESKZ
      MARC~BSTFE
      MARC~BSTMA
      MARC~BSTMI
      MARC~BSTRF
      MARC~BWSCL
      MARC~DIBER
      MARC~DISGR
      MARC~DISLS
      MARC~DISMM
      MARC~DISPO
      MARC~DISPR
      MARC~DZEIT
      MARC~EISBE
      MARC~EISLO
      MARC~EKGRP
      MARC~FHORI
      MARC~FXHOR
      MARC~KAUTB
      MARC~KORDB
      MARC~KZAUS
      MARC~LFGJA
      MARC~LFMON
      MARC~LGRAD
      MARC~LVORM
      MARC~MABST
      MARC~MINBE
      MARC~MMSTA
      MARC~MMSTD
      MARC~MRPPP
      MARC~MTVFP
      MARC~NFMAT
      MARC~PERKZ
      MARC~PLIFZ
      MARC~PLVAR
      MARC~PSTAT
      MARC~QZGTP
      MARC~RGEKZ
      MARC~RWPRO
      MARC~SBDKZ
      MARC~SCHGT
      MARC~SHFLG
      MARC~SHPRO
      MARC~SHZET
      MARC~SOBSL
      MARC~STRGR
      MARC~TRAME
      MARC~UEETK
      MARC~UEETO
      MARC~UMLMC
      MARC~UNETO
      MARC~USEQU
      MARC~VINT1
      MARC~VINT2
      MARC~VRBDT
      MARC~VRBFK
      MARC~VRBMT
      MARC~VRBWK
      MARC~VRMOD
      MARC~WEBAZ
      MARC~WERKS
      MARC~WZEIT
    MARD~DISKZ
    MARD~LBSTF
    MARD~LGORT
    MARD~LMINB
    MARD~LSOBS
      MAKT~MAKTX
    INTO TABLE IT_TABLE
    FROM MARA INNER JOIN MARC ON MARAMATNR = MARCMATNR
    INNER JOIN MAKT ON MARAMATNR = MAKTMATNR
    WHERE MARA~MATNR IN SO_MATNR
           AND MARC~WERKS IN SO_WERKS
           AND MAKT~SPRAS IN SO_SPRAS.
      SELECT
      MARA~MATNR
      MARA~MATKL
      MARA~MEINS
      MARA~MTART
      MARD~DISKZ
      MARD~LBSTF
      MARD~LGORT
      MARD~LMINB
      MARD~LSOBS
      INTO TABLE IT_mard
       FROM MARA INNER JOIN MARD ON MARAMATNR = MARDMATNR
                WHERE  MARA~MATNR IN SO_MATNR
                      and mard~werks in SO_WERKS.
      SELECT MATNR BKLAS SALK3 PEINH STPRS VERPR VPRSV
      INTO TABLE IT_MBEW FROM MBEW FOR ALL ENTRIES IN IT_TABLE WHERE MATNR =
      IT_TABLE-MATNR AND BWKEY IN SO_BWKEY.
      LOOP AT IT_TABLE.
       MOVE-CORRESPONDING IT_TABLE TO IT_FINAL0.
        READ TABLE IT_MARD WITH KEY MATNR = IT_TABLE-MATNR.
        IF SY-SUBRC = 0 .
         MOVE-CORRESPONDING IT_MARD TO IT_FINAL0.
        ENDIF.
         APPEND IT_FINAL0.
         CLEAR IT_FINAL0.
      ENDLOOP.
    LOOP AT IT_FINAL0.
        READ TABLE IT_MBEW WITH KEY MATNR = IT_final0-MATNR.
        IF SY-SUBRC = 0 .
         MOVE-CORRESPONDING IT_MBEW TO IT_FINAL.
         IF IT_MBEW-VPRSV = 'S'.
          MOVE IT_MBEW-STPRS TO IT_FINAL-ZXPRS.
         ELSE.
          MOVE IT_MBEW-VERPR TO IT_FINAL-ZXPRS.
         ENDIF.
        ENDIF.
        MOVE-CORRESPONDING IT_FINAL0 TO IT_FINAL.
        APPEND IT_FINAL.
        CLEAR IT_FINAL.
    ENDLOOP.
    Default Layout
      LOOP AT IT_FINAL.
        Read table it_final with key matnr = SO_matnr.
        Move it_final-MATNR to it_display-MATNR.
        Move it_final-MAKTX to it_display-MAKTX.
        Move it_final-MEINS to it_display-MEINS.
        Move it_final-WERKS to it_display-WERKS.
        Move it_final-DISPO to it_display-DISPO.
        Move it_final-DISMM to it_display-DISMM.
        Move it_final-PLIFZ to it_display-PLIFZ.
        Move it_final-WEBAZ to it_display-WEBAZ.
        Move it_final-MINBE to it_display-MINBE.
        Move it_final-SHZET to it_display-SHZET.
        Move it_final-EISBE to it_display-EISBE.
        Move it_final-DISLS to it_display-DISLS.
        Move it_final-BSTMI to it_display-BSTMI.
        Move it_final-BSTMA to it_display-BSTMA.
        Move it_final-BSTFE to it_display-BSTFE.
        MOVE it_final-ZXPRS to it_display-ZXPRS.
        Move it_final-PEINH to it_display-PEINH.
        Move it_final-SALK3 to it_display-SALK3.
        Append it_display.
      endloop.
      data: v_data type c value ' '.
      if it_display is initial.
        v_data = ' '.
      else.
        v_data = 'X'.
      endif.
    END-OF-SELECTION.
    END-OF-SELECTION.
      if s_job = 'X'.
        perform execute_back.
      else.
        perform execute_fore.
      endif.
          FORM execute_fore                                             *
    Form execute_fore.
    *&      Form REUSE_ALV_FIELDCATALOG_MERGE
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         I_PROGRAM_NAME               = W_REPID
         I_INTERNAL_TABNAME           = 'IT_FINAL'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
         I_INCLNAME                   = W_REPID
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
        CHANGING
          CT_FIELDCAT                  = IT_FIELDCAT
       EXCEPTIONS
         INCONSISTENT_INTERFACE       = 1
         PROGRAM_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.
    *&      Form  DISPLAY_ALV_REPORT
          Display report using ALV grid
    *IF SO_LAY <> ' '.
    VARIANT-VARIANT = SO_LAY.
    *endif.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
                       I_INTERFACE_CHECK                 = ' '
                       I_BYPASSING_BUFFER                =
                       I_BUFFER_ACTIVE                   = ' '
                         I_CALLBACK_PROGRAM                = W_REPID
                       I_CALLBACK_PF_STATUS_SET          = ' '
                       I_CALLBACK_USER_COMMAND           = ' '
                       I_CALLBACK_TOP_OF_PAGE            = ' '
                       I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
                       I_CALLBACK_HTML_END_OF_LIST       = ' '
                       I_STRUCTURE_NAME                  =
                       I_BACKGROUND_ID                   = ' '
                       I_GRID_TITLE                      =
                       I_GRID_SETTINGS                   =
                       IS_LAYOUT                         = IT_LAYOUT
                         IT_FIELDCAT                       = IT_FIELDCAT[]
                       IT_EXCLUDING                      =
                       IT_SPECIAL_GROUPS                 =
                       IT_SORT                           =
                       IT_FILTER                         =
                       IS_SEL_HIDE                       =
                       I_DEFAULT                         = 'X'
                         I_SAVE                            = 'X'
                         IS_VARIANT                        = 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
                       IT_ALV_GRAPHICS                   =
                       IT_ADD_FIELDCAT                   =
                       IT_HYPERLINK                      =
                       I_HTML_HEIGHT_TOP                 =
                       I_HTML_HEIGHT_END                 =
                       IT_EXCEPT_QINFO                   =
                     IMPORTING
                       E_EXIT_CAUSED_BY_CALLER           =
                       ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = IT_FINAL
       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.
          FORM execute_back                                             *
    FORM execute_back.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         I_PROGRAM_NAME               = W_REPID
         I_INTERNAL_TABNAME           = 'IT_FINAL'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
         I_INCLNAME                   = W_REPID
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
        CHANGING
          CT_FIELDCAT                  = IT_FIELDCAT
       EXCEPTIONS
         INCONSISTENT_INTERFACE       = 1
         PROGRAM_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.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = W_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
         I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
       IS_LAYOUT                         =
         IT_FIELDCAT                       = it_fieldcat[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
         I_SAVE                            = 'X'
         IS_VARIANT                        = variant
        IT_EVENTS                         = gt_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
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        T_OUTTAB                          = it_final
    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.
    form top_of_page.
    CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
       IMPORTING
        ES_LAYOUT                 =
         ET_FIELDCAT               = IT_FIELDCAT3[]
        ET_SORT                   =
        ET_FILTER                 =
        ES_GRID_SCROLL            =
         ES_VARIANT                = VARIANT
        ET_MARKED_COLUMNS         =
        ET_FILTERED_ENTRIES       =
        ET_FIELDCAT_BACKEND       =
        ES_PRINT                  =
       EXCEPTIONS
         NO_INFOS                  = 1
         PROGRAM_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.
    clear count.
    LOOP AT IT_FIELDCAT3 into is_fieldcat3 where no_out eq space.
    *move-corresponding is_fieldcat3 to is_fieldcat2.
    move: is_fieldcat3-fieldname to is_fieldcat2-fieldname,
          is_fieldcat3-ref_fieldname to is_fieldcat2-ref_field,
          is_fieldcat3-ref_tabname to is_fieldcat2-ref_table,
          is_fieldcat3-seltext_l to is_fieldcat2-coltext,
          is_fieldcat3-no_out to is_fieldcat2-no_out,
          is_fieldcat3-col_pos to is_fieldcat2-col_pos.
    *move:
         is_fieldcat3-row_pos to is_fieldcat2-row_pos,
         is_fieldcat3-col_pos to is_fieldcat2-col_pos,
         is_fieldcat3-fieldname to is_fieldcat2-fieldname,
         is_fieldcat3-tabname   to is_fieldcat2-tabname,
         is_fieldcat3-outputlen to is_fieldcat2-outputlen,
         is_fieldcat3-no_out    to is_fieldcat2-no_out,
         is_fieldcat3-seltext_l to is_fieldcat2-coltext,
         is_fieldcat3-ref_fieldname to is_fieldcat2-ref_field,
         is_fieldcat3-ref_tabname to is_fieldcat2-ref_table,
         is_fieldcat3-DDIC_OUTPUTLEN to is_fieldcat2-DD_OUTLEN,
         is_fieldcat3-datatype to is_fieldcat2-datatype,
         is_fieldcat3-inttype to is_fieldcat2-inttype,
         is_fieldcat3-INTLEN to is_fieldcat2-INTLEN.
    APPEND IS_FIELDCAT2 TO IT_FIELDCAT2.
    *count = count + 1.
    ENDLOOP.
    loop at it_fieldcat2 into is_fieldcat2.
      if is_fieldcat2-no_out = 'X'.
       delete it_fieldcat2 index sy-tabix.
      else.
       count = count + 1.
      endif.
    endloop.
    describe table it_fieldcat2 lines count.
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fieldcat2[]
        IMPORTING
          ep_table        = new_table.
      ASSIGN new_table->* TO <tab>.
      CREATE DATA new_line LIKE LINE OF <tab>.
      ASSIGN new_line->* TO <wa>.
    *-- Perform to build table for attachment data
      PERFORM build_xls_data_table.
    *-- Perform to populate  e-mail message
      PERFORM populate_email_message_body.
    *-- Perform to send mail
      PERFORM send_file_as_email_attachment.
    *-- Perform to Instruct mail send program for SAPCONNECT to send email.
      PERFORM initiate_mail_execute_program.
    ENDFORM.
    *&      Form  build_xls_data_table
    form build_xls_data_table.
      data: char_var(30) type C,
            num_var(10) type n.
      CONSTANTS: con_cret TYPE x VALUE '0D',  "NEW LINE
                  tabchar TYPE x VALUE '09'.   "tab
      loop at it_fieldcat2 into is_fieldcat2.
        concatenate it_attach is_fieldcat2-coltext
        into it_attach separated by tabchar.
      endloop.
      CONCATENATE con_cret it_attach  INTO it_attach.
      APPEND  it_attach.
      CLEAR it_attach.
       field-symbols: <t> type ANY.
      LOOP AT it_final.
      col_1 = 1.
       do count times.
       Assign component col_1 of structure <wa> to <f>.
       read table it_fieldcat2 into is_fieldcat2 with key col_pos = col_1.
       loop at it_fieldcat into is_fieldcat.
       if is_fieldcat-fieldname = is_fieldcat2-fieldname.
        assign component is_fieldcat-col_pos of structure it_final to <t>.
        exit.
       endif.
       endloop.
       <f> = <t>.
       clear <t>.
       col_1 = col_1 + 1.
       enddo.
       append <wa> to <tab>.
       endloop.
      loop at <tab> into <wa>.
      col_1 = 1.
      do count times.
       Assign component col_1 of structure <wa> to <f>.
       move <f> to char_var.
       concatenate it_attach char_var
       into it_attach separated by tabchar.
       col_1 = col_1 + 1.
      enddo.
       CONCATENATE con_cret it_attach INTO it_attach.
       APPEND it_attach.
       CLEAR it_attach.
      endloop.
    ENDFORM.
    FORM send_file_as_email_attachment.
      DATA:
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ.
      ld_email = p_email.
      ld_mtitle = text-003.
      ld_format = 'XLS'.
      ld_attdescription  = ' '.
      ld_attfilename = 'DATA'.
      ld_sender_address = ' '.
      ld_sender_address_type = ' '.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
    ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      LOOP AT it_attach.
        MOVE it_attach(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+255(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+510(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+765(235) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+765(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+1020(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+1275(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+1530(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+1785(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+2040(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+2295(255) TO t_hex.
        APPEND t_hex.
        MOVE it_attach+2550(100) TO t_hex.
        APPEND t_hex.
      ENDLOOP.
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_hex LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data       = w_doc_data
                put_in_outbox       = 'X'
                sender_address      = ld_sender_address
                sender_address_type = ld_sender_address_type
          IMPORTING
               sent_to_all         = w_sent_all
           TABLES
                packing_list        = t_packing_list
                contents_txt        = it_message
                contents_hex        = t_hex
                receivers           = t_receivers
           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.
    ld_error = sy-subrc.
    LOOP AT t_receivers.
       ld_receiver = t_receivers-retrn_code.
    ENDLOOP.
    ENDFORM. "SEND_FILE_AS_EMAIL_ATTACHMENT
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
          Instructs mail send program for SAPCONNECT to send email.
    FORM initiate_mail_execute_program.
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
                    WITH output = 'X'
                    AND RETURN.
    ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
           Populate message body text
    FORM populate_email_message_body.
      REFRESH it_message.
      it_message = text-004.
      APPEND  it_message.
      CONCATENATE SY-DATUM 'to' SY-DATUM INTO it_message SEPARATED BY
      space.
      APPEND  it_message.
    ENDFORM.                    " POPULATE_EMAIL_MESSAGE_BODY
    *&      Form  get_alv_layout_values
    FORM get_alv_layout_values.
      variant-report = w_repid.
      CALL FUNCTION 'REUSE_ALV_VARIANT_F4'
           EXPORTING
                is_variant    = variant
                i_save        = 'A'
           IMPORTING
                es_variant    = variant
           EXCEPTIONS
                not_found     = 1
                program_error = 2
                OTHERS        = 3.
      CHECK sy-subrc = 0.
      so_lay = variant-variant.
    ENDFORM.                    " get_alv_layout_values

    Hi Arpit,
    Take a look at the documentation of FM 'SO_DOCUMENT_SEND_API1' for parameter PACKING_LIST. I think you should set t_packing_list-head_num to a different value than 0 for the second attachment.
    Regards,
    John.

  • Smartforms to pdf and send mail

    PROGRAM :
    *& Report  ZDB_PDFMAIL
    REPORT  zdb_pdfmail.
    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_record LIKE SOLIX OCCURS 0 WITH HEADER LINE,
    i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    Work Area declarations
    w_objhead TYPE soli_tab,
    w_ctrlop TYPE ssfctrlop,
    w_compop 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
    Variables declarations
    v_form_name TYPE rs38l_fnam,
    v_len_in LIKE sood-objlen,
    v_len_out LIKE sood-objlen,
    v_len_outn TYPE i,
    v_lines_txt TYPE i,
    v_lines_bin TYPE i.
    DATA  doc LIKE docs OCCURS 0 WITH HEADER LINE.
    DATA bin_fsize TYPE i.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
      EXPORTING
        formname           = 'ZZZ_TEST2'
      IMPORTING
        fm_name            = v_form_name
      EXCEPTIONS
        no_form            = 1
        no_function_module = 2
        OTHERS             = 3.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    w_ctrlop-getotf = 'X'.
    w_ctrlop-no_dialog = 'X'.
    w_compop-tdnoprev = 'X'.
    CALL FUNCTION v_form_name
      EXPORTING
        control_parameters = w_ctrlop
        output_options     = w_compop
        user_settings      = 'X'
      IMPORTING
        job_output_info    = w_return
      EXCEPTIONS
        formatting_error   = 1
        internal_error     = 2
        send_error         = 3
        user_canceled      = 4
        OTHERS             = 5.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    i_otf[] = w_return-otfdata[].
    *CALL FUNCTION 'CONVERT_OTF_2_PDF'
    EXPORTING
      USE_OTF_MC_CMD               = 'X'
      ARCHIVE_INDEX                =
    IMPORTING
      BIN_FILESIZE                 =
    TABLES
       otf                          =
       doctab_archive               =
       lines                        =
    EXCEPTIONS
      ERR_CONV_NOT_POSSIBLE        = 1
      ERR_OTF_MC_NOENDMARKER       = 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.
    CALL FUNCTION 'CONVERT_OTF'
      EXPORTING
        format                = 'PDF'
        max_linewidth         = 132
      IMPORTING
        bin_filesize          = v_len_in
      TABLES
        otf                   = i_otf
        lines                 = i_tline
      EXCEPTIONS
        err_max_linewidth     = 1
        err_format            = 2
        err_conv_not_possible = 3
        OTHERS                = 4.
    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.
    *CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
       format                = 'PDF'
       max_linewidth         = 132
    IMPORTING
       bin_filesize          = v_len_in
    TABLES
       otf                   = i_otf
       lines                 = i_tline
    EXCEPTIONS
       err_max_linewidth     = 1
       err_format            = 2
       err_conv_not_possible = 3
       OTHERS                = 4.
    *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 v_lines_bin.
    Object with main text of the mail.
    i_objtxt = 'Find attached the output of the smart form.'.
    APPEND i_objtxt.
    i_objtxt = 'Regards,'.
    APPEND i_objtxt.
    i_objtxt = 'J.Jayanthi'.
    APPEND i_objtxt.
    DESCRIBE TABLE i_objtxt LINES v_lines_txt.
    Document information.
    w_doc_chng-obj_name = 'Smartform'.
    w_doc_chng-expiry_dat = sy-datum + 10.
    w_doc_chng-obj_descr = 'Smart form output'.
    w_doc_chng-sensitivty = 'F'. "Functional object
    w_doc_chng-doc_size = v_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 = v_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 = v_lines_bin.
    i_objpack-doc_type = 'PDF'.
    i_objpack-obj_name = 'Smartform'.
    CONCATENATE 'Smartform_output' '.pdf'
    INTO i_objpack-obj_descr.
    i_objpack-doc_size = v_lines_bin * 255.
    APPEND i_objpack.
    Document information.
    CLEAR i_reclist.
    e-mail receivers.
    i_reclist-receiver = '[email protected]'.
    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_hex               = 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.
    ERROR:
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_DYN_CALL_ILLEGAL_TYPE', was
      not caught and
    therefore caused a runtime error.
    The reason for the exception is:
    In the function "SO_NEW_DOCUMENT_ATT_SEND_API1", the STRUCTURE parameter
      "CONTENTS_HEX" is typed in such a way
    that only actual parameters are allowed, which are compatible in Unicode
      with respect to the fragment view. However, the specified actual
    parameter "I_OBJBIN" has an incompatible fragment view.
    PLS. TELL ME HOW TO UPDATE . 3KS
    WAITING FOR YOUR HELP

    I HAVE CHECK WHAT YOU SAID.
    CONCATENATE f_repid0(9) f_uname0(3) INTO lc_rq2name.
    SELECT * FROM tsp01 WHERE rq2name = lc_rq2name
      ORDER BY rqcretime DESCENDING.
    IN THE TABLE OF TSP01,HAVE NO MY RECORD.
    MAYBE MY PRINT REQUEST DOES NOT PUT INTO THE TABLE .
    WHY ? HOW TO SETTING ?
    OTHER ABAPER USER THE SAME PROGRAM ,HE CAN RUN SUCCESS.
    BUT SOMEONE NOT .
    Regards

Maybe you are looking for

  • ERROR: ORACLE prepare error: ORA-00936: missing expression

    Hello, I am required to run "pass-through" Oracle SQL, to extract data from tables into SAS for processing and manipulation. My code (attached) reads and writes (executes) but with zero records to test first. I cannot get past the Prepare Error. The

  • Change BSEG-ZUONR  during the Post Goods issue.

    Hi We wanted to Update the BSEG-ZUONR with sales Order no( traverse back to the Original SO during reversal)  ( Basically Assignment field (ZUONR) in the Accounting side) after performing the Post Goods issue  USING TRANSACTION VL02N. Is there any us

  • How to I get up to date information in Apple Maps?

    I just upgraded to Mavericks and was trying Apple Maps, but the maps are showing parks that haven't existed for 10 years, and are missing businesses that have been in my area for over 10 years? Is there a way to get more up to date information in App

  • Can  i build simple encoder like gzip,- png-, jpeg- or bmp-encoder?

    Hello dear people, can i ask about unknown photo- or texture-type? TGA File will show into flash-player? I know any encoders... Example: Encoders: For jpeg, png encoder: https://github.com/mikechambers/as3corelib/blob/master/src/com/adobe/images/PNGE

  • Reqest for SAP XI Developer Certification ,TBIT40,41,42,43  Urls

    Hi In a forum, I have come across, these words "all questions will come TBIT40,41,42,43 - Developer certification. TBIT40,50,51- Technology consultant(BASIS) . TBIT40 more then 60% questions will appear. " Can you please provide me the urls for these