Help in script logic - problem in FOR loop

Hi Experts,
We are using BPC 7.5 SP08. I have written a FOR loop in script logic default.lgf which is as follows:
*FOR %TIM_MEM%=%TIME_SET%
*XDIM_MEMBERSET TIME =%TIM_MEM%
*WHEN P_ACCT2
*IS "OSDU"
REC(EXPRESSION=[P_ACCT2].[ASSTCAINVURO][P_ACCT2].[COGSUPRVIPSA]/[P_ACCT2].[ASSTUPRVTAQTY],P_ACCT2="COGSUIPSAO")
*ENDWHEN
*COMMIT
*NEXT
As per my requirement, all this members: [ASSTCAINVURO], [COGSUPRVIPSA], [ASSTUPRVTAQTY] exists for months September to next year's August. But in my input schedule, the months are from August to next year's July(which is the company's fiscal year). Consequently the loop runs for month August to next year's July while I need to run the loop 1 month late(i.e. September to next year's August). This was achieved earlier by hard-coding the time members which we cannot afford as this requires to update these hard-coded member IDs every year.
We have also tried using the "NEXT" property of TIME dimension as follows:
*XDIM_MEMBERSET TIME =%TIM_MEM%.NEXT
but %TIM_MEM%.NEXT doesn't get the month in 'NEXT'.
Please suggest if there is any way out to solve this problem.
Thanks in advance.

Hi Appu,
Even if you restrict the scope using the XDIM statement, your script will just run the number of times as per the for loop. Actually, in reality, the same calculation is happening again and again, in your code; since your calculation is not based on the time member.
To use the for loop effectively, you need to incorporate the time member in your calculation.
Please look at the below sample code:
*XDIM_MEMBERSET TIME = %TIME_SET%
*FOR %TIM_MEM%=%TIME_SET%
   *WHEN P_ACCT2
   *IS "OSDU"
      *REC(EXPRESSION=<CALCULATION>,P_ACCT2="COGSUIPSAO")
   *ENDWHEN
*NEXT
And in your calculation, you can use statements like
([P_ACCT2].[ASSTCAINVURO],TMVL(1, [TIME].[%TIM_MEM%]))
This will ensure that everytime (as per the for loop), the calculation works on separate set of data.
Hope you got the idea.

Similar Messages

  • Help in script logic

    Hi Experts,
    We are using SAP BPC 7.5 NW Version SP08. We are using a script logic that calculates the opening value of inventory(ASSTCAINVAMO) for each month except the 1st month of financial year for which the value is entered from an input schedule. The opening value of inventory of each subsequent months are calculated when the parameters for production(e.g. OSDA) are entered from a separate input schedule. The following script logic is written for the calculation:
    *FOR %TIM_MEM%=%TIME_SET%
    *XDIM_MEMBERSET TIME =%TIM_MEM%
    *WHEN P_ACCT2
    *IS "OSDA",
    REC(EXPRESSION=[P_ACCT2].[ASSTCAINVAMO]+[P_ACCT2].[RDPA][P_ACCT2].[EFFA][P_ACCT2].[OSDA]-[P_ACCT2].[CONVAMUR][P_ACCT2].[RDPU][P_ACCT2].[EFFU][P_ACCT2].[OSDU]-([P_ACCT2].[SALQAMBC]+[P_ACCT2].[SALQAMM]),P_ACCT2="ASSTCAINVAMO",TIME=TIME.NEXT)
    *ENDWHEN
    *COMMIT
    *NEXT
    The loop works fine, but it seems the list of time values are not coming in proper sequence. For example, the loop is running for 2011.NOV before it iterates for 2011.OCT. So when it iterates for 2011.NOV, it is not getting the opening value for the month and consequently 2011.DEC's opening value is calculated assuming 2011.NOV's opening value to be 0. In the input schedule the months are in proper sequence.
    Is there any way out so that the months come in proper sequence in the logic as well?
    Thanks in advance for any help.

    We had similar issue . we changed TIME members from Monthnames to numbers . i.e  changed 2011.JAN to 2011.01 . Then you get correct result  as you are expecting . Issue when using month names in combination of TMVL is that  , instead of getting 2011. MAY for TMVL(1,2011.APR) , it gets 2011.FEB . TMVL function some how takes alphabetical order instead of taking month order . Not sure if this behavior is with service pack . But never saw any thread reporting this issue .
    Anyways ,you can wait for other responses  as i am too curious to know if any one faced this issue and how did they resolve.

  • Script logic problem BPC 7.5

    Hi!
    We have a script logic that worked fine in BPC 5.1 but after our upgrade to BPC 7.5 it doesn´t work anymore.
    I will try to explain the part of or logic that doesn´t work anymore.
    We have 2 lines that will pass through the script, each line creates a temporary value  on KATEGORI ="#avskr1").
    Depending on the value created on  u201C#avskr1" it should do calculation A if the value is negative and calculation B if the value is positive. To do this we the following script logic:
    *WHEN GET(KATEGORI="#avskr1")
           *IS < 0
    *Calculation A
    ELS
    *Calculation B
    And this logic worked fine in BPC 5.1.
    If line X had -50 as a value in  u201C#avskr1"   and line Y had 75 as a value  in u201C#avskr1" , calculation A would be performed on line X and calculation B on line Y
    With the same example as above in BPC 7.5 calculation A will be performed on both lines.
    But if I change the logic to the following script logic in BPC 7.5:
    *WHEN GET(KATEGORI="#avskr1")
           *IS  = -50
    *Calculation A
    ELS
    *Calculation B
    Calculation A would be performed on line X and calculation B on line Y. It seems like the logic can´t handle <> signs in this script logic anymore.
    Regards
    Fredrik

    Hi!
    Unfortunately it didn´t help still the same error.
    And I just got an answer from SAP Support that there are a bug in the use of "Get whith When or lookup" in 7.5 SP03 which we currently are using, but it has been fixed in SP04. They just put up a SAP not 1515973 about the issue.
    Unfortunately they have no work around for this problem so I don´t know how to solve it untill we have installed SP04.
    Regards
    Fredrik

  • BPC 10.0 Script Logic: Combination of *FOR *WHEN *LOOKUP

    Hi experts,
    I'm working on a requirement to copy values from one model to another and aggregate to values.
    Basically my script looks like that:
    *LOOPUP OTHER_MODEL
    *DIM VERSION = VERSION
    *DIM TIME = TIME
    *FOR %LOOP_CST% = %COSTCENTER_SET%
    *DIM CST_%LOOP_CST%: COSTCENTER = %LOOP_CST%
    *NEXT
    *ENDLOOKUP
    *FOR %SEL_CST% = %COSTCENTER_SET%
         *WHEN COSTCENTER
         *IS = %SEL_KST%
              *WHEN COST_TYPE
              *IS = "CST_NA"
                   *REC(EXPRESSION = LOOKUP(%SEL_CST%), COSTCENTER = [COSTCENTER].AGGR_LEVEL, CURRENCY = "CURR_NA")
              *ELSE
                    *REC(EXPRESSION = LOOKUP(%SEL_CST%), COSTCENTER = [COSTCENTER].AGGR_LEVEL, CURRENCY = "EUR")
              *ENDWHEN
         *ENDWHEN
    *NEXT
    *COMMIT
    Unfortunately, this is not working.
    If I include the for-loop inside the when-loop it is working. However, the values are multiplied based on the number of records.
    Is there another possibility to solve this issue?
    Thanks in advance,
    Benjamin

    Good Morning.
    First of all thank for answering and sorry for the incomplete code.
    It was only a test, I was trying to do a more dificult script but given the error I tried to simplify as much as posible the code.
    The complete problem it's that I have two models (Contracts and Planning). In one of them (Contracts) the user have to introduce values in UNITS level of dimension TIME.
    An example of data would be:
    DIMENSION ACCOUNT_RS = PRICEM2
    DIMENSION TIME = 2014.UNITS
    With value = 50
    In another model (Planning) I have values for another member of dimension ACCOUNT_RS for example:
    DIMENSION ACCOUNT_RS = PERCENTAGEARENT
    DIMENSION TIME = 2014.JAN
    Value = 0.5
    DIMENSION ACCOUNT_RS = PERCENTAGEARENT
    DIMENSION TIME = 2014.FEB
    Value = 0.3
    DIMENSION ACCOUNT_RS = PERCENTAGEARENT
    DIMENSION TIME = 2014.MAR
    Value = 0.4
    What I am trying to do is to read from model Contracts the value for the dimension ACCOUNT.
    For doing this I tried to build a LOOKUP to the model Contracts in the following form:
    //JAN, FEB ...
    *SELECT(%MON_SEL%,MONTHNUM,TIME,LEVEL= MONTH) 
    //2014, 2015...
    *SELECT(%YEA_SEL%,YEAR,TIME,LEVEL = YEAR)
    *LOOKUP Contracts
      *FOR %YEA_ACT% = %YEA_SEL%
      *FOR %MON_ACT% = %MON_SEL%
      //TIM_2014.JAN, TIM_2014.FEB
      *DIM TIM_%YEA_ACT%.%MON_ACT%:TIME = %YEA_ACT%
      //ACS_2014.JAN, ACS_2014.FEB
      *DIM ACS_%YEA_ACT%.%MON_ACT%:ACCOUNT_RS = PRICEM2
      *NEXT
      *NEXT
    *ENDLOOKUP
    *WHEN ACCOUNT_RS
    *IS PERCENTAGEARENT
      *FOR %YEA_ACT% = %YEA_SEL%
      *FOR %MON_ACT% = %MON_SEL%
      *WHEN TIME
      *IS %YEA_ACT%.%MON_ACT%
      //2014.JAN ..
      *REC(EXPRESION = LOKKUP(ACS_%YEA_ACT%.%MON_ACT%) )
      *ENDWHEN
      *NEXT
      *NEXT
    *ENDWHEN

  • Logic error in for loop

    I have a JSP form which list modules that student can take. Some of these modules have prerequisite and some do not.
    In order to successfully register a student, I have a number of requirements e.g. must not be already register; the registration date must not have passed etc.
    My problem is in my code logic. For example, when a student selects a module, which does not have a prerequisite, and a module, which has a prerequisite and click on the Register button, an Error.jsp page is displayed because he has not satisfied the prerequisite for the second module.
    What the program does is that it registers the first module which dose not has a prerequisite and display the Error.jsp page.
    This is confusing for the user because they expect to do the process again and do not know that the first module has been register successfully.
    Here is my code
    private int enroll()throws SQLException,IOException
          // Get the check box values
          String checkboxNames[] = request.getParameterValues( "checkbox" );
          moduleVector = (Vector) session.getAttribute( "moduleVector" );
          //Get the student bean
          studentBean = (StudentBean) session.getAttribute( "studentBean" );
          boolean isEnrolled = false;
          String studentId = studentBean.getStudentId();
          int maxModule = Integer.parseInt(studentBean.getMaxModule());
          for (int i = 0; i < checkboxNames.length; i++) {
            String moduleId = checkboxNames;
    // First, make sure that this student is not already
    // enrolled for this module, and he/she has never
    // taken and passed the module before.
    isEnrolled = srsBean.isEnrolledIn( moduleId, studentId );
    if (isEnrolled){
    session.setAttribute("pre_enrolled", moduleId);
    return PREVIOUSLY_ENROLLED;
    // Now we make sure that the registration date has not
    // already passed
    Calendar rightNow = Calendar.getInstance();
    int rightNowMonth = rightNow.MONTH;
    int rightNowDay = rightNow.DAY_OF_MONTH;
    if ( rightNowMonth > Constants.REGISTER_DATE_MONTH ) {
    return PASSED_REGISTER_DATE;
    }else if( rightNowMonth == Constants.REGISTER_DATE_MONTH ) {
    if ( rightNowDay > Constants.REGISTER_DATE_DAY ) {
    return PASSED_REGISTER_DATE;
    int noModule = srsBean.noModuleEnrolledIn( studentId );
    // Now we make sure we don't erroll student on more
    // modules that the are allowed to do.
    if (!(noModule < maxModule)){
    // convert maxModule into string so we can use setAttribute
    String max = String.valueOf(maxModule);
    session.setAttribute("exceed_max_no", max);
    return EXCEEDED_MAX_NO_MODULE;
    // if there are any prerequisites for this module, check
    // to ensure that the student has completed them.
    if ( srsBean.hasPrerequisites(moduleId)) {
    Enumeration e = srsBean.getPrerequisites(moduleId);
    while ( e.hasMoreElements() ) {
    String pre = (String) e.nextElement();
    // See if the Student's Transcript reflects
    // successful completion of the prerequisite.
    if (!srsBean.verifyCompletion(moduleId, studentId)){
    session.setAttribute("prereq_not_sat", moduleId);
    return PREREQ_NOT_SATISFIED;
    // if we made it to here in the code, we're ready to
    // officially enroll the student.
    srsBean.enroll( studentId, moduleId );
    return SUCCESSFULLY_ENROLLED;
    How can i fix this problem ?

    1. well first check whether all modlues can be registered..
    2. you need to remove that in your for loop
    srsBean.enroll( studentId, moduleId );
    3. if all conditions are satisfied.
    for (int i = 0; i < checkboxNames.length; i++) {       
      String moduleId = checkboxNames<i>;
      srsBean.enroll( studentId, moduleId );
    }4. put the above code before
    return SUCCESSFULLY_ENROLLED;

  • Help on changing array elements with For loop

    Hi,
    I'm wondering if anyone can help me with this problem.  I'd like to be able to modify elements of an array with For loop.  In the attached VI, my goal is to have an array of [0 1 2 3 4 5], but instead what I've got is [2 2 2 2 4 5].  I initialized the array with a value of 2 to help me identify which elements are changing.  Can anyone help me pointing where my mistake is?  Thanks.
    Peter
    Attachments:
    Array test.vi ‏19 KB

    It's a classic issue for LV newbies. In this case you HAVE to use a
    shift register otherwise the modifications of previous cicles are lost.
    It's all easier than it's seems, see attached vi.
    bye,
    manga
    Attachments:
    Array test 2.vi ‏19 KB

  • Script logic not working for GL account with Zero balance

    Dear Experts,
    I have a scenario where the GL account balance in ECC is 0  and when a script logic runs in BPC the same should capture a closing balance as "1".
    Though I have written the below logic, this is not getting executed and writing back the value as "1".
    Kindly help me on the same.
    *WHEN ENTITY
    *IS "ABC"
    *WHEN ACCOUNT
    *IS "20300000"
    *REC(EXPRESSION = 11, ACCOUNT = 20300000,FLOW = F99, ENTITY = ABC, PROFITCENTER  = 130010 ,  INTERCO = I_NONE , CONSOSCOPE = G_NONE, CURRENCY = LC ,CATEGORY = ACTUAL, AUDITID = INPUT)
    *ENDWHEN
    *ENDWHEN
    *COMMIT
    Regards,
    Shilpa

    Hello Vadim Kalinin,
    Thanks for the very swift help.
    Merger of the client happened in 2007. ECC is using the " 20300000- change in fair value " account to record both pre-acquisition and post-acquisition values.
    Since the treatment of pre-consolidation and post consolidation reserves is different the split of the amount between pre and post-acquisition values has to be done. For the same post acquisition value is reduced from this account using a script logic as below.
    WHEN FLOW
    *IS "F99"
    *WHEN ENTITY
    *IS "ABC"
    *REC(EXPRESSION = ([ACCOUNT].[20300000] -3258603),ACCOUNT = 20300000,FLOW = F99,  INTERCO = I_NONE , CONSOSCOPE = G_NONE ,CURRENCY = LC ,CATEGORY = ACTUAL )
    This logic worked when the account has a figure, but in July 2014 in ECC the account had a transaction and the balance has become Zero. Until this account has a figure this pre acquisition logic is not working.
    For making this work, I am trying to write a new logic to make the balance of this account as "1" in BPC through the script logic.
    Kindly suggest me on the same.
    Regards,
    Shilpa

  • BPC 7.0 MS Script-Logic problem: New values used, old values written?

    I am trying to using BPC Script logic to update my Sales cube, specifically Revenue=Units*Price and Price=Revenue/Units using the "Price" stored in a seperate Price cube.
    Inside default.lgl, I am *INCLUDE-ing my own script:
    *LOOKUP PRICES
    *DIM PREIS:ACCOUNT="Price"
    *ENDLOOKUP
    *WHEN ACCOUNT
    *IS "Units"
    *REC(FACTOR=LOOKUP(PREIS),ACCOUNT="Revenue")
    *IS "Revenue"
    *REC(EXPRESSION=%VALUE%/LOOKUP(PREIS),ACCOUNT="Units")
    *ENDWHEN
    *COMMIT
    Now, when I insert new "Units" values using the std. Excel template, strange things happen:
    - The Revenues seems to be computed and updated correctly in the cube (if I check them using excel templates, they show up).
    - The Units seem to have the values they had before... seems they get old values ?!
    E.g. if I have several write operations say, I write units=2,3,4 and price is constant 10,
    the values in the cube seem to be (table):
    value written, units in cube, revenue
    3 , 2 , 30
    4,  3 , 40
    The new value is somewhere in the MS Analysis cube, otherwise, how could later be the new value be shown, although the excel templates seem to show old values?
    Any explanation for that strange behaviour?

    I simplified and wrote the prices in the same cube as I send the data from with the excel template.
    I tried using:
    *WHEN ACCOUNT
    *IS "Units"
    [Account].[#Revenue]=[Account].[Units]*[Account].[Price]
    *ENDWHEN
    *COMMIT
    *WHEN ACCOUNT
    *IS "Revenue"
    [Account].[#Units]=[Account].[Revenue]/[Account].[Price]
    *ENDWHEN
    *COMMIT
    Now, if units are send from the excel template, revenue is calculated correctly.
    If I enter revenue instead, seems that the 1st block is executed as well (why????!!!/how to avoid - I use *WHEN - what else should I do? )  which would explain the behaviour I get the old values for Units and Account again...
    Related: How can I use "*WRITE_TO_FILE"? I tried both
    *WRITE_TO_FILE Mylog.txt
    *WRITE_TO_FILE "Mylog.txt"
    But I can't find these file after sending data through the excel template... Do I have to create the files manually first or give full Path Names?
    Thanks!

  • Pls. help, SQL script page problem

    Hi,
    Im using the Hands On Oracle Database 10g Express Edition for Linux. Im in chap06 already p. 218. I just uploaded the SYSMGMT1 script. After that I Clicked the script's icon but I cannot see any SQL DDL commands inside. Nothing happened. It said in the book that I supposed to see and browse the SQL DDL commands that make up the script. I tried to click RUN, nothing happened either. Is there some kind of a bug in my System? Pls. help me because I cannot continue this chapter's exercise if I cannot solve this first problem that I encountered here in chap06. Any help from the guys outhere is really greatly appreciated. Thank you.
    respectfully waiting,
    Len

    Hi, did you ever get a solution to this because I am having exact same problem - I cannot see the scripts if I upload them nor can I type them in from scratch as the area for seeing/editting the script doesn't seem to be accessible.

  • Help with Script Logic

    Hi All
    I am trying to write the following script
    *INCLUDE ..\finance\system_constants.lgl
    *XDIM_MEMBERSET RATE=AVG,END
    *SELECT(%IP_Currencies%, "[ID]", "INPUTCURRENCYDIM", "[MD] = 'D' OR [MD]= 'M'") )
    *XDIM_MEMBERSET INPUTCURRENCY= %IP_Currencies%
    *XDIM_MEMBER RATESRC=RATEINPUT
    *WHEN INPUTCURRENCY.MD
    *IS "D"
    *REC(EXPRESSION=ROUND(1/%VALUE%,6),RATESRC="RATECALC")
    *ELSE
    *REC(RATESRC="RATECALC")
    *ENDWHEN
    *CLEAR_DESTINATION
    *DESTINATION RATESRC=RATECALC
    My LGX file looks like this.
    *XDIM_MEMBERSET RATE=AVG,END
    *XDIM_MEMBERSET INPUTCURRENCY= DZD,USD,ARS,AUD,ATS,BSD,BBD,BEF,BMD,BRL,GBP,BGN,CAD,CLP,CNY,CYP,CZK,DKK,XCD,EGP,EUR,FJD,FIM,FRF,DEM,XAU,GRD,HKD,HUF,ISK,INR,IDR,IEP,ILS,ITL,JMD,JPY,JOD,LBP,LUF,MYR,MXN,NZD,NOK,NLG,PKR,PHP,XPT,PLN,PTE,ROL,RUR,SAR,XAG,SGD,SKK,ZAR,KRW,ESP,XDR,SDD,SEK,CHF,TWD,THB,TTD,TRL,VEB,ZMK
    *XDIM_MEMBER RATESRC=RATEINPUT
    *WHEN INPUTCURRENCY.MD
    *IS "D"
    *REC(EXPRESSION=ROUND(1/%VALUE%,6),RATESRC="RATECALC")
    *ELSE
    *REC(RATESRC="RATECALC")
    *ENDWHEN
    *CLEAR_DESTINATION
    *DESTINATION RATESRC=RATECALC
    It gets validated fine and it also runs successfully through DPM. But the problem i am facing is that the above script is only running and posting data for USD  in RATECALC where as I have lot many currencies listed in "INPUTCURRENCYDIM". It does not execute for any other currency except for USD. I want to run it for all the currencies.
    Please suggest.
    Diksha.
    Edited by: Diksha Chopra on Jun 3, 2010 9:23 PM

    Hi Diksha,
    Please check in your inputcurrency dimension, how many members are there with the property MD as D?
    I would suggest you to change your scritp to
    *INCLUDE ..\finance\system_constants.lgl
    *XDIM_MEMBERSET RATE=AVG,END
    *XDIM_MEMBER RATESRC=RATEINPUT
    *WHEN INPUTCURRENCY.MD
    *IS "D"
       *REC(EXPRESSION=ROUND(1/%VALUE%,6),RATESRC="RATECALC")
    *IS "M"
       *REC(RATESRC="RATECALC")
    *ENDWHEN
    *COMMIT
    *CLEAR_DESTINATION
    *DESTINATION RATESRC=RATECALC
    Hope this helps.

  • Help needed in logic problem

    HI,
    I am trying to implement one marketing application, where the goods will be dispatched via some transportation. The receipt name is lr number or lrno. Some times for same lr no., 2-3 goods will be dispatched. Now, I am developing one application, if an user selects the from and to date from the web page, the web page should display all the lrno. Form date to to-date, its destination place and total amount, etc. These values are coming from backend.
    Eg.
    Trname      Lrno           dt          amt
    BLR     LR300          1/2/05          1000
    MUM     LR400          1/2/05          2000
    MUM     LR400          1/2/05          100
    MUM     LR400          1/2/05          200
    DL     LR600          3/2/05          1000
    My problem is if there are 2-3 goods for same lrno, the amounts should add up and final amount should come. Only in one record.(in one row). In the above example, for MUM 3 rows are there. So, the trname, lrno, dt shuld be same , but the total amount of all the three records should be added up and display.
    Expected output
    BLR     LR300          1/2/05          1000 as it is displayed
    MUM     LR400          1/2/05          2300// it should display like this.
    DL     LR600          3/2/05          1000 // as it displayed.
    My output as follows: I cold add the amount, but, each time, the record is displayed. Like this
    BLR     LR300          1/2/05          1000 //correct output
    MUM     LR400          1/2/05          2000 //this should not display
    MUM     LR400          1/2/05          2100 // this should not display
    MUM     LR400          1/2/05          2300 //Only this record should be displayed.
    DL     LR600          3/2/05          1000 //correct output
    Code sample as follows:
    <%
    while(rs.next())
              trfamt=rs.getInt("cfrta");
              String carnam=rs.getString("ccara").trim();
              String lrdt=rs.getString("clrd").trim();
              String lrnum=rs.getString("clrn").trim();
              brk="y";
              cnt1=0;
              cnt=cnt+1;
              out.println("Counter="+cnt);
              if(cnt==1)
                   subtot=trfamt;
                   tmp=lrnum;
              }//end of if(cnt==1) cndition
              else
                   if(lrnum.equals(tmp)) //compares whether two lrno are same or not.
                        brk="n";
                        subtot=subtot+trfamt; // if lrno are same, its amount is added up
                        //carnam1=carnam;
                        //lrnum1=lrnum;
                        System.out.println(lrnum+""+tmp+" "+"Lr numbers are same.totaling is continued");
                        tmp=lrnum;
                        cnt1=cnt1+1;
                        }//end of if     
                   else
                        if(cnt1==0)
                             subtot=0; // if lrno are different, fresh totaling is done
                             subtot=trfamt;
                             System.out.println("Lr numbers are different.Fresh Totaling is done");
                             tmp=lrnum;
                             }//end of if(cnt1=0)condition
                   }//end of else
                   }//end of if(cnt==1)condition else part
         if((cnt==1)||(brk.equals("y"))||(cnt1>0))
                        {%>
                        <TABLE>
                        <TR>
                             <TD><%out.println("Carier Name="+carnam);%></TD>
                             <TD><%out.println("Lrnumber="+lrnum);%></TD>
                             <TD><%out.println("Amount="+subtot);%></TD>
                        </TR>
                        </TABLE>
                        <%}
         }//end of while condition %>          
    How to correct this error ! please help me.
    With regards,
    AShvini

    Thank you Ram.
    I will try your code. ok, i took another look at it and dont see y it shouldnt
                            if(lrnum == mc.getLrNum())
                  //if this has already been added, just update amount
                  mc.addAmount(trfamt);
                  dupRecord = true;
                                               break; //it would work correctly even without this, but y do unnecessary iterations if id found
    ,/code]
    Since past 3 days, i am struggling with this bug. SO,
    i asked for line by line compilation. As u said, i
    tried to download IDE from www.ecllips.com, but,
    stuckup somewhere. so, i gave up.
      don't give up, install eclipse (or any other ide), it would do wonders to ur development effort.
    I will try with your code and get back to u.
       cool :-)
    ram.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Help in writing logic to abaper for printing contact details from partnr fn

    Hi friends,
    I have to give the logic to the abaper to print the contact details of one partner which is manually entered in the quotation at header level.
    i have a partner z1 with partner type PE which is manually entered in the partner fn field at the header level.  this z1 partner fn is an employee.  The name and contact details of this employee needs to be printed in the header of the output.
    What is the logic i need to give to abaper for this.
    Regards,
    Anand

    Hi Anand,
    In case you do not find an ADRNR for the respective partner funtion in VBPA table, then, it means that the employee number derived from customer master is correct. Then, I think you can take KUNNR number for the employee partner function thro' VBPA and put the same in KNA1 table to get the right ADRNR. (As explained by me in the first post).
    My question now is, are you maintaining the employee in XD01 (customer) or in VPE1 (Sales Rep)?
    You can try with tables PA0002 Personal Data and PA0006 Addresses only if you maintain employees thro' VPE1 Tcode.  PA0006 has PERNR field. But, what you have to make sure is that the table is getting updated. Else, you may not find the data here as well.
    Hope this helps...
    Thanks
    Mukund S

  • A problem with for loop..

    i have a problem with this code :
         int [] P = new int [M.length];
         System.out.println(P[0]+" "+P[15]);     
         for (int i = 0 ; i < P.length ; i++){
         for (int j = i + 1 ; j < P.length ; j++){
              if (j == (P.length - 1) && M [ i ] != M [ j ]){
                        P [ i ] = M [ i ] ;
                   else if ( M [ i ] != M [ j ] ) continue ;
                   else break;
         for (int i = 0 ; i < P.length ; i++){
              System.out.println(P [ i ]);
    this code to copy distinct values in array M and print them into array P
    M and P are both of size 16
    the problem is the previous code doesn't work for P[15]
    and i don't know way
    if i have in M {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16}
    P will be {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0}
    could any body help ?

    I am sorry, but you are not done. May-be your code does what it is supposed to do but it is hard to understand. An important part of programming is not just to get your code to work, but to write code that is easily maintainable. You are probably quite new programming and I do not want to discourage you. Keep working hard and it will come.
    You almost had the solution a while back:
            int [] P = new int [M.length];
         System.out.println(P[0]+" "+P[M.length]);
            boolean unique;
         for (int i = 0 ; i < P.length ; i++){
             // All non-zero entries in P with index less than i are unique in M.
               unique = true; //Assume M[i] unique until contrary has been proven
            for (int j = 0 ; j < P.length ; j++){
              if (i != j && M[i] == M[j]) { //found another entry in M with the same value as M[i]
                            unique=false;
                   break;
               if (unique) { // M[i] is unique in M.
                  P[i] = M;
         for (int i = 0 ; i < P.length ; i++){
              System.out.println(P [ i ]);
         }This code executes in time O(n^2). It is possible to achieve O(nlog(n)) by
    1) copy M into P
    2) sort P
    3) iterate through P and set duplicates to 0.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Help with script to update shotDate for a video clip

    As hard as it is for me to believe, Adobe Premiere Pro doesn't take the date code when capturing video clips from a DV camera and put it into the "shotDate" video metadata field. Instead, it (stupidly in my view) sets the shotDate to the date when the video clip is being captured, not when it was shot. I want to write a script to correct this.
    So far I've been able to get access to the existing, bad shotDate property, but I can't seem to set it successfully. The relevant portion of my code is as follows. Can anyone point me in the right direction as to why my setting the property isn't working? Thanks in advance!
    var md = thumb.synchronousMetadata;
    md.namespace = "http://ns.adobe.com/xmp/1.0/DynamicMedia/";
    var BadShotDate = md.shotDate;
    $.writeln("Bad Shot Date: ", BadShotDate);
    // Get the XMP packet as a string and create the XMPMeta object
    var xmp = new XMPMeta(md.serialize());
    var d = new XMPDateTime(new Date()); // Dummy value for testing
    xmp.setProperty(XMPConst.NS_XMP, "shotDate", d, XMPConst.XMPDATE);
    var updatedPacket = xmp.serialize(XMPConst.SERIALIZE_OMIT_PACKET_WRAPPER | XMPConst.SERIALIZE_USE_COMPACT_FORMAT);
    thumb.metadata = new Metadata(updatedPacket);

    I figured it out, so I thought I would post a follow-up for anybody else running into the same issue. The following function will set the shot date metadata to whatever string is supplied for the given thumbnail:
    function SetShotDate(thumb, newshotdate)
    if(thumb.hasMetadata)
    // Get the metadata object - wait for valid values
    var md = thumb.synchronousMetadata;
    md.namespace = XMPConst.NS_DM;
    var xmp = new XMPMeta(md.serialize());
    xmp.setProperty(XMPConst.NS_DM, "shotDate", newshotdate);
    var updatedPacket = xmp.serialize(XMPConst.SERIALIZE_OMIT_PACKET_WRAPPER | XMPConst.SERIALIZE_USE_COMPACT_FORMAT);
    thumb.metadata = new Metadata(updatedPacket);

  • Need help with java assignment dealing with for loops...

    Hi there. I'm a beginner to java programming and I'm having a lot of difficulty.
    I am trying to do a lab for class right now, and I really don't even know where to begin and to make things worse, someone in my class lost the copies of the class book so I'm extra confused.
    I need to write a method to print a "line" of characters to the screen. The professor said that the method should consume both the character to print (this parameter can be of type char or of type String) and the number of the character to print. The method should use System.out.print().
    e.g. if the method is called printLine, then
    printLine(5,'*');
    printLine(4,'j');
    should print:
    *****jjjj
    I'd really appreciate any help possible! Thank you.

    nevermind. i figured it out.

Maybe you are looking for

  • EXTENSION MANAGER DOESN'T INSTALL "AI" FILES

    Can someone please tell me how to download an Illustrator pattern -- the William Morris Thistle -- download available in the Illustrator Exchange area.  I've downloaded it now several times; however, cannot get it into the Illustrator library.  I've

  • Blocking creation of Return PO to vendor

    Vendor owes us credit note on return stock. Debit amount in excess of $2000. Is there a way to block Users from creating a Return PO back to the same vendor but allow creation of normal standard PO. Is there a alternative way to release the block onc

  • 1st Gen iPad won't connect to my home router. EVER. Refuses to connect to my wifi.

    HELP ME PLEASE WITH THIS 1st GEN IPAD refusing to connect to Wi-Fi ISSUE It shows up as having full signal, and shows the name of our network. But go to Safari and try to go do anything and it spins and spins then tells me "Cannot Open Page...Safari

  • IPad issue with safari.

    I am trying to download software to make a hard bound photo book.  I keep getting safari cannot run application?  I have first generation iPad  

  • Why won't images show in Reflow?

    None of the images from my Photoshop file display when i open the file in Reflow. I put the .PNG or .JPG suffixs on the end of every image layer, yet none show in Reflow, just a broken link icon. I checked the images in the Reflow assets folder, they