How to send fax thru sap system

Hi all,
I need to send a fax thru sap system. In the given parameter I need to give email address & fax number. The result is the content I shud receive as both email & fax.
As far as email is concerned no problem. But I am not receiving the content fax. I am getting the following error as email. Pls find below the error message.
Your message did not reach some or all of the intended recipients.
      Subject:     000000002008
      Sent:     4/5/2007 11:47 AM
The following recipient(s) could not be reached:
      FAX3D2B918041396976@75 on 4/6/2007 2:31 AM
            The e-mail account does not exist at the organization this message was sent to.  Check the e-mail address, or contact the recipient directly to find out the correct address.The MTS-ID of the original message is:ADR32000000006890
< sap.corp #5.1.1 SMTP; 553 <FAX=+918041396976@75>... only FQDN names will be accepted>
The fax number I typed is +918041396976 but the system itself is adding @75 behind it. I am not getting the fax message.
Can anyone help me in this regard.
Thanks in advance.
Vijay.

Hi Vijay,
The fax nio. parameter can be handled thru the program. I mean remove those extra characters... and try this code below for ref (its from sap-img.com)
The following program shows you how to send a fax from within ABAP/4. The report is delivered
in the standard system and is used in Transaction SCOM for the function "Send test fax".
Only the method via the call of SAPscript with DEVICE='TELEFAX', described below, ensures the
generation of a correct transmission request, independent of the R/3 release and of the used
fax server solution and its configuration.
The regular printing (for example, with NEW-PAGE PRINT ON...) on an output device created in
the spool administration of the device class 'Telefax' does generally not work!
REPORT RSKSENDF MESSAGE-ID SK.
Test report to send a test fax
sends a fax to the number <TO_CNTRY>-<TO_NMBER>
containing an automatically generated message text.
TABLES: USR03.
PARAMETERS: TO_CNTRY LIKE T005-LAND1 OBLIGATORY,
TO_NMBER LIKE TSP01-RQTELENUM OBLIGATORY,
FROM_USR(30) TYPE C DEFAULT SY-UNAME,
TO_RECIP(30) TYPE C DEFAULT SY-UNAME.
SAPscript content ITAB
DATA: BEGIN OF TEST_DOC OCCURS 10.
INCLUDE STRUCTURE TLINE.
DATA: END OF TEST_DOC.
SAPscript header struct
DATA BEGIN OF HEADER.
INCLUDE STRUCTURE THEAD.
DATA END OF HEADER.
INITIALIZATION.
get county from user addres in usr03
system->user profile->user address
check if not empty
SELECT SINGLE * FROM USR03 WHERE BNAME = SY-UNAME.
IF SY-SUBRC = 0 AND USR03-LAND1 <> SPACE.
TO_CNTRY = USR03-LAND1.
ENDIF.
START-OF-SELECTION.
PERFORM FILL_UP_TEST_DOC.
PERFORM SHOW_TEST_DOC.
AT PF08.
PERFORM SEND_FAX TABLES TEST_DOC USING TO_CNTRY
TO_NMBER.
AT SELECTION-SCREEN ON TO_NMBER.
PERFORM CHECK_NUMBER USING TO_CNTRY TO_NMBER.
*& Form CHECK_NUMBER
FORM CHECK_NUMBER USING
COUNTRY
NUMBER.
DATA: SERVICE LIKE TSKPA-SERVICE VALUE 'TELEFAX',
LEN LIKE SY-FDPOS.
FIELD-SYMBOLS <P>.
windows GUI push the ? from mandatory input instead
of overwriting it
LEN = STRLEN( TO_NMBER ).
IF LEN > 1.
SUBTRACT 1 FROM LEN.
ASSIGN TO_NMBER+LEN(1) TO <P>.
IF <P> = '?'.
<P> = SPACE.
ENDIF.
ENDIF.
official check FM
CALL FUNCTION 'TELECOMMUNICATION_NUMBER_CHECK'
EXPORTING
COUNTRY = COUNTRY
NUMBER = NUMBER
SERVICE = SERVICE.
on old 21?/22? release you may have to handle the
exception
because the Function uses RAISE instead of
MESSAGE... RAISING....
ENDFORM. " CHECK_NUMBER
*& Form FILL_UP_TEST_DOC
fills test text in itab TEST_DOC *
real life example needs to get real life data *
FORM FILL_UP_TEST_DOC.
DATA: DATUM(12) TYPE C,
UZEIT(10) TYPE C.
SAPscript initialization
of course, you may want to set a few parameter
(FORM,LAYOUT,....)
CALL FUNCTION 'INIT_TEXT'
EXPORTING
ID = 'ST '
LANGUAGE = SY-LANGU
NAME = 'FOO-BAR'
OBJECT = 'TEXT'
IMPORTING
HEADER = HEADER
TABLES
LINES = TEST_DOC
EXCEPTIONS
OTHERS = 1.
IF SY-SUBRC <> 0.
MESSAGE A400 WITH 'INIT_TEXT'.
ENDIF.
PERFORM ADD_EMPTY_LINE.
WRITE: SY-DATUM TO DATUM.
WRITE: SY-UZEIT TO UZEIT.
PERFORM ADD_LINES USING 'This is test Telefax'(001)
DATUM UZEIT.
PERFORM ADD_EMPTY_LINE.
PERFORM ADD_LINES USING 'From: &'(002) FROM_USR SPACE.
PERFORM ADD_LINES USING 'To: &'(003) TO_RECIP SPACE.
PERFORM ADD_LINES USING 'Fax number: & &'(004)
TO_CNTRY TO_NMBER.
PERFORM ADD_EMPTY_LINE.
PERFORM ADD_LINES USING
'This is a test fax send by Report RSKSENDF'(005)
SPACE SPACE.
PERFORM ADD_LINES USING 'on SAP system & '(006)
SY-SYSID SPACE.
PERFORM ADD_EMPTY_LINE.
PERFORM ADD_LINES USING
'the quick brown fox jumps over the lazy dog.'(101)
SPACE SAPCE.
PERFORM ADD_LINES USING
'THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.'(102)
SPACE SAPCE.
PERFORM ADD_EMPTY_LINE.
PERFORM ADD_LINES USING 'End of test'(007) SPACE
SPACE.
ENDFORM. " FILL_UP_TEST_DOC
*& Form ADD_LINES
printf a line an appends it in test_doc *
--> cformat format.
--> p1 param1
--> p2 param2
FORM ADD_LINES USING CFORMAT P1 P2.
TEST_DOC-TDFORMAT = '/'.
TEST_DOC-TDLINE = CFORMAT.
IF TEST_DOC-TDLINE CA '&'.
REPLACE '&' WITH P1 INTO TEST_DOC-TDLINE.
IF TEST_DOC-TDLINE CA '&'.
REPLACE '&' WITH P2 INTO TEST_DOC-TDLINE.
ENDIF.
ENDIF.
APPEND TEST_DOC.
ENDFORM. " ADD_LINES
*& Form ADD_EMPTY_LINE
appends an empty line to test_doc *
FORM ADD_EMPTY_LINE.
TEST_DOC-TDFORMAT = '/'.
CLEAR TEST_DOC-TDLINE.
APPEND TEST_DOC.
ENDFORM. " ADD_EMPTY_LINE
*& Form SHOW_TEST_DOC
lists the test doc for aproval *
*>>>> this is for fun only because PRINT_TEXT also
offers a preview *
FORM SHOW_TEST_DOC.
FORMAT COLOR COL_BACKGROUND INTENSIFIED OFF.
WRITE: / 'Test fax would look like this:'(020).
ULINE.
SKIP.
LOOP AT TEST_DOC.
IF TEST_DOC-TDLINE <> SPACE.
WRITE:/ TEST_DOC-TDLINE.
ELSE.
SKIP.
ENDIF.
ENDLOOP.
SKIP.
ULINE.
FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.
WRITE: 'Press PF8 to send it'(021).
ENDFORM. " SHOW_TEST_DOC
*& Form SEND_FAX
send fax by calling SAPscript *
Note: Instead of using PRINT_TEXT you may also *
call OPEN_FORM / WRITE_FORM_LINES / CLOSE_FORM, *
this allows you to use a similar program structure *
as with NEW-PAGE PRINT ON / WRITE / NEW-PAGE PRINT
OFF *
FORM SEND_FAX
TABLES DOC2FAX STRUCTURE TEST_DOC
USING COUNTRY
NUMBER.
DATA: SID(5) TYPE N.
DATA BEGIN OF POPT.
INCLUDE STRUCTURE ITCPO.
DATA END OF POPT.
DATA BEGIN OF PRES.
INCLUDE STRUCTURE ITCPP.
DATA END OF PRES.
CLEAR POPT.
POPT-TDCOPIES = 1. " one copy
POPT-TDDEST = " done internaly by script,
POPT-TDPRINTER = " do not fill !!!
POPT-TDNEWID = 'X'. " do not reuse old spool request
POPT-TDDATASET = 'TEST'(022). " fill as you want
POPT-TDSUFFIX1 = 'FAX'(023). " fill as you want
POPT-TDSUFFIX2 = SY-UNAME. " fill as you want
POPT-TDIMMED = 'X'. " send now
POPT-TDLIFETIME = 8. " keep 8 days in spool
POPT-TDTELENUM = NUMBER. " number without country code
POPT-TDTELELAND = COUNTRY. " country of recipient
POPT-TDCOVER = 'test fax'(024).
POPT-TDCOVTITLE = 'test fax'(024).
POPT-TDIEXIT = 'X'.
CALL FUNCTION 'PRINT_TEXT'
EXPORTING
APPLICATION = 'TX'
ARCHIVE_INDEX = ' '
ARCHIVE_PARAMS = ' '
DEVICE = 'TELEFAX' "<<< here we say: fax it !
DIALOG = 'X'
HEADER = HEADER
OPTIONS = POPT
IMPORTING
RESULT = PRES
TABLES
LINES = DOC2FAX
EXCEPTIONS
OTHERS = 01.
do not bother with exception in sample code
CANCELED = 01
DEVICE = 02
FORM = 03
OPTIONS = 04
UNCLOSED = 05
UNKNOWN = 06
FORMAT = 07
TEXTFORMAT = 08
EXTERNAL = 09.
IF SY-SUBRC = 0.
arriving here means we could send:
SID = PRES-TDSPOOLID.
IF SID > '00000'.
MESSAGE S433 WITH SID.
ENDIF.
LEAVE .
ELSE.
do not bother with exception in sample code
MESSAGE A400 WITH 'PRIN_TEXT'.
ENDIF.
ENDFORM. " SEND_FAX

