Urgent ...how to send output of sap through mail

Could you please guide me how to send output of SAP Script  through mail in PDF format.
Thanks in Advance....
Regards,
Kumar.

*& Report  ZSPOOLTOPDF                                                 *
*& Converts spool request into PDF document and emails it to           *
*& recipicant.                                                         *
*& Execution                                                           *
*& This program must be run as a background job in-order for the write *
*& commands to create a Spool request rather than be displayed on      *
*& screen                                                              *
REPORT  zspooltopdf.
PARAMETER: p_email1 LIKE somlreci1-receiver,
           p_sender LIKE somlreci1-receiver,
               p_delspl  AS CHECKBOX.
*DATA DECLARATION
DATA: gd_recsize TYPE i.
Spool IDs
TYPES: BEGIN OF t_tbtcp.
        INCLUDE STRUCTURE tbtcp.
TYPES: END OF t_tbtcp.
DATA: it_tbtcp TYPE STANDARD TABLE OF t_tbtcp INITIAL SIZE 0,
      wa_tbtcp TYPE t_tbtcp.
Job Runtime Parameters
DATA: gd_eventid LIKE tbtcm-eventid,
      gd_eventparm LIKE tbtcm-eventparm,
      gd_external_program_active LIKE tbtcm-xpgactive,
      gd_jobcount LIKE tbtcm-jobcount,
      gd_jobname LIKE tbtcm-jobname,
      gd_stepcount LIKE tbtcm-stepcount,
      gd_error    TYPE sy-subrc,
      gd_reciever TYPE sy-subrc.
DATA:  w_recsize TYPE i.
DATA: gd_subject   LIKE sodocchgi1-obj_descr,
      it_mess_bod LIKE solisti1 OCCURS 0 WITH HEADER LINE,
      it_mess_att LIKE solisti1 OCCURS 0 WITH HEADER LINE,
      gd_sender_type     LIKE soextreci1-adr_typ,
      gd_attachment_desc TYPE so_obj_nam,
      gd_attachment_name TYPE so_obj_des.
Spool to PDF conversions
DATA: gd_spool_nr LIKE tsp01-rqident,
      gd_destination LIKE rlgrap-filename,
      gd_bytecount LIKE tst01-dsize,
      gd_buffer TYPE string.
Binary store for PDF
DATA: BEGIN OF it_pdf_output OCCURS 0.
        INCLUDE STRUCTURE tline.
DATA: END OF it_pdf_output.
CONSTANTS: c_dev LIKE  sy-sysid VALUE 'DEV',
           c_no(1)     TYPE c   VALUE ' ',
           c_device(4) TYPE c   VALUE 'LOCL'.
*START-OF-SELECTION.
START-OF-SELECTION.
Write statement to represent report output. Spool request is created
if write statement is executed in background. This could also be an
ALV grid which would be converted to PDF without any extra effort
  WRITE 'Hello World'.
  new-page.
  commit work.
  new-page print off.
  IF sy-batch EQ 'X'.
    PERFORM get_job_details.
    PERFORM obtain_spool_id.
Alternative way could be to submit another program and store spool
id into memory, will be stored in sy-spono.
*submit ZSPOOLTOPDF2
       to sap-spool
       spool parameters   %_print
       archive parameters %_print
       without spool dynpro
       and return.
Get spool id from program called above
IMPORT w_spool_nr FROM MEMORY ID 'SPOOLTOPDF'.
    PERFORM convert_spool_to_pdf.
    PERFORM process_email.
    if p_delspl EQ 'X'.
      PERFORM delete_spool.
    endif.
    IF sy-sysid = c_dev.
      wait up to 5 seconds.
      SUBMIT rsconn01 WITH mode   = 'INT'
                      WITH output = 'X'
                      AND RETURN.
    ENDIF.
  ELSE.
    SKIP.
    WRITE:/ 'Program must be executed in background in-order for spool',
            'request to be created.'.
  ENDIF.
      FORM obtain_spool_id                                          *
FORM obtain_spool_id.
  CHECK NOT ( gd_jobname IS INITIAL ).
  CHECK NOT ( gd_jobcount IS INITIAL ).
  SELECT * FROM  tbtcp
                 INTO TABLE it_tbtcp
                 WHERE      jobname     = gd_jobname
                 AND        jobcount    = gd_jobcount
                 AND        stepcount   = gd_stepcount
                 AND        listident   <> '0000000000'
                 ORDER BY   jobname
                            jobcount
                            stepcount.
  READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
  IF sy-subrc = 0.
    message s004(zdd) with gd_spool_nr.
    gd_spool_nr = wa_tbtcp-listident.
    MESSAGE s004(zdd) WITH gd_spool_nr.
  ELSE.
    MESSAGE s005(zdd).
  ENDIF.
ENDFORM.
      FORM get_job_details                                          *
FORM get_job_details.
Get current job details
  CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
       IMPORTING
            eventid                 = gd_eventid
            eventparm               = gd_eventparm
            external_program_active = gd_external_program_active
            jobcount                = gd_jobcount
            jobname                 = gd_jobname
            stepcount               = gd_stepcount
       EXCEPTIONS
            no_runtime_info         = 1
            OTHERS                  = 2.
ENDFORM.
      FORM convert_spool_to_pdf                                     *
FORM convert_spool_to_pdf.
  CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
       EXPORTING
            src_spoolid              = gd_spool_nr
            no_dialog                = c_no
            dst_device               = c_device
       IMPORTING
            pdf_bytecount            = gd_bytecount
       TABLES
            pdf                      = it_pdf_output
       EXCEPTIONS
            err_no_abap_spooljob     = 1
            err_no_spooljob          = 2
            err_no_permission        = 3
            err_conv_not_possible    = 4
            err_bad_destdevice       = 5
            user_cancelled           = 6
            err_spoolerror           = 7
            err_temseerror           = 8
            err_btcjob_open_failed   = 9
            err_btcjob_submit_failed = 10
            err_btcjob_close_failed  = 11
            OTHERS                   = 12.
  CHECK sy-subrc = 0.
