Not able to Pass header info to Microsoft MapPoint WebService using WLS10

We are passing some Header info to the MapPoint Web Service from our client Web Service which is hosted in Weblogic 10, however we are not sure if the info is getting passed.
The actual soap header which we are trying to postis as below:
<env:Header xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<m:CustomerInfoFindHeader xmlns:m="http://s.mappoint.net/mappoint-30/">
<m:CustomLogEntry>2</m:CustomLogEntry>
</m:CustomerInfoFindHeader>
</env:Header>
We are using the below code snippet for setting the header:
Document doc = null;
try
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
factory.setNamespaceAware(true);
doc = factory.newDocumentBuilder().newDocument();
catch(ParserConfigurationException pce)
System.out.println("ERROR -> " + pce.getMessage());
Element header = doc.createElementNS("http://schemas.xmlsoap.org/soap/envelope/", "SOAP-ENV:Header");
Element headerContent = doc.createElementNS("http://s.mappoint.net/mappoint-30/","m:CustomerInfoFindHeader");
Element headerChildContent = doc.createElementNS("http://s.mappoint.net/mappoint-30/", "m:CustomLogEntry");
headerChildContent.appendChild(doc.createTextNode("2"));
headerContent.appendChild(headerChildContent);
header.appendChild(headerContent);
Attr nsAttr = doc.createAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:m");
nsAttr.setValue("http://s.mappoint.net/mappoint-30/");
headerContent.setAttributeNodeNS(nsAttr);
findServiceControl.setOutputHeaders(new Element[] {header});
Here findServiceControl is the Service Control object.
Even if the code is not throwing any error/exception I am not able to see the header portion which invoking the Mappoint Web Service (using the weblogic test client for testing the webservice).
Is there any other methodology for setting the header.
Regards
Sanjeev Singh

