How we can capture sender address in UMS adapter

hi,
we use  Custom Callout in UMS adapter to capture sender address
we  create one temp text file to keep sender address and but i  get "java.lang.NullPointerException"
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import oracle.sdp.messaging.Message;
import oracle.tip.pc.services.translation.util.ICustomCallout;
public class UMSCustomFilter implements ICustomCallout{
    @Override
  public boolean execute(Message message) throws Exception {
      BufferedWriter output=null;
      File file ;
    try {
                  file = new File("C:\\TEMP\\mail1.txt");
                  output = new BufferedWriter(new FileWriter(file));
                  String emailFromAddress  =message.getSenders()[0].getValue();
                  output.write(emailFromAddress);
                  output.close();
            } catch ( Exception e ) {
               e.printStackTrace();
                   output.write(e.toString());
               } finally{
                 if  (output!=null)
                   output.close();
      return true;
Thanks
Sameer

    Controls                                                         *
CONTROLS: z_cond_type TYPE TABLEVIEW USING SCREEN 9001.
    Types                                                            *
TYPES: BEGIN OF ty_cond_type.
INCLUDE          TYPE zvsd_ct.
TYPES: z_sel TYPE char01,
       END OF ty_cond_type.
    Internal tables                                                  *
DATA : it_cond_type TYPE STANDARD TABLE OF ty_cond_type,
    Workareas                                                        *
DATA : wa_cond_type TYPE ty_cond_type.
CONSTANTS : kc_sel      TYPE char03    VALUE 'SEL'.
MODULE user_command_9001 INPUT.
  CASE sy-ucomm.
    WHEN kc_sel.
      PERFORM f_sel_desel USING kc_sel_flag.
    WHEN kc_desel.
      PERFORM f_sel_desel USING space.
  ENDCASE.   "CASE sy-ucomm.
ENDMODULE.                 " USER_COMMAND_9001  INPUT
PROCESS AFTER INPUT.
  LOOP AT it_cond_type.
    MODULE selected_row.
  ENDLOOP.
MODULE selected_row INPUT.
  MODIFY it_cond_type
         FROM wa_cond_type
         INDEX z_cond_type-current_line
         TRANSPORTING z_sel.
ENDMODULE.                 " selected_row  INPUT
FORM f_sel_desel
     USING    p_sel_desel TYPE c.
Set the value
  wa_cond_type-z_sel = p_sel_desel.
Update the Itab.
  MODIFY it_cond_type
         FROM wa_cond_type
         TRANSPORTING z_sel
         WHERE mandt EQ sy-mandt. "Where cond is only to specify all
ENDFORM.                    " f_sel_desel
This is code from the Live Task try to understand what i am doing.

Similar Messages

  • F110 - Pre-notification by E-Mail: How to change the sender address

    Hi experts,
    by executing pre-notifications in F110 an e-mail is generated. The sender e-mail address is set from sap user (master data) who has executed pre-notification. This is the current setting.
    Now the sender e-mail address has to be a static e-mail address not the address from user master data. Independent from user who is executing f110 there has to be the same (static) sender address.
    I tried to use business transaction events, 2040. So I copied the standard function modules, assigned them to the events and set some breakpoints in the function modules without any success.
    Additionally I executed F110 (pre-notification) in debugging mode and set dynamical breakpoints at the new created function modules - again without any success.
    Does anyone has an idea what's going wrong?
    Thanks in advance,
    Tan
    Message was edited by: Tan Yildiz
    In P/S-Modules i cannot select event 2040, message: entry not available in TBE01 - how can I get event 2040 selected?

    Thanks for the help and guidance.
    I ran that command
    [PS] C:\Windows\system32>Get-OrganizationConfig | fl MicrosoftExchangeRecipien*
    and it shows similar to the expected putput.
    We are migrating currently to 0365 so we have a cloud entry also but it looks the same.
    MicrosoftExchangeRecipientEmailAddresses            : {smtp:[email protected],
    smtp:MicrosoftExchange329e71ec88ae4615bbc36ab6ce41109e@domainclou                                                   
    d.mail.onmicrosoft.com, SMTP:MicrosoftExchange329e71ec88ae4615bbc                                                    
    [email protected], smtp:MicrosoftExchange329e71ec88ae4615bbc3                                                     
    [email protected], X400:C=US;A= ;P=ATS;O=COS;S=Micr                                                     
    osoftExchange329e71ec88ae4615bbc36ab;}
    MicrosoftExchangeRecipientReplyRecipient            :
    MicrosoftExchangeRecipientPrimarySmtpAddress        :
    [email protected]
    MicrosoftExchangeRecipientEmailAddressPolicyEnabled : True
    I am nervous about changing anything with the set-organizationconfig cmdlet so if there are other ideas I could try first please help.
    Thanks again
    Brian

  • How I can delete email addresses from I-photo 11?

    Hello to every body.
    I sent a photo from I-photo by the command "share.....by email". Now If I want to share another photo, I put in the email window, the first letter of email address, and it show me the preceeding addresses used to share the photo. In these used addresses there is a unwanted one and I want to delete it.
    How I can do that?
    Thank you very much.
    marco

    Greetings Marco,
    Quit iPhoto if it is open
    Remove the following file to the trash:  Your User > Library > Preferences > com.apple.iPhoto.plist*
    Re-open iPhoto
    This will remove all saved email addresses from iPhoto's memory.  Note: It will also restore the default location of the iPhoto Library if you moved it (hold down the option key and launch to choose the old location if you've moved it).  It will also remove certain preferences such as your email accounts if they are not stored in the Mail program and Facebook / Flickr accounts.
    Hope that helps!

  • How i can change MAC-address of ethernet?

    in the tiger i just was typing "sudo ifconfig en0 lladdr (or ether) 00:0c:76:18:25:ac" but in leopard that doesn't work.
    Programms like MacDaddy X and ChangeMAC doesn't work too.
    I dunno what i must do, please help.
    how it works in leopard?
    Message was edited by: Flamesix

    i'm having the same problem (and because of that i claim Apple did really forgot the 'Computers' part when they changed their name, i had to install Leopard just to see i cant change the mac thus connect to my lan, thus i had to install tiger back, grr)
    in another thread i've found this alternative to en0 ether xx:xx... :
    sudo ifconfig en0 lladdr 00:00:00:00:00:00
    but i remember trying it without success, anyone has a clue how to change the MAC address in leopard? on top of it - why on earth would they downgrade a system? is this one of these 300 new features? sweet :P

  • How long can the Mini DisplayPort to VGA Adapter last?

    Hi,
    I've been using Mini DisplayPort to VGA Adapter (genuine) for a year now but not everyday. Yesterday I bought a new display that needs this adapter, so now is the time that it will be used everyday. I was wondering how long can it last (or operational hours) if it were to sit in the same place, not unplugged, with an average use of 4 hours a day?
    Thanks
    PS. This one: http://store.apple.com/us/product/MB572Z/B/mini-displayport-to-vga-adapter.

    This is impossible to predict.
    Sometime cables last a lifetime, sometimes they fail in short order.

  • How mail can be send to superior if not approved within deadline

    Hi firends,
    I'm a little new 2 workflows and i have 2 issues
    1)   If the approver doesnot act with a time limit a mail has to be send to his superior regarding the delay approver is creating. How can i achieve this scnerio? will the tab 'LatestEnd' has to be used? and if yes how can i use it?
    and the approver should still be able to approve it and the flow should not be altered.
    2)  If the approver does not act within the time limit, the approval process should be assigned to another user. But in this case also the flow should not be altered exept that the approver has changed. How can i achieve this scnerio??
    Kindly reply soon.
    Thanks & Regards,
    Ajo John

    Hi Ajo,
    May b u can try the following.
    1) If the approver doesnot act with a time limit a mail has to be send to his superior regarding the delay approver is creating. How can i achieve this scnerio? will the tab 'LatestEnd' has to be used? and if yes how can i use it?
    and the approver should still be able to approve it and the flow should not be altered.
    Yes. You are right u can use the "Latest End" tab
    Choose "workflow Item Creation" in the Refer Date / Time field
    and in the Time field enter the  "x" days after which the Superior must recieve the mail.
    and in the bottom  half of the page.
    enter the Supervisor  as the Recipient of the when last end date missed.
    u can choose "user" and then enter the Superior User id
    or u can use "Expression" and then enter a expression which determines the Superior user id.
    2. If the approver does not act within the time limit, the approval process should be
    assigned to another user. But in this case also the flow should not be altered exept that the approver has changed. How can i achieve this scnerio??
    U can achieve this,  by making the Agent determination as a background activity.
    U can follow the sequence
    U can use a Fork
    with 2 inputs and 1 output.
    Branch 1
    1. Approval Process with Agent1 as the responsible Agent.
    2. Approval step set with "Latest end" set as 3 days
    Branch 2.
    1. Approval Process with Agent2 as the responsible Agent.
    2. Approval Step set with "Requested Start" set as 3 days (i.e. the latest end of the previous agent)
    May be  this answers your question.
    Raj

  • How I can modify the address in rvorder01 and rvdelnote in scripts?

    Hi i want to modify the existing address and company details plz send me the code and how to modify the address of rvorder01 and rvdelnote in script .... THis is very urgent ,,, thankign U

    do you want to modify SAP Standard ? it is not good idea.
    Copy the layout into custom layout and create new output type ,attach ur layout and corresponing print program.
    What address do you want change ?

  • Mail spec, how many can I send?

    I have recently moved from Outlook on a PC to Mail on a new macbook. All is good but for sending mass emails. Are there limits to the program? I know I have some from my isp (100 per mail, 200 per hour) and I am not exceeding them. Mail seems to leave out people. I am using BCC and all the addreeses are good. I also put one in the to line.
    Does anyone else have trouble with this? I have searched the site but find no info other than a few other posts that do not solve it either.
    I am using latest versions of everything
    Thanks
    Obmit

    Obmit,
    If you are using Rich Text Format when composing, and especially if you are adding attachments, or using a Signature that mixes fonts, then Mail 2.x will convert the RTF to HTML, and this may cause some recipients some problems, and with some others, it may trigger their SPAM filters to block the message, altogether. This would most likely be the SPAM filters provided by their email provider, or ISP.
    If the address is in the Long Headers, and the message in the Sent, then it was sent to everyone -- my guess is for some people, it is being blocked, for the reasons, above.
    If you wish to test, compose and address a message to all to whom you desire to send, and then click on Format, and choose Make Plain Text -- this will test my theory.
    Ernie

  • How i can capture the value for ovs selector in web dynpro application

    hi
    i create one OVS for SALES DOCUMNT MY PRIMARY KEY
    FILED IS VBELN AND I WANT GENERATE ONE REPORTS FOR SALES DOCUMENT HOW THIS SERCH HELP IS CAPTURE THE VALUE I WANT TO SOULATION

    >
    awadhesh chandel wrote:
    > hi
    >  i create one OVS for SALES DOCUMNT MY PRIMARY KEY
    > FILED IS VBELN AND I WANT GENERATE ONE REPORTS FOR SALES DOCUMENT HOW THIS SERCH HELP IS CAPTURE THE VALUE I WANT TO SOULATION
    I am afraid that you are going to have to supply a few more details.  What exactly are you having problems with?  Do you need help creating the OVS?  Or perhaps on how to capture the input from the OVS?  Or do you nee dhelp actually generating the report of the sales documents itself?

  • TS4268 How I can block sending message to # 00447786205094

    I have been charged for international SMS and these SMS are been sent to # 00447786205094, without my knowledge, I am not sure how this has been happned from my phone. Is there someway i can block this particular number?

    This SMS is an SMS to the Apple server in the UK for the purpose of activating iMessage and FaceTime. If you are using a supported carrier for the iPhone, then those carriers normally do not charge for that message if they support iMessage and FaceTime.
    Is it possible that you are not using  a supported carrier for the iPhone?

  • How i can receive & send data through port? urgent

    port=9999
    data receive in 4 column
    name, price, high, low
    i want to receive this data & display this data in from & automatic refresh
    do u have any idea ?
    plz urgent reply

    IDS (Internet Developer Suite) is a RAD tool to create database application however that totally depend upon your requirement but if u feels limitation while working on Form IDS , u can switch to Jdeveloper an open source environment but still u have option create bean in Jdeveloper as per your need and bundled it with your Forms.
    I still suggest to discuss the problems which you are facing while invoking the bean in your form so that we can guide u better.
    Finally, neither move to latest version or change your development platform just for seek of fashion
    Hope it clears now!

  • Please advice how I can change the address in the map

    http://interior-design-preview.businesscatalyst.com/contact

    Hi jetaf,
    It looks like this map has been inserted onto the page using an iframe and the iframe source references a latitude and longitude which is why it is pointing to that specific location. Therefore what you will need to do is navigate to this page within the admin console, switch to HTML view and update the latitude and longitude to the updated location.
    Thanks,
    Matt.

  • Can I send all address book cards to iCloud?

    Can I send address book cards to I cloud?

    Welcome to the Apple Community.
    Yes, unless there are some that you don't want on all your devices.

  • How to put the sender name in the wf-system

    Hi,
    Can anybody pls tell me how to give the sender address in stead of WF-SYSTEM
    When ever a mail is triggered the mail is send to the mail inbox.in the mail inbox it is showing in the sender option : WF-SYSTEM...
    I want to put any name their .
    can i put any name their.
    please help me.....very urgent.
    For any clarification pls revert back.
    Thnks

    Hi,
    I've put the steps again here but this time I've put in Bold the lines that needs to be added in the different sources.
    • Copy the BO SOFM to ZSOFM
    And add to the method Send an import parameter
    SENDER like PA0105-USRID_LONG
    Then change the method SEND
    begin_method send changing container.                             
    data: result_object type swc_object.                              
    data: document_data  like sodocchgi1,                             
          document_type  like sofolenti1-obj_type,                    
          receivers      like somlreci1 occurs 1 with header line,    
          object_para    like soparai1  occurs 0 with header line,    
          object_parb    like soparbi1  occurs 0 with header line,    
          object_header  like solisti1 occurs 1 with header line,     
          object_content like solisti1 occurs 10 with header line.    
    data  folder_id      like soobjinfi1-object_id.                   
    data  new_object_id  like soobjinfi1-object_id.                   
    data  document_id    like sofolenti1-doc_id.                      
    data low_len like sy-tabix.                                       
    data  rcode          like sonv-rcode.                             
    <b>data : SENDER like pa0105-usrid_long.                             
    DATA : packinglist LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.     
    DATA: tab_lines TYPE sy-tabix.                                    
    DATA : sender_address like SOEXTRECI1-RECEIVER.                   
    swc_get_element container 'SENDER' SENDER.       </b>
    * get receivers out of container                 
    perform extract_receivers tables receivers         
                                     container.        
    if object-key = space.                             
      * get document data out of the container       
      perform extract_document tables object_para      
                                      object_parb      
                                      object_header    
                                      object_content   
                                      container        
                               using  document_type    
                                      document_data.   
    <b>DESCRIBE TABLE object_content LINES tab_lines.     
    Packing List                                     
    CLEAR packinglist-transf_bin.                      
    packinglist-head_start = 1.                        
    packinglist-head_num = 0.                          
    packinglist-body_start = 1.                        
    packinglist-body_num = tab_lines.                  
    packinglist-doc_type = 'RAW'.                      
    APPEND packinglist.                                                                               
    move sender to sender_address. 
    * send document                                               
      call function 'SO_DOCUMENT_SEND_API1'                         
        exporting                                                   
          put_in_outbox = ''                                        
          document_data = document_data                             
          sender_address = sender_address                           
          sender_address_type        = 'SMTP'                       
          commit_work                = ''                           
       tables                                                       
          packing_list   = packinglist                              
          receivers      = receivers                                
          contents_txt   = object_content                           </b>   exceptions                                                    
          parameter_error = 23                                      
          too_many_receivers =  1                                   
          x_error =              1000                               
          operation_no_authorization =  13                          
          enqueue_error =     2                                     
          document_type_not_exist = 3                               
          document_not_sent =  15.                                  
      if sy-subrc ne 0.                                             
        exit_return 1023  document_data-obj_descr space space space.
      endif.                                                        
    * create now SOFM object of sent document                     
      if sy-subrc = 0.       
        perform insert_document_with_data using new_object_id        "870566
                                                document_data               
                                       changing folder_id                   
                                                rcode.                      
      else.                                                                 
        move sy-subrc to rcode.                                             
        exit_return 1900 'Document Insert' space space space. "#EC NOTEXT   
      endif.                                                                
    * create result element with object key                               
      if rcode = 0.                                                         
        perform create_result tables container                              
                              using folder_id                               
                                    new_object_id                           
                                    result_object.                          
        perform create_object using folder_id                               
                                    new_object_id.                          
      endif.                                                                
    else.                                                                   
      move object-key to document_id.                                       
      call function 'SO_OLD_DOCUMENT_SEND_API1'                             
           exporting                                                        
                document_id                =  document_id                   
                PUT_IN_OUTBOX              =                              
           IMPORTING                                                      
                SENT_TO_ALL                =                              
           tables                                        
                receivers                  =  receivers  
           exceptions                                    
                too_many_receiver          = 1           
                document_not_sent          = 2           
                document_not_exist         = 14          
                operation_no_authorization = 13          
                parameter_error            = 23          
                x_error                    = 6           
                enqueue_error              = 7           
                others                     = 1000.       
      if sy-subrc ne 0.                                  
        exit_return 1023  document_id space space space. 
      endif.                                             
    endif.                                               
    end_method.                                                                               
    • Copy the function SWW_SRV_MAIL_SEND to ZSWW_SRV_MAIL_SEND
    And add as import parameter SENDER TYPE COMM_ID_LONG.
    In this function it will create an object SOFM and call the method Send and link the container for this method. So now we’ll create our copy of SOFM and add SENDER as container.
    Set the object.
      swc_create_object office_object 'ZSOFM' space.
      swc_set_element local_container 'DocumentName' documentname.
      swc_set_element local_container 'DocumentTitle' documenttitle.
      swc_set_element local_container 'SENDER' SENDER.
      swc_set_table local_container 'DocumentContent' documentcontent[].
      swc_set_table local_container 'Receivers' t_receivers.
      swc_set_element local_container 'Express' express.
      IF NOT documentexpirydate IS INITIAL.
                  swc_set_element local_container 'DocumentExpiryDat'
                  documentexpirydate.
         ENDIF.
    •Create a subtype for BO SELFITEM
    Example : ZSELFWI
    Create a method “SendWithSender”
    Tab General : Check Synchronous & Result parameter
    Tab Result type : Object type SOFM
    Tab ABAP :  SWO_INVOKE
    Then you’ll have to copy all the parameter from the original function
    “SendTaskDescription” and add a new one
    SENDER(import like PA0105-USRID_LONG)
                Then copy the method “SendTaskDescription” to the code of “SendWithSender”
    Now you’ll have to do some modifications to call the copy of the function
    SWW_SRV_MAIL_SEND  and then delegate ZSELFWI &#61664; SELFITEM
    And now in your task call the method SendWithSender of Selfitem and bind an address to Sender.
    BEGIN_METHOD SENDWITHSENDER CHANGING CONTAINER.                  
    <b>DATA: WORKITEMID LIKE SWWWIHEAD-WI_ID.                           </b>
    DATA: receivers TYPE swc_object OCCURS 0.                        
    DATA: BEGIN OF address_objects OCCURS 3,                         
           a_object TYPE swc_object,                                 
          END OF address_objects.                                    
    DATA: return TYPE STANDARD TABLE OF swotreturn WITH HEADER LINE. 
    DATA: text_lines TYPE STANDARD TABLE OF tline WITH HEADER LINE.  
    DATA: document_content TYPE so_txttab.                           
    DATA: ls_document_content TYPE LINE OF so_txttab.                
    DATA: workitem_task LIKE swwwihead-wi_rh_task,                   
          workitem_language LIKE swwwihead-wi_lang,                  
          workitem_short_text LIKE swwwihead-wi_text,                
          express LIKE sos04-l_***,                                  
          send_type LIKE sos04-l_art,                                
          send_language LIKE sy-langu,                               
          rc LIKE syst-subrc.                                        
    <b>DATA: SENDER like PA0105-USRID_LONG.                             </b>
    DATA: BEGIN OF address_strings OCCURS 3,                         
           a_string LIKE soxna-fullname,                             
         END OF address_strings.                                     
    DATA: attachments TYPE swc_object OCCURS 0 WITH HEADER LINE.     
    DATA: line_width LIKE thead-tdlinesize.                          
    DATA: wi_handle TYPE REF TO if_swf_run_wim_internal.             
    DATA: wi_container TYPE REF TO if_swf_cnt_container.             
    DATA: lv_excp TYPE REF TO cx_swf_run_wim.                               
    DATA: l_subrc TYPE sysubrc.                                             
    DATA: l_expiry_date TYPE sydatum.                                       
    DATA: l_settings TYPE swp_admin.                                                                               
    ~~ begin of trace specific coding ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    PERFORM trc_init <b>in program SWWSI</b> .                                     
    ~~ end of trace specific coding ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                               
    swc_container addr_crea_container.                                                                               
    Get the input parameters.                                             
    swc_get_table container 'AddressStrings' address_strings.               
    swc_get_element container 'TypeId' send_type.                           
    swc_get_table container 'Receivers' receivers.                          
    swc_get_element container 'Express' express.                            
    swc_get_element container 'Language' send_language.                     
    swc_get_table container 'Attachments' attachments.                      
    swc_get_element container 'LineWidth' line_width.                       
    <b>SWC_GET_ELEMENT CONTAINER 'SENDER' SENDER.                              
    SWC_GET_PROPERTY SELF 'WorkitemId' WORKITEMID.                          </b> ~~ begin of trace specific coding ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
    PERFORM trc_after_import_params <b>in program SWWSI</b>                        
                                    TABLES container                        
                                           address_strings                 
                                           receivers                       
                                           attachments                     
                                    USING send_type                        
                                          express                          
                                          send_language                    
                                          line_width.                      
    ~~ end of trace specific coding ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
    Get some attributes of the object.                                   
    TRY.                                                                   
        CALL METHOD cl_swf_run_wim_factory=>find_by_wiid                   
          EXPORTING                                                        
            im_wiid     = <b>WorkitemId</b>                                       
          RECEIVING                                                        
            re_instance = wi_handle.                                       
        workitem_task = wi_handle->m_sww_wihead-wi_rh_task.                                                                               
    IF send_language IS INITIAL.                                       
          send_language = wi_handle->m_sww_wihead-wi_lang.                 
        ENDIF.                                                                               
    wi_container = wi_handle->get_wi_container( ).                     
      Perform variable substitution for task description.                
        CLEAR text_lines[].        
        IF line_width IS INITIAL.                      
         line_width = 75.                            
          line_width = 132.                            
        ENDIF.                                         
        CALL FUNCTION 'SWU_GET_TASK_TEXTLINES'         
          EXPORTING                                    
            task              = workitem_task          
            usage             = 'W'                    
            linewidth         = line_width             
            language          = send_language          
            container_handle  = wi_container           
          TABLES                                       
            ascii_text_lines  = text_lines             
          EXCEPTIONS                                   
            wrong_usage       = 01                     
            text_not_found    = 02                     
            text_system_error = 03.                    
        IF sy-subrc NE 0.                              
          exit_return 1004 space space space space.    
        ENDIF.                                                                               
    get work item text                               
        CALL METHOD wi_handle->get_witext              
          EXPORTING                                    
            im_language = send_language                
          RECEIVING                                                             
            re_witext   = workitem_short_text.                                                                               
    ~~ begin of trace specific coding ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       
        PERFORM trc_after_text_generation <b>in program SWWSI</b>                      
                                          TABLES                                
                                             text_lines                         
                                          USING                                 
                                              wi_handle->m_sww_wihead           
                                              workitem_short_text               
                                              send_language                     
                                              line_width.                       
    ~~ end of trace specific coding ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                               
    Fill the document content.                                                
        LOOP AT text_lines.                                                     
          ls_document_content-line = text_lines-tdline.   "note 510198          
          APPEND ls_document_content TO document_content.                       
        ENDLOOP.                                                                               
      * note 881594 - determine default expiry date for office documents      
        CALL FUNCTION 'SWP_ADMIN_DATA_READ'                                     
          IMPORTING                                                             
            wf_settings = l_settings.                                           
        IF NOT l_settings-doc_expiry IS INITIAL.                           
          l_expiry_date = sy-datum + l_settings-doc_expiry.                
        ENDIF.                                                                               
    *- There problems with the implementation of persistence service       
    *- of objects. The symptom of this problems is that sendorders         
    *- (SCOT) are not saved if an object pool exists. Therefore we         
    *- create a new session in this environments.                          
        DATA: t_receivers_por TYPE tswotobjid.                             
        DATA: t_attachments_por TYPE tswotobjid.                           
        DATA: receiver_object TYPE swc_object.                             
        DATA: attachment_object TYPE swc_object.                           
        DATA: por TYPE swotobjid.                                          
        DATA: result_por TYPE swotobjid.                                   
        DATA: rfcdest TYPE rfcdest.                                        
        DATA: documentname TYPE sodocchgi1-obj_name.                       
        DATA: documenttitle TYPE sodocchgi1-obj_descr.                     
        DATA: t_address_strings type swfstrtab.                                                                               
    LOOP AT receivers INTO receiver_object.                            
          swc_object_to_persistent receiver_object por.                    
          IF sy-subrc EQ 0.                                                
            swc_free_object receiver_object.                               
            APPEND por TO t_receivers_por.                                 
          ENDIF.                                                           
        ENDLOOP.                                          
        LOOP AT attachments INTO attachment_object.       
          swc_object_to_persistent attachment_object por. 
          IF sy-subrc EQ 0.                               
            swc_free_object attachment_object.            
            APPEND por TO t_attachments_por.              
          ENDIF.                                          
        ENDLOOP.                                          
        LOOP AT address_strings.                          
          append address_strings to t_address_strings.    
        endloop.                                                                               
    rfcdest = space.                                  
        IF cl_object_pool=>instance_exists( ) EQ 'X'.     
          rfcdest = 'NONE'.                               
        ENDIF.                                                                               
    documentname = 'Notiz'(001).                      
        documenttitle = workitem_short_text.              
        CALL FUNCTION <b>'ZSWW_SRV_MAIL_SEND'                </b>
          DESTINATION rfcdest                             
          EXPORTING                                       
            send_type               = send_type           
            send_language           = send_language       
            documentname            = documentname        
            documenttitle           = documenttitle                
            documentcontent         = document_content             
            receivers               = t_receivers_por              
            express                 = express                      
            documentexpirydate      = l_expiry_date                
            attachments             = t_attachments_por            
            address_strings         = t_address_strings            
            <b>SENDER                  = SENDER    </b>                   
          IMPORTING                                                
            result_por              = result_por                   
          EXCEPTIONS                                               
            document_not_send       = 1                            
            not_specified           = 2                            
            error_during_send       = 3                            
            error_during_attachment = 4                            
            OTHERS                  = 2.                           
        l_subrc = sy-subrc.                                        
    *~~ begin of trace specific coding ~~~~~~~~~~~~~~~~~~~~~       
        PERFORM trc_after_send <b>in program SWWSI</b> USING l_subrc.     
    *~~ end of trace specific coding ~~~~~~~~~~~~~~~~~~~~~~~       
      Check the result of the method call.                       
        CASE l_subrc.                                              
          WHEN 0.                                                  
            Set the return element (the SOFM object).               
            swc_set_element container result result_por.           
            commit work.                                           
          WHEN 1.                                                  
            exit_return 1001 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.  
          WHEN 2.                                                  
            exit_return 1002 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.  
          WHEN 4.                                                  
            exit_return 1005 sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.  
            WHEN OTHERS.                                           
              exit_return 1003 space space space space.            
          ENDCASE.                                                                               
    CATCH cx_swf_run_wim INTO lv_excp .                          
        exit_return 1006 <b>workitemid</b> space space space.                                                                               
    ENDTRY.                                                                               
    END_METHOD.

  • Change sender address when use function SO_NEW_DOCUMENT_SEND_API1

    The requirement need change the sender address when use function   SO_NEW_DOCUMENT_SEND_API1.
    for example,the fixed sender  is '[email protected]'. how to change the sender address. could you please
    provide a instance?

    Hi 莫言,
    As explained in mail home wiki here, this function module is obsolete and complex to use, please use CL_BCS instead. You can find lots of example there. And it is pretty easy to change sender address using CL_BCS instead.
    Best regards,
    Jerry

Maybe you are looking for

  • Apple TV wifi error

    Sorry for my English is very basic. Wifi does not work on my Apple TV. Only works by LAN cable. Upon entering the wireless menu there is a legend that says "Activation error". Thanks.

  • Cancellation of collective order.

    Hi PP gurus, While cancelling collective orders, all the input materials for main and sub orders were returned back (with 262 movt.) and output on the main WO also cancelled (with 102 movt.) But the output material of the sub orders were not cancelle

  • Pages5:Saving Docs as Word docs?

    Pages '09 didn't force you to save your doc in Pages format. You could choose to save it as a Word, or whatever. Now, in the new Pages, it seems you are forced to save your doc in Pages format; you can only obtain a Word copy by exporting the doc aft

  • Channels getting in scheduled status

    Hi , All the channels in PI is getting in scheduled status , the channels were working fine till 1 PM , but all of a sudden the status oof massages are going to scheduled state. There is no blocked queue in SMQ1 and SMQ2 , even there is no error in R

  • Setting a new volume for iphoto

    I had to reboot my system with Mac OS X.3, but because of memory constraints on the Mac hard drive, I had to install the operating system on my portable hard drive. It starts up okay, but iphoto now doesn't know where to go to find my iphoto library.