Create a List of receivers for the FM SO_NEW_DOCUMENT_SEND_API1 on screen

Hello everybody,
I user the FM SO_NEW_DOCUMENT_SEND_API1 to send mails from SAP. I send the mail to different types of receivers. SAP users, external receivers, ...
I have define this list of receivers with a distribiution list in the Business Workplace (SO23).
There you define for each row of the list which type is it.
Now I have a problem.
I want to implement a report which sends the output to n receivers. This receivers can be different types. I don't want to use a static distribution list in SO23.
I will send the mail to n dynamic receivers which should be defined in the selection screen.
The problem is that I don't know how I can define the receiver type for an receiver.
This means I need something like the table in SO23 on my screen where I can insert any receivers with the adress and the adapted type.
Do anybody of knows how I can solve this behaviour?
Regards and thank you
Christian
Edited by: Christian Swonke on Mar 4, 2008 9:58 AM

Hi
Try this,
Add the recipients email address
  CLEAR wa_receivers.
  REFRESH it_receivers.
  wa_receivers-receiver   = c_mailid_1.
  wa_receivers-rec_type   = c_u.
  wa_receivers-com_type   = c_int.
  wa_receivers-notif_del  = c_x.
  wa_receivers-notif_ndel = c_x.
  APPEND wa_receivers TO it_receivers.
Add the recipients email address
  CLEAR wa_receivers.
  REFRESH it_receivers.
  wa_receivers-receiver   = c_mailid_2.
  wa_receivers-rec_type   = c_u.
  wa_receivers-com_type   = c_int.
  wa_receivers-notif_del  = c_x.
  wa_receivers-notif_ndel = c_x.
  APPEND wa_receivers TO it_receivers.
Add the recipients email address
  CLEAR wa_receivers.
  REFRESH it_receivers.
  wa_receivers-receiver   = c_mailid_3.
  wa_receivers-rec_type   = c_u.
  wa_receivers-com_type   = c_int.
  wa_receivers-notif_del  = c_x.
  wa_receivers-notif_ndel = c_x.
  APPEND wa_receivers TO it_receivers.
Add the recipients email address
  CLEAR wa_receivers.
  REFRESH it_receivers.
  wa_receivers-receiver   = c_mailid_4.
  wa_receivers-rec_type   = c_u.
  wa_receivers-com_type   = c_int.
  wa_receivers-notif_del  = c_x.
  wa_receivers-notif_ndel = c_x.
  APPEND wa_receivers TO it_receivers.
Add the recipients email address
  CLEAR wa_receivers.
  REFRESH it_receivers.
  wa_receivers-receiver   = c_mailid_5.
  wa_receivers-rec_type   = c_u.
  wa_receivers-com_type   = c_int.
  wa_receivers-notif_del  = c_x.
  wa_receivers-notif_ndel = c_x.
  APPEND wa_receivers TO it_receivers.
Add the recipients email address
  CLEAR wa_receivers.
  REFRESH it_receivers.
  wa_receivers-receiver   = c_mailid_6.
  wa_receivers-rec_type   = c_u.
  wa_receivers-com_type   = c_int.
  wa_receivers-notif_del  = c_x.
  wa_receivers-notif_ndel = c_x.
  APPEND wa_receivers TO it_receivers.
Perform send_file_as_email_attachment.
*&      Form  send_file_as_email_attachment
Form for sending the data in an e-mail as an Excel attachment
FORM send_file_as_email_attachment.
Declaration of the local variables used for passing the values to the function module.
  DATA: ld_mtitle              TYPE  sodocchgi1-obj_descr,
        ld_email               TYPE  somlreci1-receiver,
        ld_format              TYPE  so_obj_tp ,
        ld_attdescription      TYPE  so_obj_nam ,
        ld_attfilename         TYPE  so_obj_des ,
        ld_sender_address      TYPE  soextreci1-receiver,
        ld_sender_address_type TYPE  soextreci1-adr_typ.
