Edit postDelete postReport this postReply with quote create attachment for

Hello all,
i want to create an attachment for billing document.
i read that i need to run 'SO_DOCUMENT_INSERT_API1' and 'BINARY_RELATION_CREATE' .
but it would be very helpfull to see a code example.
Thanks
Moshe

Davis:
Check in MRP Group settings, Availability Check session, flag activate full confirmation logic. Test activate full confirmation logic.
Regards,
Ricardo

Similar Messages

  • Edit postDelete postReport this postReply with quote ATP check but the comm

    hi , all guys :
    when I create the pp-pi order , first i use the batch determination to allocate the component
    batch , then i do the ATP check , but the committed quantity always is zero ,the ATP alway does
    not support confirm quantity (co09 the confirm quantity always is zero),so when i create the other pp-pi order the stock quantity always cover the reqirements quantity of components
    in the mater data , i use the ATP group is 02 (the customizing is standard) i think the ATP scope is irrelative to this issue .
    in the order type control parameters , i use the ATP check
    for example :
    the componet 100-200 have three batchs :
    batch: 20100501 quantity 30 kg
    batch: 20100502 quantity 40 kg
    batch: 20100601 quantity 40 kg
    now , the requirment of component 100-200 is 100 kg
    the batch determination conditions is self expiration .
    so i throght the batch determination and batch split to allocate the bacth and quantity is
    batch: 20100501 quantity 30 kg
    batch: 20100502 quantity 40 kg
    batch: 20100601 quantity 30 kg
    after allocating , i run the ATP check ,BUT the COMMITED QUANTITY ALWAYS IS ZERO .
    I don't know why !!! ,where can configure the ATP confirm quantities (committed quantities) the in the customizing
    can you give help me!!!
    thanks!!!
    best regards

    Davis:
    Check in MRP Group settings, Availability Check session, flag activate full confirmation logic. Test activate full confirmation logic.
    Regards,
    Ricardo

  • Edit postDelete postReport this postReply with quoteME2N - sending alv resu

    Hello to SAP Guru
    Transaction ME2N , using variants.
    I was required to create/develop a code that will send ME2N ALV report
    by mail as excel file attached.
    It means:
    1. running ME2N
    2. Choose variant
    3. Run F8 and send ALV result report by mail from within the code
    Any idea how to do it?
    If there is some suitable user_exit an any enhancement to do it there ?
    I have searched for user exits but didn't found something helpful.
    Thanks a lot,
    regards,
    Daniel

    Hi Max,
    thanks for your reply.
    I know that there are some options:
    1. use an enhencement in the code RM06EN00
    2. search user exit to create a new code
    3. search for badi
    but
    1. I have no idea where to change this standard code RM06EN00 and to enter a new
        enhancement point
    2. the only user exit that I have found is LMEDR001 - I set a break point here
        and I see that my printing process doesn't pass through this code at all.
    3. There isn't any badi for the printing process - at least I didn't found it.
    Please, advice,
    Regards,
    Daniel.

  • Report this postReply with quote Credit check for unconfirmed item

    Hello,
    I have configured automatic credit control for sales orders.
    When a confirmed order quantity is entered, I get a warning message plus the credit block, just as I need. If I have no confirmed quantity of the items, I get no message, just a saved order.
    Our item confirmation is done only on what is in stock, not on RLT, so it is common that an item has 0 confirmation. I need a credit block if the value would otherwise exceed the open credit limit? How can I do this? I've tried both the static and dynamic checks, but they only work with confirmed quantities.
    Thanks

    pricing:
       step  Des                      From     print     subtotal
       120   Total                                   X        1
       130   Credit value           120         X        A
    and also in automatic credit control select open orders
    but system calculate the credit value=confirmed quantity*price.

  • Create attachment for PO

    Hi expert
       How can i Create attachment for PO use ABAP.
    BR
    Chris

    You can attach manually any document to PO .
    But you cannot attach document while you create PO in T/Code ME21N 
    Save you PO ( ME21N ) and again open with change ( ME22N ) then you can attach document through Service for Object button. Service for Object button available down side of Command screen ( in your PO screen ME22N ) 
    Click your Service Object button -> Create -> Create attachment 
    then select your window directory ( which file you need to attach) select your file Now your system shows message  Service "Create attachment" is started. 
    Save again your PO. You can see (open) your attachment in same field ( Service for Object ) select and Create and check attachment list. You can attach as many document in your PO.
    Note: This is only information for internal or you can print separately this document for sending to vendor ( fax ) System will not print automatically along PO print out.

  • Create attachement for GOS in background

    Hi all, i have to create attachments for GOS in the background. i found a blog that suggested me to use the classess 
    CLASS    CL_BINARY_RELATION definition load.
    CLASS    CL_OBL_OBJECT      definition load.
      Link : /people/rammanohar.tiwari/blog/2005/10/10/generic-object-services-gos--in-background
    Looks like it might work. But problem is iam using 4.6C version and i donot see these classes. Can you please suggest any work around for this.

    Hi Peter, Thanks for the link to the blog. i was able to create attachment for GOS in the background.
    Iam also adding link to this message that found for the same purpose
    http://friendlyabaper.blogspot.com/2008/07/oh-my-gos.html
    Have a nice time.

  • Can't create attachment for Procurement Requisition on PS

    Hi All
    Please tell me how create attachment for Procurement Requisition on PS due to displaying attachment list on MM(Tr-cd ME52n).
    I wasn't able to find the way though I could create Procurement Requisition and attachment for activity on PS(Tr-cd cj20n).
    Can any one help on this?
    Thanks and regards,
    Atsushi

    I could create attachment to activity, WES Element, Network in cj20n(using service for object u2192 create u2192 create attachment).
    However, I wasn't find the way to create attachment directly to PR.
    So, I would like to ask you to let me know the process that activity's attachment transfer to PR automatically.
    If possible, please teach me how to create attachment to PR in cj20n.
    In short,, I want to confirm attachment of PR in me52n(using service for object u2192 Attachment list) and create attachment to PR or transfer activity's attachment to PR in cj20n

  • Has anyone received this error, "Failed to create directory for PX images"

    I recently migrated to Windows7.  98% of the migration went well. All of my pictures and Elements Catalog came over fine.  I had to "reconnect" all of the pictures in the catalog due to new directory name, but it worked fairly well.  Of the 11,000 entries synch'd with photoshop.com, 10,500 re-synch'd fine. However almost 500 are stuck with an error of "Failed to create directory for PX images".  Can anyone help with how to resolve this issue?  Note, I did try to remove the picture from the album and then re-add, but that didn't work.
    Thank you in advance for any help you can provide.
    Thanks,
    Jeff

    function(){return A.apply(null,[this].concat($A(arguments)))}
    JeffAGoldberg wrote:
    Erased everything on photoshop.com (which I couldn't accomplish due to bugs on photoshop.com) and created a new catalog.
    Jeff
    What problems are you facing in deleting files from PS.com. Are you able to maintain a proper synced catalog now ? If possible please elaborate so that we can help.

  • Creating attachment for WI

    Hi,
    Wanted to know how to create an attachment(e.g. wanted to send a list from spool request no.) for a workitem?
    Regards,
    Akshay

    Hi,
    Please follow the steps below;
    Follow these steps;
    1.create a node 'FILEUPLOAD' with 2 attributes
    a) FILECONTENT type XSTRING
    b) FILENAME type STRING
    2. Create a fileuplaod uielement
    a) bind the data property with attribute 'FILECONTENT'
    b) bind the filename property with attribute 'FILENAME'
    3. Create a button 'UPLOAD'
    a) create the action method for this button
    Paste the following code in this method
    Data l_node type ref to if_wd_context_node.
    Data l_stru type wd_this->elements_cn_fileupload.
    l_node = wd_context->get_child_node( 'FILEUPLOAD' ).
    l_node->get_static_attributes( importing static_attributes = l_stru ).
    "save l_stru-fielcontent in database. Your file will be saved in the database in XSTRING format.
    Now when you want to display  this file;
    1. Create a Node 'FILEDOWNLOAD' with 1 attribute
    a) FILE type XSTRING
    2. Create a filedownload uielement
    a) bind the data property with the attribute 'FILE'
    Fetch the file from databased and set the File attribute of teh filedownload uielemnt to display the file.
    Hope this helps!
    Radhika.

  • Desperate help needed with quote create issues ...

    Dear SD experts
    I am trying to create a quote using 'BAPI_QUOTATION_CREATEFROMDATA2' in the test mode.
    I am entering the bear minimum required (without opening any parameters other than the default
    which are QUOTATION_HEADER_IN and QUOTATION_PARTNERS.
    The problem that I am seeing is with QUOTATION_PARTNERS-ITM_NUMBER.
    When I give QUOTATION_PARTNERS-ITM_NUMBER = '0000000' and run, I get a bogus
    message that the quote (with a number assigned) is created. But when I try to open using VA23
    it is not and even the table 'VBAK' doesn't have an entry for this.
    However when I change QUOTATION_PARTNERS-ITM_NUMBER = '0000020'  where 000020 is a valid value, I get a message that says  "112 Please enter sold-to party or ship-to party".
    What I don't understand is how this ITM_NUMBER "item number of SD document"  is connected
    to ship-to variable. How can I make sure that these two have proper relationship in the database.
    Any suggestions or comments will be highly appreciated.
    Thanks
    Ram

    not answered but am closing this to make place for other questions.

  • I want to be able to download pictures from my camera and caption them.  Is this possible with any known app for iPad2?

    I want to be able to download pictures from my camera and caption them on my iPad2.  Is this possible?  Having trouble finding an app for that...

    I believe the iPhoto App can add captions to photos.

  • GOS - Create Attachment for Order in Background.

    Hi,
    My Requirement is to attach a document (.PDF, .DOC, .TIF or .JPG) to transaction JHA1X with respect to Order in background and it wll be stored in Open Text Server. 
    Document details wiil be passed throuh Portal, as XSTRING to ECC. Is there any BAPI ( Something that helps) available to upload this to transaction ?
    Note : Through transaction I am able to do this ( By BO and Doc Type ) using store business document.
    Thanks,
    Praveen N

    I would call the method CREATE_ATTACHMENT of class CL_GOS_DOCUMENT_SERVICE
    this will allow to select the file on PC and will attach it to the business object
    if you already have the binary contents of the file and don't want to change the way to get it, then you can look into this method how to do it

  • CRM ONLINE 2013: On Approval Of Quotation, Run Report, Generate PDF and Send an Email With PDF as attachment

    Hi,
    I am using CRM ONLINE 2013.
    How to automate below process?
    1. On Approval Of Quotation, Run Report.
    2. Generate PDF.
    3. Send an Email With PDF as attachment.
    As i have gone through many forums for this topic, but creating a plugin code for generating Report PDF is not possible in CRM ONLINE.
    So, What is the alternate way to do this..?
    Thanks.

    This is my entire code mentioned below:-
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title></title>
        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
        <script type="text/javascript">
            if (typeof (SDK) == "undefined")
            { SDK = { __namespace: true }; }
            SDK.JScriptRESTDataOperations = {
                _context: function () {
                    if (typeof GetGlobalContext != "undefined")
                    { return GetGlobalContext(); }
                    else {
                        if (typeof Xrm != "undefined") {
                            return Xrm.Page.context;
                        else { return new Error("Context is not available."); }
                _getServerUrl: function () {
                    var serverUrl = this._context().getServerUrl()
                    if (serverUrl.match(/\/$/)) {
                        serverUrl = serverUrl.substring(0, serverUrl.length - 1);
                    return serverUrl;
                _ODataPath: function () {
                    return this._getServerUrl() + "/XRMServices/2011/OrganizationData.svc/";
                _errorHandler: function (req) {
                    return new Error("Error : " +
      req.status + ": " +
      req.statusText + ": " +
      JSON.parse(req.responseText).error.message.value);
                _dateReviver: function (key, value) {
                    var a;
                    if (typeof value === 'string') {
                        a = /Date\(([-+]?\d+)\)/.exec(value);
                        if (a) {
                            return new Date(parseInt(value.replace("/Date(", "").replace(")/", ""), 10));
                    return value;
                Create: function (object, type, successCallback, errorCallback) {
                    var req = new XMLHttpRequest();
                    req.open("POST", this._ODataPath() + type + "Set", true);
                    req.setRequestHeader("Accept", "application/json");
                    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
                    req.onreadystatechange = function () {
                        if (this.readyState == 4 /* complete */) {
                            if (this.status == 201) {
                                successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d);
                            else {
                                errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
                    req.send(JSON.stringify(object));
                Retrieve: function (id, type, successCallback, errorCallback) {
                    var req = new XMLHttpRequest();
                    req.open("GET", this._ODataPath() + type + "Set(guid'" + id + "')", true);
                    req.setRequestHeader("Accept", "application/json");
                    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
                    req.onreadystatechange = function () {
                        if (this.readyState == 4 /* complete */) {
                            if (this.status == 200) {
                                successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d);
                            else {
                                errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
                    req.send();
                Update: function (id, object, type, successCallback, errorCallback) {
                    var req = new XMLHttpRequest();
                    req.open("POST", this._ODataPath() + type + "Set(guid'" + id + "')", true);
                    req.setRequestHeader("Accept", "application/json");
                    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
                    req.setRequestHeader("X-HTTP-Method", "MERGE");
                    req.onreadystatechange = function () {
                        if (this.readyState == 4 /* complete */) {
                            if (this.status == 204 || this.status == 1223) {
                                successCallback();
                            else {
                                errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
                    req.send(JSON.stringify(object));
                Delete: function (id, type, successCallback, errorCallback) {
                    var req = new XMLHttpRequest();
                    req.open("POST", this._ODataPath() + type + "Set(guid'" + id + "')", true);
                    req.setRequestHeader("Accept", "application/json");
                    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
                    req.setRequestHeader("X-HTTP-Method", "DELETE");
                    req.onreadystatechange = function () {
                        if (this.readyState == 4 /* complete */) {
                            if (this.status == 204 || this.status == 1223) {
                                successCallback();
                            else {
                                errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
                    req.send();
                RetrieveMultiple: function (type, filter, successCallback, errorCallback) {
                    if (filter != null) {
                        filter = "?" + filter;
                    else { filter = ""; }
                    var req = new XMLHttpRequest();
                    req.open("GET", this._ODataPath() + type + "Set" + filter, true);
                    req.setRequestHeader("Accept", "application/json");
                    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
                    req.onreadystatechange = function () {
                        if (this.readyState == 4 /* complete */) {
                            if (this.status == 200) {
                                successCallback(JSON.parse(this.responseText, SDK.JScriptRESTDataOperations._dateReviver).d.results);
                            else {
                                errorCallback(SDK.JScriptRESTDataOperations._errorHandler(this));
                    req.send();
                __namespace: true
        </script>
        <script type="text/javascript">
            //Create Email and link it with Order as Regarding field
            var Xrm;
            var email = new Object();
            var ownerID = "";
            var CustomerId = "";
            if (window.opener) { Xrm = window.opener.Xrm; }
            else if (window.parent) { Xrm = window.parent.Xrm; }
            //Get ownerid who send email of quotation to customer
            function GetOwnerID() {
                var owner = Xrm.Page.getAttribute("ownerid").getValue();
                ownerID = owner[0].id;
                var ownerName = owner[0].name;
                var entityType = owner[0].entityType;
                GetToEmailGUID();
            //Get customerid who receive email of quotation from owner
            function GetToEmailGUID() {
                var Customer = Xrm.Page.getAttribute('customerid').getValue();
                CustomerId = Customer[0].id;
                var CustomerName = Customer[0].name;
                var entityType = Customer[0].entityType;
                //if CustomerId is type of "Account" then get Primary Contact id of that account
                if (entityType == "account") {
                    var contact = Xrm.Page.getAttribute("customerid").getValue();
                    if (contact === null) return;
                    var serverUrl = Xrm.Page.context.getClientUrl();
                    var oDataSelect = serverUrl + "/XRMServices/2011/OrganizationData.svc/AccountSet(guid'" + contact[0].id + "')?$select=PrimaryContactId";
                    var req = new XMLHttpRequest();
                    req.open("GET", oDataSelect, false);
                    req.setRequestHeader("Accept", "application/json");
                    req.setRequestHeader("Content-Type", "application/json;charset=utf-8");
                    req.onreadystatechange = function () {
                        if (req.readyState === 4) {
                            if (req.status === 200) {
                                var retrieved = JSON.parse(req.responseText).d;
                                CustomerId = retrieved.PrimaryContactId.Id;
                            else {
                                alert(this.statusText);
                    req.send();
            function CreateEmail() {
                GetOwnerID();
                email.Subject = "Email with Report Attachment";
                //Set The current order as the Regarding object
                email.RegardingObjectId = {
                    Id: Xrm.Page.data.entity.getId(),    //Get the current entity Id , here OrderId
                    LogicalName: Xrm.Page.data.entity.getEntityName()//Get the current entity name, here it will be “salesOrder”
                //Create Email Activity
                SDK.JScriptRESTDataOperations.Create(email, "Email", EmailCallBack, function (error) { alert(error.message); });
            // Email Call Back function
            function EmailCallBack(result) {
                email = result; // Set the email to result to use it later in email attachment for retrieving activity Id
                var activityPartyFrom = new Object();
                // Set the From party of the ActivityParty to relate an entity with Email From field
                activityPartyFrom.PartyId = {
                    Id: CustomerId, //"79EBDD26-FDBE-E311-8986-D89D6765B238",  // id of entity you want to associate this activity with.        
                    LogicalName: "contact"
                // Set the "activity" of the ActivityParty
                activityPartyFrom.ActivityId = {
                    Id: result.ActivityId,
                    LogicalName: "email"
                // Now set the participation type that describes the role of the party on the activity).
                activityPartyFrom.ParticipationTypeMask = { Value: 2 }; // 2 means ToRecipients
                // Create the from ActivityParty for the email
                SDK.JScriptRESTDataOperations.Create(activityPartyFrom, "ActivityParty", ActivityPartyFromCallBack, function (error) { alert(error.message); });
                var activityPartyTo = new Object();
                // Set the From party of the ActivityParty to relate an entity with Email From field
                activityPartyTo.PartyId = {
                    Id: ownerID, //"79EBDD26-FDBE-E311-8986-D89D6765B238",  // id of entity you want to associate this activity with.        
                    LogicalName: "systemuser"
                // Set the "activity" of the ActivityParty  
                activityPartyTo.ActivityId = {
                    Id: result.ActivityId,
                    LogicalName: "email"
                // Now set the participation type that describes the role of the party on the activity).    
                activityPartyTo.ParticipationTypeMask = { Value: 1 }; // 1 means Sender
                // Create the from ActivityParty
                SDK.JScriptRESTDataOperations.Create(activityPartyTo, "ActivityParty", ActivityPartyToCallBack, function (error) { alert(error.message); });
            //ActivityParty From Callback
            function ActivityPartyFromCallBack(result) {
            //ActivityParty To Callback
            function ActivityPartyToCallBack(result) {
                GetReportId('ABM_Infotech_SalesQuote');
            //Create attachment for the created email
            function CreateEmailAttachment() {
                //get reporting session and use the params to convert a report in PDF
                var params = getReportingSession();
                //Email attachment parameters
                var activitymimeattachment = Object();
                activitymimeattachment.ObjectId = Object();
                activitymimeattachment.ObjectId.LogicalName = "email";
                activitymimeattachment.ObjectId.Id = email.ActivityId;
                activitymimeattachment.ObjectTypeCode = "email",
                    activitymimeattachment.Subject = "File Attachment";
                activitymimeattachment.Body = encodePdf(params);
                activitymimeattachment.FileName = "Report1.pdf";
                activitymimeattachment.MimeType = "application/pdf";
                //Attachment call
                SDK.JScriptRESTDataOperations.Create(activitymimeattachment, "ActivityMimeAttachment", ActivityMimeAttachmentCallBack, function (error) { alert(error.message); });
            //ActivityMimeAttachment CallBack function
            function ActivityMimeAttachmentCallBack(result) {
                var features = "location=no,menubar=no,status=no,toolbar=no,resizable=yes";
                var width = "800px";
                var height = "600px";
                window.open(Xrm.Page.context.getServerUrl() + "main.aspx?etc=" + 4202 + "&pagetype=entityrecord&id=" + email.ActivityId, "_blank", features);
                // To open window which works in outlook and IE both
                //openStdWin(Xrm.Page.context.getServerUrl() + "main.aspx?etc=" + 4202 + "&pagetype=entityrecord&id=" + email.ActivityId, "_blank", width,
    height, features);
            //This method will get the reportId based on a report name that will be used in            getReportingSession() function
            function GetReportId(reportName) {
                var oDataSetName = "ReportSet";
                var columns = "ReportId";
                var filter = "Name eq '" + reportName + "'";
                retrieveMultiple(oDataSetName, columns, filter, onSuccess);
            function retrieveMultiple(odataSetName, select, filter, successCallback) {
                var serverUrl = Xrm.Page.context.getServerUrl();
                var ODATA_ENDPOINT = "/XRMServices/2011/OrganizationData.svc";
                var odataUri = serverUrl + ODATA_ENDPOINT + "/" + odataSetName + "?";
                if (select) {
                    odataUri += "$select=" + select + "&";
                if (filter) {
                    odataUri += "$filter=" + filter;
                $.ajax({
                    type: "GET",
                    contentType: "application/json; charset=utf-8",
                    datatype: "json",
                    url: odataUri,
                    beforeSend: function (XMLHttpRequest) {
                        XMLHttpRequest.setRequestHeader("Accept", "application/json");
                    success: function (data) {
                        if (successCallback) {
                            if (data && data.d && data.d.results) {
                                successCallback(data.d.results);
                            else if (data && data.d) {
                                successCallback(data.d);
                            else {
                                successCallback(data);
                    error: function (XmlHttpRequest, errorThrown) {
                        if (XmlHttpRequest && XmlHttpRequest.responseText) {
                            alert("Error while retrieval ; Error – " + XmlHttpRequest.responseText);
            function onSuccess(data) {
                reportId = data[0].ReportId.replace('{', ").replace('}', ");
                CreateEmailAttachment(); // Create Email Attachment
            //Gets the report contents
            function getReportingSession() {
                var pth = Xrm.Page.context.getServerUrl() + "/CRMReports/rsviewer/reportviewer.aspx";
                var retrieveEntityReq = new XMLHttpRequest();
                var Id = Xrm.Page.data.entity.getId();
                var quotationGUID = Id.replace('{', ""); //set this to selected quotation GUID
                quotationGUID = quotationGUID.replace('}', "");
                var reportName = "ABM_Infotech_SalesQuote"; //set this to the report you are trying to download
                var reportID = "751089AA-74B8-E211-B52F-D8D3855B253B"; //set this to the guid of the report you are trying to download
                var rptPathString = ""; //set this to the CRMF_Filtered parameter
                var strParameterXML = "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'><entity name='quote'><all-attributes /><filter type='and'><condition
    attribute='quoteid' operator='eq' uitype='quote' value='" + quotationGUID + "' /> </filter></entity></fetch>";
                retrieveEntityReq.open("POST", pth, false);
                retrieveEntityReq.setRequestHeader("Accept", "*/*");
                retrieveEntityReq.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                rptPathString = "id=%7B" + reportID + "%7D&uniquename=" + Xrm.Page.context.getOrgUniqueName() + "&iscustomreport=true&reportnameonsrs=&reportName="
    +
                                reportName + "&isScheduledReport=false&p:ABMFilteredQuote=" + strParameterXML;
                //remove the part starting from &p:salesorderid if your report has no parameters
                retrieveEntityReq.send(rptPathString);
                var x = retrieveEntityReq.responseText.indexOf("ReportSession=");
                var ret = new Array();
                ret[0] = retrieveEntityReq.responseText.substr(x + 14, retrieveEntityReq.responseText.indexOf("&", x) - x - 14); //the session id
                x = retrieveEntityReq.responseText.indexOf("ControlID=");
                ret[1] = retrieveEntityReq.responseText.substr(x + 10, retrieveEntityReq.responseText.indexOf("&", x) - x - 10); //the control id
                return ret;
            var bdy = new Array();
            var bdyLen = 0;
            function concat2Bdy(x) {
                bdy[bdyLen] = x;
                bdyLen++;
            function encodePdf(params) {
                bdy = new Array();
                bdyLen = 0;
                var retrieveEntityReq = new XMLHttpRequest();
                var pth = Xrm.Page.context.getServerUrl() + "/Reserved.ReportViewerWebControl.axd?ReportSession=" + params[0] +
                "&Culture=1033&CultureOverrides=True&UICulture=1033&UICultureOverrides=True&ReportStack=1&ControlID=" + params[1] +
                "&OpType=Export&FileName=Public&ContentDisposition=OnlyHtmlInline&Format=PDF";
                retrieveEntityReq.open("GET", pth, false);
                retrieveEntityReq.setRequestHeader("Accept", "*/*");
                retrieveEntityReq.send();
                BinaryToArray(retrieveEntityReq.responseBody);
                return encode64(bdy);
            var StringMaker = function () {
                this.parts = [];
                this.length = 0;
                this.append = function (s) {
                    this.parts.push(s);
                    this.length += s.length;
                this.prepend = function (s) {
                    this.parts.unshift(s);
                    this.length += s.length;
                this.toString = function () {
                    return this.parts.join('');
            var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
            function encode64(input) {
                var output = new StringMaker();
                var chr1, chr2, chr3;
                var enc1, enc2, enc3, enc4;
                var i = 0;
                while (i < input.length) {
                    chr1 = input[i++];
                    chr2 = input[i++];
                    chr3 = input[i++];
                    enc1 = chr1 >> 2;
                    enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
                    enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
                    enc4 = chr3 & 63;
                    if (isNaN(chr2)) {
                        enc3 = enc4 = 64;
                    } else if (isNaN(chr3)) {
                        enc4 = 64;
                    output.append(keyStr.charAt(enc1) + keyStr.charAt(enc2) + keyStr.charAt(enc3) + keyStr.charAt(enc4));
                return output.toString();
        </script>
        <script type="text/vbscript">
        Function BinaryToArray(Binary)
               Dim i
               ReDim byteArray(LenB(Binary))
               For i = 1 To LenB(Binary)
                     byteArray(i-1) = AscB(MidB(Binary, i, 1))
                     concat2Bdy(AscB(MidB(Binary, i, 1)))
             Next
              BinaryToArray = byteArray
       End Function     
        </script>
    </head>
    <body>
        <input type="button" onclick="CreateEmail();" value="Attach Report" />
    </body>
    </html>

  • Do I need to install Oracle database 12c on PC to create tables for Weblogic server

    Hi,
    I am new to WebLogic and I am following a book Java EE Development
    with Eclipse published by PACKT Publishing to learn  Java EE.  I have installed Oracle Enterprise Pack for Eclipse
    on the PC and I am able to log into the WebLogic Server
    Administration Console and set up a Data Source.  However the next step is to create
    tables for the database.  The book says that the tables can be
    created using SQL script run from the SQL command line.
    I cannot see any way of inputting SQL script into the WebLogic
    Server Admistration Console.  Aslo there is no SQL Command line
    in DOS.
    I have put a previous question on the Oracle Forum about the above and I  was advised to use SQL Plus
    to create the tables for the weblogic server but no mention was made of installing Oracle database.
    I have downloaded InstantClient SQL Plus and Instantclient Basic on a PC and
    put the files into the same directory C:\SQLPlus but now I am having a problem in that it is
    looking for a username and password when I run the sqlplus.exe file.
    Now I assume that I need to have an installation of Oracle databse on the
    PC so as to be able to use SQL Plus.  Am I correct in this or can I create tables for the
    datasource in weblogic without an Oracle database?
    Thanks in advance for your help. Brian

    You should install it separately and also need to change the OBIEE's user.sh to tell it where is your Oracle client installed.

  • Create file for export data from Essbase

    I wish to create dynamically CalcScript for an unloading of the data from Essbase.
    For this purpose I have created variables for each measurement.
    How to create procedure for generate a file with my variables?
    Thanks.

    Hi,
    There are a number of ways of doing this, you could use the odiOutFile tool and write your script into the text, replacing parts of the text with your ODI variables.
    Or you can hold the script in say a db table or file and then create an interface to write a file, it should replace the variable text with your ODI variables if you declare them in a package.
    Cheers
    John
    http://john-goodwin.blogspot.com/

Maybe you are looking for

  • Gather table Statistics

    i need collect the statistics for few tables from a schema. i am doing the following: i am creating a table to save the statistics. begin dbms_stats.create_stat_table(ownname =>'TEST', statab =>'TEST_ORD',); end; and then i am gathering the table sta

  • Remove first letter in a string

    how to remove the first letter in a string ? example string : hkitty result : kitty

  • Content alignment problem

    Alignment on all web pages is off, sign in boxes are gone, calenders overlap, graphics gone

  • Set Maximum on {tag_totalunits}

    We are trying to limit the number of units ordered through the checkout. We want orders in which the {tag_totalunits} is greater than 75 to prompt the user to use the quote form instead of the buy form. Since the code for the input is generated by BC

  • Kodo plugin for eclipse 3.1.2 : does it work ?

    hi, i have installed the plugin in my Eclipse plugins directory but i still cannot see it in Eclipse IDE. I tried to change perspectives, and customize it, i dont see any KODO views. Nothing. Does anyone know if it's bugging, or what i can do to make