Custom copy script

Dear All,
Can someone please explain to me why this is happening.
I have created a script based on several scripts i found on SDN.
I have some knowhow from SAP BPC MS and according to me this should just work.
This is the script.
*XDIM_MEMBERSET C_DATASRC=Upl
*XDIM_MEMBERSET GROUPS=LC
*XDIM_MEMBERSET IN_WASTETYPE=BAS(IWT_ALL)
*XDIM_MEMBERSET MEASURES=PERIODIC
*XDIM_MEMBERSET LINEMAINITEM=<ALL>
*XDIM_MEMBERSET PACKAGETYPE=BAS(PT_ALL)
*XDIM_MEMBERSET PROFITCENTER=BAS(N)
*XDIM_MEMBERSET P_PROFITCENTER=BAS(P_N)
*XDIM_MEMBERSET TIME=%TIME_SET%
*XDIM_MEMBERSET VALUETYPE=ACTUAL,FORECAST,PLANNED
*LOOKUP EBIT
*DIM MEASURES=PERIODIC
*DIM LMITEM: LINEMAINITEM=SCP
*DIM PACKAGETYPE=PT_NONE
*ENDLOOKUP
*WHEN P_PROFITCENTER
*IS <> P_NONE
*WHEN LINEMAINITEM
*IS WTODT
*REC(EXPRESSION=0, LINEMAINITEM=LINEMAINITEM.ZACC1)
*REC(FACTOR=LOOKUP(LMITEM), LINEMAINITEM=LINEMAINITEM.ZACC1)
*ENDWHEN
*WHEN LINEMAINITEM
*IS DT
*REC(EXPRESSION=0, LINEMAINITEM=LINEMAINITEM.ZACC1)
*REC(FACTOR=LOOKUP(LMITEM),LINEMAINITEM=LINEMAINITEM.ZACC1)
*ENDWHEN
*ENDWHEN
*COMMIT
I would say that it is possible to post data from a calculation on a other linemainitem.
In the linemainitem dimension i created a propperty ZACC1, which is a reference to a other linemainitem.
The only thing is, when i run this logic it posts zero's on itself, in this case WTODT and DT and not %VALUE%*LOOKUP on LINEMAINITEM.ZACC1.
Can someone point me in the right direction to make this script work?
Thanks in advantage
Harmen

The problem is solved.
Somehow BPC has the tendency to post a counter booking on itself when a logic fetches a figure.
I don't know why or how, but it's what I saw it doing.
The initial script was correct, the only thing I had to add to the script was
REC(FACTOR=1)
The finalized script now is this:
*XDIM_MEMBERSET C_DATASRC=Upl
*XDIM_MEMBERSET GROUPS=LC
*XDIM_MEMBERSET IN_WASTETYPE=IWT_NONE
*XDIM_MEMBERSET MEASURES=PERIODIC
*XDIM_MEMBERSET LINEMAINITEM=WTODT,DT
*XDIM_MEMBERSET PACKAGETYPE=PT_NONE
*XDIM_MEMBERSET PROFITCENTER=BAS(N)
*XDIM_MEMBERSET P_PROFITCENTER=BAS(P_N)
*XDIM_MEMBERSET TIME=%TIME_SET%
*XDIM_MEMBERSET VALUETYPE=PLANNED
*LOOKUP EBIT
*DIM LMITEM: MEASURES=PERIODIC
*DIM LMITEM: LINEMAINITEM=SCP
*DIM LMITEM: PACKAGETYPE=PT_NONE
*DIM LMITEM: PROFITCENTER=PC_NONE
*DIM LMITEM: VALUETYPE=PLANNED
*ENDLOOKUP
*WHEN P_PROFITCENTER
*IS  <> P_NONE
*WHEN LINEMAINITEM
*IS WTODT
*REC(FACTOR=LOOKUP(LMITEM), LINEMAINITEM=LINEMAINITEM.ZACC1)
*REC(FACTOR=1)
*NEXT
*ELSE
*WHEN LINEMAINITEM
*IS DT
*REC(FACTOR=LOOKUP(LMITEM), LINEMAINITEM=LINEMAINITEM.ZACC1)
*REC(FACTOR=1)
*NEXT
*ENDWHEN
*ENDWHEN
*ENDWHEN
*COMMIT 
NOTE: there are point brackets in the line *IS  P_NONE but the BB code probably recognized this as a command.
Thanks for the help, I can't give you the points since the solutions was different than suggested
Harmen
Edited by: HarmenKlapwijk on Apr 8, 2011 4:44 PM

