Passing hard code value as the sender name in  fm SO_NEW_DOCUMENT_SEND_API1

Hi Experts,
I am using one FM "SO_NEW_DOCUMENT_SEND_API1" to send mail form my program.
In the receipient inbox  under from address the mail is showing
the USER ID in which that program has been executed .
*Is it possible to send a hard coded value as a sender instead of the sap user id in the sender address * .
Regards
sarmistha
Edited by: sarmistha das on May 6, 2008 11:18 AM

Hi,
Using FM SO_NEW_DOCUMENT_SEND_API1 you cannot have hard coded sender address.
You can create your Z fm that is copy of the above fm and implement an option to have sender address.
Or you can implement below logic to send an email in your program.
*TABLES : ypgtest.
DATA: send_request       TYPE REF TO cl_bcs.
DATA: text               TYPE bcsy_text.
DATA: xtext TYPE STANDARD TABLE OF solix .
DATA: document           TYPE REF TO cl_document_bcs.
DATA: sender             TYPE REF TO if_sender_bcs.
DATA: recipient          TYPE REF TO if_recipient_bcs.
DATA: bcs_exception      TYPE REF TO cx_bcs.
DATA: sent_to_all        TYPE os_boolean.
DATA: conlength TYPE i ,
      conlengths TYPE so_obj_len ,
      result_content TYPE string .
     subject TYPE so_obj_des .
DATA: e_r_page TYPE REF TO cl_rsr_www_page.
DATA: content_length     TYPE     w3param-cont_len ,
      content_type     TYPE     w3param-cont_type,
      return_code     TYPE     w3param-ret_code .
DATA: html TYPE STANDARD TABLE OF w3html .
DATA: server TYPE string ,
      port TYPE string .
DATA: wa_rec TYPE ad_smtpadr .
DATA: bcs_message TYPE string .
  DATA : reply TYPE REF TO if_recipient_bcs.
  DATA: tmp_str TYPE string .
data: v_sender like SENDER_ID.
v_sender = SENDER_ID.
  IF NOT recepients[] IS INITIAL .
    CLEAR result_content.
    CLEAR : server, port .
    CALL FUNCTION 'TH_GET_VIRT_HOST_DATA'
       EXPORTING
         protocol             = 1
         virt_idx             = 0
  LOCAL                = 1
      IMPORTING
        hostname             = server
        port                 = port
      EXCEPTIONS
        not_found            = 1
        internal_error       = 2
        OTHERS               = 3 .
    CLEAR tmp_str .
    CONCATENATE 'http://' server ':' port '/sap/public/' INTO tmp_str .
    REPLACE ALL OCCURRENCES OF '/sap/public/' IN result_content WITH
    tmp_str .
    CLEAR tmp_str .
    CLEAR: conlength,conlengths .
    REFRESH text .
    text[] = email_body[].
    TRY.
        CLEAR send_request .
        send_request = cl_bcs=>create_persistent( ).
        CLEAR document .
        document = cl_document_bcs=>create_document(
                        i_type    = 'HTM'
                        i_text    = text
                       i_length  = conlengths
                        i_subject = subject ).
    add document to send request
        CALL METHOD send_request->set_document( document ).
        CLEAR sender .
        sender = cl_cam_address_bcs=>create_internet_address( SENDER_ID ).
        CALL METHOD send_request->set_sender
          EXPORTING
            i_sender = sender.
        CLEAR sender .
        reply = cl_cam_address_bcs=>create_internet_address( reply_id ).
        CALL METHOD send_request->set_reply_to
          EXPORTING
            i_reply_to = reply.
        CLEAR wa_rec .
        LOOP AT recepients INTO wa_rec  .
          CLEAR recipient .
          recipient = cl_cam_address_bcs=>create_internet_address(
                                            wa_rec ).
    add recipient with its respective attributes to send request
          CALL METHOD send_request->add_recipient
            EXPORTING
              i_recipient = recipient
              i_express   = 'X'.
        ENDLOOP .
        CALL METHOD send_request->set_status_attributes
          EXPORTING
            i_requested_status = 'E'
            i_status_mail      = 'E'.
        CALL METHOD send_request->set_send_immediately( 'X' ).
    ---------- send document ---------------------------------------
        CALL METHOD send_request->send(
          EXPORTING
            i_with_error_screen = 'X'
          RECEIVING
            result              = sent_to_all ).
        IF sent_to_all = 'X'.
          APPEND 'Mail sent successfully ' TO return .
        ENDIF.
        COMMIT WORK.
