Variable code

Hello Friends,
Need some help from you ...
I have to write a variable code in my devlopment and i m not familier with ABAP programming. It will be nice help for me if any one can help or send me an ABAP code.
Requierment is as follows.
There is one query which is showing current week date and now USEr want to see the 12 weeks before data along with current data. so he can compare with current data and 12 weeks before data.
So please let me know how to proceed and send me sample code if you can ..it will be nice help for me.. 
my mail id is [email protected]
Sample code is as below - This code was actully for 4 weeks comparision data ,
Calculates Interval for Current Week - 4 to Current Week
(Last Four Weeks plus Current Week as a Range)
  WHEN 'ZXV_L4W'.
   IF I_STEP = 2.
    CLEAR L_S_RANGE.
    v_date1 = SY-DATUM - 28.
    v_date2 = SY-DATUM.
    CALL FUNCTION 'DATE_GET_WEEK'
     EXPORTING
      DATE = v_date1
     IMPORTING
      WEEK = v_cweek1.
    IF SY-SUBRC EQ 0.
     CALL FUNCTION 'DATE_GET_WEEK'
      EXPORTING
       DATE = v_date2
      IMPORTING
       WEEK = v_cweek2.
     IF SY-SUBRC EQ 0.
      L_S_RANGE-LOW  = v_cweek1.
      L_S_RANGE-HIGH = v_cweek2.
      L_S_RANGE-SIGN = 'I'.
      L_S_RANGE-OPT  = 'EQ'.
      APPEND L_S_RANGE TO E_T_RANGE.
     ENDIF.
    ENDIF.
   ENDIF.
I thanks to all of you in advance for your help
Regards

Hi,
The idea of this exit is to translate the date specified in the variable ZPRPYA into a date range (From-To).
WHEN 'ZRDDAT2'.  <i><b>>>when the variable is ZRDDAT2</b></i>
IF i_step = 2. "after the popup
LOOP AT i_t_var_range <i><b>>> an internal table</b></i> INTO loc_var_range <i><b>>> another internal table</b></i>
WHERE vnam = 'ZPRPYA'. <b><i>>> you can view the structure of the tables by double-clicking on the name.  There are probably some defaulted value being saved for the variable ZPRPYA</i></b>
CLEAR l_s_range.  <i><b>>> fields in this range will be something like, variable name, sign, operator, from value (high) and to value (low)</b></i>
previous_year = loc_var_range-low(4). "3  <i><b>>> assigning the first 4 chars of the FROM value to previous_year... this is usually depicted as taking the first 4 chars of eg '20060101'.</b></i>
two_years_ago = previous_year - 1. "2 <i><b>>> formula to find the years 2 yrs ago eg = 2004 (2006 - 2)</b></i>
CONCATENATE two_years_ago '01' '01' INTO l_s_range-low.  <i><b>>> this will gel the value in variable two_years_ago (2004) into the FROM space eg 20040101.</b></i>
CONCATENATE previous_year '12' '31' INTO l_s_range-high.
<i><b>>> this will gel the value in variable previous_year (2006) into the TO space eg 20060101.</b></i>
CONDENSE l_s_range-low.
CONDENSE l_s_range-high.  <i><b>>> to remove any spaces.</b></i>
l_s_range-sign = 'I'.
l_s_range-opt = 'BT'.
APPEND l_s_range TO e_t_range.  <i><b>>> e_t_range will be the range used by the system to represent the variable value</b></i>
EXIT.
ENDLOOP.
ENDIF.
ENDCASE.
Hope this helps,
Gimmo
Message was edited by: Gimmo
Message was edited by: Gimmo