If you're not sure the header is being created properly, you should switch to using a javax.xml.transform.stream.StreamSource and javax.xml.transform.dom.DOMResult. For instance:
import java.io.ByteArrayInputStream;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.stream.StreamSource;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
StringBuffer xml = new StringBuffer()
.append("<env:Header ")
.append("xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\">")
.append("<m:CustomerInfoFindHeader xmlns:m=\"http://s.mappoint.net/mappoint-30/\">")
.append("<m:CustomLogEntry>2</m:CustomLogEntry>")
.append("</m:CustomerInfoFindHeader>")
.append("</env:Header>);
TransformerFactory xformFactory = TransformerFactory.newInstance();
Transformer transformer = xformFactory.newTransformer();
ByteArrayInputStream bais = new ByteArrayInputStream(xml.toString().getBytes());
DOMResult result = new DOMResult();
transformer.transform(new StreamSource(bais), result);
Document document = (Document)result.getNode();
findServiceControl.setOutputHeaders(new Element[] {document.getDocumentElement()});
If you want to see the SOAP request being sent to the Mappoint Web Service, add the following to the JAVA_OPTIONS environment variable (in the startWebLogic.cmd file), and bounce it:
-Dweblogic.wsee.verbose=*
-Dweblogic.log.RedirectStdoutToServerLogEnabled=true
This will write the SOAP request (and SOAP response) to the server log of the WebLogic Server instance, which the service control is running in.

Similar Messages

  • Not able to pass portal login page with valid credentials using WebDispatch

    Hi,
    We are implementing SAP BillerDirect Portal. To make BillerDirect Portal available over the internet, we Configured SAP WebDispatcher with SSL termination.  We followed the steps mentioned in SAP Help Documentaion for SAP WebDispatcher with SSL termination.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/76/6d4fa247d0d647b5bd40745400d873/frameset.htm
    We created certificate  and send it to CA (TrustCenter CA). We received the CA response and we imported the certificate.
    AS mentioned in the help document, we configured the SAP Web Dispatcher profile to support SSL termination
    We tried to access our BillerDirect Portal over the internet using below link
    https://company.com/bd
    We are getting login page, once we enter correct user ID and Password, portal is not loading (not going to next page) portal remains on same login page.
    If we enter invalid credentials portal login page is giving u201CUser Authentication Failedu201D error.
    If we try to access any portal login pages which brings a pop-up for login, login gets succeeded and we are able to see next pages
    Examples
    1)     https://company.com/bd/admin/xcm/init.do
    2)     https://company.com/monitoring/SystemInfo
    All pages which bring up portal login page without pop-up, not able to pass through portal login screen.
    We Tried the ProxyMapping option on Dispatcher using Visual admin. This option also didnu2019t work for us.
    Here is the WebDispatcher Profile
    SAPSYSTEMNAME = xxx
    SAPGLOBALHOST = xxxxx
    SAPSYSTEM = 00
    INSTANCE_NAME = W00
    DIR_CT_RUN = $(DIR_EXE_ROOT)\$(OS_UNICODE)\NTI386
    DIR_EXECUTABLE = $(DIR_CT_RUN)
    Accesssability of Message Server
    rdisp/mshost = hostnameofportalserver with FQDN
    ms/http_port = 8101
    Configuration for medium scenario
    icm/max_conn = 500
    icm/max_sockets = 1024
    icm/req_queue_len = 500
    icm/min_threads = 10
    icm/max_threads = 50
    mpi/total_size_MB = 80
    SAP Web Dispatcher Ports
    icm/server_port_0 = PROT=HTTPS,PORT=443
    icm/server_port_1 = PROT=HTTP,PORT=80
    icm/HTTPS/verify_client = 0
    SAP Web Dispatcher Web Administration
    icm/HTTP/admin_0 = PREFIX=/sap/wdisp/admin,DOCROOT=D:\usr\sap\xxx\W00\data\icmanroot\admin,AUTHFILE= D:\usr\sap\xxx\SYS\global\security\data\icmauth.txt
    Parameters for the SAP Cryptographic Library
    ssl/ssl_lib = D:\usr\sap\xxxW00\sapcrypto.dll
    ssl/server_pse = D:\usr\sap\xxx\W00\sec\SAPSSLS.pse
    ssf/name = D:\usr\sap\xxx\W00\sec\SAPSSLS.pse
    ssf/ssfapi_lib =  D:\usr\sap\xxx\W00\sapcrypto.dll
    sec/libsapsecu =  D:\usr\sap\xxx\W00\sapcrypto.dll
    wdisp/ssl_cred = D:\usr\sap\xxx\W00\sec\SAPSSLC.pse
    Parameters for Using SSL to the backend server
    wdisp/ssl_encrypt = 1
    wdisp/ssl_auth = 1
    wdisp/ssl_cred = D:\usr\sap\xxxW00\sec\SAPSSLC.pse
    wdisp/ssl_certhost = hostnameofportalserver with FQDN
    wdisp/ssl_ignore_host_mismatch = true
    #ICM Parameters
    icm/HTTP/j2ee_0 = PREFIX=/, HOST =hostnameofportalserver with FQDN PORT=50000,SPORT=50001, SSLENC=1,TYPE=1, CRED =D:\usr\sap\xxx\W00\sec\SAPSSLC.pse
    We also tried below options in WebDispatcher profile but we are getting same problem.
    wdisp/add_client_protocol_header = true
    wdisp/add_clientprotocol_header = 1
    wdisp/ssl_ignore_host_mismatch = true
    #ICM Parameters
    icm/HTTPS/forward_ccert_as_header = true
    icm/HTTPS/trust_client_with_issuer = *
    icm/HTTPS/trust_client_with_subject = *
    we also tried
    wdisp/ssl_encrypt = 0
    wdisp/ssl_auth = 0
    we also tried
    wdisp/ssl_encrypt = 2
    wdisp/ssl_auth = 2
    We are not able to resolve issue. Please help us on resolving this issue.
    Thanks
    Praveen

    ' in Host Names is not allowed. Our hosname has '_'.
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/67/be9442572e1231e10000000a1550b0/frameset.htm

  • Not able to pass table name as parameter in function

    Hi,
    i am not able to pass tablename as parameter. I am using below function.
    function count_test(tabname varchar2) return number is
    l_count number;
    begin
    select count(*) INTO l_count FROM tabname;
    RETURN l_count;
    END;

    You can't do it with static SQL.
    The only way is to do it with dynamic SQL:
    EXECUTE IMMEDIATE 'select count(*) FROM '|| tabname INTO l_count;
    Regards.
    Al
    Edited by: Alberto Faenza on May 10, 2012 1:44 AM
    Mispelling

  • Not able to view the content in Microsoft help viewer (MS VS 2012)

    Hello Team,
    I'm Rahul from Daimler-Chrysler, Bangalore location. I’m the IT Engineer for Daimler-Chrysler.
    We tried many settings in IE but still not able to resolved. So i need more expert help. 
    My customer having one issue- 
    # User is not able to view the content in Microsoft help viewer (MS VS 2012), below is the error: Its opening in HTML Format.
    So please help me. Contact no- +91-9972004298. and personal id:- [email protected]/[email protected]
    I call you to Microsoft customer care they advice me to ASK Question. Please help me, I'm waiting for your reply.
    Thanks,
    Rahul B. Patil.
    +919972004298.

    Hi Sri,
    it looks that your HANA instance has been created before we enabled the web-based development workbench. Some privileges are missing, we can't migration those existing instances.
    Nevertheless you can ignore the error above. You can see all the content inside your instance "smstest1".
    If you want to get rid of the cosmetic issue. You might delete this instance and create a new one.
    Best regards
    Xu

  • Not able to Pass Reference Variables to Deferred task

    Hi All,
    I am not able to Pass the reference variables to Deferred task, With the following code, I am getting null values (for the passed refs) in Deferred Task.
    Code is as:
    <Action id='1' name='Set Deferred Task Action' application='com.waveset.session.WorkflowServices'>
    <Argument name='op' value='addDeferredTask'/>
    <Argument name='type' value='User'/>
    <Argument name='name' value='$(empId)'/>
    <Argument name='authorized' value='true'/>
    <Argument name='task' value='WF_User Deferred Task'/> // Task defination
    <Argument name='date'>
    <Date>2008-11-19T14:50:18.840Z</Date>
    </Argument>
    <Argument name='taskDefinition'>
    <block trace='true'>
    <defvar name='usrObject'> // This is the variable I am passing to 'WF_User Deferred Task'
    <new class='com.waveset.object.GenericObject'/>
    </defvar>
    <invoke name='setAttributes'>
    <ref>usrObject</ref>
    <map>
    <s>accId</s>
    <ref>empId</ref>
    <s>updStatus</s>
    <ref>newStatus</ref>
    </map>
    </invoke>
    </block>
    </Argument>
    </Action>
    <Transition to='End'/>
    Please suggest me.
    Thanks,
    Ravi.

    yeah, you don't have your usrObject available in the deffered task however all variables that you put inside the usrObject are avialble. Like <ref>accId<ref> and <ref>updStatus</ref>. If you still need them organized hierarchically, you might try to add one more level to the object before passing it to addDefferedTask
                <block>
                  <defvar name='objWrapper'>
                    <new class='com.waveset.object.GenericObject'/>
                  </defvar>
                  <defvar name='usrObject'>
                    <new class='com.waveset.object.GenericObject'/>
                  </defvar>
                  <invoke name='setAttributes'>
                    <ref>usrObject</ref>
                    <map>
                      <s>accId</s>
                      <s>yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy</s>
                      <s>updStatus</s>
                      <s>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</s>
                    </map>
                  </invoke>
                  <invoke name='setAttributes'>
                    <ref>objWrapper</ref>
                    <map>
                      <s>usrObject</s>
                      <ref>usrObject</ref>
                    </map>
                  </invoke>
                  <ref>objWrapper</ref>
                </block>I hope you ve got the idea. Cheerz.

  • We are not able to pass the presentation variables(date & Date1) to the det

    Hi,
    We have followed the below link to use the date between prompt and passed the presentation variables in the filter condition of the report criteria.
    http://obiee101.blogspot.com/2009/03/obiee-between-dates-prompt.html
    But we are not able to pass the presentation variables(date & Date1) to the detail report.
    Any suggestions are highly appreciated.
    Thanks in Advance
    Siva.

    Yes,I think it wont pass the parameters from one parent report to child report.one thing you can do is put the detailed report on a page in the same dashboard as that of prompt.Put the same between condition on that report also.Give navigation link to this page instead of report.You can hide this page as well so that it will be available only on navigation.
    i have not tried it.Give it a try.
    Regards,
    Sandeep

  • Iam not able to find Header, Navigation and Structure options in. I am using Dreamweaver CS6

    Iam not able to find Header, Navigation and Structure options in Insert Panel. I am using Dreamweaver CS6

    I've updated and now the problem solved. Thank you very much Ben...

  • Error sending emails: Windows Live Hotmail was not able to complete this request. Microsoft may contact you about any issues you report.

    Every time i start writing a new email to send in Hotmail, i get an error message appear preventing me from continuing saying, 'Windows Live Hotmail was not able to complete this request. Microsoft may contact you about any issues you report.'
    I don't get this problem with Windows Explorer?

    If you have any form of Pop Up blocker, this can cause the error message.

  • Not Able to Promote DC to server even i am using built in Administrator Account.

    hi,
    i am facing below mentioned issue from last 4 to 5 days and i am very frustrating about this error and nobody give me a proper solution. if any anybody facing this kind of issue please give me a solution this will very helpful for me. 
    "Windows Server 2012 domain controllers have a default for the security setting named "Allow cryptography algorithms compatible with Windows NT 4.0" that prevents weaker cryptography algorithms when establishing security channel sessions."
    Thanks & Regards,
    Sushant Chavan.

    Hi Sushant,
    >>Not Able to Promote DC to server even i am using built in  Administrator Account.
    I have seen your thread "Verification of prerequisites for Domain Controller promotion failed" and provided a reply.
    Verification of prerequisites for Domain Controller promotion failed
    http://social.technet.microsoft.com/Forums/en-US/23f33ffa-a847-47bc-81d4-569f8e195886/verification-of-prerequisites-for-domain-controller-promotion-failed?forum=winserver8gen
    In the reply, it provides a step-to-step guidance for setting up a Windows Server 2012 Domain Controller. Have we followed it to promote the server?
    Best regards,
    Frank Shen

  • Hi, im not able to backup all ma contact to my icloud using my iphone 3gs. only 290 out of 600 contact gets backup in icloud, though i hav enough memory. How to fix it ?? I want to transfer my contacts from 3gs to 5s

    Hi, im not able to backup all ma contact to my icloud using my iphone 3gs. only 290 out of 600 contact gets backup in icloud, though i hav enough memory. How to fix it ??

    I have had similar issues backing up to iCloud. Thy only thing I have found to work every time is backing up to iTunes and then doing a restore to my new device. That includes iPhone 6.

  • I am not able to log into FaceBook on my macbook pro using my Apple ID

    I am not able to log into FaceBook on my macbook pro using my Apple ID

    Then, what razmee209 says.  It's apparently not a phone issue since other people can get in, so I'd call the facebook app developer and let them know what's going on.

  • Hi,am not able to open PDF Files in Mozilla Firefox without using plugins...I need Solution

    Hi,am not able to open PDF Files in Mozilla Firefox without using plugins...I need Solution

    Hello,
    Please see the support article below for full information on viewing PDF in Firefox:
    [[View PDF files in Firefox without downloading them]]
    If you want to use Firefox's built in PDF viewer (i.e. not a plugin) then you will need to ensure that any PDF plugins are uninstalled from Firefox and that 'Preview in Firefox' is selected as the Action for PDF files (see screenshot below).
    I hope that helps. Let me know if not.

  • Iphone 4 sync issue -  My iTunes is not able to sync the iPhone 4. I'm using windows 7 32bit. At the first step it gets stuck refelcting backing up the phone then nothing happens for ages. I'm using the latest iTUnes version, does anyone have similar prob

      My iTunes is not able to sync the iPhone 4. I'm using windows 7 32bit. At the first step it gets stuck refelcting backing up the phone then nothing happens for ages. I'm using the latest iTUnes version, does anyone have similar prob??? There are no error codes which appear and the iTUNES just gets hanged, is there a solution?

    Remove the song in question from the sync list and see if the rectifies the problem.
    If it does, then iTunes believes the song no longer exists on your drive and that will need to be corrected.

  • I m not able to connect for the wifi  which i have used earlier ,i m getting an error as unable to join the network how to resolve this please help me

    i m not able to connect for the wifi  which i have used earlier ,i m getting an error as unable to join the network how to resolve this please help me

    We were able to log in this morning and all is working. You should be able to log in at any point today. Please let us know if you are having any other difficulties.

  • Not able to open MS Excel attachment in the email Using SO_NEW_DOCUMENT_ATT

    Hi, I am not able to open the attached MS excel in the mail its giving error as "Problems came up in the following areas during load Table". My requirement is to send a colored excel as attachment through mail when the program is executed in background. For this i have reffered the following link " http://wiki.sdn.sap.com/wiki/display/Snippets/FormattedExcelasEmailAttachment". That is i have used the XML method for this . I would be thankful if you can let me know where i am doing the mistake For refference i am pasting my code: * Send mail when executed in background mode IF sy-batch eq 'X'. PERFORM send_mail_bkgrnd. ELSE. " Foreground mode PERFORM build_layout. PERFORM build_field_cat. PERFORM display. ENDIF. FORM SEND_MAIL_BKGRND . PERFORM process_xml_data. PERFORM disatch_mail. ENDFORM. " SEND_MAIL_BKGRND &---- *& Form PROCESS_XML_DATA &---- FORM PROCESS_XML_DATA . DATA lv_xlwidth TYPE i. * Creating a ixml Factory l_ixml = cl_ixml=>create( ). * Creating the DOM Object Model l_document = l_ixml->create_document( ). * Create Root Node 'Workbook' l_element_root = l_document->create_simple_element( name = 'Workbook' parent = l_document ). l_element_root->set_attribute( name = 'xmlns' value = 'urn:schemas-microsoft-com:office:spreadsheet' ). ns_attribute = l_document->create_namespace_decl( name = 'ss' prefix = 'xmlns' uri = 'urn:schemas-microsoft-com:office:spreadsheet' ). l_element_root->set_attribute_node( ns_attribute ). ns_attribute = l_document->create_namespace_decl( name = 'x' prefix = 'xmlns' uri = 'urn:schemas-microsoft-com:office:excel' ). l_element_root->set_attribute_node( ns_attribute ). * Create node for document properties. r_element_properties = l_document->create_simple_element( name = 'TEST_REPORT' parent = l_element_root ). l_value = sy-uname. l_document->create_simple_element( name = 'Author' value = l_value parent = r_element_properties ). * Styles r_styles = l_document->create_simple_element( name = 'Styles' parent = l_element_root ). * Style for Header r_style = l_document->create_simple_element( name = 'Style' parent = r_styles ). r_style->set_attribute_ns( name = 'ID' prefix = 'ss' value = 'Header' ). r_format = l_document->create_simple_element( name = 'Font' parent = r_style ). r_format->set_attribute_ns( name = 'Bold' prefix = 'ss' value = '1' ). r_format = l_document->create_simple_element( name = 'Interior' parent = r_style ). r_format->set_attribute_ns( name = 'Color' prefix = 'ss' value = '#92D050' ). r_format->set_attribute_ns( name = 'Pattern' prefix = 'ss' value = 'Solid' ). r_format = l_document->create_simple_element( name = 'Alignment' parent = r_style ). r_format->set_attribute_ns( name = 'Vertical' prefix = 'ss' value = 'Center' ). r_format->set_attribute_ns( name = 'WrapText' prefix = 'ss' value = '1' ). r_border = l_document->create_simple_element( name = 'Borders' parent = r_style ). r_format = l_document->create_simple_element( name = 'Border' parent = r_border ). r_format->set_attribute_ns( name = 'Position' prefix = 'ss' value = 'Bottom' ). r_format->set_attribute_ns( name = 'LineStyle' prefix = 'ss' value = 'Continuous' ). r_format->set_attribute_ns( name = 'Weight' prefix = 'ss' value = '1' ). r_format = l_document->create_simple_element( name = 'Border' parent = r_border ). r_format->set_attribute_ns( name = 'Position' prefix = 'ss' value = 'Left' ). r_format->set_attribute_ns( name = 'LineStyle' prefix = 'ss' value = 'Continuous' ). r_format->set_attribute_ns( name = 'Weight' prefix = 'ss' value = '1' ). r_format = l_document->create_simple_element( name = 'Border' parent = r_border ). r_format->set_attribute_ns( name = 'Position' prefix = 'ss' value = 'Top' ). r_format->set_attribute_ns( name = 'LineStyle' prefix = 'ss' value = 'Continuous' ). r_format->set_attribute_ns( name = 'Weight' prefix = 'ss' value = '1' ). r_format = l_document->create_simple_element( name = 'Border' parent = r_border ). r_format->set_attribute_ns( name = 'Position' prefix = 'ss' value = 'Right' ). r_format->set_attribute_ns( name = 'LineStyle' prefix = 'ss' value = 'Continuous' ). r_format->set_attribute_ns( name = 'Weight' prefix = 'ss' value = '1' ). * Style for Data "Color properties are set over here r_style1 = l_document->create_simple_element( name = 'Style' parent = r_styles ). r_style1->set_attribute_ns( name = 'ID' prefix = 'ss' value = 'Data' ). r_border = l_document->create_simple_element( name = 'Borders' parent = r_style1 ). r_format = l_document->create_simple_element( name = 'Border' parent = r_border ). r_format->set_attribute_ns( name = 'Position' prefix = 'ss' value = 'Bottom' ). r_format->set_attribute_ns( name = 'LineStyle' prefix = 'ss' value = 'Continuous' ). r_format->set_attribute_ns( name = 'Weight' prefix = 'ss' value = '1' ). r_format = l_document->create_simple_element( name = 'Border' parent = r_border ). r_format->set_attribute_ns( name = 'Position' prefix = 'ss' value = 'Left' ). r_format->set_attribute_ns( name = 'LineStyle' prefix = 'ss' value = 'Continuous' ). r_format->set_attribute_ns( name = 'Weight' prefix = 'ss' value = '1' ). r_format = l_document->create_simple_element( name = 'Border' parent = r_border ). r_format->set_attribute_ns( name = 'Position' prefix = 'ss' value = 'Top' ). r_format->set_attribute_ns( name = 'LineStyle' prefix = 'ss' value = 'Continuous' ). r_format->set_attribute_ns( name = 'Weight' prefix = 'ss' value = '1' ). r_format = l_document->create_simple_element( name = 'Border' parent = r_border ). r_format->set_attribute_ns( name = 'Position' prefix = 'ss' value = 'Right' ). r_format->set_attribute_ns( name = 'LineStyle' prefix = 'ss' value = 'Continuous' ). r_format->set_attribute_ns( name = 'Weight' prefix = 'ss' value = '1' ). * Worksheet r_worksheet = l_document->create_simple_element( name = 'Worksheet' parent = l_element_root ). r_worksheet->set_attribute_ns( name = 'Name' prefix = 'ss' value = 'Sheet1' ). * Table r_table = l_document->create_simple_element( name = 'Table' parent = r_worksheet ). r_table->set_attribute_ns( name = 'FullColumns' prefix = 'x' value = '1' ). r_table->set_attribute_ns( name = 'FullRows' prefix = 'x' value = '1' ). * Column Formatting DO 32 TIMES. CASE sy-index. WHEN 1. lv_xlwidth = '300'. WHEN 2. lv_xlwidth = '300'. WHEN OTHERS. lv_xlwidth = '300'. ENDCASE. PERFORM clmn_formatting USING lv_xlwidth. ENDDO. * Blank Row r_row = l_document->create_simple_element( name = 'Row' parent = r_table ). * Column Headers Row r_row = l_document->create_simple_element( name = 'Row' parent = r_table ). r_row->set_attribute_ns( name = 'AutoFitHeight' prefix = 'ss' value = '1' ). * VC. No. r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ). r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Header' ). r_data = l_document->create_simple_element( name = 'Data' value = 'VC No.' parent = r_cell ). r_data->set_attribute_ns( name = 'Type' prefix = 'ss' value = 'String' ). * Source r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ). r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Header' ). r_data = l_document->create_simple_element( name = 'Data' value = 'Source' parent = r_cell ). r_data->set_attribute_ns( name = 'Type' prefix = 'ss' value = 'String' ). DO 30 TIMES. * * TPLGRP r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ). r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Header' ). r_data = l_document->create_simple_element( name = 'Data' value = '' parent = r_cell ). r_data->set_attribute_ns( name = 'Type' prefix = 'ss' value = 'String' ). ENDDO. * Blank Row after Column Headers r_row = l_document->create_simple_element( name = 'Row' parent = r_table ). DO 32 TIMES. r_cell = l_document->create_simple_element( name = 'Cell' parent = r_row ). r_cell->set_attribute_ns( name = 'StyleID' prefix = 'ss' value = 'Data' ). ENDDO. * Data Table CLEAR gs_output. LOOP AT gt_output INTO gs_output. r_row = l_document->create_simple_element( name = 'Row' parent = r_table ). DO 32 TIMES. CASE sy-index. WHEN 1. a_dvalue = gs_output-vc_number. WHEN 2. a_dvalue = gs_output-source. WHEN 3. a_dvalue = gs_output-tplgrp_01. WHEN 4. a_dvalue = gs_output-tplgrp_02. WHEN 5. a_dvalue = gs_output-tplgrp_03. WHEN 6. a_dvalue = gs_output-tplgrp_04. WHEN 7. a_dvalue = gs_output-tplgrp_05. WHEN 8. a_dvalue = gs_output-tplgrp_06. WHEN 9. a_dvalue = gs_output-tplgrp_07. WHEN 10. a_dvalue = gs_output-tplgrp_08. WHEN 11. a_dvalue = gs_output-tplgrp_09. WHEN 12. a_dvalue = gs_output-tplgrp_10. WHEN 13. a_dvalue = gs_output-tplgrp_11. WHEN 14. a_dvalue = gs_output-tplgrp_12. WHEN 15. a_dvalue = gs_output-tplgrp_13. WHEN 16. a_dvalue = gs_output-tplgrp_14. WHEN 17. a_dvalue = gs_output-tplgrp_15. WHEN 18. a_dvalue = gs_output-tplgrp_16. WHEN 19. a_dvalue = gs_output-tplgrp_17. WHEN 20. a_dvalue = gs_output-tplgrp_18. WHEN 21. a_dvalue = gs_output-tplgrp_19. WHEN 22. a_dvalue = gs_output-tplgrp_20. WHEN 23. a_dvalue = gs_output-tplgrp_21. WHEN 24. a_dvalue = gs_output-tplgrp_22. WHEN 25. a_dvalue = gs_output-tplgrp_23. WHEN 26. a_dvalue = gs_output-tplgrp_24. WHEN 27. a_dvalue = gs_output-tplgrp_25. WHEN 28. a_dvalue = gs_output-tplgrp_26. WHEN 29. a_dvalue = gs_output-tplgrp_27. WHEN 30. a_dvalue = gs_output-tplgrp_28. WHEN 31. a_dvalue = gs_output-tplgrp_29. WHEN 32. a_dvalue = gs_output-tplgrp_30. ENDCASE. PERFORM fill_data_val_excel USING a_dvalue. ENDDO. CLEAR gs_output. ENDLOOP. * Creating a Stream Factory l_streamfactory = l_ixml->create_stream_factory( ). * Connect Internal XML Table to Stream Factory l_ostream = l_streamfactory->create_ostream_itable( table = l_xml_table ). * Rendering the Document l_renderer = l_ixml->create_renderer( ostream = l_ostream document = l_document ). l_rc = l_renderer->render( ). * Saving the XML Document l_xml_size = l_ostream->get_num_written_raw( ). ENDFORM. " PROCESS_XML_DATA &---- *& Form DISATCH_MAIL &---- FORM DISATCH_MAIL . DATA: objpack LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE. DATA: objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE. DATA: objbin LIKE solix OCCURS 10 WITH HEADER LINE. DATA: objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE. DATA: reclist LIKE somlreci1 OCCURS 5 WITH HEADER LINE. DATA: doc_chng LIKE sodocchgi1. DATA: tab_lines LIKE sy-tabix. DATA: l_num(3). DATA: subj_date(10) TYPE c. * Mail Subject data lv_date TYPE d. lv_date = sy-datum. CONCATENATE lv_date6(2) '-' lv_date4(2) '-' lv_date+0(4) INTO subj_date. CONCATENATE 'SAP Application Usage Report ' subj_date INTO doc_chng-obj_descr SEPARATED BY space. * Mail Contents objtxt = 'Dear User,'. APPEND objtxt. CLEAR objtxt. APPEND objtxt. CONCATENATE 'Please find the attached SAP Application Usage Report for ' subj_date INTO objtxt SEPARATED BY space. " Mail Contents APPEND objtxt. CLEAR objtxt. APPEND objtxt. objtxt = 'Thanks & Regards,'. APPEND objtxt. objtxt = 'Himanshu Kanekar'. APPEND objtxt. DESCRIBE TABLE objtxt LINES tab_lines. READ TABLE objtxt INDEX tab_lines. doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objtxt ). * Packing List For the E-mail Body objpack-head_start = 1. objpack-head_num = 0. objpack-body_start = 1. objpack-body_num = tab_lines. objpack-doc_type = 'RAW'. APPEND objpack. * Creation of the Document Attachment LOOP AT l_xml_table INTO wa_xml. CLEAR objbin. objbin-line = wa_xml-data. APPEND objbin. ENDLOOP. DESCRIBE TABLE objbin LINES tab_lines. objhead = 'SAP Login Details'. APPEND objhead. * Packing List For the E-mail Attachment objpack-transf_bin = ''."'X'. objpack-head_start = 1. objpack-head_num = 0. objpack-body_start = 1. objpack-body_num = tab_lines. CONCATENATE 'SAP_Login_Details' subj_date INTO objpack-obj_descr SEPARATED BY space. objpack-doc_type = 'XLS'. objpack-doc_size = tab_lines * 255. APPEND objpack. * Target Recipent CLEAR reclist. reclist-receiver = reclist-rec_type = 'U'. APPEND reclist. * Sending the document CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1' EXPORTING document_data = doc_chng put_in_outbox = 'X' commit_work = 'X' TABLES packing_list = objpack object_header = objhead contents_txt = objtxt contents_hex = objbin receivers = reclist EXCEPTIONS too_many_receivers = 1 document_not_sent = 2 operation_no_authorization = 4 OTHERS = 99. ENDFORM. " DISATCH_MAIL

    Refer:
    http://www.sap-img.com/abap/sending-mail-with-attachment-report-in-background.htm
    http://www.saptechies.com/sending-mail-with-attachment-report-in-background/

Maybe you are looking for

  • How to improve the performance of insert statement.

    Hi All, I have one procedure and it inserts 40 million records into one table. As my current method taking long time to accomplish the task, Is there any mechanism to improve the performance Thanks in Advance.

  • How to add Short cut to DISCONNECT and LOGOFF

    We have an App that requires Remote Desktop Services Having installed & configured it. We asked the software company to setup App. This work fine in Desktop session i.e users login via mstsc and get presented with a desktop. But unfortunately not as

  • New Repository variable failing with 'Unresolved Identifier' error

    Hi, I created a new repository variable and when used in the Segments/Reports it is failing with 'Unresolved Identifier' error. This is happening intermittently and sometimes it is getting the results as expected, Can you please let me know where I a

  • Help reqd in FM SO_DOCUMENT_LINK

    Can any one tell me about the import and export parameters of the FM SO_DOCUMENT_LINK? Thanks in advance

  • Small issue with CS3 / CS4 in Vista 64

    Hello, Recently made the move from XP 32 to Vista 64 and I'm having issues with CS3 and CS4 when it comes to inserting images and/or browsing for background images in a CSS file. The first issue I have is where the cursor starts out. See the image be