Transfer the 132-long strings to 255-long strings
  LOOP AT it_pdf_output.
    TRANSLATE it_pdf_output USING ' ~'.
    CONCATENATE gd_buffer it_pdf_output INTO gd_buffer.
  ENDLOOP.
  TRANSLATE gd_buffer USING '~ '.
  DO.
    it_mess_att = gd_buffer.
    APPEND it_mess_att.
    SHIFT gd_buffer LEFT BY 255 PLACES.
    IF gd_buffer IS INITIAL.
      EXIT.
    ENDIF.
  ENDDO.
ENDFORM.
      FORM process_email                                            *
FORM process_email.
  DESCRIBE TABLE it_mess_att LINES gd_recsize.
  CHECK gd_recsize > 0.
  PERFORM send_email USING p_email1.
perform send_email using p_email2.
ENDFORM.
      FORM send_email                                               *
-->  p_email                                                       *
FORM send_email USING p_email.
  CHECK NOT ( p_email IS INITIAL ).
  REFRESH it_mess_bod.
Default subject matter
  gd_subject         = 'Subject'.
  gd_attachment_desc = 'Attachname'.
CONCATENATE 'attach_name' ' ' INTO gd_attachment_name.
  it_mess_bod        = 'Message Body text, line 1'.
  APPEND it_mess_bod.
  it_mess_bod        = 'Message Body text, line 2...'.
  APPEND it_mess_bod.
If no sender specified - default blank
  IF p_sender EQ space.
    gd_sender_type  = space.
  ELSE.
    gd_sender_type  = 'INT'.
  ENDIF.
Send file by email as .xls speadsheet
  PERFORM send_file_as_email_attachment
                               tables it_mess_bod
                                      it_mess_att
                                using p_email
                                      'Example .xls documnet attachment'
                                      'PDF'
                                      gd_attachment_name
                                      gd_attachment_desc
                                      p_sender
                                      gd_sender_type
                             changing gd_error
                                      gd_reciever.
ENDFORM.
      FORM delete_spool                                             *
FORM delete_spool.
  DATA: ld_spool_nr TYPE tsp01_sp0r-rqid_char.
  ld_spool_nr = gd_spool_nr.
  CHECK p_delspl <> c_no.
  CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
       EXPORTING
            spoolid = ld_spool_nr.
ENDFORM.
*&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
      Send email
FORM send_file_as_email_attachment tables it_message
                                          it_attach
                                    using p_email
                                          p_mtitle
                                          p_format
                                          p_filename
                                          p_attdescription
                                          p_sender_address
                                          p_sender_addres_type
                                 changing p_error
                                          p_reciever.
  DATA: ld_error    TYPE sy-subrc,
        ld_reciever TYPE sy-subrc,
        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_receiver LIKE  sy-subrc.
data:   t_packing_list like sopcklsti1 occurs 0 with header line,
        t_contents like solisti1 occurs 0 with header line,
        t_receivers like somlreci1 occurs 0 with header line,
        t_attachment like solisti1 occurs 0 with header line,
        t_object_header like solisti1 occurs 0 with header line,
        w_cnt type i,
        w_sent_all(1) type c,
        w_doc_data like sodocchgi1.
  ld_email   = p_email.
  ld_mtitle = p_mtitle.
  ld_format              = p_format.
  ld_attdescription      = p_attdescription.
  ld_attfilename         = p_filename.
  ld_sender_address      = p_sender_address.
  ld_sender_address_type = p_sender_addres_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'.
  CLEAR t_attachment.
  REFRESH t_attachment.
  t_attachment[] = it_attach[].
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_attachment 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
            commit_work                = 'X'
       IMPORTING
            sent_to_all                = w_sent_all
       TABLES
            packing_list               = t_packing_list
            contents_bin               = t_attachment
            contents_txt               = it_message
            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.
Populate zerror return code
  ld_error = sy-subrc.
Populate zreceiver return code
  LOOP AT t_receivers.
    ld_receiver = t_receivers-retrn_code.
  ENDLOOP.
ENDFORM.
regards,
venkat