Passing the values to the local variables
  ld_mtitle              = text-001.                                   " Mail title.
  ld_format              = c_xls.                                      " Mail format.
  ld_attdescription      = text-012.                                   " Mail attachment description.
  ld_attfilename         = text-011.                                   " Filename.
  ld_sender_address      = ''.                                         " sender address.
  ld_sender_address_type = ''.                                         " sender addres type.
Fill the document data and get size of attachment
  CLEAR: wa_docdata, wa_attach.
  READ TABLE it_attach INTO wa_attach INDEX v_lines.
  wa_docdata-doc_size   = ( v_lines - c_1 ) * c_255 + STRLEN( wa_attach ).
  wa_docdata-obj_langu  = sy-langu.
  wa_docdata-obj_name   = c_saprpt.
  wa_docdata-obj_descr  = ld_mtitle.
  wa_docdata-sensitivty = c_f.
  CLEAR it_attachment.
  REFRESH it_attachment.
  it_attachment[] = it_attach[].
Describe the body of the message
  CLEAR wa_packing_list.
  REFRESH it_packing_list.
  wa_packing_list-transf_bin = space.
  wa_packing_list-head_start = c_1.
  wa_packing_list-head_num   = c_0.
  wa_packing_list-body_start = c_1.
  DESCRIBE TABLE it_message LINES wa_packing_list-body_num.
  wa_packing_list-doc_type = c_raw.
  APPEND wa_packing_list TO it_packing_list.
Create attachment notification
  wa_packing_list-transf_bin = c_x.
  wa_packing_list-head_start = c_1.
  wa_packing_list-head_num   = c_1.
  wa_packing_list-body_start = c_1.
  DESCRIBE TABLE it_attachment LINES wa_packing_list-body_num.
  wa_packing_list-doc_type   =  ld_format.
  wa_packing_list-obj_descr  =  ld_attdescription.
  wa_packing_list-obj_name   =  ld_attfilename.
  wa_packing_list-doc_size   =  wa_packing_list-body_num * c_255.
  APPEND wa_packing_list TO it_packing_list.
  CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
    EXPORTING
      document_data              = wa_docdata
      put_in_outbox              = c_x
      sender_address             = ld_sender_address
      sender_address_type        = ld_sender_address_type
      commit_work                = c_x
    IMPORTING
      sent_to_all                = wa_sent_all
    TABLES
      packing_list               = it_packing_list
      contents_bin               = it_attachment
      contents_txt               = it_message
      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.
  IF sy-subrc = 0.
    MESSAGE s019(ztrack_toolmsg) WITH text-002.             " E-mails have been sent to the mentioned people.
   LEAVE LIST-PROCESSING.
  ELSE.
    MESSAGE s019(ztrack_toolmsg) WITH text-003.             " Message sending failed.
   LEAVE LIST-PROCESSING.
  ENDIF.
  REFRESH: it_packing_list,
           it_attachment,
           it_message,
           it_receivers.
ENDFORM.                    " send_file_as_email_attachment
Regards
Rohini.

