How can I send a parameter to a RFC function in c++ code (in eDM develop)?

Hi,
I am expanding Easy Document Management 6 SP14 via c++ code and I am trying to send a parameter value to a RFC function.
I have succeeded calling a RFC function that requires no parameters.
I have a pointer that points to the function, but I couldn't find a way to point to the parameter and send a value to it.
I will appreciate any help (and code example if possible).
Thanks,
Eitam

Hi guys,
unfortunately I coulden't send parameters to RFC functions as you all described (get the message "This function is not yet implemented" when using Rfc->Field...), so I chose to follow SAP note 821930 which describes how to do something similar in ABAP code (I only need the selected document parameters).
The problem is that in my code I open SAP gui (as I did in my c++ code: pRfc->InitFunction(L"MyRfcFunction",VARIANT_TRUE),
but now I don't know how to send the connection parameters from easyDMS to my ABAP function that perform the "call transaction" method.
my code:
FUNCTION Z_EASYDMS_FUNCT_GET_LIST. (from note 821930)
""Local Interface:
*" TABLES
*" DOCUMENTS STRUCTURE BAPI_DOC_FILES2 OPTIONAL
*" EXT_FUNCTIONS STRUCTURE ZEASYDMS_EXT_FUNC OPTIONAL
ext_functions-functioncode = 'Z_MY_FUNCTION'.
ext_functions-displayname = 'Add Doc To Project'.
APPEND ext_functions TO ext_functions.
ENDFUNCTION.
FUNCTION z_easydms_funct_called. (from note 821930)
""Local Interface:
*" IMPORTING
*" VALUE(FUNCTIONCODE) LIKE SY-UCOMM OPTIONAL
*" EXPORTING
*" VALUE(RETURN) TYPE BAPIRET2
*" TABLES
*" DOCUMENTS STRUCTURE BAPI_DOC_FILES2 OPTIONAL
IF functioncode = 'Z_MY_FUNCTION'.
CALL FUNCTION 'Z_MY_FUNCTION'.
ENDIF.
ENDFUNCTION.
FUNCTION Z_MY_FUNCTION.
call transaction 'CJ20N'
ENDFUNCTION.
now nothing happens, but if I run first my old c++ code (from easyDMS context menu I choose what I've created in c++ which basically does "pRfc->InitFunction(L"MyRfcFunction",VARIANT_TRUE)" ) and then run the implementation above from the context menu it will work (the sap gui will open because it gets the connection parameters from the c++).
Thanks for your help,
Eitam

Similar Messages

  • HTTPService: How can I send a variable or call a function in it?

    Ok i have the following HTTPService request:
    <mx:HTTPService id="userRequest" url="
    http://mywebsite/get_data.php"
    useProxy="false" method="POST">
    <mx:request xmlns="">
    <user1>{username.text}</user1>
    </mx:request>
    </mx:HTTPService>
    Pretty straight forward stuff there. EXCEPT... i want to use
    a variable instead of 'username.text...
    <user1>{UserNameList[0]}</user1>
    OR i want to be able to call a function that will return the
    results such as:
    <user2>{ UserFunction() }</user2>
    Of course, neither of these work and this makes me sad :(
    Anyone have any ideas? Much appreciated~!

    on that i can't help
    i'm a .net programmer an i use a lot httpservices but mostly
    i use webservices to get my data.
    But i can give my way of working. When you send your data
    from flex you are sending a virtual xml file thru http, then in
    .net using it xml class i read this stream of xml coming from flex,
    go to my database, get the result , wrapped it in xml and send thru
    stream again, so that flex understands the answer. When it gets to
    flex i just use e4x to read my data.
    There are tons of tutorials on the net for PHP, i wish i had
    half for .Net :D

  • How can I send purchase order through SAP mail ?

    How can I send purchase order through SAP mail ? Can any one explain whts the NACE settings?

    just  do it as  <b>Anji reddy</b> said to you   ...or else  ...  in the purchase  order trascation  ...print it  ... so that  it will generate the spool request  for that  purchase  order  ....
    so the   the belwo program is for sending <b>the Spool   Request  data   as  Email  to  any Email id  ...</b>
    The code below demonstrates how to retrieve a spool request and email it as a PDF document. Please note for the below program to process a spool request the program must be executed in background otherwise no spool request will be created. Once you have had a look at this there is an modified version of the program which works in both background and foreground. Also see transaction SCOT for SAPConnect administration.
    *& 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
                                        DEFAULT '[email protected]',
               p_sender LIKE somlreci1-receiver
                                        DEFAULT '[email protected]',
               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.
    Girish

  • How can i send a big file as pararameter of any method in a Web Service???

    Hello,
    i have a problem,,,,, i want to send a file of 2mb as parameter of a web service method.
    When i send this file as a vector of bytes i have the error out of memory...
    If the file is 200kb or smaller works fine....
    How can i send a big file as pararameter of any method in a Web Service???
    thanks in advance and excuse me for my bad english

    you can think about streams.
    in our case, what we did is, we will place a file in a common ftp server and return the url to the client.
    regards,
    mukunt

  • How can we send the smartform output to mail.

    Dear Friends,
    My query is how can we send the smart form output to mail.
    In my company,payslip are given to the employee in printed format.instead of that we need to send payslip in mail.how can i do..plz help me.
    [email protected]

    The code below demonstrates how to retrieve a spool request and email it as a PDF document. Please note to process a spool request the program can be executed in background or foreground. Because of the additional functionality to allow this to work in both background and foreground it has made it a little more confusing soyou might want to start by looking at the background only program. Also see transaction SCOT for SAPConnect administration.
    *& Report  ZSPOOLTOPDF2                                                *
    *& Converts spool request into PDF document and emails it to           *
    *& recipicant.                                                         *
    *& Execution                                                           *
    *& This program can be run in background or online and a spool request *
    *& will still be created                                               *
    REPORT  zspooltopdf2.
    PARAMETER: p_email1 LIKE somlreci1-receiver
                                        DEFAULT '[email protected]',
               p_sender LIKE somlreci1-receiver
                                        DEFAULT '[email protected]',
               p_delspl  AS CHECKBOX,
               p_online no-display.
    *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,
           w_spool_nr like sy-spono.
          %_print LIKE pri_params.
    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 p_online = 'X'.
      Processing performed when program calls itself when run online
        gd_spool_nr = sy-spono.
        EXPORT gd_spool_nr TO MEMORY ID 'SPOOLTOPDF'.
        EXIT.
      endif.
      IF sy-batch EQ 'X'.
        PERFORM get_job_details.
        PERFORM obtain_spool_id.
      ELSE.
        gd_spool_nr = sy-spono.
    If executed online, it submits a program to perform the write statements
    instructing it to create a spool request, this could be another program
    which just performs the write statements and then exports sy-spono
    to memory. But in this example it calls itself passing X to parameter
    p_online, which takes it down an alternative procesing path.
        submit ZSPOOLTOPDF2
               with p_online = 'X'
               to sap-spool
               spool parameters   %_print
              archive parameters %_print
               without spool dynpro
               and return.
      ENDIF.
    Get spool id from program called above
      IMPORT gd_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.
          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,
    Shakti Barath

  • How can I send a .pdf attachement using maildemo_sql.txt

    Hi
    I have created a PL/SQL package using the following link.
    Could you plese tell me how can I send a .pdf as an attachement using the follwing package?
    http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/maildemo_sql.txt
    regards

    When using the "MailDemo" package, in order to send email attachements, the document you attach MUST reside on the Database Server or UTL_SMTP or UTL_MAIL Oracle packages won't be able to find the file. I recommend you define a location (directory) on the database server file system where all email attachements must be stored and reference this location using an Oracle Directory object. You will need to modify the BEGIN_ATTACHMENT procedure to add the file location referenced by the Oracle Directory object to the filename parameter. For example:
    /* Create the Oracle DIRECTORY */
    CREATE OR REPLACE DIRECTORY FILE_ATTACHMENTS as '/temp/attachments/';
    /* Modification to MAILDEMO */
      PROCEDURE begin_attachment(conn         IN OUT NOCOPY utl_smtp.connection,
                        mime_type    IN VARCHAR2 DEFAULT 'text/plain',
                        inline       IN BOOLEAN  DEFAULT TRUE,
                        filename     IN VARCHAR2 DEFAULT NULL,
                        transfer_enc IN VARCHAR2 DEFAULT NULL) IS
      BEGIN
        write_boundary(conn);
        write_mime_header(conn, 'Content-Type', mime_type);
        IF (filename IS NOT NULL) THEN
           IF (inline) THEN
           write_mime_header(conn, 'Content-Disposition',
             /* 'inline; filename="'||BFILENAME('filename||'"'); */ /* Line BEFORE */
               'inline; filename="'||BFILENAME('FILE_ATTACHMENTS',filename)||'"'); /* Line AFTER */
           ELSE
           write_mime_header(conn, 'Content-Disposition',
             /* 'attachment; filename="'||filename||'"'); */  /* Line BEFORE */
               'attachment; filename="'||BFILENAME('FILE_ATTACHMENTS',filename)||'"');  /* Line AFTER */
           END IF;
        END IF;
        IF (transfer_enc IS NOT NULL) THEN
          write_mime_header(conn, 'Content-Transfer-Encoding', transfer_enc);
        END IF;
        utl_smtp.write_data(conn, utl_tcp.CRLF);
      END;If you have to send the file attachment from the User's workstation, then I suggest you either add the ability to FTP a file from a users workstation to the Database Server; use a javabean to send email directly from the client workstation or use WebUtil to open an Outlook message and attach the file using Outlook. I personally prefer using the database package to send email because you have a central point that all processes use and that makes the process easier to maintain. If you opt to try the Java Bean or WebUtil options, here are some great links that work really well also.
    Java Option:
    Send email with html body and local file attachments
    WebUtil Option:
    Sending Email via Outlook via forms
    Re: Sending email from Oracle Forms with attachments
    I cannot confirm the WebUtil options work as I have not tested these myself, however, I have tested the Java option and it works fine.
    Hope this helps,
    Craig B-)
    If a response is helpful or correct, please mark it accordingly.

  • How can I send email using two different email address that both link back to my one exchange account on my Ipad mini

    How can I send email using two different email address that both link back to my one exchange account on my Ipad mini? 
    On my PC I simply have a master return email address and use a POP for the secondary address.  Both are through the one exchange account without a problem.  I need to be able to do the same on my Ipad.

    Ah, I should have made that clear.  My domain didn't come from google.  It was purchased at and is hosted at dreamhost, but I haven't used their email servers in years - I just route everything through gmail.  I actually have a bunch of domains (with websites).
    Gmail has an option that lets someone with custom domains send (and receive) email through gmail using the custom domain once Google confirms proper ownership of the domain (to prevent spammers and such).  Gmail has a setting for "send email as" which allows gmail to be sent using a custom domain as the sender.  I'm pretty sure Apple's old mobileme had this feature too, but I didn't use it.

  • How can I send stuff from one iPhone to another via Bluetooth?

    How can I send stuff from one iPhone to another via Bluetooth?

    There are some apps that will let you send photos from one iOS device to another over BT.

  • How can I send email from my yahoo alias account in iPhone5 mail?

    How can I send email from my yahoo alias account in iPhone5 mail?
    I have 2 email accounts: [email protected] is an alias of [email protected]
    In my old iPhone3 I had these accounts set up so that I could send and receive email from both accounts. I did this using the following settings:
    ‘Other’ POP account info:
    Name: xyz
    Address: [email protected]
    Description: alias
    Incoming mail server:
    Host name: pop.mail.yahoo.com
    User name: [email protected]
    Password: password for yahoo account
    Server port: 995
    Outgoing mail server:
    SMTP: smtp.o2.co.uk (o2 is the name of my phone network)
    Server port: 25
    ‘Yahoo!’ account info:
    Name: xyz
    Address: [email protected]
    Password: password for yahoo account
    Description: Yahoo!
    Outgoing mail server:
    Primary server: Yahoo! SMTP server
    Server port: 465
    I’ve tried using the same settings in my new iPhone5, but it doesn’t work. I can receive mail to both accounts, and can send from the Yahoo account, but I cannot send mail from the alias account. When I try, it displays the message: “Cannot send mail. A copy has been placed in your Outbox. The recipient ‘[email protected]’ was rejected by the server”.
    I’ve tried to configure the POP alias account using combinations of ‘pop.mail.yahoo.com’, ‘pop.mail.yahoo.co.uk’, ‘apple.pop.mail.yahoo.co.uk’ and ‘apple.pop.mail.yahoo.com’, for the incoming host, and ‘smtp.o2.co.uk’, ‘smtp.mail.yahoo.com’, ‘smtp.mail.yahoo.co.uk’, ‘apple.smtp.mail.yahoo.com’ and ‘apple.smtp.mail.yahoo.co.uk’ for the outgoing mail server. None of these have worked.
    I’ve also tried setting it up using IMAP instead of POP without success. I tried configuring it using combinations of ‘imap.mail.yahoo.com’, ‘apple.imap.mail.yahoo.com’, ‘imap.mail.yahoo.co.uk’ and ‘apple.imap.mail.yahoo.co.uk’ for the incoming mail server and ‘smtp.o2.co.uk’, ‘smtp.mail.yahoo.com’, ‘smtp.mail.yahoo.co.uk’, ‘apple.smtp.mail.yahoo.com’ and ‘apple.smtp.mail.yahoo.co.uk’ for the outgoing mail server.
    Yahoo say that if I can't send Yahoo! Mail from my mail program, I may be accessing the Internet through an ISP that is blocking the SMTP port, and that if this is the case, I should try setting the SMTP port number to 587 when sending email via Yahoo!'s SMTP server. I don't think that this is the problem, but I tried it just to make sure - without success.
    I’ve also heard that the problem might have something to do with the SPF settings of my alias domain provider. I’m not too sure exactly what SPF settings are, or how to change them, but from what I can gather it seems unlikely that this is the problem given that I was able to send mail from my alias account on my old iPhone3.
    Any help much appreciated: how can I get my alias account to send emails in iPhone5 mail?
    Many thanks,
    Patrick

    A new development: I've tried sending emails from the alias several times over the past 24 hours, but in general I've deleted them if they haven't sent within about half an hour.
    However, one of the messages I left sitting in the outbox did send successfully in the end, but this took about an hour.
    So: perhaps my problem is not in fact that I am completely unable to send mail from my alias, but that I can only do so intermittently and extremely slowly, and by ignoring the "cannot send" message.
    Any help appreciated.

  • How can we send Error Idocs via mail

    Hi,
    I have read read through forums and  understood that it can be achieved either through workflow or through report using table edidd & edids.
    If workflow option is used , does the mail trigger for every error idoc ? How can we send daily error report to user say by EOD containing all error idocs using all possible options.
    Regards,
    Rachel

    Rachel,
    I dont think so any direct Report will be available just to get Error IDOCs details. Although you can create a simple report to read the tables. An example is in below link.
    http://wiki.scn.sap.com/wiki/display/Snippets/Custom+report+for+IDOC+Monitoring
    Also, you can create a Query of EDIDC and EDIDS tables to obatin relevant information.
    Thanks,
    Ravi

  • How can I send more than one document on an email

    how can I send more than one document on one email

    Thank you but I understand that form of attaching a document. However when I select a document then click 'Share' I have the option of sending the document by email as a word or pages document or pdf, what I want to know is can I use this procedure to send more than one document per email and if I can how?

  • How can I send more than one foto in a email

    How can I send more than one foto in a email?

    Or, to send up to 5 photos in one email, open the Photos app, go to the Album containing the photos, tap Select, tap up to 5 photos (a blue tick will appear on them), then tap the Share icon (square with arrow pointing up) and choose Mail.
    If you choose more than 5 photos this way, you won't get the Mail option.

  • How can I send multiple photos in an email?

    How can I send multiple photos in an email?

    In Photos, when looking at your pictures, click the Action arrow first (upper right), before selecting any pictures.  Then you can tap select the pictures you want to send then click "Share" in the upper left.  From there you can Email.
    If you click and open one picture first, the Action button will only allow you to share that one picture.
    (Yeah, took me a while to figure this out. )
    ivan

  • How can I send out a voice memo by iphone 6 plus?

    How can I send out a voice memo to my friend? the voice memo last around 1.5 hours.  I tried to sent by email but not success.
    Pls. help.

    It is not Family Sharing - it is Continuity. Go to Settings>FaceTime>Cellular Calls, turn them off.
    Cheers,
    GB

  • How can I send a podcast video via email?

    Hello techies,
    How can I send a National Geographic podcast via email to a friend?
    I've tried importing and exporting without much success.

    Hello Chris Miller,
    Of course I did. I certainly would not have suggested doing something I haven't tried to do myself. Would You? I wouldn't unless we are experimenting with something, but this is not the case here.
    I also mentioned to lexlizandtay to watch the filesize.
    Many ISP's have a 10 MB limit on sending or receiving emails.
    I also said in my above post "Works for Me"......
    I have a 3.8 MB Podcast that was downloaded straight from Apple. I can send this without any problems the way I mentioned above.
    I also have other podcasts that I made myself using GarageBand or Quicktime that work just fine.
    Give it a try.

Maybe you are looking for

  • Access Denied to report file on Windows Server 2003 Enterprise

    Hi, I have a deployment problem for which I am out of ideas. I have an ASP.NET web site deployed on a server running Windows Server 2003 R2, sp2.  It makes extensive use of Crystal Reports, including both displaying them and e-mailing them to specifi

  • Can I install TES 5.3.1 saClient on 64-bit Windows 7.

    I'm getting an error: "The program can't start because Vcl50.bpl is missing from your computer. Try reinstalling the program to fix this problem." I tried to do a reinstall, but no luck. Any ideas? Thanks, -Kevin Metropolitan Community College

  • How to change user name in OIM 11

    Hi, I have a custom java class to generate unique user names based on last name + initials + numbers (for duplicates). We have this implemented in plugin framework and it seems to be working fine. But when someone changes his name (first, last or mid

  • Blurry text using Bitmap text (pixelfont) alternative

    I've placed a bitmap text (no anti-alias) inside a movieclip and it looks crisp and clean when exported to swf. Now I have dragged a copy of that movieclip on stage and it becomes blurry/fuzzy as soon as I export it to swf (the original is still clea

  • Batch import of images

    Hi, Is it possible to batch import images into iBA? I would like to have 1 image per page (different images) and do this for, say, 200 pages. Is this possible? Placing an image on the template page and placeholder and generating many pages, then manu