*                     exception handling
* replace this very rudimentary exception handling
* with your own one !!!
      CATCH cx_bcs INTO bcs_exception.
        bcs_message = bcs_exception->get_text( ).
        APPEND bcs_message TO return .
        EXIT.
    ENDTRY.
  ELSE .
    APPEND 'Specify email address for sending' TO return .
  ENDIF .
Regards,
Shravan G.

Similar Messages

  • Hard code accounts using the dynamic report templates?

    Anyone ever been able to hard code accounts using the dynamic report templates?
    How about getting the Property name/value fields to work?

    Hi,
    No, this is not possible.
    In Dynamic Report templates (which are not based on EVDRE function in version 7 and below), the only thing you can do is to not use any expansion at all and to list your specific accounts on the layout itself. Or to expand your accounts based on a dimension property.
    In version 7.5, all Dynamic Templates for Report and Input Schedules will use EVDRE function.
    Hope this helps.
    Kind Regards,
    Patrick

  • [svn] 2093: fix air-config. xml so that there are no hard-coded values for the build number.

    Revision: 2093
    Author: [email protected]
    Date: 2008-06-16 12:57:18 -0700 (Mon, 16 Jun 2008)
    Log Message:
    fix air-config.xml so that there are no hard-coded values for the build number. This gets updated from the root build.xml by using a combination of a value from build.properties, release.version, and a value passed into build.xml build.number.
    partial fix for sdk-15812
    Ticket Links:
    http://bugs.adobe.com/jira/browse/sdk-15812
    Modified Paths:
    flex/sdk/branches/3.0.x/frameworks/air-config.xml

    I need to add just one more thing and that is on battery life.  Last night I sat with the rMBP on my lap installing software, surfing the web, answering emails for close to 4 and 1/2 hours.  At the point I took it back to the charger it still was showing a computed battery time remaining of 3.5 hours.
    Today I had two VMs open and took the machine of the charger and sat outside with my dogs for about 30 minutes.  During this time I was working in both VMs, editing and compiling code.  My battery life estimate showed a good solid 4 hours. 
    This is roughly 6 times greater than what I had with my 2010 MBP and it too had a SSD.  I am not sure why but this retina MBP just seems to not work as hard doing anything that caused my 2010 MBP to struggle.
    While the battery life is certainly better than I expected it is clear that load can change that very rapidly. So I think I still need to visit clients with an external battery or charger in hand.  But I don't think I will be quite so scared that my laptop will simply run out of power before I can even get it plugged in.

  • How do I get a new value for the service name field and update it in Connection Properties?

    I am running Windows Vista. I just upgraded to Firefox 4. When I try to log on to the internet, it tells me the proxy server is refusing connections. A diagnostic reported Error 815 and said the remote server is not responding because there is an invalid value for the "Service Name" field. It said to get a new value and update it in Connection Properties. How do I do this?

    When you create a new film script, the first page you see is a title page.
    The page after this title page is the one where you generally type in your scenes.
    It looks like you are facing some issue and not able to delete any text.
    Can you please send me this script so that I can have a better look at your issue?
    You can save this script to disk by using option 'File -> Save to disk'. This will create a '.stdoc' file on your system.
    Just mail this '.stdoc' file to me at 'roverma <at> adobe <dot> com'
    Thanks

  • Setting Dynamic values to the payload-name / Content Desc

    Hi All,
    I am using a PayloadZIp module and i am trying to zip the file and retain the filename.
    For this i have done the following things. I have used PayloadZIp in the Sender channel. In the recv channel used the DynamicConfigurationBean and wrote the value as a part of message_interface and then using variable substitution i have configured made the filename as the sender name.zip
    for eg if the file zipped at the sender side is name1.txt the recv channel would be name1.txt.zip where the variable substituiton would have the value name1.txt
    but the problem is that the value of the file inside the zip is not name1,txt . I would like it to be name1.txt
    I have used the messageTransformBean and stuff tried setting the ContentTypes Desc all of them take constant values. i am not able to set the real filename as the filename for the attachment.
    Can anyone share their views on this and let meknow hw i can achieve this
    Rgds
    aditya

    Hi
    > I am using a PayloadZIp module and i am trying to zip the file and retain the filename.
    > For this i have done the following things. I have used PayloadZIp in the Sender channel.
    If you are trying to zip a file, then why are you using the PayloadZipbean on the Sender CC, you should use the module on the Receiver CC.
    > for eg if the file zipped at the sender side is name1.txt the recv channel would be name1.txt.zip where the variable substituiton would have the value name1.txt
    >
    > but the problem is that the value of the file inside the zip is not name1,txt . I would like it to be name1.txt
    >
    What file name are you getting now?
    have a look at this blog : http://www.sdn.sap.com/irj/scn/weblogs;jsessionid=%28J2EE3417700%29ID0591392850DB01436613452367233705End?blog=/pub/wlg/5899
    Pooja.

  • Changing the sender name of WF-BATCH

    Hi,
    I am new to workflow programming and looking for guidance on changing the sender name of the emails going (SENDMAIL activity) as WF-BATCH user.
    I looked at the input from this group on similar question and understood that what I need to achieve can only be done via FM SO_DOCUMENT_SEND_API1.
    I am unsure how to accomplish this if the email I am sending out needs to read the description captured in the task (whic is a dialog method) before this (TS01000140).
    Can anyone give me inputs on how to achieve this?
    Thanks for commenting.
    María

    Hi,
    First of all, you might want to check class cl_bcs for sending emails. Basically your function will do the same but this class is a bit more functionality. Plenty of examples in SCN/Internet.
    Whatever function/method you will choose to use, the idea is to develop a workflow method, and then call the email sending function/method from this method. Then you of course develop a task that will call your new method. Now, you will need certain parameters for the email sending function/method: subject, body text, recipient, etc. You need to either deliver these parameters for the method from your workflow container or build some additional logic to the workflow method. E.g. if your task TS01000140 gets the email text into the workflow container, then you need to bind it to your email sending task (and to the method) => you need to add this to your task container and then add it as a parameter to your method.
    One additional hint: When building the custom logic, pay attention to email language. You want to deliver the emails in correct language, so the recipient language must be known before the email is sent...
    Regards,
    Karri 

  • How to change the sender name "workflow system" to Diff name

    Hi ,,
      How to change the mail sender name that is "workflow system" to different name. Whenever the mail is triggered it shows the sender name as "workflow system" . i want to change the name of the sender..Even i changed the name of the WF-Batch(name) user but no use.. Pls advice.
    regards,
    Roops.

    Hi Roops,
    Check if the following [link1|Re: How to change text of wf batch??] [link2|Update should not happen in the name of WF-BATCH] helps you.
    Regards,
    Saumya

  • The mail server responded: sorry, the sender name and auth login doesn't coincide (#5.7.1)

    I get the following message on trying to send emails from my yahoo account
    An error occurred while sending mail. The mail server responded: sorry, the sender name and auth login doesn't coincide (#5.7.1). Please verify that your email address is correct in your Mail preferences and try again.
    Help!

    Check if the client connector used to connect with the 587 port is allowed to accept authentication on Plain Text.
    Try a relay connector if you want to send the email without the authentication.
    http://technet.microsoft.com/en-us/library/bb232021(v=exchg.141).aspx
    Syed MM Messaging SME - IBM || MCTS || MCSE || MCSA || VCP5 || VCA ||

  • Bold the hard code value in sap-script

    Hi friends,
        Could anyone tell me how to display 1st half of hard code text in bold and 2nd half in unbold of a line of hardcode text ?
    Pls treat it urgent
    I will reward for every useful responses.
    Thx in Adv.
    Bobby

    hi,
    Create a character format for bold using Se72.
    let the charcter format is c1.
    Then call the style as
    /: Style <STYLE NAME>
    then In the editor Write like this
    <c1>Hi How</c1> r u
    it will display Hi How as bold and r u as simple.
    regards
    Sandipan

  • Code to retrive the sender and receiver interface names using custome adapter module

    Hello Team,
    I want to develop an custom adapter module which could retrieve the names of the sender and receiver interfaces of the scenario and for that i am trying to use com.sap.aii.af.service.administration.api.monitoring.ProcessContextFactory.ParamSet but i don't know whether this API will support or not and also i don't know how to develop the code using this API so please suggest me some code for it so that i could retrieve the names.
    Thanks you all in advance.
    Regards,
    Avinash.   

    Hi,
    Just ASMA setting will do the needful. Are you planning to rename your target file name. If yes then only you will require UDF.
    Update: Since your directory name will be taken from source file name then you have to use mapping for this, else it will not be possible.
    I don't know if creating a new module for this will help you solve the issue, but in that case rather creating adapter module, mapping will be easier.
    Regards,
    Sarvesh
    Edited by: Sarvesh Singh on Dec 7, 2009 3:04 PM

  • Passing a default value to the master block and do the auto query

    Hi
    My problem is i have a MD FORM to which i have to pass a default value and do an auto query so that when i run the form the form should open with this default value and do the query and get the details.
    I tried many things like trying to set the value of the column using p_session.set_value and then calling the same form using wwa_app_module_link by using the value in the condition but every time unless i press the query button i did not get the values.
    Now i don't know what to do.
    My portal version is 3.0.7.6.2
    Some body please help me
    thanks
    Sreedhar

    I don't think this works for 3 parameters, but I know it will work for 1. Maybe you can do something with it.
    1. Create a link to the destination component (YourProvider.YourLink)
    2. Use the code below to use that link to pass the value of a form field to the destination component. 'FieldName' is the field on the destination component you want to query, and '_FieldName_cond' is the condition. This creates the destination URL.
    3. wwa_app_module.set_target(l_url) will send you to the URL you generated.
    l_url := PORTAL.wwv_user_utilities.get_url('YourProvider.YourLink', 'FieldName', v_YourParameterValue, '_FieldName_cond', '=');
    portal.wwa_app_module.set_target(l_url);
    I'm not the best at this, but this works for me in most cases.

  • How to hard code values in drop down by index

    Hi everyone
    I hav a node containing 2 attributes ie value n key. I am using drop down by index.  Value attribute is bound to my drop dwn box. In key I am providing key value for the value.  I need to hard code 3 value..Can anyone help me how to do so.
    Thanks
    Jaspreet Kaur

    Hi,
    Example for Data Binding of the DropDownByIndex UI Element:
    Procedure at design time:
           1.      Create a view with the name TestView.
           2.      Insert the DropDownByIndex UI element as a container child of the TestView view. (Step 1)
           3.      Create the context structure, as described in step 2.
    Create the context node X with the cardinality 0..n. Insert the value attribute y of the type String into this node. Then perform the data binding of the DropDownByIndex UI element in the Properties window of the View Designer. The texts property must be bound to the value attribute y with the context path description TestView.X.y (step 3).
    The context path TestView.X.y describes the attribute y in the context node X of the view context of the TestView view.
    You can fill the context with test data using the following controller implementation.
    public void wdDoInit()
        //@@begin wdDoInit()
       String[] letters = new String []
       {"A", "B", "C", "D"};
    //Create context elements for the node "X"
       List nodeElements = new ArrayList();
       for (int i =  0; i <letters.length; ++i)
          IPrivateTestView.IXElement xElement = wdContext.createXElement();
          xElement.setY(letters<i>);
          nodeElements.add(xElement);
    //Bind node element list to the node
       wdContext.nodeX().bind(nodeElements);
    //Set node’s lead selection which determines the selected item
       wdContext.nodeX().setLeadSelection(1);
        //@@end
    Regards
    Ayyapparaj

  • How to pass line item values in the table paramer of FM

    Hi all,
    When i will give the import of  the FM as VBELN"sales order number.
    I want to display all the line items for "PO Quantity in the out put of the FM.
    For this i thnk i have to pass the line item values in the table parameter of the FM.
    Can any body please tell me how to pass the values for the line items in the table parameter fo teh FM.
    Please give a example.
    Thanks

    Sub pLoopThroughPivotFields()
    Dim oItem As Excel.PivotItem
    Dim oField As Excel.PivotField
    Set oField = ThisWorkbook.Worksheets("Sheet1").PivotTables("Pivot Table name").PivotFields("field name")
    For Each oItem In oField.PivotItems
    oField.CurrentPage = oItem.Name
    'Put your copy code here
    DoEvents
    Next oItem
    End Sub
    Felipe Costa Gualberto - http://www.ambienteoffice.com.br

  • How can I add form field value to the file name in save as dialog box

    I do not want the form to be saved automatically, just want the form to auto populate the "file name" only.
    A little background on the forms I want to use:  My company has 70 retail outlets, I'll use one of our pdf forms called an "Incident Report" as an example.  I would like for a store manager to be able to complete the form, then email the form to the main office (I already have javascript to add field values and form name to the email subject line), once the main office receives it, I want for them to be able to file the pdf electronically on our server.  We have mutliple forms that we use so I do not want any of the forms to automatically save anywhere, (at this time anyway) I just want the office personnel to be able to click "save as" (or whatever they will need to click) and the form automatically add certain field values from the pdf they have received, of which will be different each time the form is sent to the office (Date, store #, employee name etc.) in addition to the name of the form in the "File name" of the "Save As" dialog box.  The main office employees will decide into which server file the pdf should be saved.
    I'm using Acrobat 8 professional, the stores and office personnel use Adobe reader.
    One little note:  We currently print and file a lot of paper on a daily bases, as soon as I can get this to work, we are going green.
    Me and a lot of trees in this will really apprecitate any help you can give with this!  :-)

    You might want to take a look at the document "Developing Acrobat Applications Using JavaScript" (js_developer_guide.pdf) which is part of the Adobe Acrobat SDK, which can be downloaded here. Read the "Privileged versus non-privileged context" (p. 45ff.). You will find an example for "Executing privileged methods in a non-privileged context". Should be almost exactly what you are looking for.
    Small Outline: For security reasons ("the user always has to know what's going on") you are not allowed to use the "Doc.saveAs"-method without the user permission (--> in a non-privileged context). In order to reach the goal of a privileged context you can use a trusted function. You do this by creating a JavaScript file (*.js) in either the Application-JavaScript-Folder (default location on Windows systems: "%ProgramFiles%\Adobe\Acrobat 10.0\Acrobat\Javascripts") or the User-JavaScript-Folder (default location on Windows systems: "%AppData%\Adobe\Acrobat\10.0\JavaScripts"). Add the following content to the new file:
    myTrustedBrowseForDoc = app.trustedFunction( function ( oArgs ) {
         app.beginPriv();
              var myTrustedRetn = app.browseForDoc( oArgs );
         app.endPriv();
         return myTrustedRetn;
    myTrustedSaveAs = app.trustedFunction( function ( doc, oArgs ) {
         app.beginPriv();
              var myTrustedRetn = doc.saveAs( oArgs );
         app.endPriv();
         return myTrustedRetn;
    The developer guide actually wants you to add this content to the existing "config.js" file. I recommend creating a new file, since its easier to deploy in a network. Either way, every client/user who needs to be able to save documents this way, needs this JavaScript Code in his Application/User-JavaScript-Folder.
    Within the Acrobat Document, which you want to obtain a certain file name, you can now use the trusted functions "myTrustedBrowseForDoc" and "myTrustedSaveAs" to store the file. To call the trusted functions and deliver the file name you can either you use a form field (button) or you add a new menu item. Add the following JavaScript Action to the button/menu item and change "Roller Coaster" to the name of the field which contains the value which you want to become the new file name:
    var fileName = this.getField("Roller Coaster").valueAsString;
    try {
         var oRetn = myTrustedBrowseForDoc({bSave: true, cFilenameInit: fileName + ".pdf"});
         try {
              myTrustedSaveAs(this, { cPath: oRetn.cPath, cFS:oRetn.cFS });
         catch(e) {
              console.println("Save not allowed, perhaps readonly.");
    catch(e) {
    console.println("User cancelled Save As dialog box");
    Good Luck!

  • Passing selection screen values to the next report using CALL TRANSACTION

    Hi experts,
    I have 2 reports. In the first report i have the 3 input fields in the first report, how do i pass the values to the next report which is transaction: ZKKBC_PKO_2.
    I want to display in the next report the selections that the user previously selected.
    First report:
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: COMP     LIKE AFRU-WERKS OBLIGATORY MODIF ID s1.
    PARAMETERS: PERIOD   LIKE COEP-PERIO OBLIGATORY MODIF ID s1.
    PARAMETERS: YEAR     LIKE COEP-GJAHR OBLIGATORY MODIF ID s1.
    SELECTION-SCREEN END OF BLOCK b1.
    CALL TRANSACTION 'ZKKBC_PKO_2'.
    Anyone can help me?
    Thanks,
    Lawrence

    Hi experts,
    What i did is this:
    Using SET PARAMETER
    in the first report
    SET PARAMETER ID 'WRK' FIELD COMP.
    SET PARAMETER ID 'VPE' FIELD PERIOD.
    SET PARAMETER ID 'GJR' FIELD YEAR.
    CALL TRANSACTION 'ZKKBC_PKO_2'.
    Second Report
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    PARAMETERS: WRK     LIKE AFRU-WERKS.
    PARAMETERS: VPE     LIKE COEP-PERIO.
    PARAMETERS: GJR     LIKE COEP-GJAHR.
    SELECTION-SCREEN END OF BLOCK blk1.
    Using SUBMIT
    First Report
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: COMP     LIKE AFRU-WERKS OBLIGATORY MODIF ID s1.
    PARAMETERS: PERIOD   LIKE COEP-PERIO OBLIGATORY MODIF ID s1.
    PARAMETERS: YEAR     LIKE COEP-GJAHR OBLIGATORY MODIF ID s1.
    SELECTION-SCREEN END OF BLOCK b1.
    SUBMIT ZCO_PRDCOST_ACTUAL_2 VIA SELECTION-SCREEN USING SELECTION-SETS OF PROGRAM 'ZCO_PRDCOST_ACTUAL_1' AND RETURN.
    Second Report:
    GET PARAMETER ID 'WRK' FIELD comp.
    GET PARAMETER ID 'VPE' FIELD COEP-PERIO.
    GET PARAMETER ID 'GJR' FIELD YEAR.
    Either this 2 ways i still cannot get the first report selection values on the 2nd report. Can someone help me see if my codes is correcT?

Maybe you are looking for

  • Crystal Report and stored procedure calls

    Hi, 1.   I am trying to access a Stored Procedure through Crystal Reports 2008. I have 3 Parameters in it and now I need the 2 Parameters from the stored Procedure to be given by User and the 3rd Parameter should be passed from the backend code. Plea

  • How to display calendar

    So I've been working on this problem but i am stuck in the formating of the days integers for each calendar month here is the problem Displaying calendars (filename: DisplayCalendars.java) Design an algorithm and then write a Java program that prompt

  • ODBC Client/Server mode, multi-thread running problem

    I got following message when I was running mutithread program, with ODBC API. Does anyone have this experence? Who can solve this? thanks! [TimesTen][TimesTen 7.0.4.0.0 CLIENT]Communication link failure. System call recv() failed with OS error 73. EC

  • Remove hidden app

    A friend has an imcomplete Facebook app installation. It is in the Settings and one can get to Facebook from there but there is no icon for it. If one goes to the running applicstions ( by double-clicking the home button), its icon shows up with the

  • ATI and NVidia Card in MacPro - Setting primary GPU

    Hi I have a ATI 5870 (offiical, from apple store) in slot 1 and a NVidia GT120 (came with purchase) in slot 2, I want the computer to do the processing with the faster, bigger, better, I-paid-lot-of-money-for-this 5870, but things like Cinema 4D seem