Similar Messages

  • Create a list or container for states of a statemachine

    Hi,
    I am working on an application where several different types of devices will be put into a test fixture for board level testing.  Based on the type of board, i need to create an ordered list of all of the tests necessary for the device.  I have a state machine and a unique state for each of the tests and am trying to figure out how to create a list of tests for the specific device.  I want to have a check in each of the states to remove the first item of the list and then take the next value and wire it to the shift register used to go from state to state.  This should allow the state machine to switch to the appropriate state based on the device type and its necessary test sequence.
    Should this be implemented with an array?  Is there some easier container to work with for this use case?  I need a container that will allow me to easily add between 5 and 30 state names (based on the needs of the device type) and easily remove them or increment a pointer to the next state in the container.
    Thanks,
    Gary
    Solved!
    Go to Solution.

    I would avoid using the stacked sequence at all cost. This is not a very good approach to the solution. How are you determining which tests need to be run at which time? I would use a loop to enqueue the desired tests. You can use a separate table (which could be initialized from an external source such as an ini file) which defines all your available tests, hich hardware they apply to and the order they would need to be run. When your specific hardware is selected you can iterate over the table and select the tests that need to be executed. Using the state machine is still a good idea since it allows you to interrupt the exection as well as insert or include other general tasks that may be required during the tests.
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • TS3988 How do I create a List (multiple recipients) for my iCloud email?

    What steps must I take to create a List (multiple recipients) for my iCloud email?  I will be corresponding with a fied group of contacts over the course of a 3-month project.  I need to create a List/Alias that will send the same message to some 18-20 members of this group in a single email exchange.

    lets try this again. A PST file is an outlook file. Thunderbird does not and never has created them.
    https://addons.mozilla.org/en-US/thunderbird/addon/importexporttools/
    Use the add-on to export your mail as EML. This is a fairly standard format that just abut any mail client can read. Except Outlook.

  • Parts Requirement Create Order Error:Validation Failed for the field - Shipping Method DHL

    Trying to create Parts Requirement.
    Error message on clicking "Create Order" button: "Validation Failed for the field - Shipping Method DHL"
    Please suggest the Setup that needs to be done for this.

    Kinck
    The same script worked for me in vision (R12.1). You may have issues with your defaulting of a number of attributes that you are not passing in the API (like price list, line type and so on). You may want to check them.
    Thanks
    Nagamohan

  • Has anyone created a NI-VXI driver for the Ardence RTX operating system?

    Has anyone created a NI-VXI driver for the Ardence RTX operating system?
    a VXI instrument through a PCI-VXI-8335 card (in the PC) talking to a PCI-VXI-8345 card (in the VXI chassis) via MXI-3, Has anyone created a PCI-VXI-8335 card  driver for the Ardence RTX operating system?

    Now  i want  develop driver on RTX,my hard platform is similiar(PCI8335+VXI8340+1418A),and after i read the PCI baseaddress,i find PCI8335 only has memory-map,so that means if i want to driver this board ,so i take following steps list below:
    1.use Rtmapmemory() to map the baseaddress to virtual address
    2.using memset() or memcpy() to driver the 1418A board
    is this right?
    if you can give me some hints,thanks 
    or you can contact me :[email protected] 

  • Is there any object in labview that contains a list of data for the user to select (selection one at a time) or add a new data?

    Is there any object in labview that contains a list of data for the user to select (selection one at a time) or add a new data?

    List and table controls -> listbox..is that what you are thinking of?
    The listbox presents the user with a list of options, and you can set it to only accept one selection at a time...Adding new data to the list can not be done directly by the user but if you make e.g. a text control and a button you can programatically insert new objects described in the text box when the button is pressed...(see example).
    If you need more than one column you have the multicolumn listbox. If you want the users to write new entries directly yu can use a table and read selected cells using it's selection start property to read what cell has been selected.
    MTO
    Attachments:
    Listbox_example.vi ‏34 KB

  • Can we create a local client copy for the RFID Client in discovery Box

    Can we create a local client copy for the RFID(400 Client) in the Discovery Box,and if created which profile we have to select for the client and also at a time we can work on these both client or not  .

    This isn't possible with Live Mail.  Acrobat has an add-in for Outlook (which you've used), but there is no similar function for Live Mail.

  • Is there a list of shortcuts for the camera raw plugin anywhere?

    Is there a list of shortcuts for the camera raw plugin anywhere?
    The link under Bridge no longer works

    I've not had time to check all of the changes from Bridge 2 to 2.1 but attachment (approx 400KB) should be pretty close.
    BTW: check out the result of of Alt/Option dragging sliders in Split Tone panel ;-)

  • HT201320 Both of my kids have an iPod Touch.  Can I have two iPods registered on the same email account or do I have to create a new email account for the second one?

    Both of my kids have an iPod Touch.  Can I have two iPods registered on the same email account or do I have to create a new email account for the second one?

    There is some info in this discussion.
    https://discussions.apple.com/thread/6024120?tstart=0

  • Can you create a table of contents for the documents within a PDF Portfolio?

    If I create a pdf portfolio that contains multiple documents (e.g. Word, multiple PDFs and Excel documents), is there a way to create a table of contents at the beginning of the portfolio to help navigate to the individual documents?

    Hi,
    The Files list displays a list of files, so the user can quickly see all the files in the portfolio with any information you want to share; title, description, file type, size etc.
    Or, you can also use a different layout, for example, the Linear and use the space next to each file to describe it.
    Hope this helps.......
    JGaf

  • How to get list of permissions for the PCD location

    Hello Team,
    I have group called "ABC". We have lots of roles created in PCD, and some of the roles are assigned to "ABC" group. I want to list out all the roles which is added to the group "ABC".
    Can you please help me?
    Thanks
    Manoj K

    Hi,
    Thanks for the reply.
    Yes, i would like to know what are all the PCD roles which are assigned to group "ABC".
    Yes, you are right, that we can select the group in user Management and if we click on the "Assigned roles" and if we use the string * then we will get a list.
    But if i do that, it is giving below information.
    Last search returned 134 elements. This exceeded the defined max hits of 50. Narrow your search criteria and search again.
    So,this information i got when i select the Search Recursive button, So, i want to know how to get these 134 list from User Management.
    Thanks
    Manoj K

  • Finesse -( UCCX 10) - Create a list of actions for Call ends

    Hi,
    I want to create a list of actions in Finesse, when the call ends for Agent, it dials another Trigger.  How can I do that?
    There are two options, Browser pop-up or HTTP Request. Unfortunately there is not enough document about this on the net.
    Thanks,
    HM

    Hi,
    Actually my requirement is to allow users to select multiple values from an LOV i.e. 7,8,11 (comma seperated). As it is not possible with the standard list of values to select multiple values so I'm using the above document from the Metalink to create an LOV with the same look and feel as the standard LOV of forms. I've tried all the steps but unfortunately no luck.
    Elements in List => put one item with space <--- i'm confused on this one, may be i'm not setting this properly.
    Thanks
    regards
    RM

  • Error while creating request list Unable to detect the SAP system directory

    We are upgrading SAP BW (NW 7.0 EHP1) to SAP BW (NW 7.3)
    source OS: Windows 2008 R2,  source DB: MSSQL server 2008 R2 SP1 CU3
    I had started the upgrade by running: STARTUP.BAT
    I had started the DSUGui on the server (CI / DB on the same server) from: D:\usr\sap\BP1\upg\sdt\exe\DSUGui.bat
    I ran both programs (run as administrators).
    Once SAP Gui connects and was able to create userid/ password and when ready to start the initialization phase (click next)
    gives me the error
    Error while creating request list - see preceeding messages. Unable to detect the SAP system directory on the local host
    I had tried STARTUP.BAT "jce_policy_zip=Z:\export-import\downloads\jce_policy-6'  and still the same error.
    I had started DSUGui.bat with trace and the trace file contents are
    <!LOGHEADER[START]/>
    <!HELP[Manual modification of the header may cause parsing problem!]/>
    <!LOGGINGVERSION[2.0.7.1006]/>
    <!NAME[D:
    usr
    sap
    bp1
    upg
    sdt
    trc
    server.trc]/>
    <!PATTERN[server.trc]/>
    <!FORMATTER[com.sap.tc.logging.TraceFormatter(%d [%s]: %-100l [%t]: %m)]/>
    <!ENCODING[UTF8]/>
    <!LOGHEADER[END]/>
    Jan 11, 2012 10:14:58 AM [Error]:                          com.sap.sdt.engine.core.communication.AbstractCmd.log(AbstractCmd.java:102) [Thread[ExecuteWorker,5,main]]: Execution of command com.sap.sdt.engine.core.communication.CmdActionEvent@376433e4 failed: while trying to invoke the method java.io.File.getAbsolutePath() of an object returned from com.sap.sdt.dsu.service.req.DSURequestListBuilder.getSystemDir()
    Jan 11, 2012 10:14:58 AM [Error]:                          com.sap.sdt.engine.core.communication.AbstractCmd.log(AbstractCmd.java:103) [Thread[ExecuteWorker,5,main]]: java.lang.NullPointerException: while trying to invoke the method java.io.File.getAbsolutePath() of an object returned from com.sap.sdt.dsu.service.req.DSURequestListBuilder.getSystemDir()
    Jan 11, 2012 10:14:58 AM [Error]:                          com.sap.sdt.engine.core.communication.AbstractCmd.log(AbstractCmd.java:103) [Thread[ExecuteWorker,5,main]]: java.lang.NullPointerException: while trying to invoke the method java.io.File.getAbsolutePath() of an object returned from com.sap.sdt.dsu.service.req.DSURequestListBuilder.getSystemDir()
    Jan 11, 2012 10:14:58 AM [Error]:                                                 com.sap.sdt.engine.core.communication.CmdActionEvent [Thread[ExecuteWorker,5,main]]: java.lang.NullPointerException: while trying to invoke the method java.io.File.getAbsolutePath() of an object returned from com.sap.sdt.dsu.service.req.DSURequestListBuilder.getSystemDir()
         at com.sap.sdt.dsu.service.req.DSURequestListBuilder.persistSystemInfo(DSURequestListBuilder.java:277)
         at com.sap.sdt.dsu.service.DSUService.createRequestList(DSUService.java:338)
         at com.sap.sdt.dsu.service.controls.DSUListener.actionNext(DSUListener.java:144)
         at com.sap.sdt.dsu.service.controls.DSUListener.actionPerformed(DSUListener.java:67)
         at com.sap.sdt.server.core.controls.SDTActionListener$Listener.actionPerformed(SDTActionListener.java:46)
         at com.sap.sdt.engine.core.communication.CmdActionEvent.actOnEvent(CmdActionEvent.java:43)
         at com.sap.sdt.engine.core.communication.CmdEvent.execute(CmdEvent.java:69)
         at com.sap.sdt.engine.core.communication.ExecWorker.handleCmd(ExecWorker.java:36)
         at com.sap.sdt.engine.core.communication.AbstractWorker.run(AbstractWorker.java:93)
    I could not get Upgrade started.  Any help is appreciated
    Thanks
    Prathap

    Did you get this solved?
    I have the same problem

  • Can i create more than one attributes for the custom class created using java API

    Hello everyone,
    I have been creating class and its attributes programatically using java APIs, I want to know that is there any way to create multipal attributs for the same class in just one call of API with all the options for each attributes,
    thanks

    You can create a new class and define all of the Attributes at the time the class is created - this is the preferred way of creating classes. Use the addAttributeDefinition() method on ClassObjectDefinition. If you need to add attributes to existing classes, you can only add them one at a time (using the addAttribute() method on ClassObject).
    (dave)

  • How do I create a new .DS_Store file for the Desktop?

    I have an account, in this case it is the System Administrator account (which I seldom use), where the Desktop icons all scrunch up to the right side of the screen. I can re-arrange them, but when I log out and sign back on, the icons are shifted back to the right side of the screen. I thought perhaps I had a corrupted .DS_Store file that needed to be removed. However, it turns out that I can find no .DS_Store file to remove for this account. Finder just doesn't seem to be able to create a new one. I'm not sure how or when the old one disappeared.
    Any suggestions how I can get the Finder or something else to create a new .DS_Store for the Desktop so that icons will stay put?

    I think I found an answer (not a solution) to my problem. Consulting with Apple Support, there is no way for the System Administrator's desktop to "remember" the positions of icons from one session to the next. They will always move to the right-hand side of the screen when you log back in. Apparently this is a change that occurred with OS 10.6.4. No reason by Apple given for the change, nor is it readily apparent to me why the Desktop or Finder in the System Admin account should work any differently than in any other account. Might simply be an oversight or a bug.
    If anybody has a fix, I would appreciate learning about it.

Maybe you are looking for