Similar Messages

  • Variable code within code

    I was wondering how you can make variable code within code, for example, normally, you can use this["blabla"+variable]; to make the code say blablavariable.
    But now i want to make new variables by using this code, within a for loop [using teller1 as the increasing value]
    this["var ringsegment_mc:Ring_"+teller1+"=new [Ring_"+teller1+"]()"];
    which i basically want to have say:
    var ringsegment_mc:Ring_1=new Ring_1();
    but this doesnt work, it doesnt make a variable called ringsegment_mc.
    why I want to do this, is because i need to make an add child which makes 16 parts, from 16 different movieclips.
    here is the code for that for loop:
    for(var teller1=0; teller1<16; teller1++) {
        kernplaats += Number(Math.random()*200+300);
        this["var ringsegment_mc:Ring_"+teller1+"=new [Ring_"+teller1+"]()"];
        ringsegment_mc.x=xco[teller1]+kernplaats;
        ringsegment_mc.y=yco[teller1]+kernplaats;
        ringsegment_mc.geklikt = Number(0);
        ringsegment_mc.score = Number(ringscore);
        ringsegment_mc.speedmodded = Number(0);
        ringsegment_mc.kerngroep = Number(1);
        ringsegment_mc.addEventListener(Event.ENTER_FRAME,vernietig);
        addChild(ringsegment_mc);

    Hmm, i already fixed it, though im still not really sure why it happened:
    i have a for loop adding the addchilds 16 times, using a different movieclip for each instance
    loading the x and y coordinates from an array, containing 16 values [which ive changed to 17 now, to make it work]
    the arrays:
    var xco:Array = [121,180,233,271,292,292,270,231,179,124,74,34,11,9,30,70,121];
    var yco:Array = [11,11,33,73,124,181,232,270,290,291,271,234,183,125,72,33,11];
    the part of the for loop and positioning:
    for(var teller1=1; teller1<17; teller1++) {
        //var ringsegment_mc:Ring_1=new Ring_1();
        var ClassReference:Class = getDefinitionByName("Ring_"+teller1) as Class;
        var ringsegment_mc:MovieClip=new ClassReference();
        ringsegment_mc.x=xco[teller1]+kernplaatsx;
        ringsegment_mc.y=yco[teller1]+kernplaatsy;
    i traced the x and y coordinates, and it appeared that Ring_16 got 0.0 as coordinates.
    so i added the first coordinate to the end, and it works fine now.
    and while typing i realise that the first value in an array is number 0 and not 1
    DOH!
    Thanks for the help guys!
    Especially you, Hakan!

  • Bind variable code takes more time to complete?

    Hello, My database is oracle11g.
    I have same plsql code and first one is without bind variable and second one is with bind variable. Usually, bind variable should take less time. But here
    the bind variable takes more time than the regular code... Can any one please explain why?
    SQL> alter system flush shared_pool;
    System altered.
    SQL> declare
    2 cursor c1 is select * from emp where rownum < 50;
    3 l_start NUMBER DEFAULT DBMS_UTILITY.GET_TIME;
    4 v_cnt number;
    5 begin
    6 for i in c1 loop
    7 SELECT count(*) into v_cnt
    8 FROM rate
    9 WHERE rate_id IN (SELECT rate_id
    10 FROM ratedetail
    11 WHERE benefit_id = i.benefit_id)
    12 AND effective_date =
    13 TO_DATE ('2011-01-23 00:00:00', 'yyyy-MM-dd HH24:MI:SS')
    14 AND rate_type_id = 1;
    15 end loop;
    16 DBMS_OUTPUT.PUT_LINE('total minutes....'||ROUND(ROUND((DBMS_UTILITY.GET_TIME - l_start)/100, 2)
    /60,3));
    17 end;
    18 /
    total minutes.....06
    PL/SQL procedure successfully completed.
    SQL> alter system flush shared_pool;
    System altered.
    SQL>
    SQL> declare
    2 cursor c1 is select benefit_id from emp where rownum < 50;
    3 l_start NUMBER DEFAULT DBMS_UTILITY.GET_TIME;
    4 v_cnt number;
    5 begin
    6 for i in c1 loop
    7 execute immediate 'SELECT count(*)
    8 FROM rate
    9 WHERE rate_id IN (SELECT rate_id
    10 FROM ratedetail
    11 WHERE benefit_id = :x)
    12 AND effective_date = trunc(sysdate)-202
    13 AND rate_type_id = 1'
    14 into v_cnt using i.benefit_id;
    15 end loop;
    16 DBMS_OUTPUT.PUT_LINE('total minutes....'||ROUND(ROUND((DBMS_UTILITY.GET_TIME - l_start)/100, 2)
    /60,3));
    17 end;
    18 /
    total minutes.....061
    PL/SQL procedure successfully completed.
    SQL>

    Shrinika wrote:
    Thanks for the clarification.. Now i understand...
    One final question on this thread before i close this thread....
    My database is set to CURSOR_SHARING=FORCE for some reason. It seems somebody applied a "quick and dirty fix" to "database is slow" problem. BAD PRACTICE
    My question is, when we use bind variable, does it parse the sql code every time? or does it reuse the execution plan?
    In my database, it reuse the execution plan... Just checking... When we set CURSOR_SHARING=FORCE, it should generate the execution plan
    for every unqiue sql code... Is that correct? Am i confusing?If by "parse" you mean a "hard parse" (which generates execution plan), then the answer is NO. As you observed, it reuses execution plan.
    For e.g. with CURSOR_SHARING=FORCE setting, following SQLs
    select employee_no, first_name, last_name from employees where dept_no = 10 ;and
    select employee_no, first_name, last_name from employees where dept_no = 20 ;would tend to reuse the same execution plan since both of these will be rewritten by oracle (before execution) as
    select employee_no, first_name, last_name from employees where dept_no = :SYS01 ;Hope this helps.
    Edited by: user503699 on Aug 14, 2010 3:55 AM

  • Variable Code for Date

    Requirement: I have Posting Date for all Objects Now i want to create the <b>Variable “PSTVAR”</b>such that the variable will populate <b>only the entries with
    User Input Posting Date(During Report Execution) >=greater than equal to Posting Date(OPSTDATE). .</b>
    <b>Example</b> POSTING DATE = 03032007
    POSTING DATE = 01012006
    IF USER INPUT DATE = 01012007
    Then only POSTING DATE = 03032007 will show up in report
    write the code in <b>customer exit cmod in BI</b> if CAN CORRECT THE CODE WOULD BE GREAT
    Data: l_s_var_range Type rrangeexit.
    L_d_PSTDATE Type /bio/oipstdate.
    L_d_PSTDATE Type /bio/oipstdate.
    IF I_STEP=2.
    READ TABLE I_t_var_range INTO l_s_var_range WITH KEY VNAM = ‘PSTVAR’.
    If L_d_PSTDATE >= PSTVAR’
    L_d_PSTDATE=l_s_var_range-low(0)
    Please help me modify the above code with logic or with some extra line of code to solve my requirement. Appreciate all of you for help in advance
    Thanks
    Soniya Kapoor

    This can be done without any coding.
    If you are using the Web, there is a Boolean operator dropdown for each variable. Enter "1/1/2007" for the Posting Date variable value (in your example), then change the operator to ">=". (There is probably even a way to default to this.)
    If you are using Excel, enter "1/1/2007" for the Posting Date variable value, then right click and choose "Options" and ">=".
    Hope this helps...
    Bob

  • Variable code in ZXRSRU01 Include

    Hi,
    I created the following code in ZXRSRU01 Include for a custom variable 'YFBV_027':
    WHEN 'YFBV_027'.
    CASE i_step.
      WHEN '2'.
          concatenate sy-datum(6) '01' into datum.
          datum(4) = datum(4) + 1.
          l_s_range-low = datum.
          l_s_range-sign = 'I'.
          l_s_range-opt  = 'EQ'.
          APPEND l_s_range TO e_t_range.
          CLEAR l_s_range.
    endcase.
    The question is: Why I cannot introduce <b>l_s_range-opt  = 'LT'</b>, but only 'EQ'?
    The error message is:
    00010004    AError for variable  in customer enhancement YFBV_027    
    Thanks for your help.

    Hi Claudia,
    Is your variable single entry?

  • Custom variable code problem

    Hi,
    I have a variable called 'Sales Office From Dealer'  so as you guessed, based on the dealer I want to find the sales office.  However, I have 2 seperate queries, in one I have a mandatory input variable so the user can input the dealer (that's for sales managers) and I have a seperate query that the dealers themselves will run where I figure out the dealer from the userid of the person logged on.  So, in order to populate by Sales Office variable, I need to first determine the dealer then use the result for the Sales office.  And I want all that in the same variable to avoid so much more customization and other variables are based on the sales office. 
    When I run the query with the input variable for the dealer, it only works if I comment out the 'if i_step=1' part, if I leave both parts, I get the following warning (and I end up getting 'unassigned' in my result: 
    '''Initial RANGE-LOW for customer user exit variable 'ZV_SALESOFF_FR_DEALR' corrected to #.'''
    When I run the query based on the user variable, it works all the time even with both parts there.
    Here's the code:
      WHEN 'ZVC_SALESOFF_FR_DEALR'.
    first step is to determine whether to take the dealer
    from an input screen (i_step=2) or based on the user id
    automatically (i_step=1)
        IF i_step = 1.
           CONCATENATE '000000'
                       sy-uname(4)
           INTO l_dealer.
          SELECT SINGLE sales_off
          FROM /bi0/pcust_sales INTO l_salesoff1
          WHERE cust_sales EQ l_dealer
                 AND distr_chan EQ '10'
                 AND salesorg EQ '1000'.
          CLEAR l_s_range.
          l_s_range-sign = 'I'.
          l_s_range-opt  = 'EQ'.
          l_s_range-low = l_salesoff1.
          APPEND l_s_range TO   e_t_range.
          EXIT.
        ENDIF.
        IF i_step = 2.
          LOOP AT i_t_var_range INTO loc_var_range
          WHERE vnam = 'ZV_PDEALER_MANDATORY' .
            l_dealer = loc_var_range-low.
            SELECT SINGLE sales_off
            FROM /bi0/pcust_sales INTO l_salesoff
            WHERE cust_sales EQ l_dealer
                  AND distr_chan EQ '10'
                  AND salesorg EQ '1000'.
            CLEAR l_s_range.
            l_s_range-sign = 'I'.
            l_s_range-opt  = 'EQ'.
            l_s_range-low = l_salesoff.
            APPEND l_s_range TO   e_t_range.
            EXIT.
          ENDLOOP.
        ENDIF.
    Thanks
    Suzanne

    Sorry, when I looked at the code that I pasted it didn't look right - here is the actual final code - does this make more sense?
      WHEN 'ZVC_PDEALER1'.
    Assign first Dealer of the Sales Area
    Find sales area then the first dealer
        IF i_step = 1.
          CLEAR l_s_range.
          l_s_range-sign = 'I'.
          l_s_range-opt  = 'EQ'.
          CONCATENATE '000000'
          sy-uname(4)
          INTO l_dealer.
            SELECT SINGLE /BIC/ZECO_ZONE
            FROM /bi0/pcust_sales INTO l_ecozone
            WHERE cust_sales EQ l_dealer
                  AND distr_chan EQ '10'
                  AND DIVISION = '10'
                  AND salesorg EQ '1000'
                  AND CRMSALGRPX = 'Y'
                  AND OBJVERS = 'A'.
        ENDIF.
        IF i_step = 2.
          CLEAR l_s_range.
          l_s_range-sign = 'I'.
          l_s_range-opt  = 'EQ'.
          LOOP AT i_t_var_range INTO loc_var_range
          WHERE vnam = 'ZV_PDEALER_MANDATORY' .
            l_dealer = loc_var_range-low.
            SELECT SINGLE /BIC/ZECO_ZONE
            FROM /bi0/pcust_sales INTO l_ecozone
            WHERE cust_sales EQ l_dealer
                  AND distr_chan EQ '10'
                  AND DIVISION = '10'
                  AND salesorg EQ '1000'
                  AND CRMSALGRPX = 'Y'
                  AND OBJVERS = 'A'.
          ENDLOOP.
        ENDIF.
        SELECT cust_sales
        INTO CORRESPONDING FIELDS OF TABLE t_ecozone
        FROM /bi0/pcust_sales
        WHERE /BIC/ZECO_ZONE EQ l_ecozone
              AND DISTR_CHAN = '10'
              AND DIVISION = '10'
              AND CRMSALGRPX = 'Y'
              AND OBJVERS ='A'.
        DELETE t_ecozone WHERE cust_sales EQ l_dealer.
        SORT t_ecozone.
        READ TABLE t_ecozone INTO l_pdealer# INDEX 1.
        IF sy-subrc NE 0.   "if DID NOT FIND something in read stmt. above
          l_pdealer# = SPACE.
        Endif.
          CLEAR l_s_range.
          l_s_range-sign = 'I'.
          l_s_range-opt  = 'EQ'.
          l_s_range-low = l_pdealer#.
          APPEND l_s_range TO   e_t_range.
        EXIT.

  • How to turn off automatic variable code suggest for a single page?

    Does anyone know how to turn off the code assist feature where CFBuilder tries to assist you by listing all the variables on the page?  I have a CFC with over 3000 lines and it causes CFBuilder to hang/freeze like you wouldn't believe.  I'd like to turn off this feature for large files (or at least see if I can tune the feature to be smarter about what variables it suggests).
    Does anyone know how to disable this feature on a specific template or turn this feature off altogether?  Note: I do want to keep the tag attribute suggestion if possible.

    Update: I tried using CFBuilder as a plugin for Eclipse (64 bit) and then followed the steps here: CFBuilder 2 Performance Problems on Windows 7 64-bit Solved » websolete.
    So far I have experienced noticeably faster response times. However, the program still hangs when trying to suggest variable names.  It would be great if there was a way just to disable that feature until Adobe fixes it.

  • Basic define variable code won't work

    hi.
    this is very odd. i took a 3-day actionscript workshop. we
    used the same one-line method of declaring and assigning a
    String/Number/Boolean/etc instance many many times. now i am on my
    home computer and trying to review the basics. the basic code
    (STRAIGHT OUT OF THE BOOK) is not working! i have tried variations
    of the same type of declaration by grabbing code from the
    macromedia sample tutorials and same problem. both the computer
    that i was using at the workshop and my home computer have Flash 8.
    the only difference i can think of is the class had a PC, whereas i
    use a mac at home. i am totally baffled. if anyone has any insight,
    i'd be very appreciative.
    my code...
    var userName:String = "fred";
    trace(userName);
    returns
    undefined.
    on the other hand, this 2-line method of declaring/assigning
    does work for me on my mac:
    var userName:String;
    userName = "fred";
    trace(userName);
    merry christmas btw :)

    kglad, i think i have identified the problem.
    at first i unknowingly opened up a new document from template
    (Advertising), which appears to be just a blank doc sized to
    certain dimensions. the code does NOT work.
    but when i open a new plain flash document, the code that i
    posted works fine.
    i'm not sure what specifically about the advertising
    templates makes good code not work. but now i know not to ever use
    them.
    thanks for your replies. appreciate it.

  • How Can i hard code variable at reports in obiee 11g

    Hi
    I created as variable at rpd and using variable i am able to get expected results.
    But i dont want to use variable directly , how can i hard code variable code at report and get same results.
    Can anyone help me on this.
    Thanks

    Not clear what you trying to achieve, try to go thru given info.
    The statement 'select 1 from dual' in init blocks works using connection pool, but the same will not work in report since report understands Presentation Catalog objects.
    In the report your query suppose to be like select 1 from Subject area where someColumn >0
    If helps pls mark

  • Variable Exit Code i_step = 2

    Hi There
    I have an issue with the code of type i_step = 2. What i want to do is to check a table and if a certain value is in that table i want to include a restriction for all values for the caracteristic on which the variable is based.
    My code looks like this:
    IF zuser_auth-comp_code = '*'.
              ls_range-low = '*'.
              ls_range-sign = 'I'.
              ls_range-opt = 'CP'.
              APPEND ls_range to e_t_range.
              EXIT.
    ENDIF.
    THE CP = * restriction is used without problems for i_step = 0 variables but it does not work for i_step = 2. Does anybody know why or know another way to restrict to all values in a i_step = 2 variable exit??
    I hope that you can help me.
    /Chris

    Hi again
    You are right the I_step = 2 is executed after execution of the query. When i debug the exit my exit variable code is executed but the result is that the program ends with an illegal state.Below i have inserted the complete code.
    WHEN 'ZCECCST2'.  "Authorization check for Company Code
        IF i_step = '2'.
          READ TABLE i_t_var_range into loc_var_range with key IOBJNM = '0COMP_CODE'.
          if sy-subrc <> '0'.
          SELECT * FROM ZUSER_AUTH WHERE
              username = l_uname.
          IF zuser_auth-comp_code = '*'.
              SELECT comp_code from /bi0/mcomp_code into ls_range-low.
              ls_range-low = '*'.
              ls_range-sign = 'I'.
              ls_range-opt = 'CP'.
              APPEND ls_range to e_t_range.
              ENDSELECT.
              EXIT.
          ELSE.
              ls_range-low = zuser_auth-comp_code.
              ls_range-sign = 'I'.
              ls_range-opt = 'EQ'.
              if ls_range-low <> ''.
                APPEND ls_range to e_t_range.
              endif.
          ENDIF.
          ENDSELECT.
          ELSE.
              ls_range-low = loc_var_range-low.
              ls_range-sign = 'I'.
              ls_range-opt = 'EQ'.
              APPEND ls_range to e_t_range.
          ENDIF.
      endif.
    /Chris

  • Where do I write the code for customer exit variable?

    Hi Gurus,
    Can anyone tell me where and the procedure that I have to follow to get to the include ZXRSRU01 where I can write customer exit variable code.
    I know its written in ZXRSRU01, but in my system it seems like its not active or does not exist. How do I get to start working in this include for customer exit variables?
    Any help is appreciated. Thank you.
    Regards
    Reddy

    hi Reddy,
    variable exit use enhancement RSR00001 not RSAP0001. EXIT_SAPLRRS0_001.
    try to follow some steps in 'how to' doc related to this, and sample code may useful for you
    https://websmp206.sap-ag.de/~sapdownload/011000358700002762582003E/HowToDeriveVariableValue.pdf
    https://websmp206.sap-ag.de/~sapdownload/011000358700002765042003E/HowToVerifyVariableInput.pdf
      INCLUDE ZXRSRU01                                                   *
      DATA: L_S_RANGE TYPE RSR_S_RANGESID.
      DATA: LOC_VAR_RANGE LIKE RRRANGEEXIT.
      CASE I_VNAM.
      WHEN 'CUMMONTH'.
        IF I_STEP = 2.                                  "after the popup
          LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE
                  WHERE VNAM = 'MONTH'.
            CLEAR L_S_RANGE.
            L_S_RANGE-LOW      = LOC_VAR_RANGE-LOW(4)."low value, e.g.200001
            L_S_RANGE-LOW+4(2) = '01'.
            L_S_RANGE-HIGH     = LOC_VAR_RANGE-LOW.   "high value = input
            L_S_RANGE-SIGN     = 'I'.
            L_S_RANGE-OPT      = 'BT'.
            APPEND L_S_RANGE TO E_T_RANGE.
            EXIT.
          ENDLOOP.
        ENDIF.
      ENDCASE.
    hope this helps.

  • Using a variable in two threads...

    i am new to java and have a thread question.
    i am using a GUI and then run a swingworker thread to get updates from a server on a regular basis.
    i realize that if the GUI is updated within the swingworker thread i need to use the invokeLater to put it on the EDT.
    but what if i have a boolean variable declared in the main class that i use within the swingworker thread.
    in other words both the EDT and the swingworker thread might use or set the variable.
    does this variable need to be declared in any special way?
    boolean isOn = false; (how i am declaring)
    so one case would be where the EDT sets the variable true or false and the swingworker thread simply checks the state of the variable.
    if (isOn) (do this);
    else (do that);
    in another case both the EDT and the swingthread check and set the var.
    if (isOn) { Thread.sleep(10);}
    isOn = true;
    isOn = false;
    im new to java so just trying to see if this is ok and if i need to declare isOn as syncronized or something.
    not sure if this will work

    There's no need to use both volatile and
    synchronized. Either declare the variable as volatile
    (*), or use synchronization when reading/writing it.
    (*) At least in theory, I'm not sure this has ever
    been guaranteed to work in practice. In any case,
    volatile is superfluous if you use synchronization.You need to use volatile keyword if do not want that compiler optimizes
    you code in multithread applications.
    For example:
        private boolean isDataChanged;
        void setDataChanged(boolean dataChanged){ isDataChanged = dataChanged; }
        boolean isDataChanged(){ return isDataChanged; }
        void someMethod(){
         isDataChanged = false;
         // some code which does not change isDataChanged variable
         if(isDataChanged){
             // code block 1
         }else{
             // code block 2
        }Compiler can optimize someMethod method to the next code because
    isDataChanged is false in if-else statement:
        void someMethod(){
         isDataChanged = false;
         // some code which does not change isDataChanged variable
         // code block 2
        }But isDataChanged viariable can be changed by another thread
    in multifreads applications so optimization will not be correctly
    because isDataChanged can be true in if-else statement.

  • Session variable causing ADODB.Field error '800a0bcd'

    i have a page that before the session variable was added,
    would display the
    text i required if the recordset was empty.
    Now i have a session variable on the same page and if the
    recordset is
    empty, instead of showing the text i need displayed, i get
    the following
    error:
    ADODB.Field error '800a0bcd'
    Either BOF or EOF is True, or the current record has been
    deleted. Requested
    operation requires a current record.
    /Help_Desk/verified.asp, line 31
    If i remove the session variable code from the page, it works
    fine.....why
    the conflicts?
    <%Session("last")
    =(rsVerify.Fields.Item("c_last_name").Value)%>
    <%Session("first")
    =(rsVerify.Fields.Item("c_first_name").Value)%>
    <html>
    What im doing is verifying if a user exists in the database.
    If they do
    there name is stored in a session and used later on the
    following pages. If
    they do not exist, they are suppose to receive a message
    indicating to call
    our support center to update there name...
    I dont understand why the addition of the above two lines
    cause this error

    Here is all the code on the page... please let me know if
    there is something
    incorrect.....
    <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    <!--#include file="../Connections/USD.asp" -->
    <%
    Dim rsVerify__varLname
    rsVerify__varLname = "%"
    If (Request.Querystring("last") <> "") Then
    rsVerify__varLname = Request.Querystring("last")
    End If
    %>
    <%
    Dim rsVerify__varFname
    rsVerify__varFname = "%"
    If (Request.Querystring("first") <> "") Then
    rsVerify__varFname = Request.Querystring("first")
    End If
    %>
    <%
    Dim rsVerify
    Dim rsVerify_numRows
    Set rsVerify = Server.CreateObject("ADODB.Recordset")
    rsVerify.ActiveConnection = MM_USD_STRING
    rsVerify.Source = "SELECT c_last_name, c_first_name,
    c_middle_name,
    c_email_addr FROM AHD.ctct WHERE c_last_name = '" +
    Replace(rsVerify__varLname, "'", "''") + "' and c_first_name
    = '" +
    Replace(rsVerify__varFname, "'", "''") + "' and del = '0'"
    rsVerify.CursorType = 0
    rsVerify.CursorLocation = 2
    rsVerify.LockType = 1
    rsVerify.Open()
    rsVerify_numRows = 0
    %>
    <%Session("last")
    =(rsVerify.Fields.Item("c_last_name").Value)%>
    <%Session("first")
    =(rsVerify.Fields.Item("c_first_name").Value)%>
    <html>
    <head>
    <title>Account Verification</title>
    </head>
    <body text="#000000" link="#0000FF" vlink="#0000FF"
    alink="#0000FF"
    leftmargin="0" topmargin="0">
    <!--#include virtual="/inc/header.asp" -->
    <br>
    <br>
    <% If Not rsVerify.EOF Or Not rsVerify.BOF Then %>
    <table width="605" align="center">
    <tr bgcolor="#9999FF">
    <td><strong>USD Name:</strong></td>
    <td><strong><%=(rsVerify.Fields.Item("c_last_name").Value)%>,
    <%=(rsVerify.Fields.Item("c_first_name").Value)%></strong></td>
    </tr>
    <tr>
    <td><strong>First
    Name:</strong></td>
    <td><strong><font
    color="#FF0000"><%=(rsVerify.Fields.Item("c_first_name").Value)%></font></strong></td>
    </tr>
    <tr>
    <td><strong>Last Name:</strong></td>
    <td><strong><font
    color="#FF0000"><%=(rsVerify.Fields.Item("c_last_name").Value)%></font></strong></td>
    </tr>
    <tr>
    <td><strong>Email:</strong></td>
    <td><strong><font
    color="#FF0000"><%=(rsVerify.Fields.Item("c_email_addr").Value)%></font></strong></td>
    </tr>
    <tr>
    <td><strong>Location:</strong></td>
    <td><strong><font
    color="#FF0000"><%=(rsVerify.Fields.Item("c_middle_name").Value)%></font></strong></td>
    </tr>
    <tr>
    <td colspan="2"><div
    align="center"><strong>If all 4 fields above
    contain
    your correct information please select from the links
    below.<br>
    If your are missing any information above please contact the
    help
    desk
    before proceeding.</strong> </div></td>
    </tr>
    <tr>
    <td colspan="2"><hr size="1"> <table
    width="400" align="center">
    <tr>
    <td><div align="center"><strong><a
    href="/Help_Desk/usd_stores1.asp">Open
    Store / DC
    Request</a></strong></div></td>
    <td><div align="center"><strong><a
    href="/Help_Desk/usd_corp1.asp">Open
    Corporate
    Request</a></strong></div></td>
    </tr>
    </table></td>
    </tr>
    </table>
    <% End If ' end Not rsVerify.EOF Or NOT rsVerify.BOF %>
    <br>
    <div align="center">
    <% If rsVerify.EOF And rsVerify.BOF Then %>
    <table width="605">
    <tr>
    <td><div align="center"><font
    color="#FF0000"><strong>If you are
    receiving
    this message, chances are you are not completely setup in
    USD.<br>
    Please contact the help desk to have your information
    verified and
    setup
    if needed.</strong></font>
    </div></td>
    </tr>
    </table>
    <% End If ' end rsVerify.EOF And rsVerify.BOF %>
    </div>
    <div align="center"></div>
    <!--#include virtual="/inc/footer.asp" -->
    </body>
    </html>
    <%
    rsVerify.Close()
    Set rsVerify = Nothing
    %>
    "Daniel" <[email protected]> wrote in message
    news:[email protected]...
    >i have a page that before the session variable was added,
    would display the
    >text i required if the recordset was empty.
    >
    > Now i have a session variable on the same page and if
    the recordset is
    > empty, instead of showing the text i need displayed, i
    get the following
    > error:
    >
    > --------------------------
    > ADODB.Field error '800a0bcd'
    > Either BOF or EOF is True, or the current record has
    been deleted.
    > Requested operation requires a current record.
    >
    > /Help_Desk/verified.asp, line 31
    > -----------------------------
    >
    > If i remove the session variable code from the page, it
    works fine.....why
    > the conflicts?
    >
    > <%Session("last")
    =(rsVerify.Fields.Item("c_last_name").Value)%>
    > <%Session("first")
    =(rsVerify.Fields.Item("c_first_name").Value)%>
    > <html>
    >
    > --------------
    >
    > What im doing is verifying if a user exists in the
    database. If they do
    > there name is stored in a session and used later on the
    following pages.
    > If they do not exist, they are suppose to receive a
    message indicating to
    > call our support center to update there name...
    >
    > I dont understand why the addition of the above two
    lines cause this error
    >
    >

  • Peculiar behavior of Shared Variable RT FIFO

    I'm trying to "leverage" the enhanced TCP/IP and Shared Variable properties of LabView 8.5.  My application involves (among other things) doing continuous sampling (16 channels, 1KHz/channel) using 6-year-old PXIs (Pentium III) and streaming data to the host.  I developed a small test routine that was more than capable of handling this data rate, even when I had the host put a 20msec wait between attending to the PXI (to simulate other processing on the host).  To do this, I enabled the "RT FIFO" property of the Shared Variable (which was an array of 16 I16 integers) and specified a buffer size of 50 (that's 50 arrays).  Key to making this work was figuring out the "error codes" associated with the SV RT FIFO, particularly the one that says the FIFO is empty (so don't save the "non-data" that is present).
    Flush with success, I started developing a more realistic routine that involves rather more traffic between Host and Remote, including the passing back and forth of "event" data.  These include, among other things, "state variables" to enable both host and remote to run state machines that stay "in sync"; in addition, the PXI also acquires digital data (button pushes, etc.) which are other "events" to be sent to the Host and streamed to disk.  I developed the dual state-machine model without including the "analog data" machine, just to get the design of the Host/Remote system down and deal with exchanging digital data through other Shared Variables.  Along the way, I decided to make these also use an RT FIFO, as I didn't want to "miss" any data.  One problem I had noticed when using Shared Variables is the difficulty of telling "is this new?", i.e. is the variable present one that has been already read (and processed) or something that needs processing.  I ended up adopting something of a kludge for the events by including an incrementing "event ID" that could be tested to see if it was "new".
    Today, I put the two routines together by adding the "generate 16-channels of integer data at 1 KHz and send it to the Host via the Shared Variable" code to my existing Host/Remote state machine.  I used exactly the same logic I'd previously employed to monitor the RT FIFO associated with this Shared Variable (basically, the Host reads the SV, then looks at the error code -- a value of -2220 means "Shared Variable FIFO Read Buffer Empty", so the value you just read is an "old" value, so throw it away).  Very sad -- my code threw EVERYTHING away!  No matter how slowly the Host ran, the indicator always said that the Shared Variable FIFO Read Buffer was empty!  This wasn't true -- if I ignored the flag, and saved anyway, I saw reasonable-looking data (I was generating a sinusoid, and I saw numbers going up and down).  The trouble was that I read many more points than were actually generated, since I read the same values multiple times!
    Looking at the code, the error line coming into the Shared Variable (before it was read) was -2220, and it remained so after it was read.  How could this be?  One possibility is that my other Shared Variables were mucking up the error line, but I would have thought that the SV Engine handling reading my "analog data" SV would have set the error line appropriately for my variable.  On a hunch, I turned of the RT FIFO on the two Event shared variables, and wouldn't you know, this more-or-less fixed it!
    But why?  What is the point of having a shared variable "attached" to an error line and having it return "Shared Variable FIFO Read Buffer Empty" if it doesn't apply to its own Read Buffer?  This seems to me to be a very serious bug that renders this extremely useful feature almost worthless (certainly mega-frustrating).  The beauty of the new Shared Variable structure and the new code in Version 8.5 is that it does seem to allow better and faster communication in real-time using TCP/IP, so we can devote the PXI to "real-time" chores (data acquisition, perhaps stimulus generation) and let the PC handle data streaming, displays, controls, etc.
    Has anyone been successful in developing a data-streaming application using shared variables between a PXI and and PC, particularly one with multiple real-time streams (such as mine, where I have an analog stream from the PXI at 16 * 1KHz, a digital stream from the PXI at irregular intervalus, but possibly up to 300 Hz, and "control" information going between PC and PXI to keep them in step)?  Note that I'm attempting to "modernize" some Version 7 code that (in the absence of a good communication mechanism) is something of a nightmare, with data being kept in PXI memory, written on occasion to the PXI hard drive (!), and then eventually being written up to the PC; in addition, because the data "stayed" on the PXI, we split the signal and ran a second A/D board in the PC just so we could "see" the signal and create a display.  How much better to get the PXI to send the data to the PC, which can sock it away and take samples from the data stream to display as they fly by on their way to the hard drive!
    But I need to get Shared Variables (or something similar) working more "understandably" first ...
    Bob Schor

    Bob,
    The error lines passed into and out of functions are just just clusters with a status boolean, an error code, and an error string, and are not "attached" to a particular function as you describe in your post.  Most functions have an error in input and an error out output, and most functions will simply do nothing except pass through the error cluster if the error in status is True (to verify this for yourself, double click on a function such as a DAQmx Read or Write and look at the block diagram.  If there is an error passed in, no read/write occurs).  This helps prevent unwanted code from  executing when an error does arise in your program.  By wiring the error cluster from your other shared variables to your analog data variable, you're essentially telling LabVIEW that these functions are related and that your analog data variable depends requires that the other shared variables are functioning properly.  The error wire is a great way to enforce the flow of your program, but you must always consider how it will affect other functions if an error does arise.
    Anyways, it's great that you have things more or less working at the moment.  Keep us all updated!

  • Customer exit variable in Planning filter - IP

    Hi,
    I am new to business planning. I am trying to use a customer exit variable in filter, while performing check system generates message "RFC failue error". the logic is written to get the current year. But I am not able to use this variable?  Can you please answer me this question... Can I use Customer exit variables in planning modeler filters or planning functions ?

    Hi there,
    Yes you can, and it is used very often in both.
    Probably your variable is wrongly defined.
    What you can do is create a query over that aggregation level, and insert the planning filter in there. Put some key figure on the query and put a breakpoint on your variable customer exit code. Execute the query and debug the variable code to check the error.
    Hope this helps,
    Regards,
    Diogo.

Maybe you are looking for

  • I try to open video but get error and iTunes closes

    So one day I try to watch favorite Tv show, Unan1mous, but the artwork changes to first frame of video and message pops up. "iTunes has encountered problem and needs to close. We are sorry for the inconvinence. -Send Error Report- -Don't Send- I just

  • RAW files in Iphoto open as JPG in PSE10

    I have a new Mac Air, and have been using Iphoto '11 (9.4.2).  I downloaded PSE 10 through the App Store.  In Iphoto I have clicked the "advanced" tabs to use PSE 10 as external editor and to export files as RAW.  However, whenever I try to open a RA

  • Do I need to declare my custom setter accessor in my interface/header file

    Hi there: I'm working through a Objective C tutorial. I've got an instance var that is declared in the var section of my @interface (in the header file). It's also declared as a property...all the defaults apply (assign and whatever else). @property

  • Error: cannot be resolved to type

    Hi Guys, I downloaded an application to launch an RTP client/server but I cannot compile it, yhe error message is below: vmplanet@vmplanet-desktop:~/JavaRTP/playerv1$ make javac Client.java 1. ERROR in Client.java (at line 306)      RTPpacket rtp_pac

  • Query on Outer join

    Hi all, I have a doubt, its written below, pls get me solved Inner join: SELECT D.DEPTNAME, E.EMPNAME FROM DEPARTMENT D, EMPLOYEE E WHERE trim(E.DEPTNAME) = D.DEPTNAME AND E.EMPNAME = 'ABC' TO FETCH ALL THE VALUES FROM DEPARTMENT TABLE BUT ONLY MATCH