Similar Messages

  • Custom Calculation Script almost works...

    I'm trying to creaet a form that uses a dropdown box to select the proper text for a text field.  I have created the form and the Custom Calculation for my Text box works great (Thanks to these forums!).
    The problem I am experincing now is that I want to be able to use an Add Page button to spawn another blank copy of the form within the file.  The page spawns correctlly (Once again thanks to these forums!), but My text fields in all of the pages only have the calculated value based upon the last page added.
    Here is my script to spawn the page based upon a template called "Additional Information":
    var a = this.getTemplate("Additional Information");
    a.spawn();
    resetFieldsOnPage(pageNum++);
    resetFieldsOnPage() is a document level javascript that is used to clear the form when it spawns and also to clear and indvidual page with the use of a Clear Button:
    function resetFieldsOnPage(p)
    var fields = [];
        for (var i=0; i<this.numFields; i++) {
            var f = this.getField(this.getNthFieldName(i));
            if (f==null) continue;
            if (f.page==p)
                fields.push(f.name);
        this.resetForm(fields);
    My Text field with the custom calaculation script looks like this:
    //var v = this.getField("Dropdown2").value;
    var v;
    var p = "P";
    var pagecount = this.pageNum;
    var AI= ".Additional Information.";
    var drop = "Dropdown21";
    var Value1013A = "VALUEA";
    var Value1013B = "VALUEB";
    var Value1013C = "VALUEC";
    var Value1013D = "VALUED";
    var Value1013E = "VALUEE";
    var Value1013F = "VALUEF";
    var Value1013G = "VALUEG";
    var Value1013H = "VALUEH.";
    var Value1015A = "VALUE105A";
    if (pagecount == "0") v = this.getField(drop).value;
        else v = this.getField(p+pagecount+AI+drop).value;
    if (v=="101-3 subd.A") this.event.value = Value1013A;
         else if (v=="101-3 subd.B") this.event.value = Value1013B;
         else if (v=="101-3 subd.C") this.event.value = Value1013C;
         else if (v=="101-3 subd.D") this.event.value = Value1013D;
         else if (v=="101-3 subd.E") this.event.value = Value1013E;
         else if (v=="101-3 subd.F") this.event.value = Value1013F;
         else if (v=="101-3 subd.G") this.event.value = Value1013G;
         else if (v=="101-3 subd.H") this.event.value = Value1013H;
         else if (v=="101-5 subd.A") this.event.value = Value1015A;
         else this.event.value = " ";
    I can add pages succesfully with the ADD PAGE button and the additional forms are blank.  As soon as I select a Value in dropdown21 on the new page, All the text boxes that have the above custom calcualtion script change to the value on the last page.  The last page is correct, but all the pages before it have changed.
    I have made sure that the form is blank before creating the template.  I have even exported a copy of the orginal page with no data in it and then imported it as a new page.  After the import I have changed all of the form field to completelly different names and then modified the script of the imported page before creating the template.  I just can't see the problem.  Any help is appreciated.  Thanks

    Simple field notation: Field 1 / Field 2
    Custom script:
    var v1 = +this.getField("Field 1").value;
    var v2 = +this.getField("Field 2").value;
    if (v2==0) event.value = "";
    else event.value = (v1 / v2);

  • Custom Calculation Script Question

    I'm flying blind here, I know nothing about this stuff. I just need something i can copy and paste into the "custom calculation script" box.
    I'm working on making a character sheet for star wars saga edition auto calculate. The only thing I have left before it is completely done is one last calculating field. However, I have no clue how to do it.
    What it needs to do is take the value from one field (user entered info) and then divide it by 2, always rounding down.
    The field the user enters a number in is named "Level" and the field that needs to display that number is named "1/2lvl".

    If no one answers here you can try the Acrobat Scripting forum.

  • How to avoid custom action script link executing for all pages. It should execute for only custom list

    Hello all,
    The below code creates the custom action script link. however this is executing for all the pages.
    I want to execute only to list not on all the pages. How i can acheive this. Please help
    var context =
    new SP.ClientContext.get_current;
    this.oWebsite = context.get_web();
    var collUserCustomAction =
    this.oWebsite.get_userCustomActions();
    var scriptLink = collUserCustomAction.add();
    scriptLink.set_name('Welcome');
    scriptLink.set_title('Welcome');
    scriptLink.set_description('Welcome to new custom script Link');
    scriptLink.set_location('ScriptLink');
    scriptLink.set_scriptSrc('~Site/Scripts/test.js');
    scriptLink.set_group('');
    scriptLink.update();
    Navaneeth

    Then Edit the list page add the script editor web part on the page . Copy the paste the script. Now it will affect the list only. Or else in your script just validate the list id.
    Ravin Singh D

  • OBIEE variables in custom java script

    Hello all
    Can I use OBIEE variables like presentation and session variables in my custom java script code that I am writing in text view on a dashboard page. Is it possible to do that. please me soon if somebody knows the solution to do that.
    Thanks in Advance

    Hi john
    Thanks for reply, I am able to generate javascript using text view on a dashboard page.
    But I want to access OBIEE variables in javascript. How I can do that in narrative view. Can u explain me or give me any link.
    Thanks

  • How to convert an Excel Formula to a Custom Calculation Script in a Adobe Acrobat 9 Form?

    Hello,
    I am not familiar whatsoever with Javascript and need some help in converting the following Excel Formula so that I can enter it into a Custom Calculation Script in a Adobe PDF Form. Here is the formula:
    =IF(E15<25.01,9.95,IF(E15<50.01,11.95,IF(E15<75.01,13.95,IF(E15<100.01,16.95,IF(E15<150.01 ,19.95,IF(E15<200.01,24.95,IF(E15>200.00,E15*0.125)))))))
    Where "E15" will be the text field named "Subtotal" on my Adobe PDF Form.
    Thank you for any help you can provide!

    Fortunately JavaScript has the 'switch' statement so nested if statements can be avoided.
    var E15 = this.getField("Subtotal").value;
    switch(true) {
    case (E15 < 25.01) :
    event.value = 9.95;
    break;
    case (E15 < 50.01) :
    event.value = 11.95;
    break;
    case (E15 < 75.01) :
    event.value = 13.95;13
    break;
    case (E15 < 100.01) :
    event.value = 16.95;
    break;
    case (E15 < 150.01) :
    event.value = 19.95;
    break;
    case (E15 < 200.01) :
    event.value = 24.95;
    break;
    case (E15 > 200) :
    event.value = E15 * 0.125;
    break;
    default:
    event.value = "";
    break;
    } // end switch;

  • Character Limit to Custom Calculation Script?

    Hi. I have a document that has a text form field. I want to run a custom calculation script that basically says if field "Group Number" = xxxxxxx, then field "Group Name" should = ABC Company.
    I have a list of almost 575 group numbers and names that I need to put in the script. And I've got the script working just fine but I am guessing there is a character limit to the script field???? It won't let me put my full list in there.
    Any suggestions on how to get around this??
    Thanks,
    Brandy

    I think I might have one error but I thought I had corrected it. Let me run this by you. My "if" lines are like this:
    if(a == '88096') event.value = 'Stacy's Carpet Steam Cleaning Company';
    But the code doesn't seem to like the ' in the Group's name. Is there a way to correct that without getting rid of the ' .... ?????

  • Need Assistance With Custom Calculation Script

    I need help with a custom calculation script in Acrobat Pro.  I am trying to add the sum of fields A, B, C, D, E, F, and G together with the lesser value of fields H and I.  What would be the script to enter for this result?  Thank you.

    event.value = Number(this.getField("A").value) + Number(this.getField("B").value) + Number(this.getField("C").value) + Number(this.getField("D").value) + Number(this.getField("E").value) + Number(this.getField("F").value) + Number(this.getField("G").value) + Math.min(Number(this.getField("H").value), Number(this.getField("I").value));

  • Help with Custom calculation script in Acrobat 8

    Hi all, I am using acrobat 8 on OS 10.5
    I am trying to add certain fields (numbers) and then subtract another field value to give an end result.
    I don't know anything about Javascript, would anyone be able to help with any info on how I achieve this result? I can only see Add, x and average etc... nothing there for subtraction
    Thanks for any help in advance
    Swen

    This should get you started:
    >if (event) {
    // get values from two text fields
    var a = Number(this.getField('Text1').value);
    var b = Number(this.getField('Text2').value);
    // subtract the values and show it
    this.event.target.value = a - b;
    Place this in a 3d text field, as a Custom Calculation Script.

  • Is it possible to use extensive formulas (e.g. "if" or vlookup functions) in the "Custom Calculation Script"?

    I am working on a form fill PDF converted from MS excel. This is for others to use who don't have MS excel that need to use my spreadsheet.
    1. I would like to know how complex can the formulas be in the custom calculation script in the calculate tab under properties in a cell menu?
    2. Where can I find what formulas will work in the custom calculation script along with the format for those formulas to work correctly (tutorials would help)?
    I have tried writing an "if" function but received and error so I am assuming either functions don't work in the script or there is a different format than standard spreadsheet formats.
    Bruce

    In that case the for loop would be:
        for (var i = 0; i < 8; i += 1) {
            sum += +getField("Total." + i).value;
    So initially, the counter i is equal to zero, so the field name used with the getField method is:
    "Total." + 0, which results in the string "Total.0". With each iteration, the variable i is incremented by 1, so the subsequent field names are the following:
    "Total.1"
    "Total.2"
    "Total.3"
    "Total.4"
    "Total.5"
    "Total.6"
    "Total.7"
    The script gets the value of each field, converts it to a number, and adds the number it to the running sum.

  • How do I create an "if" function in a custom calculation script?

    I need to take a simple "value is the sum of" and make it so if one field is less than 1 then the result of the formula will equal "0".
    For example here is a simple "sum of" script:
    Incent Bns.26, Time Bns.26, Spec Bns.26.
    Now converted to a custom calculation script:
    event.value = ((this.getField("Time Bns.26").value) + (this.getField("Incent Bns.26").value)) + (this.getField("Spec Bns.26").value);
    Where Time Bns is calculated by looking at another field Hours26 using a special formula to calculate the bonus.
    I would like to add something like an "if" function to the script so that if the Hours26 field is less than 1 then the output of the script will equal "0".
    I tried this already:
    var rank = this.getField("Hours26").value
    var value = 0
    if (rank < 1) {
      value = 0
    else  (rank > 0) {
       value = ((this.getField("Time Bns.26").value) + (this.getField("Incent Bns.26").value)) + (this.getField("Spec Bns.26").value);
    event.value = value
    But get the error: SyntaxError : missing ; before statement 7 at line 8:
    Thanks ahead of time for any help.
    Bruce

    Try this:
    var rank = this.getField("Hours26").value;
    var value = 0;
    if (rank < 1) {
      value = 0;
    } else {
       value = ((this.getField("Time Bns.26").value) + (this.getField("Incent Bns.26").value)) + (this.getField("Spec Bns.26").value);
    event.value = value;

  • Custom Calculation Script Help Needed

    I need to make a script that Sums a column of fields based on whether or not information found in another column of fields is the same or specific text. Please see below screenshot of what I would like it to do.
    I would like a Sum of all Amounts that have the Code A...

    You can use this script as the custom calculation script of "SumOfA":
    var total = 0;
    for (var i=0; i<=2; i++) {
        if (this.getField("p1TC."+i).value=="Code A")
            total+=Number(this.getField("p1RecIn."+i).value);
    event.value = total;
    You can easily adjust it for the other field as well.

  • Custom calculation script for a lease (please help)

    I have so little experience with this it isn't funny.  I prior to now have never used javascript.  But Im trying to get my lease form to auto calculate a tenants pro-rate that would be due if they moved in on the middle of the month for example.
    I created the below script and im sure there is a few things or more than a few things wrong with it...can anyone give me some pointers.
    // Custom Calculate script
    (function () {
        // Get the input field values, as strings
        var leasemonth = getField("LeaseBegMonth").valueAsString;
        var leasestartday = getField("LeaseBegDay").valueAsString;   
        var rentamount = getField("MonthlyRent").valueAsString;
        // calculate how many days in the month
        if ( leasemonth=1
                var leasedays = 31
        elseif (leasemonth=2
                var leasedays = 28
        elseif (leasemonth=3
                var leasedays = 31
        elseif (leasemonth=4
                var leasedays = 30
        elseif (leasemonth=5
                var leasedays = 31
        elseif (leasemonth=6
                var leasedays = 30
        elseif (leasemonth=6
                var leasedays = 30
        elseif (leasemonth=7
                var leasedays = 31
        elseif (leasemonth=8
                var leasedays = 31
        elseif (leasemonth=9
                var leasedays = 30
        elseif (leasemonth=10
                var leasedays = 31
        elseif (leasemonth=11
                var leasedays = 30
        elseif (leasemonth=12
                var leasedays = 31
        //CALCULATE HOW MANY DAYS REMAIN
        var daysremain = LeaseBegDay-leasedays   
        //CALCULATE THE PRORATE AND DISPLAY IT
        event.value = (rentamount/leasedays)* daysremain
    Thanks for your help!!

    Thank you thank you thank you!  Here is the revised script with the changes.  about to go plug it in and see if it works.
    // Custom Calculate script
    (function () {
        // Get the input field values
       var leasemonth = Number(this.getField("LeaseBegMonth").valueAsString);
       var leasestartday = Number(this.getField("LeaseBegDay").valueAsString);   
       var rentamount = Number(this.getField("MonthlyRent").valueAsString);
       var leasedays = 0
        // calculate how many days in the month
    if ( leasemonth==1)
           leasedays = 31;
    else if (leasemonth==2)
           leasedays = 28;
    else if ( leasemonth==3)
           leasedays = 31;
    else if (leasemonth==4)
           leasedays = 30;
    else if ( leasemonth==5)
           leasedays = 31;
    else if (leasemonth==6)
           leasedays = 30;
    else if ( leasemonth==7)
           leasedays = 31;
    else if (leasemonth==8)
           leasedays = 31;
    else if ( leasemonth==9)
           leasedays = 30;
    else if (leasemonth==10)
           leasedays = 31;
    else if ( leasemonth==11)
           leasedays = 30;
    else if (leasemonth==12)
           leasedays = 31;
        //CALCULATE HOW MANY DAYS REMAIN
        var daysremain = leasestartday-leasedays   
        //CALCULATE THE PRORATE AND DISPLAY IT
        event.value = (rentamount/leasedays)* daysremain

  • Custom calculation script for checkboxs

    Hello,
    Can anyone help me out with custom calculation script for this?  I have two mutually exclusive checkboxes that, when checked, I want to populate data into other text fields.
    If Checkbox1 is checked:
    Company1=Warehouse Alpha
    Address1=1234 Any Street
    City/State/Zip1= Los Angeles, CA 90020
    Contact Name1= Mr. Nice Guy
    Phone Number1= 213-854-8565
    Email1=[email protected]
    If Checkbox2 is checked:
    Company2=Warehouse Beta
    Address2= 5678 Awesome Blvd.
    City/State/Zip2= San Bernardino, CA 96545
    Contact Name2= Mr. Handsome
    Phone Number2= 909-824-8265
    Email2=[email protected]
    Thanks,
    Bryan

    So one has two check boxes and one wants them to be mutually exclusive. Name them the same and change the export value of the field. Try it and observe what happens as you check the different check boxes.
    You have described what happens if either box is checked but what happens when a checked box Is unckecked?
    One can place scripts in many locations. I would use a mouse up action for both the check boxes, use the same script for both check boxes.
    I would assume you are using the following names for the fields to populate:
    Company
    Address
    CityStateZip
    ContactName
    PhoneNumber
    Email
    // Mouse up action for both check boxes;
    // initial value for the fields:
    this.getField("Company"),value = "";
    this.getField("CityStateZip"),value = "";
    this.getField("ContactName"),value = "";
    this.getField("PhoneNumber"),value = "";
    this.getField("Email"),value = "";
    // test for check box value for selected box;
    if(event.value == 1) {
    this.getField("Company"),value = "Warehouse Alpha";
    this.getField("CityStateZip"),value = "1234 Any Street";
    this.getField("ContactName"),value = "Los Angeles, CA 90020";
    this.getField("PhoneNumber"),value = "213-854-8565";
    this.getField("Email"),value = "[email protected]";
    if(event.value == 2) {
    this.getField("Company"),value = "Warehouse Beta";
    this.getField("CityStateZip"),value = "5678 Awesome Blvd.";
    this.getField("ContactName"),value = "San Bernardino, CA 96545";
    this.getField("PhoneNumber"),value = "Mr. Handsome";
    this.getField("Email"),value = "[email protected]";
    // end Mouse up action for both check boxes;

  • Custom calculation script not working

    Hi...
    I've been looking at the samples and searching but have yet to make my custom calculation script work.  The bottom line is that I want one field to be blanked out if another is populated.
    My script currently looks like this:
    event.value = (getField("List_B1") + '').length > 0 ? '' : getField("List_A1");
    I've also tried
    event.value = (getField("List_B1").value + '').length > 0 ? '' : getField("List_A1").value;
    Neither result in List_A1 being empty when List_B1 has something in it.
    Anyone see something I'm missing?
    Thanks
    Mark

    The fields are being processed in programmatically.  The request came in that when we save the form values as a pdf that they don't want any List A value to show if List B has a value set.  So to give an example the inputs would be
    List A : foo
    List B : bar
    List C : baz
    What I'm trying to do with the custom calculation is to have the output pdf be
    List A:
    List B: bar
    List C: baz
    at least that's what my script was aiming for, but what's coming out is
    List A : foo
    List B : bar
    List C : baz
    Come to think about it, it probably has to do with the order with which the fields are being set and the expression fires.  In other words, it could be that when List A is set, List B hasn't been set yet, so the expression's a no-op...
    Thanks
    Mark

Maybe you are looking for

  • Base value not flowing in J1IEX

    Hi All, The Excise Base Value is not flowing in J1IEX. I am doing an STO. The other duties like BED, AED are flowing while capturing  excise invoice, but not the Base value. PLease let me know the settings to ensure the Base value flows in J1IEX. Tha

  • Troubles printing to a networked HP printer!

    If you can see the networked HP printer but still nothing prints, or if you are thinking about buying an HP printer this weekend - you may be interested in the following HP link which lists the printers that can be successfully networked. I have been

  • ORA-22908: reference to NULL table value (insert into nest)

    Hi all, When attempting to insert a record into a nested table I get the above error (ORA-22908...). I've read what the error means, but to be honest it's a bit confusing. I'm wondering if someone could shed some light on the topic for me. The insert

  • Question for Creative staff about final X-Fi dri

    I was wondering if you guys are going to release the portion of the x-fri drivers for Vista that we could get for XP off of the CD. By this I mean the nice little GUI that we could mess with treble and bass and all the other setting that is not that

  • Error 0 Statement Ignored

    I'm migrating from Reports 10.xxx to 11.1.2.0, and I run into something very strange. Any select statement on any trigger on Reports 11.xxx  returns Error 0 at line x, column x SQL statement ignored. The reports have been and are still running on Rep