Similar Messages

  • How to send a smartform result through mail?

    How to send a smartform result through mail?

    HI,
    YOu can convert the output of Smartform into a attachment say PDF file & then send it across through mail.
    Refer following program:
    <a href="http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm">http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm</a>
    Best regards,
    Prashant

  • In solman 4.0 how to send message to SAP through service desk

    Dear all,
            I have configured service desk functionality, My requirement is from service desk how to send message to SAP.
    Regards,
    Pavan.

    Hi,
    Following the steps:
    &#131;Basic configuration - RFC Connections to SAP
    Check if the RFC Connectino SAPOSS is working properly
    Check if load distribution group is set to EWA
    The RFC Connections:
    - SAP-OSS (Send Message to SAP)
    - SAP-OSS-LIST-O01 (Update Message from SAP)
    will be created automatically by the system with a user which has been assigned
    previously.
    IMG Path: SAP Web Application Server | SAP Web Application Server | SAP Solution Manager| Basic Settings | SAP Solution Manager System | Connection to SAP | Assign user for forwarding Service Desk Message
    With transaction SM59 you can adjust the RFC connections.
    - For further information on SAP R/3 Front-end connections, see SAP Notes: 33135, 766505, 24177
    - To forward Service Desk notifications and Issues to SAP, you need to assign a user to the SAPNet R/3
    Front-end connection to SAP.
    Activities:
    - 1. From the SAP Solution Manager (transaction SOLUTION_MANAGER), choose (Edit-> Global Settings.
    - 2. Choose Display<->Change.
    - 3. For SAP Service Marketplace, specify http://service.sap.com as the URL.
    - 4. In the Connection to SAP tab, specify SAPOSS as the RFC destination. Note that the entry is casesensitive.
    - 5. For User forwading messages, enter a valid user and a password. This user will require all the authorizations for SAPNet R/3 Front-end for your customer number.
    - 6. Save your changes.
    The system automatically generates the following RFC destinations and assigns the S-User and password you specified: SAP-OSS, SAP-OSS-LIST-O01
    Good Lucky!

  • How to send internal table data through mail from report in foreground

    hi all,
    iam trying  to convert the internal table data into excel format and sending it through mail by runnning the report in foreground.
    mail is going sucessfully with excel format,but iam facing the problem in the excel format of the material column as follows:
    the matrno shows the wrong format -2.63E+11  instead of displaying correct format-263215000000.
    Pls suggest the alternative process for the above mentioned problem.
    Thanks,
    Sivagopal R.

    Hi Siva,
      Try to copy 263215000000 in one of the cells of excel sheet and press enter.It will automatically convert into -2.63E+11 .
      This means the default formatting of the excel sheet makes this happen.If you convert the format of the cell to "NUMBER" then u will get the required result.
      But I doubt whether or not it is possible through ABAP programming.
    Regards,
    Vimal.

  • How To Send A Text Attachment Through MAIL Adapter

    Hi Experts,
       I Did A Scenario that is  By using file adapter at the sender side and PI as a middle ware i have sent one text file to database
    Now here my question is
    I have to send the same text file which i have sent database... my using Mail Adapter
    Simply  File to Mail Scenario
    FILE         PI                MAIL
    But I have to send the same text file which i sent to database... by using mail adapter... Here all the configuration are done ... And the channels are working properly... only thing  here is..to send same text file using mail adapter..
    It will be good if  any one can explain step by step..
    Regards
    aravindh

    Hi Rajendra,
       Tanq for connecting me ... This  Blog helped me a lot ....And it is a useful answer to me..
    For this file to mail scenario we have got .txt as an attachment ... Its fine ... But her my Client is asking me to add CONTENT in the mail... Content in the sense..
    Example of content...
    Hi,
    Please find the attachment
    Regards,
    sap pi,
    They need in the form of like this...  To add content in the mail  What i have to do...DO i need to add more configurations if it is what are they...
    Please solve the issue.. It is appreciated  some one can explain me step by step or .. By sending me screen charts..
    Thanks in  advance....
    Regards
    vinay

  • How to send Dynamic Interactive Forms through mail?

    Hi all,
    I'm trying to sent Interactive Forms as attachment through mails.
    Everything works fine as long as the Content of this Interactive Form stays static.
    When I add dynamic elements and test this in SFP, they work.
    However when they get sent by mail, the dynamic content is lost and gets back Static.
    Does anyone has ABAP code or any other solutions so that the PDF gets send as an Dynamic Form?
    Thanks in advance.
    Kind Regards,
    Maarten

    Hi,
    I'm working from the Web UI. This is BSP. Here I add 2 Methods (GET_PDF and SEND_MAIL).
    The GET_PDF gets all data for the form and then sends the FORMOUTPUT to the SEND_MAIL method.
    Here I add the PDF as following:
    First I convert it to BINARY and then I add it as attachment.
    Do I need to add it as another TYPE or ....
    +  CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          BUFFER                = ip_formoutput-PDF "PDF file from function module
        APPEND_TO_TABLE       = ' '
      IMPORTING
        OUTPUT_LENGTH         =
        TABLES
          BINARY_TAB            = lt_att_content_hex
      lo_document->add_attachment(
        EXPORTING
          i_attachment_type    = 'PDF'
          i_attachment_subject = 'Your appointment Details'
          i_att_content_hex    = lt_att_content_hex ).+
    Kind Regards,
    Maarten

  • How to send existing excel file through mail

    Hello Friends,
    I have to send mail with Excel File attachement. i have already exist Excel file and that file i hv to send through mail. so pl help me out for sending existing excel file .
    i.e. user pickup the exist excel file and that file would be sent to particular mail id.
    thank you,
    Marmik

    Hi marmik,
    1. There is some trick involved
    in the binary files.
    2. I have made a program (and it works fantastic)
    ONLY 6 LINES FOR EMAILING
    BELIEVE ME
    ITS A FANTASTIC PROGRAM.
    IT WILL WORK LIKE OUTLOOK EXPRESS !
    3. The user is provided with
    a) file name
    b) email address to send mail
    and it sends ANY FILE (.xls,.pdf .xyz..)
    Instantaneously !
    4. Make two things first :
    1. Include with the name : ZAMI_INCLFOR_MAIL
    2. Report with the name : ZAM_TEMP147 (any name will do)
    3. Activate both and execute (2)
    4. After providing filename, email adress
    5. Code for Include :
    10.08.2005 Amit M - Created
    Include For Mail (First Req F16)
    Modification Log
    Data
    DATA: docdata LIKE sodocchgi1,
    objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
    objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
    objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
    objhex LIKE solix OCCURS 10 WITH HEADER LINE,
    reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
    DATA: tab_lines TYPE i,
    doc_size TYPE i,
    att_type LIKE soodk-objtp.
    DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
    FORM
    FORM ml_customize USING objname objdesc.
    Clear Variables
    CLEAR docdata.
    REFRESH objpack.
    CLEAR objpack.
    REFRESH objhead.
    REFRESH objtxt.
    CLEAR objtxt.
    REFRESH objbin.
    CLEAR objbin.
    REFRESH objhex.
    CLEAR objhex.
    REFRESH reclist.
    CLEAR reclist.
    REFRESH listobject.
    CLEAR listobject.
    CLEAR tab_lines.
    CLEAR doc_size.
    CLEAR att_type.
    Set Variables
    docdata-obj_name = objname.
    docdata-obj_descr = objdesc.
    ENDFORM. "ml_customize
    FORM
    FORM ml_addrecp USING preceiver prec_type.
    CLEAR reclist.
    reclist-receiver = preceiver.
    reclist-rec_type = prec_type.
    APPEND reclist.
    ENDFORM. "ml_customize
    FORM
    FORM ml_addtxt USING ptxt.
    CLEAR objtxt.
    objtxt = ptxt.
    APPEND objtxt.
    ENDFORM. "ml_customize
    FORM
    FORM ml_prepare USING bypassmemory whatatt_type whatname.
    IF bypassmemory = ''.
    Fetch List From Memory
    CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
    listobject = listobject
    EXCEPTIONS
    OTHERS = 1.
    IF sy-subrc <> 0.
    MESSAGE ID '61' TYPE 'E' NUMBER '731'
    WITH 'LIST_FROM_MEMORY'.
    ENDIF.
    CALL FUNCTION 'TABLE_COMPRESS'
    IMPORTING
    COMPRESSED_SIZE =
    TABLES
    in = listobject
    out = objbin
    EXCEPTIONS
    OTHERS = 1
    IF sy-subrc <> 0.
    MESSAGE ID '61' TYPE 'E' NUMBER '731'
    WITH 'TABLE_COMPRESS'.
    ENDIF.
    ENDIF.
    Header Data
    Already Done Thru FM
    Main Text
    Already Done Thru FM
    Packing Info For Text Data
    DESCRIBE TABLE objtxt LINES tab_lines.
    READ TABLE objtxt INDEX tab_lines.
    docdata-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
    CLEAR objpack-transf_bin.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = 'TXT'.
    APPEND objpack.
    Packing Info Attachment
    att_type = whatatt_type..
    DESCRIBE TABLE objbin LINES tab_lines.
    READ TABLE objbin INDEX tab_lines.
    objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
    objpack-transf_bin = 'X'.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = att_type.
    objpack-obj_name = 'ATTACHMENT'.
    objpack-obj_descr = whatname.
    APPEND objpack.
    Receiver List
    Already done thru fm
    ENDFORM. "ml_prepare
    FORM
    FORM ml_dosend.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = docdata
    put_in_outbox = 'X'
    commit_work = 'X' "used from rel. 6.10
    IMPORTING
    SENT_TO_ALL =
    NEW_OBJECT_ID =
    TABLES
    packing_list = objpack
    object_header = objhead
    contents_bin = objbin
    contents_txt = objtxt
    CONTENTS_HEX = objhex
    OBJECT_PARA =
    object_parb =
    receivers = reclist
    EXCEPTIONS
    too_many_receivers = 1
    document_not_sent = 2
    document_type_not_exist = 3
    operation_no_authorization = 4
    parameter_error = 5
    x_error = 6
    enqueue_error = 7
    OTHERS = 8
    IF sy-subrc <> 0.
    MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
    WITH docdata-obj_name.
    ENDIF.
    ENDFORM. "ml_customize
    FORM
    FORM ml_spooltopdf USING whatspoolid.
    DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
    Call Function
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
    EXPORTING
    src_spoolid = whatspoolid
    TABLES
    pdf = pdf
    EXCEPTIONS
    err_no_otf_spooljob = 1
    OTHERS = 12.
    Convert
    PERFORM doconv TABLES pdf objbin.
    ENDFORM. "ml_spooltopdf
    FORM
    FORM doconv TABLES
    mypdf STRUCTURE tline
    outbin STRUCTURE solisti1.
    Data
    DATA : pos TYPE i.
    DATA : len TYPE i.
    Loop And Put Data
    LOOP AT mypdf.
    pos = 255 - len.
    IF pos > 134. "length of pdf_table
    pos = 134.
    ENDIF.
    outbin+len = mypdf(pos).
    len = len + pos.
    IF len = 255. "length of out (contents_bin)
    APPEND outbin.
    CLEAR: outbin, len.
    IF pos < 134.
    outbin = mypdf+pos.
    len = 134 - pos.
    ENDIF.
    ENDIF.
    ENDLOOP.
    IF len > 0.
    APPEND outbin.
    ENDIF.
    ENDFORM. "doconv
    CODE FOR PROGRAM
    5.
    REPORT zam_temp147 .
    INCLUDE zami_inclfor_mail.
    DATA
    DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
    DATA : file_name TYPE string.
    data : path like PCFILE-PATH.
    data : extension(5) type c.
    data : name(100) type c.
    SELECTION SCREEN
    PARAMETERS : receiver TYPE somlreci1-receiver lower case.
    PARAMETERS : p_file LIKE rlgrap-filename
    OBLIGATORY.
    AT SELECTION SCREEN
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CLEAR p_file.
    CALL FUNCTION 'F4_FILENAME'
    IMPORTING
    file_name = p_file.
    START-OF-SELECTION
    START-OF-SELECTION.
    PERFORM ml_customize USING 'Tst' 'Testing'.
    PERFORM ml_addrecp USING receiver 'U'.
    PERFORM upl.
    PERFORM doconv TABLES itab objbin.
    PERFORM ml_prepare USING 'X' extension name.
    PERFORM ml_dosend.
    SUBMIT rsconn01
    WITH mode EQ 'INT'
    AND RETURN.
    FORM
    FORM upl.
    file_name = p_file.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = file_name
    filetype = 'BIN'
    TABLES
    data_tab = itab
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17.
    path = file_name.
    CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
    EXPORTING
    complete_filename = path
    CHECK_DOS_FORMAT =
    IMPORTING
    DRIVE =
    EXTENSION = extension
    NAME = name
    NAME_WITH_EXT =
    PATH =
    EXCEPTIONS
    INVALID_DRIVE = 1
    INVALID_EXTENSION = 2
    INVALID_NAME = 3
    INVALID_PATH = 4
    OTHERS = 5
    ENDFORM. "upl
    regards,
    amit m.

  • How to send the form data through mail with pdf format?

    forms 6i
    Hi to all,
    i am developed one master detail form.example is based on the dept number emp details will be displayed.here my requirment is whatever displayed on the form
    the data ,these data send to mail with any format.is it possible? if is possible any one give a proper solution.
    Regards,
    Stevie
    Edited by: 994418 on 6 May, 2013 11:15 PM

    Hello,
    you can create a Report that accepts the search parameters from the Forms mask and generates a PDF. You also have the option to send the report via mail.
    Personally I would generate the report with a tool like as_pdf
    http://technology.amis.nl/2012/04/11/generating-a-pdf-document-with-some-plsql-as_pdf_mini-as_pdf3/
    Then you can send the mail using utl_mail or utl_smtp.
    www.google.com/search?q=site:forums.oracle.com+utl_mail+utl_smtp
    Regards
    Marcus

  • How to send output of smartform in pdf format as an attachment to email

    how to send output of smartform in pdf format as an attachment to email
    search before posting further and follow Forum rules
    Edited by: Vijay Babu Dudla on Jan 15, 2009 4:50 AM

    Did u check on sdn?
    i dont think so or else there are many posts on this topic and good wikis too.
    look at one of these code tutorial wiki
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/mail%2bsend%2bthrough%2boutput%2bcontrols
    So next time do use the search functionality.
    кu03B1ятu03B9к
    Edited by: kartik tarla on Jan 15, 2009 12:33 PM

  • How to send idocs across SAP  systems in same network

    Hello
    I wander how to send idocs across SAP  systems in same network

    Hi Jan Bo,
        please check the below link
    http://help.sap.com/saphelp_nw04s/helpdata/en/dc/6b7f3c43d711d1893e0000e8323c4f/frameset.htm
    please write if you want more detailes.
    Regards,
    S.Manu.

  • How to send SMS from SAP to Any mobile

    Hi Friends,
    I have a requrement. How to send SMS from SAP to Any mobile?? For Example: If i created PO in SAP then i want to send a SMS to Concerned Vendor and HOD.
    Please provide the pre-requisites?
    Naveen

    Hi Naveen,
    there is a standard webservice globally available called Send SMS and you can consume that webservice with the help of CAF and you can send PO number as SMS, If the standard webservice do not work then you have to create your own webservice to fulfill the functionality.
    Regards
    Manohar

  • How to sending simple text in the mail body

    Hi friends,
                 How to send simple text in the mail body through ABAP code
       plz send me the related code and setting for that mail.
      Thanks&Regards,
      Srinivas

    try this...
    FORM send_file_as_email_attachment .
      DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE.
      DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
      DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE.
      DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
      DATA: objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE.
      DATA : i_body TYPE soli_tab WITH HEADER LINE.
    DATA: it_attach LIKE it_display1 OCCURS 0 WITH HEADER LINE.
      DATA: doc_chng LIKE sodocchgi1.
      DATA: tab_lines LIKE sy-tabix.
      DATA: att_lines TYPE i.
    DATA: lv_lines TYPE i.
      DATA: file TYPE string.
      data: g_datum like sy-datum.
      data: g_datum1(10) type c.
      DATA: len TYPE n.
      LOOP AT it_email.
        CLEAR : objpack,
                objhead,
                objbin,
                objtxt,
                reclist.
        REFRESH: objpack,
                 objhead,
                 objbin,
                 objtxt,
                 reclist.
        g_datum =     sy-datum - 1.
        concatenate g_datum6(2) '.' g_datum4(2) '.' g_datum+0(4) into
        g_datum1.
    doc_chng-obj_descr = 'Aged Stock more than 45 Days'.
        CONCATENATE 'Aged Stock more than 45 Days' '-' it_email-vkbur INTO
        doc_chng-obj_descr.
        CONCATENATE 'Please find enclosed Aged Stock Details ( >45days ) report as on'
        g_datum1
        INTO objtxt-line SEPARATED BY space.
        APPEND objtxt.
        objtxt-line = ' '.
        APPEND objtxt.
        objtxt-line = 'Regards'.
        APPEND objtxt.
        objtxt-line = 'LIS SAP Projects'.
        APPEND objtxt.
        objtxt-line =
        'PS: Pls send feedback for futher improvements to SAP office.'.
        APPEND objtxt.
        DESCRIBE TABLE objtxt LINES tab_lines.
        READ TABLE objtxt INDEX tab_lines.
        doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ).
       CLEAR objpack-transf_bin.
        objpack-head_start = 1.
        objpack-head_num = 1.
        objpack-body_start = 1.
        objpack-body_num = tab_lines.
        objpack-doc_type = 'TXT'.
       objpack-obj_name = 'Run_prog'.
       objpack-obj_descr = 'Agestock.txt'.
       lv_lines = tab_lines.
        APPEND objpack.
    *CONCATENATE 'Plant'   'Material Number' 'Qty(More than 45days)'
    *'Amount' INTO
           it_display SEPARATED BY space.
           append objbin.
           clear: objbin.
        CLEAR:it_display2.
        REFRESH it_display2.
        it_display2-werks = 'Plant|'.
        it_display2-matnr = 'Material Number'.
        it_display2-qty = '|Qty > 45 days'.
        it_display2-amount = '      |Amount'.
        APPEND it_display2.
        it_display2-werks = ''.
        it_display2-matnr = ''.
        it_display2-qty = ''.
        it_display2-amount = ''.
        APPEND it_display2.
        CLEAR : it_display2.
        sort it_display1 by amount descending.
        LOOP AT it_display1 WHERE werks = it_email-vkbur.
         AT FIRST.
    *CONCATENATE 'Plant    '   'Material Number' 'Qty(More than 45days)'
    *'Amount' INTO
           objbin-line SEPARATED BY space.
           append objbin.
           clear: objbin.
         ENDAT.
          CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
            EXPORTING
              input  = it_display1-matnr
            IMPORTING
              output = it_display1-matnr.
          it_display1-qty = TRUNC( it_display1-qty ).
          MOVE-CORRESPONDING it_display1 TO it_display2.
          APPEND it_display2.
          CLEAR:it_display1,it_display2,objbin.
          CLEAR:it_display1.
        ENDLOOP.
        objbin[] = it_display2[].
        DESCRIBE TABLE objbin LINES tab_lines.
        objhead = 'Suug'.
        APPEND objhead.
        objpack-transf_bin = 'X'.
        objpack-head_start = 3.
        objpack-head_num = 1.
        objpack-body_start = 1.
        objpack-body_num = tab_lines.
        objpack-doc_type = 'RAW'.
        objpack-obj_name = 'Run_prog'.
        objpack-obj_descr = 'Agestock.txt'.
        APPEND objpack.
        reclist-receiver = '[email protected]'.
        reclist-rec_type = 'U'.
        APPEND reclist.
    =====================================================================
        CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
          EXPORTING
            document_data              = doc_chng
            commit_work                = 'X'
          TABLES
            packing_list               = objpack
            object_header              = objhead
            contents_bin               = objbin
            contents_txt               = objtxt
            receivers                  = reclist
          EXCEPTIONS
            too_many_receivers         = 1
            document_not_sent          = 2
            operation_no_authorization = 4
            OTHERS                     = 99.
        CLEAR : it_email.
      ENDLOOP.
    ENDFORM.                    "send_mail
    Message was edited by:
            Sugumar Ganesan

  • Can any one tell me how to send one PO to mutilple mail ids in vendor maste

    Hi Experts,
    Can any one tell me how to send one PO as a mail to multiple vendors who are all maintained in my vendor master record
    Suppose I have 3 mail ids in my Vendor master record and I created a PO with that vendor, will that PO goes to all the three mail ids maintained in the vendor master record  or only to one ?
    Inorder to send to multiple mail ids, Do we need to do any configure any thing in SPRO settings functionally, if so where we have to maintain?
    Or shall an Abaper needs to maintain a code for that.?
    Please suggest me, I would appreciate your feed back.
    Best Regards,
    Sairam

    Go to XK02 enter the vendor code
    go to the communication tab
    Email will be there press the ---> button
    you can add many Emails in the list.
    Please ensure that the  message output is configured by
    the  SAP BASIS team
    No need of any configuration
    G.Ganesh Kumar

  • How can send a script as a mail.

    Hi
    this is fazil.
    Please tell me any body How can send a script as a mail.
    Thanks & Regards
    Fazil
    [email protected]

    Hi Fazil,
    First convert your script to Smartform and then use this type of coding to mail it.
    Check this code.
    REPORT zptpfrm202p_pogr_pr_instr MESSAGE-ID zmm.
    TABLES *
    Database table made for getting information about PRINTPREVIEW and
    PRINT command more than one times
    TABLES: zgr_table.
    TYPE-POOLS:syscr.
    GLOBAL TYPE DECLARATION *
    DATA: zdoc_output_info TYPE ssfcrespd, "SF:Return Document Inf.
    zjob_output_info TYPE ssfcrescl, "SF:Return value at end of
    form printing
    i_control TYPE ssfctrlop ,
    i_output_options TYPE ssfcompop,
    zjob_output_opts TYPE ssfcresop. "SF:Return value at start
    of form printing
    *This internal table is used for storing Document Segment: Material
    DATA: BEGIN OF i_mseg.
    INCLUDE STRUCTURE mseg.
    DATA: END OF i_mseg.
    This internal table is used for storing Header: Material Document
    DATA: BEGIN OF i_mkpf.
    INCLUDE STRUCTURE mkpf.
    DATA: END OF i_mkpf.
    *Variables
    DATA flag(1) TYPE c.
    DATA: vfile TYPE string.
    SELECTION-SCREEN *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
    PARAMETERS:p_mblnr TYPE mkpf-mblnr OBLIGATORY MATCHCODE OBJECT zganesh,
    p_mjahr TYPE mkpf-mjahr OBLIGATORY MATCHCODE OBJECT zganesh1,
    p_zeile TYPE mseg-zeile OBLIGATORY MATCHCODE OBJECT zganesh2.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 10.
    PARAMETER:r_disp RADIOBUTTON GROUP g1 USER-COMMAND u1 DEFAULT 'X'.
    SELECTION-SCREEN:COMMENT 15(10) text-002 .
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 10.
    PARAMETERS: r_down RADIOBUTTON GROUP g1.
    SELECTION-SCREEN:COMMENT 15(10) text-003.
    *PARAMETERS: v_file LIKE rlgrap-filename .
    *SELECTION-SCREEN:COMMENT 70(50) text-005.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 10.
    PARAMETERS: r_print RADIOBUTTON GROUP g1 .
    SELECTION-SCREEN:COMMENT 15(10) text-004.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS: v_file LIKE rlgrap-filename MODIF ID g12.
    SELECTION-SCREEN END OF BLOCK b2.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR v_file.
    DATA : wlv_field_name LIKE dynpread-fieldname,
    wlv_file_name LIKE ibipparms-path.
    wlv_field_name = v_file.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    field_name = wlv_field_name
    IMPORTING
    file_name = wlv_file_name.
    IF sy-subrc EQ 0.
    vfile = wlv_file_name.
    v_file = wlv_file_name.
    ENDIF.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
    IF screen-name = 'V_FILE'.
    IF r_disp EQ 'X' OR r_print EQ 'X'.
    screen-input = 0.
    ELSE.
    screen-input = '1'.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    START-OF-SELECTION EVENT *
    START-OF-SELECTION.
    CALLING CONVERSION FUNCTION MODULE 'CONVERSION_EXIT_ALPHA_INPUT' *
    *Conversion function module for appending 00 befor MBLNR FIELD
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = p_mblnr
    IMPORTING
    output = p_mblnr.
    Call subroutine for fetching data from database
    PERFORM get_data.
    END-OF-SELECTION EVENT *
    END-OF-SELECTION.
    Call subroutine for calling and processing smartform
    PERFORM call_smartform.
    *& Form get_data
    Subroutine for fetching data from database
    FORM get_data .
    Fetching data from MKPF table with using parameters MBLNR and MJAHR
    SELECT SINGLE * FROM mkpf
    INTO i_mkpf
    WHERE mblnr = p_mblnr
    AND mjahr = p_mjahr.
    IF sy-subrc EQ 0.
    Fetching data from MSEG with using parameters MBLNR,ZEILE and MJAHR
    SELECT SINGLE * FROM mseg
    INTO i_mseg
    WHERE mblnr = i_mkpf-mblnr
    AND mjahr = i_mkpf-mjahr
    AND zeile = p_zeile.
    IF sy-subrc NE 0.
    CLEAR i_mseg.
    ENDIF.
    ELSE.
    MESSAGE i000.
    EXIT.
    ENDIF.
    ENDFORM. " get_data
    *& Form call_smartform
    Subroutine for calling smartform
    FORM call_smartform .
    Local template used in the processing output of smartform
    TYPES: BEGIN OF lt_ztable,
    mandt TYPE sy-mandt,
    mblnr TYPE mseg-mblnr,
    flag(1) TYPE c,
    END OF lt_ztable.
    CONSTANTS: c_x(1) TYPE c VALUE 'X'.
    Workarea
    DATA: lw_ztable TYPE lt_ztable.
    *Variable used in the smartform
    DATA: lv_form(30) TYPE c,
    lv_fm_name(30) TYPE c.
    lv_form = 'ZPTPFRM202L_POGR'.
    *Calling function module SSF_FUNCTION_MODULE_NAME which gives new name
    *to the function module that will generated by smartform.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = lv_form
    IMPORTING
    fm_name = lv_fm_name
    EXCEPTIONS
    no_form = 1
    no_function_module = 2
    OTHERS = 3.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    *Calling function module that will be generated by smartform
    IF r_disp = c_x.
    i_output_options-tdimmed = space.
    i_output_options-tdnewid = c_x.
    i_output_options-tddest = 'LOCL'.
    i_control-no_dialog = 'X'.
    i_control-preview = 'X'.
    ELSEIF r_print = c_x.
    i_output_options-tdimmed = c_x.
    i_output_options-tddest = 'LOCL'.
    i_control-no_dialog = c_x.
    ELSE.
    i_output_options-tdimmed = space.
    i_output_options-tdnewid = c_x.
    i_output_options-tddest = 'LOCL'.
    i_control-getotf = 'X'.
    i_control-preview = space.
    i_control-no_dialog = c_x.
    flag = c_x.
    ENDIF.
    CALL FUNCTION lv_fm_name
    EXPORTING
    control_parameters = i_control
    output_options = i_output_options
    user_settings = space
    zmkpf = i_mkpf
    zmseg = i_mseg
    IMPORTING
    document_output_info = zdoc_output_info
    job_output_info = zjob_output_info
    job_output_options = zjob_output_opts
    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.
    Modify the database table if it found the print command
    IF zjob_output_opts-tdpreview NE c_x.
    lw_ztable-mandt = sy-mandt.
    lw_ztable-mblnr = p_mblnr.
    lw_ztable-flag = c_x.
    MODIFY zgr_table FROM lw_ztable.
    CLEAR lw_ztable.
    ENDIF.
    IF flag EQ c_x.
    DATA: li_lines LIKE tline OCCURS 100 WITH HEADER LINE.
    DATA: lv_file TYPE string,
    lbin_fsiz TYPE i.
    lv_file = v_file.
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    format = 'PDF'
    IMPORTING
    bin_filesize = lbin_fsiz
    TABLES
    otf = zjob_output_info-otfdata
    lines = li_lines
    EXCEPTIONS
    err_max_linewidth = 1
    err_format = 2
    err_conv_not_possible = 3
    err_bad_otf = 4
    OTHERS = 5.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    bin_filesize = lbin_fsiz
    filename = lv_file
    filetype = 'BIN'
    TABLES
    data_tab = li_lines
    EXCEPTIONS
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3
    invalid_type = 4
    no_authority = 5
    unknown_error = 6
    header_not_allowed = 7
    separator_not_allowed = 8
    filesize_not_allowed = 9
    header_too_long = 10
    dp_error_create = 11
    dp_error_send = 12
    dp_error_write = 13
    unknown_dp_error = 14
    access_denied = 15
    dp_out_of_memory = 16
    disk_full = 17
    dp_timeout = 18
    file_not_found = 19
    dataprovider_exception = 20
    control_flush_error = 21
    OTHERS = 22.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDIF.
    ENDFORM. " call_smartform
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • How to send multiple attachements in single mail

    Hi All,
    Currently i am using this function module SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail with only one attachment.
    But now i need to send multiple attachments to a single mail.
    Can any one please tell me as how to send multiple attachments in single mail.
    Thanks in advance.

    Hi
    See this and do accordingly
    Mailing with Attachment by ABAP Coding  
    Refer this link:
    Mail with attachment.
    FORM send_list_to_basis .
      DATA: w_path      LIKE rlgrap OCCURS 0 WITH HEADER LINE,
            lt_index    TYPE sy-tabix,
            doc_type(3) TYPE c,
            descr       LIKE it_objpack_basis-obj_descr,
            temp_data   LIKE w_path,
            temp1       TYPE string,
            tab_lines   TYPE i,
            langu(15)   TYPE c,
            expirydate  TYPE so_obj_edt,
            L_FILE1(100).
      CONCATENATE 'C:\' sy-repid '_' sy-datum '.XLS' INTO L_FILE1.
      W_PATH-FILENAME = L_FILE1.
      APPEND w_path.
      CLEAR w_path.
      wa_doc_chng-obj_descr  = 'User List not logged on for 180 days'.
      wa_doc_chng-obj_langu  = 'E'.
      wa_doc_chng-obj_expdat = sy-datum.
      CLEAR w_subject.
      CONCATENATE 'Please find attached document with list of users'
                  'not logged on for 180 days for client' sy-mandt
                  INTO w_subject SEPARATED BY space.
      it_objtxt_basis-line = w_subject.
      APPEND it_objtxt_basis.
      CLEAR it_objtxt_basis.
      it_objtxt_basis-line = text-004.
      APPEND it_objtxt_basis.
      CLEAR it_objtxt_basis.
      CLEAR w_tab_line.
      DESCRIBE TABLE it_objtxt_basis LINES w_tab_line.
      READ TABLE it_objtxt_basis INDEX w_tab_line  INTO l_cline.
      wa_doc_chng-doc_size =
       ( w_tab_line - 1 ) * 255 + STRLEN( l_cline ).
      CLEAR it_objpack_basis-transf_bin.
      it_objpack_basis-head_start = 1.
      it_objpack_basis-head_num   = 0.
      it_objpack_basis-body_start = 1.
      it_objpack_basis-body_num   = w_tab_line.
      it_objpack_basis-doc_type   = 'RAW'.
      APPEND it_objpack_basis.
      CLEAR it_objpack_basis.
      LOOP AT w_path.
        temp1 = w_path.
        descr = w_path.
        CALL FUNCTION 'STRING_REVERSE'
          EXPORTING
            string  = descr
            lang    = 'E'
          IMPORTING
            rstring = descr.
        CALL FUNCTION 'STRING_SPLIT'
          EXPORTING
            delimiter = '\'
            string    = descr
          IMPORTING
            head      = descr
            tail      = temp_data.
        CALL FUNCTION 'STRING_REVERSE'
          EXPORTING
            string  = descr
            lang    = 'E'
          IMPORTING
            rstring = descr.
        CALL FUNCTION 'STRING_SPLIT'
          EXPORTING
            delimiter = '.'
            string    = descr
          IMPORTING
            head      = temp_data
            tail      = doc_type.
        CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            filename      = temp1
            filetype      = 'BIN'
            header_length = 0
            read_by_line  = 'X'
            replacement   = '#'
          TABLES
            data_tab      = it_upload.
        DESCRIBE TABLE it_upload LINES tab_lines.
        DESCRIBE TABLE it_objbin_basis LINES lt_index.
        lt_index = lt_index + 1.
        LOOP AT it_upload.
          wa_objbin_basis-line = it_upload-line.
          APPEND wa_objbin_basis TO it_objbin_basis.
          CLEAR wa_objbin_basis.
        ENDLOOP.
        it_objpack_basis-transf_bin = 'X'.
        it_objpack_basis-head_start = 0.
        it_objpack_basis-head_num   = 0.
        it_objpack_basis-body_start = lt_index.
        it_objpack_basis-body_num   = tab_lines.
        it_objpack_basis-doc_type   = doc_type.
        it_objpack_basis-obj_descr  = descr.
        it_objpack_basis-doc_size   = tab_lines * 255.
        APPEND it_objpack_basis.
        CLEAR it_objpack_basis.
      ENDLOOP.
      it_reclist_basis-receiver = '[email protected]'.
      it_reclist_basis-rec_type = 'U'.
      APPEND it_reclist_basis.
      CLEAR it_reclist_basis.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = wa_doc_chng
          put_in_outbox              = 'X'
          commit_work                = 'X'
        TABLES
          packing_list               = it_objpack_basis
          contents_txt               = it_objtxt_basis
          contents_bin               = it_objbin_basis
          receivers                  = it_reclist_basis
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          OTHERS                     = 99.
      IF sy-subrc EQ 0.
        SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
      ENDIF.
    ENDFORM.                    " send_list_to_basis
    <b>Reward points for useful Answers</b>
    Regards
    Anji

Maybe you are looking for

  • Mini Bridge thumb nail size error

    I keep the scroll bar on the bottom of the mini bridge all the way to the left. This should show the smallest thunbnails. However when I first start the mini bridge the thumb nail size is medium sized. If I move the scroll bar toward the center, the

  • Re: How long to repair before I can cancel?

    I reported a fault firstly on one of my landlines on the 4th August. I returned home from holiday then to find my Alarm was faulting and there was no signal on the phone whatsoever. I phoned to report the fault and they said it would take 4 days to r

  • Finder Font... Can it be changed?

    I have a user with a reading disability. He can read some fonts better than others. With OS9 and before the Finder font could be changed as well as the size. Every since OSX we have not been able to change the font in the finder. Some applications ch

  • Curve 8520

    My Curve 8520 is stuck and continues to reboot. I keep getting this message when it verifies the security: "Uncaught Exception: Index 19>=19" then the screen goes completely blank and then a white screen pops up and says "App Error 523"  Can someone

  • Shopping Cart Reports - SRM Reporting

    Hello, is there a badi or an enhancement spot to manipulate the following queries (selection criteria and result): /SAPSRM/SRM_SC_I_01 and /SAPSRM/SRM_SC_H_01 Thanks for your help