Similar Messages

  • 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.

  • Send mail from SAP system to another SAP system

    Hello Xperts
    I need to send a mail from one SAP box (ECC) to another SAP box (SRM,CRM, EP etc). I know how to send mail from SAP to external address but unable to find the parameters in this case. Kindly help.
    thkx
    Prabhu
    PS: Kindly DONOT post on "How to send mail from SAP" as my questions is all abt how to send mail from one sap system to another sap system

    Hi
    To send mail Internally check this sample code it works fine this code was developed by me
    *& Report  ZMATURITYREPORT                                             *
    *&   Title - Maturity   report                                         *
    *&           ABAP/4 Consultant                                         *
    *& Name- Pavan Praveen Valluri Created on 26/07/2007                   *
    *& Module - FI                                                         *
    REPORT  ZMATURITYREPORT.
    tables: bseg.
    * SELECTION SCREEN---------------------------------------------------  *
    parameters: p_email type somlreci1-receiver default
    '@gujaratpetro.com'.
    * Data: p_email(25) type c value '[email protected]'.
    * END OF SELECTION SCREEN -------------------------------------------  *
    *----------DATA DECLARATION--------------------------------------------*
    data: it_message type standard table of solisti1 initial size 0
    with header line.
    data: it_message1 type standard table of solisti1 initial size 0
    with header line.
    data: it_message2(10) type N.
    data: it_message3 type standard table of solisti1 initial size 0
    with header line.
    data: it_message4 type standard table of solisti1 initial size 0
    with header line.
    data: it_attach type standard table of solisti1 initial size 0
    with header line.
    data: text(150).
    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,
          gd_error type sy-subrc,
          gd_reciever type sy-subrc.
    start-of-selection.
    data: lv_date type sy-datum.
    data: lv_date1 type sy-datum.
    data: lv_formatdate(10) type c.
    data: lv_formatdate1(10) type c.
    data: var1(4) type c,
    var2(2) type c,
    var3(2) type c.
    data: begin of int_bseg occurs 0,
        BELNR LIKE BSEG-BELNR,
        ZUONR LIKE BSEG-ZUONR,
        GJAHR LIKE BSEG-GJAHR,
        DMBTR LIKE BSEG-DMBTR,
        HKONT LIKE BSEG-HKONT,
    end of int_bseg.
    data: begin of int_SKAT occurs 0,
        TXT50 LIKE SKAT-TXT50,
        SAKNR LIKE SKAT-SAKNR,
        KTOPL LIKE SKAT-KTOPL,
    end of int_SKAT.
    data: begin of int_bkpf occurs 0,
          BELNR LIKE BKPF-BELNR,
          BUKRS LIKE BKPF-BUKRS,
          GJAHR LIKE BKPF-GJAHR,
          BUDAT  LIKE BKPF-BUDAT,
    end of int_BKPF.
    data: 2days_out type sy-datum.
    2days_out = sy-datum + 2.
    data: var4(4) type c,
    var5(2) type c,
    var6(2) type c.
    *-------- END OF DATA DECLARATION--------------------------------------*
    *--- CONCATENATING AND ARRANGING DATE ---------------------------------*
    lv_date = 2days_out.
    var1 = lv_date+(4).
    var2 = lv_date+4(2).
    var3 = lv_date+6(2).
    concatenate var3 var2 var1 into lv_formatdate separated by '.'.
    *--- END OF CONCATENATING AND ARRANGING DATE  -------------------------*
    *-------------------------SELECTION FOR BSEG---------------------------*
    select zuonr belnr bukrs GJAHR DMBTR HKONT from bseg into
    corresponding fields of  table int_bseg
    where bukrs = 'company name' and
          ZUONR = lv_formatdate.
    *--------------END OF SSELECTION FOR BSEG---------------------------   *
    *-------------------------SELECTION FOR BKPF---------------------------*
    select  BUDAT BUKRS BELNR GJAHR  from BKPF into
    corresponding fields of table int_BKPF
    where bukrs = 'company name'.
    append int_BKPF.
    *------------------END OF SELECTION FOR BKPF---------------------------*
    *-------------------------SELECTION FOR SKAT---------------------------*
    select SAKNR TXT50 from SKAT into
    corresponding fields of  table int_SKAT
    where KTOPL = 'company name'.
    *and      SAKNR = INT_BSEG-HKONT.
    APPEND INT_SKAT.
    *--------------END OF SSELECTION FOR SKAT---------------------------   *
    *-----------------POPULATING EMAIL SUBJECT ----------------------------*
    perform populate_email_message_body.
      perform send_file_as_email_attachment
      tables it_message
      it_attach
      using p_email
      'Maturity after 2 days'
      'XLS'
      'filename'
      changing gd_error
      gd_reciever.
    * Instructs mail send program for SAPCONNECT to send email(rsconn01)
      perform initiate_mail_execute_program.
    *endif.
    end-of-selection.
    *------------END OF POPULATING EMAIL SUBJECT --------------------------*
    *& Form SEND_FILE_AS_EMAIL_ATTACHMENT
    * Send email
    form send_file_as_email_attachment tables pit_message
    pit_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.
      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[] = pit_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.
    * 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
          object_header              = t_object_header
          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.                    "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.
      if gd_error eq 0.
        submit rsconn01 with mode = 'INT'
                      with output = 'X'
                      and return.
      endif.
    endform.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    *& Form POPULATE_EMAIL_MESSAGE_BODY
    * Populate message body text
    form populate_email_message_body.
      refresh it_message.
      refresh it_message1.
      refresh it_message3.
       refresh it_message4.
    *--------------- LOOP FOR BSEG -----------------------------------------
      loop at int_BSEG.
    read table int_bKPF WITH KEY BELNR = INT_BSEG-BELNR
            GJAHR = INT_BSEG-GJAHR.
    read table int_SKAT WITH KEY SAKNR = INT_BSEG-HKONT.
    *---CHANGING DATE FORMAT FOR BKPF---------------------------------------
    lv_date1 = int_bkpf-budat.
      var4 = lv_date1+(4).
      var5 = lv_date1+4(2).
      var6 = lv_date1+6(2).
    concatenate var6 var5 var4 into lv_formatdate1 separated by '.'.
    *---END OF CHANGING DATE FORMAT FOR BKPF-------------------------
    it_message =  int_bseg-belnr.
    it_message1 =  lv_formatdate1.
    it_message2 = int_bseg-dmbtr.
    it_message3 = int_bseg-hkont.
    IT_MESSAGE4 = INT_SKAT-TXT50.
    SHIFT IT_MESSAGE2 LEFT DELETING LEADING '0'.
    *-------------POPULATING EMAIL BODY WITH DATA -------------------------
    concatenate 'Maturity After 2Days' 'for'  'G/L account-' it_message3
    '--' IT_MESSAGE4  ',' 'Amount-' it_message2
        into it_message separated by space.
    append it_message.
    append it_message1.
    append it_message3.
      clear it_message.
      clear it_message1.
      clear it_message2.
      clear it_message3.
    endloop.
    *------------END OF LOOP FOR BSEG --------------------------------------
    endform. " POPULATE_EMAIL_MESSAGE_BODY
    <b><i>
    To send an mail with external attachment check this one
    </b></i>
    <i>first create a Include report with the following coding</i>
    *& Include ZPA1_INCLFOR_MAIL *
    * 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
    <b>
    Then include that report in the following report and copy the same code and paste it there
    </b>
    *& Report ZPA_TEMP147 *
    REPORT ZPA_TEMP147 .
    INCLUDE zpa1_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
    <b>These are the FM for sending external email :-</b>
    SO_DOCUMENT_SEND_API1
    SAPoffice: Send new document with attachments via RFC
    SO_NEW_DOCUMENT_ATT_SEND_API1
    (In 4.6C only, You can go to SE37 and click the documentation on how to use it. A sample program is provided there.)
    SAPoffice: Send new document with attachments via RFC
    Note : If you are using FM SO_NEW_DOCUMENT_ATT_SEND_API1 then Export Parameter DOCUMENT_DATA-OBJ_DESCR contains the Subject.
    SO_NEW_DOCUMENT_SEND_API1
    SAPoffice: Send new document
    <b>Check this sample report</b>
    DATA : BEGIN OF ITAB OCCURS 0,
    PERNR LIKE PA0001-PERNR,
    ENAME LIKE PA0001-ENAME,
    END OF ITAB.
    DATA: message_content LIKE soli OCCURS 10 WITH HEADER LINE,
    receiver_list LIKE soos1 OCCURS 5 WITH HEADER LINE,
    packing_list LIKE soxpl OCCURS 2 WITH HEADER LINE,
    listobject LIKE abaplist OCCURS 10,
    compressed_attachment LIKE soli OCCURS 100 WITH HEADER LINE,
    w_object_hd_change LIKE sood1,
    compressed_size LIKE sy-index.
    START-OF-SELECTION.
    SELECT PERNR ENAME
    INTO CORRESPONDING FIELDS OF TABLE ITAB
    FROM PA0001
    WHERE PERNR < 50.
    LOOP AT ITAB.
    WRITE :/02 SY-VLINE , ITAB-PERNR, 15 SY-VLINE , ITAB-ENAME, 50
    SY-VLINE.
    ENDLOOP.
    * Receivers
    receiver_list-recextnam = '[email protected]'. "-->
    * EMAIL ADDRESS
    RECEIVER_list-RECESC = 'E'. "<-
    RECEIVER_list-SNDART = 'INT'."<-
    RECEIVER_list-SNDPRI = '1'."<-
    APPEND receiver_list.
    * General data
    w_object_hd_change-objla = sy-langu.
    w_object_hd_change-objnam = 'Object name'.
    w_object_hd_change-objsns = 'P'.
    * Mail subject
    w_object_hd_change-objdes = 'Message subject'.
    * Mail body
    APPEND 'Message content' TO message_content.
    * Attachment
    CALL FUNCTION 'SAVE_LIST'
    EXPORTING
    list_index = '0'
    TABLES
    listobject = listobject.
    CALL FUNCTION 'TABLE_COMPRESS'
    IMPORTING
    compressed_size = compressed_size
    TABLES
    in = listobject
    out = compressed_attachment.
    DESCRIBE TABLE compressed_attachment.
    CLEAR packing_list.
    packing_list-transf_bin = 'X'.
    packing_list-head_start = 0.
    packing_list-head_num = 0.
    packing_list-body_start = 1.
    packing_list-body_num = sy-tfill.
    packing_list-objtp = 'ALI'.
    packing_list-objnam = 'Object name'.
    packing_list-objdes = 'Attachment description'.
    packing_list-objlen = compressed_size.
    APPEND packing_list.
    CALL FUNCTION 'SO_OBJECT_SEND'
    EXPORTING
    object_hd_change = w_object_hd_change
    object_type = 'RAW'
    owner = sy-uname
    TABLES
    objcont = message_content
    receivers = receiver_list
    packing_list = packing_list
    att_cont = compressed_attachment.
    <b>Settings for sending mail</b>
    Configuring SAP 4.6x Internet mail Gateway
    SAP can be configured to send and receive emails from different sources.This section explains how to integrate SAPOffice with an external emailsystem. Your Internet email must be configured and running prior to this.Email from SAP is forwarded to the users external email system..
    You can configure inbound and outbound forwarding. Outbound flow forwardsa SAP message (eg: update termination) via UNIX sendmail to the intended recepient. Inbound accepts a message from sendmail and places it in the users SAPOffice inbox. Many companies prefer to configure outbound only.
    Configuring outbound forwarding
    SAP configuration
    1. Create your RFC destination for outbound email using transaction SM59
    RFC Destination : SAP_INTERNET_GATEWAY
    Connection Type : T
    Description : SAP internet mail gateway
    Click on 'Explicit Host' if you wanton demand gateway dameon invocation.
    Program : /sapmnt/SID/exe/mlunxsnd
    Target Host : Enter hostname that runs your central instance.
    Click 'Test Connection' and you should seea successfull message.
    2. Shared Office Settings transaction SO16-> Send -> Settings or
    directly via transaction SCOT- SAPconnect Administation
    Nodes - Create
    Node : IMAIL
    Description : SAP internet mail gateway
    RFC Destination : SAP_INTERNET_GATEWAY
    Tick : Internet
    Address Area : *
    Tick : All formats
    Dev. type : Choose an approciate Printer Device
    Set further addresstype : N
    Maximum waiting timefor repeat send attempt procedure : Blank or decide for yourself
    Tick : Node is ready for use
    Setting
    - DefaultDomain : <your company domain>.com
    - Conversionrule : require if your communication device only support one format.
    e.g. if you email system only support the format RAW (ASCII text format)
    Format To Format Ranking Function module
    ALI RAW 1 SX_OBJECT_CONVERT_ALI_RAW (convert APAP List)
    Referto note 171698 - SAPconnect: Formats, conversion, device type
    UNIX configuration
    1 .. cd /sapmnt/SID/exe
    2 ..csh
    ..mlsomadm mailgw.ini
    System Name [C11] :
    Client [000] :
    Username : MAILADM
    Password : MAILADM
    Language : E
    Load Balancing :
    Hostname : <hostname>
    System number : <instance_number>
    Gateway hostname: <central_instance_hostname>
    Gateway Service : <instance number>
    Use SAP Router :
    Trace level :
    Sendmail Command [/usr/lib/sendmail -i -f<SENDER_ADDRESS>]:
    Codepage [ISO-8859-1] :
    Trace Level (Outbound) [0] :
    Update file sapmailsid.cfg? [Y]
    Testing whether your configuration is successful
    1. Logon to SAP
    2. Execute transaction SO01
    3. Write a message and send it to <your_internet_email_address>
    4. If you don't see the mail in your internet mailbox, go back and review steps 1-12
    Schedule the SAP Internet Mail Gateway Jobs to start every 5 minutes
    1. Create
    2. Position your cursor at INT
    3. Click Schedule and supply the date and time
    4. Click Schedule periodically and tick Minutes and type in 5
    5. Click Create and you are done
    6. Click Show Scheduling to check
    Problems that you might encounter :-
    If you have set up a node in SCOT and it tests out well but recieve the reply.
    "Cannot process message in node, parameterscannot be converted".
    Make sure the RFC connection is working, and that SapConnect has been installed on the Unix Server or the Microsoft Exchange Server. Originally, I had the same error, and found that nothing had been installed on Unixor Exchange, to support SapConnect.
    In SCOT (View -> System Status), your mail remains at the Intransit column.
    Check you sendmail.cf files (e.g.Sun Solaris /etc/mail/sendmail.cf). Try using the sendmail command to send a test file at the Unix level. You must be able to send mail at theUnix level before you can send mail at the SAP level.
    http://help.sap.com/saphelp_nw04/helpdata/en/cf/700b405bacdd5fe10000000a155106/content.htm
    http://www.tamboly.com/SAPEmailConfiguration.html
    Check my previous links
    Mail Send
    sending mails from abap program
    Mail Sending to external email id's
    settings needed for sending emails
    Regards
    Pavan

  • 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!

  • 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

  • How to send FAX using java. (JTAPI)

    Can anybody suggest how to send FAX in Java. I've heard bout JTAPI's. but never tried it. and the sample code given is good for nothing. I want to send (not receive) FAX from my java application (Ive already tried javax.comm package, for that u need third party FAX server)
    Or is ther any other way of sending FAX except JTAPI?
    Pls comment on this.
    thanx in advance
    Ketan Malekar
    [email protected]

    To cse.mahbub:
    Are you aware that you replied to a 5 1/2 year old question?
    Please don't do that. Reply only to current questions.

  • 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 send SMS thru SMPP from PL/SQL

    How to send SMS thru SMPP from PL/SQl or forms application. SMPP interface setuped in the SMSC. Requirement is send to SMS's to custoemrs thru our forms application.

    How to send SMS thru SMPP from PL/SQl or forms application. SMPP interface setuped in the SMSC. Requirement is send to SMS's to custoemrs thru our forms application.

  • Sending emails from SAP system

    Hai everybody,
    for sending emails from SAP system , what are all the configuration we have to made & what are all the cheks we have to perform at BASIS level .
    Pl guide me.
    Ramesh

    Hi,
    Configurations need to be done with Tcode : SCOT
    and RFC need to be established using SM59.
    SO_NEW_DOCUMENT_ATT_SEND_API1 is the Function Module used for sending Emails from SAP System.
    The Email ID's are maintained in XK02 , XD02 For Vendors and Customers in the Basic Data.
    You need to write the code to fetch the ID's from the Vendor Master dataor customer master data based on the Vendor/Customer Numbers.
    You can always monitor the Emails in SOST.
    This is all you need to do.

  • How to send faxes and e-mails in ECC6 .0 ?

    We are trying to upgrade from 4.6c (hp-ux) to ECC 6.0 (hp-ux) .
    We are sending faxes via Winfax pro.
    In ECC 6.0 , transaction SPAD doesn't allow Telefax as a type of device.
    We are also sending e-mails through "SAP Internet mail Gateway" and MS-Exchange 2003.
    It seems the two solutions have been discontinued.
    How to setup fax & e-mail ?
    Winfax Pro is not supported now, so there it exist a SAP supported list of fax software ?
    Thank you.

    Hi,
    1. You have to Configure the Email connections through SCOT tcode.
    2. After that you ccan send/recive a mails from exchange server and SAP R/3 systems.
    Look into the following link.
    http://help.spa.com--> search for E-mail configuration and aslo search for FAX configuration.
    Regards,
    Srini Nookala

  • How to send mail to SAP inbox

    Hello,
      Could any body tell me how to attach a report output to a mail which need to be send to SAP Inbox.
    The report is ALV report. Is there any Function Module to do so.
    Regards,
    Satya

    email to SAP Inbox
    Send mail to User's SAP Inbox also
      RECLIST-RECEIVER = IT_ZMMTACCUID-ACCTUSRID.
      RECLIST-REC_TYPE = 'B'.
      APPEND RECLIST.
      CLEAR RECLIST.
    SEND THE DOCUMENT BY CALLING THE SAPOFFICE API1 MODULE FOR SENDING
    DOCUMENTS WITH ATTACHMENTS
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           EXPORTING
              DOCUMENT_DATA              = DOC_CHNG
              PUT_IN_OUTBOX              = 'X'
           IMPORTING
              SENT_TO_ALL                = SENT_TO_ALL
            NEW_OBJECT_ID              =
           TABLES
              PACKING_LIST               = OBJPACK
              OBJECT_HEADER              = OBJHEAD
              CONTENTS_BIN               = OBJBIN
              CONTENTS_TXT               = OBJTXT
              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.
    following options are available for field
    RECLIST-REC_TYPE
         Name
    P     Private distribution list
    C     Shared distribution list
         O     SAPoffice user
         B     SAP user
         U     Internet address
    X     X.400 address
    R     SAP user in another SAP System
    A     External address
         F     Fax number
         D     X.500 Address
         L     Telex number
    H     Organizational unit/position
    J     SAP object
    G     Organization object/ID
    Regards
    amole

  • Urgent : - Some Error in code while sending attachment thru SAP

    hiii,
    i have posted a problem in the following thread.
    How to send PDF file thru SAP
    at some extent Surpreet is able to solve  the problem, but now we r stuck to this that email is coming with attachment but not the exact that i am attching and trying to send the mail.
    can any one check this code and rectify if any error is there.
    REPORT YBALTEST.
    DATA: gd_cnt TYPE i,
    gd_sent_all(1) TYPE c,
    gd_doc_data LIKE sodocchgi1,
    gd_error TYPE sy-subrc.
    DATA: it_message LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    it_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
    it_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    it_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
    it_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    * Binary store for PDF
    DATA: BEGIN OF it_pdf_output OCCURS 0,
    row(255).
    DATA: END OF it_pdf_output.
    START-OF-SELECTION.
    perform send_email_message .
    *& Form SEND_EMAIL_MESSAGE
    * Send email message
    FORM send_email_message.
    DATA: tab_lines LIKE SY-TABIX.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = 'C:test.pdf'
    filetype = 'BIN'
    TABLES
    data_tab = it_pdf_output .
    * Populate the subject/generic message attributes
    concatenate 'Attached is the '
    ' are waiting for.' into it_message.
    append it_message.
    DESCRIBE TABLE it_message LINES tab_lines.
    READ TABLE it_message INDEX tab_lines.
    gd_doc_data-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( it_message ).
    gd_doc_data-obj_langu = sy-langu.
    gd_doc_data-obj_name = 'SENDFILE'.
    gd_doc_data-obj_descr = 'Attachement'.
    gd_doc_data-sensitivty = 'O'.
    describe table it_pdf_output lines tab_lines.
    * Describe the body of the message
    CLEAR it_packing_list-transf_bin.
    it_packing_list-head_start = 1.
    it_packing_list-head_num = 0.
    it_packing_list-body_start = 1.
    it_packing_list-doc_type = 'RAW'.
    it_packing_list-body_num = tab_lines.
    APPEND it_packing_list.
    describe table it_pdf_output lines tab_lines.
    CLEAR it_packing_list.
    it_packing_list-transf_bin = 'X'.
    it_packing_list-head_start = 1.
    it_packing_list-head_num = 1.
    it_packing_list-body_start = 1.
    it_packing_list-doc_type = 'RAW'.
    it_packing_list-body_num = tab_lines.
    it_packing_list-doc_size = tab_lines * 255.
    it_packing_list-OBJ_DESCR = ' object '.
    it_packing_list-obj_name = 'MAIL'.
    APPEND it_packing_list.
    it_receivers-receiver = '[email protected]'.
    it_receivers-rec_type = 'U'.
    it_receivers-com_type = 'INT'.
    APPEND it_receivers .
    * Call the FM to post the message to SAPMAIL
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = gd_doc_data
    * put_in_outbox = 'X'
    commit_work = 'X'
    * IMPORTING
    * sent_to_all = gd_sent_all
    TABLES
    packing_list = it_packing_list
    contents_txt = it_message
    contents_bin = it_pdf_output
    receivers = it_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.
    ENDFORM. " SEND_EMAIL_MESSAGE
    thanx
    abhishek suppal

    just unreadable
    like this
    €¥ä™„ã„ã˜®â”î¢íà¨ãˆ±ãŒ¸ã€ æ¼ æ©¢ã° â¼¼æ¥Œæ•®ç‰¡ç©©æ‘¥ã„ ä°¯ãŒ ã”²ã˜²â¼¶âãˆ±ãœ¸ä”¯ã ã¤·ã´ä¸¯ãˆ â¼¹â”ã¤²ã”¹ã€´ä ¯å¬ ã„ ã˜µâ€·ãˆ¹å´¶ã¸¾æ”æ‘®æ‰¯àµªâ€ â€ â€ â€ â€ à¨ç‰¸æ™¥à¨ãˆ±ãŒ¸ã˜ à´±ã€Šã€°ã€°ã€°ã„°â€¶ã€°ã€°â€°àµ®ã€Šã€°ã€°ãˆ°ã¤¶â€¹ã€°ã€°â€°àµ®ã€Šã€°ã€°ãˆ°ãŒ¸â€·ã€°ã€°â€°àµ®ã€Šã€°ã€°ãŒ°ãœ±â€³ã€°ã€°â€°àµ®ã€Šã€°ã€°ãŒ°ãŒ³â€²ã€°ã€°â€°àµ®ã€Šã€°ã€°ãŒ°ã µâ€°ã€°ã€°â€°àµ®ã€Šã€°ã€°ãŒ°ã„¶â€¸ã€°ã€°â€°àµ®ã€Šã€°ã€°ãŒ°ã€¸â€²ã€°ã€°â€°àµ®ã€Šã€°ã€°ãŒ°ã ¸â€°ã€°ã€°â€°àµ®ã€Šã€°ã€°ã˜°ã”µâ€±ã€°ã€°â€°àµ®ã€Šã€°ã€°ãˆ´ãµâ€¹ã€°ã€°â€°àµ®ã€Šã€°ã€°ãˆ´ãˆ¶â€²ã€°ã€°â€°àµ®ã€Šã€°ã€°ãˆ´ã€·â€³ã€°ã€°â€°àµ®ã€Šã€°ã€°ãˆ´ã˜¸â€¶ã€°ã€°â€°àµ®ã€Šã€°ã€°ãˆ´ãˆ¹â€°ã€°ã€°â€°àµ®ã€Šã€°ã€°ãŒ´ã °â€´ã€°ã€°â€°àµ®ã€Šã€°ã€°ãŒ´ãŒ±â€¸ã€°ã€°â€°àµ®ã€Šã€°ã€°ãŒ´ã³â€µã€°ã€°â€°àµ®ã€Šã€°ã€°ãŒ´ã„µâ€¸ã€°ã€°â€°àµ®
    《〰〰㌴㜵′〰〰‰൮《〰〰㌴㐷‸〰〰‰൮《〰〰㌴㐹‵〰〰‰൮《〰〰㐴〱‶〰〰‰൮《〰〰㐴㘱‰〰〰‰൮《〰〰㐴㌳‶〰〰‰൮《〰〰㐴㌴‹〰〰‰൮《〰〰㐴㤴′〰〰‰൮《〰〰㐴㤵‴〰〰‰൮《〰〰㐴㌶‶〰〰‰൮《〰〰㐴㘷‴〰〰‰൮《〰〰㐴ㄸ‸〰〰‰൮《〰〰㔴㈰‴〰〰‰൮《〰〰㔴㔲‰〰〰‰൮《〰〰㔴㠳‶〰〰‰൮《〰〰㔴㐴‰〰〰‰൮《〰〰㔴㜵‷〰〰‰൮《〰〰㔴㌶‱〰〰‰൮《〰〰㔴㠶‵〰〰‰൮《〰〰㔴㌷‹〰〰‰൮《〰〰㔴〹‷〰〰‰൮《〰〰㔴㘹‱〰〰‰൮《〰〰㘴〲‸〰〰‰൮《〰〰㘴㘲′〰〰‰൮《〰〰㘴〵‷〰〰‰൮《〰〰㘴㘵
    â€±ã€°ã€°â€°àµ®ã€Šã€°ã€°ã˜´ãŒ·â€¶ã€°ã€°â€°àµ®ã€Šã€°ã€°ã˜´ã¤·â€°ã€°ã€°â€°àµ®ã€Šã€°ã€°ã˜´ã˜¹â€²ã€°ã€°â€°àµ®ã€Šã€°ã€°ãœ´ã„°â€¶ã€°ã€°â€°àµ®ã€Šã€°ã€°ãœ´ãœ°â€°ã€°ã€°â€°àµ®ã€Šã€°ã€°ãœ´ãˆ±â€´ã€°ã€°â€°àµ®ã€Šã€°ã€°ãœ´ã ²â€¸ã€°ã€°â€°àµ®ã€Šã€°ã€°ãœ´ã³â€²ã€°ã€°â€°àµ®ã€Šã€°ã€°ãœ´ãœ´â€¸ã€°ã€°â€°àµ®ã€Šã€°ã€°ãœ´ãŒµâ€²ã€°ã€°â€°àµ®ã€Šã€°ã€°ãœ´ãŒ·â€·ã€°ã€°â€°àµ®ã€Šã€°ã€°ãœ´ã¤·â€±ã€°ã€°â€°àµ®ã€Šã€°ã€°ãœ´ã¸â€µã€°ã€°â€°àµ®ã€Šã€°ã€°ãœ´ã¤¸â€¹ã€°ã€°â€°àµ®ã€Šã€°ã€°ãˆ°ã¤´â€³ã€°ã€°â€°àµ®ã€Šã€°ã€°ã„°ã˜µâ€·ã€°ã€°â€°àµ®çŠæ…²æ±©ç‰¥à¨ã°¼åŒ¯ç©©â¥ãŒ±ã´å€¯æ•²â¶ã¤²ã”¹ãœ²å ¯æ•’å¦æµ´ãˆ ã¤´â¼³æ½’ç‘¯ã„ ã ²â€µâ€°â½’æ¹…ç‰£ç¹â´ãˆ±ã¸ã€ åˆ ä¤¯æ™®â¯ã˜²â€³â€°â½’ä‘‰ã±›ã‰†ã„·ã€µã„±ãˆ²ã†ä•‚ä‘ƒä‰„ãœµä„³äŒ¸ãˆ¹ã„°ãˆ±ä˜±ã°¾ã”°ã¤°äŒ±ã…ãäŒ¹ãœ³äˆ´ä‰ã™‚ä´äŒµãœ·ä‘‚ãä™å´¾ã¸¾à¨ç‘³ç‰¡ç¡´æ•²àµ¦ã€Š
    à¨â”¥ä½…àµ†â€Šâ€ â€ â€ â€ â€ â€ â€ â€ â€ â€ â€ â€ à´ ã„Šã³â€³â€°æ‰¯ã±ªâ¼¼æ•Œæ®æ¡´ã  ã„²äŒ¯ã„ ãˆ³â¼·æ¥†ç‘¬ç‰¥ä˜¯æ…¬æ•´æ•„æ½£æ•¤ä¤¯ã„ ã´â¼²âŒãŒ±ã„±ä¼¯ã„ ã¤²â¼µâ“ã”¹ã¸¶çŒ¾ç‰´æ…¥àµ#풜鷾姐å‘)Ὕ됑盿##Ἵ슂Ⓑꖓ⎇↦⮍憺஌펙#ëŸ¼ë´ ä·ä¦“îŒˆë½‰ìš°Ø‰æ‚©ë¶£èµ¤èŒ¾é™à·å‡‡á®€à§ªê™«é¢ë‘„åª¸ì¯¨ä¶”â£‚î¡ä”텆䓗鿦콛æžáŠé®½î‹™äŠæŸ¾ï‰ä˜šî ‚ã¥ªæ±£ï…¯ç±½é¡ƒç¨•âªˆä»ê‰ç„“ï·–ä¤˜à³®äŸœé§‚ãƒè©ä ƒæ¡¸î„¦â›³îºç©·ë†¿äŠ¹êŒêºž×¥æ£êŠ½îºŽ#絥쇒뀁劒혣긤㏬䮧䉏㕴箨䔈鲝㟆ꃬ㮁層#個顃æŽå¯¶íž£ä–•à£ªå£ƒä˜â¬ç®²é¼¨í†äœ½é´”ïš·ï‹éƒ¶ì‹¥çŒ‘ë°‰ë°´â‚‡à¹¸é±¤ä‡é®‹æ®¢é”´ã€Šë±ä•»ï±ªÚ„ì·“ç”›ëŠ¢æ¿ á¼žå·»ë€¸âšë¯‡áµ¢æŠî€â¢®ï¥ì£¦î’ë¡¹ê’¼æ¾ é¢¹å‚‹äªè¨¹è‹ê·Žä‰½ì‘Äâ¤é»—î²±â‰æš£ë²¨è™„凾#辍ﮔ
    껆펽㥆⽛䆺㬸睲讀㤓꒜è
    regards
    Message was edited by: Surpreet Singh Bal

  • How to send IDOC to DataWareHouse Systems

    Can anyone tell me how to send an IDOC to Datawarehouse systems.

    Hi,
    please have a look at thread [How to send an IDoc from MII to SAP|http://forums.sdn.sap.com/click.jspa?searchID=60546363&messageID=8112660].
    Does this help?
    Michael

  • Error when clicking send fax in SAP B1 2007A

    Hi,
    I'm trying to configure my client's SAP B1 server to be able to send faxes via SBOMailer and MS Fax. I read the guides and documentation.
    1. Does faxing only work strictly in the scenarios stated in the documentation?
    2. Will it work if:-
    a) The server has MS Fax and a fax modem installed; and
    b) I am logged in to the server via remote desktop; and
    c) I only configured the fax portion of the SBOMailer since I am not using the email function?
    Basically, in this scenario, the Service Manager, SBO Mailer, MS Fax, fax modem and SAP Client (because I am using remote desktop) are on the same machine.
    I am asking this because I keep getting the following error when I click send:-
    "Email address has not been defined for the sender. Cannot send email, SMS, or fax. , 'manager' [Message 3581-4]"
    I have checked the company details, business partner details and the fax console's "sender information". They all have email addresses and fax numbers keyed in.
    After a few minutes, the fax console shows that the system tried to dial to itself and so got a "no dial tone" error. The file that it sent only contained the Cover page and nothing else. What's going on?
    Can anyone out there help me?
    Regards,
    Jin Siang

    Hi,
    Thanks for your advice. That solved one part of the problem. Now the system states "Operation Completed Successfully." BUT nothing appears in the fax console outbox and sent folders. The SBOMailer and MS Fax do not seem to be communicating with each other.
    Email settings are blank because it is not used.
    For fax settings, I put:-
    Microsoft Fax Server: Server IP
    Fax Server Type: Microsoft Fax
    All tickboxes have been checked.
    Schedule settings: On specific date
    Connection settings: Correct login settings
    Database settings: Correct DB selected
    Any ideas, guys?
    Thanks,
    Chris.
    Edited by: Jin Siang Lee on Feb 18, 2009 10:38 AM
    Edited by: Jin Siang Lee on Feb 18, 2009 10:44 AM

  • How to send  FAX from the SDK ?

    Hi,
    I'm trying to figure out what objects are used to send FAX via the sdk
    I dont know how to be set either, Is a MODEM needed ont the system where the ADD-ON is running ?
    I tried with FAXCOMLib.dll which never worked for me.  PRobably due to the fact that I don't know if its possible to send on a Remote Windows Fax Server
    I would apreciate just some hints.
    Thank you

    Marc,
    The SDK does not expose any objects at this time that works with faxing from Business One.
    Apologies.
    Eddy

Maybe you are looking for