Script logic select statement error (*SELECT(%YEAR%,"[YEAR]","T_TIME","[ID]

Hi
i am trying to use the below statement . its giving error . pls have a look
*SELECT(%YEAR%,"[YEAR]","T_TIME",u201D[ID]=%T_TIME_SET%u201D)
*SELECT(%PYEAR%,"[YEAR]-1","T_TIME",u201D[ID]=%T_TIME_SET%u201D)
*RUNALLOCATION
*FACTOR=1
*DIM T_MOVEMENTS WHAT = CB; WHERE=OB;
*DIM T_TIME WHAT=MAR.%PYEAR%; WHERE=BAS(TOTAL.%YEAR%)
*ENDALLOCATION
*COMMIT
The resule
Validation status of executable file: Failed
- Incorrect syntax near 'u201D'. in:select [YEAR] from mbrT_TIME where u201D[ID]=%T_TIME_SET%u201D
Validation status of syntax: Failed
- Invalid syntax found; see statements in red
Bud if specify the year its running properly. pls  advice me whare i was wrong
Thanks

Hi Narsi,
You can use the below instruction:
*SELECT(%YEAR%,"[YEAR]","T_TIME",u201DID='%T_TIME_SET%'u201D)
*SELECT(%PYEAR%,"[YEAR]-1","T_TIME",u201DID='%T_TIME_SET%'u201D)
I have just added single quote before and after %T_TIME_SET% and %T_TIME_SET%
Please try this!!
Thanks,
Rohit

Similar Messages

  • Select statement error.

    Hi all,
    I have a select statement which will join 4 tables as shown below. Something is not working right in the select statement and caused the shortdump.
    I really cannot figure out where is not right.
    Please help.
    TYPES:  
      BEGIN OF t_lips,
        matnr TYPE matnr,
        lfimg TYPE lfimg,
        meins TYPE meins,
        vbeln TYPE vbeln_vl,
        lfart TYPE lfart,
        vstel TYPE vstel,
        maktx TYPE maktx,
        werks TYPE werks_d,
        exnum TYPE exnum,
        posnr TYPE posnr_vl,
        uecha TYPE uecha,
        netwr TYPE netwr,
        waerk TYPE waerk,
        vgbel TYPE vgbel,
      END OF t_lips.
    DATA: lt_lips      TYPE TABLE OF t_lips.
    SELECT lips~matnr lfimg lips~vrkme lips~vbeln lfart
        vbap~vstel lips~arktx lips~werks exnum
        vbap~netwr vbap~waerk lips~vgbel
        lips~posnr lips~uecha
      INTO TABLE lt_lips
      FROM lips INNER JOIN vttp
        ON    vttp~vbeln = lips~vbeln
        INNER JOIN likp
        ON    lips~vbeln = likp~vbeln
        INNER JOIN VBAP
        ON lips~vgbel = vbap~vbeln
      WHERE vttp~tknum = ps_vttk-tknum
        AND   lfimg      <> 0.
    Error analysis                                                                               
    An exception occurred that is explained in detail below.                                     
        The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught                
         in                                                                               
    procedure "GET_DATA" "(FORM)", nor was it propagated by a RAISING clause.                    
        Since the caller of the procedure could not have anticipated that the                        
        exception would occur, the current program is terminated.                                    
        The reason for the exception is:                                                             
        In a SELECT access, the read file could not be placed in the target                          
        field provided.                                                                               
    Either the conversion is not supported for the type of the target field,                     
        the target field is too small to include the value, or the data does not                     
        have the format required for the target field.                                               

    Hi,
    In the below code, where are you picking up value for LFIMG and LFART. Give the alias/table name for them also.
    for ex. lips~lfimg....
    SELECT lips~matnr lfimg lips~vrkme lips~vbeln lfart
        vbap~vstel lips~arktx lips~werks exnum
        vbap~netwr vbap~waerk lips~vgbel
        lips~posnr lips~uecha
      INTO TABLE lt_lips
      FROM lips INNER JOIN vttp
        ON    vttp~vbeln = lips~vbeln
        INNER JOIN likp
        ON    lips~vbeln = likp~vbeln
        INNER JOIN VBAP
        ON lips~vgbel = vbap~vbeln
      WHERE vttp~tknum = ps_vttk-tknum
        AND   lfimg       0.
    Hope this is useful.
    Also selection of records should be same as declared in table lt_lips otherwise use 'INTO CORRESPONDING TABLE LT_LIPS'
    Regards,
    Saba
    Edited by: Saba Sayed on Oct 24, 2008 9:30 AM

  • Global profile select statement error

    Hello,
    I try to set up profiles to personalize reports for users.
    When I use global profile with profile value of first kind  (on a profile value screen i choose "value", type, my formula "="my variable", and click add) and attatch it to the publication, it doesn't work properly. No matter what i use inside formula field, BO environment doesn't personalize report in accordance to it.
    I've noticed that there is something wrong with select statement created by BO. After sending a publication, report instance received by user has "description" field like "(and (equal null "my variable")). No matter what i put inside formula box in profile "equal null" statement is always added.
    When i use second type profile value (filter expression) everythig seems to be fine.
    Is this some kind of bug inside global profile mechanism
    I have BO XI R 3.1 without any fixpacks.
    Thanks in advance for any help
    best regards
    Wojtek

    Hi,
    In the Values option one can only use fixed values no formulas. Hence the formulas will not work.
    In my case the expression option does not work. Have you tried using a formual =CurrentUser in the expression field.

  • Script Logic - Scoping Statement Challenge

    Dear Friends,
    I have a requirement where I need to write a script logic to calculate the net of all Balance Sheet accounts which are under a Hierarchy node (say: BALANCESHEET) and post the reversal to another Account (say: 9999999) which is also located under the hierarchy node: BALANCESHEET
    Now the tricky bit is to exlcude the posting account (9999999) when I am reading the Accounts under the hierarchy node: BALANCESHEET.
    Anyone knows how to do it ?
    Below is my code which only works when the Account: 9999999 is located outside of the hier node: BALANCESHEET
         *XDIM_MEMBERSET ACCOUNT = BAS(BALANCESHEET)
         *XDIM_MEMBERSET TIME = 2014.APR
         *WHEN TIME
         *IS 2014.APR
         *REC(FACTOR = -1, ACCOUNT=9999999)
         *ENDWHEN
    The scoping statement I wish that would work is:
         *XDIM_MEMBERSET ACCOUNT = BAS(BALANCESHEET), BUT EXCLUDE 9999999
    Appreciate any response on this.
    Thanks,

    Hi Vadim,
    I was hoping you would respond.
    Your code worked like a charm!!
    I never know until now that we could use the below statement prior to *SELECT statement and use that variable within succeeding *SELECT statement.
    *XDIM_MEMBERSET ACCOUNT AS %ACCT% = BAS(BALANCESHEET)
    Because before I tried below with no luck but never knew about above statement.
    *SELECT(%ALLBSEXIMBAL%,"[ID]",GL_ACCOUNT,"[ID]=BAS(CBS) AND [ID]<>2199999")
    Even the SAP Help doesn't have the above syntax in their documentation, how did you know about it??
    You are a genius.
    Thanks very much for helping out
    Cheers!

  • Script Logic - REC Statement

    Hi,
    Can we use dimension property value in REC statement?
    *REC(EXPRESSION = %value%/[TIME].CURRENTMEMBER.PROPERTIES("ACCTHRS"),ACCT_PROJECT="FTE_DIRECT_BASE")
    WHEN I PROCESS THE SCRIPT LOGIC I AM GETTING AN ERROR "INVALID LINE IN LOGIC SECTION: *REC........"
    THANKS

    Hi,
    In this case, you can use LOOKUP. For instance,
    *LOOKUP XXX
    *DIM AAA:TIME=TIME.ACCTHRS
    *ENDLOOKUP
    *REC(EXPRESSION = %value%/LOOKUP(AAA),ACCT_PROJECT="FTE_DIRECT_BASE")
    Hope this helps.
    Regards,
    YH Seo
    ====================================================================================================
    Hi,
    Can we use dimension property value in REC statement?
    *REC(EXPRESSION = %value%/TIME.CURRENTMEMBER.PROPERTIES("ACCTHRS"),ACCT_PROJECT="FTE_DIRECT_BASE")
    WHEN I PROCESS THE SCRIPT LOGIC I AM GETTING AN ERROR "INVALID LINE IN LOGIC SECTION: *REC........"
    THANKS

  • Fetching a value from a select statement inside select clause

    hello all,
    I have a problem executing a procedure it gives me a runtime error, what am doing is i have multiple select statement inside a select clause. am using the entire select statement for a ref cursor. when running the query seperately am able to get the records but it's not getting compiled.
    here is the piece of code which am working with
    create or replace procedure cosd_telecommute_procedure
    (p_from_date in date,
    p_to_date in date,
    p_rset in out sys_refcursor)
    as
    p_str varchar2(10000);
    begin
    p_str := 'select personnum, '||
    'fullname, '||
                   'personid, '||
         'hours, '||
         'applydtm, '||
    'paycodeid, '||
         'laborlev2nm, '||
         'laborlev3nm, '||
         'laborlev2dsc, '||
    'adjdate, '||
         'timeshtitemtypeid, '||
         '(select max(eff_dt) from cosd_telecommute_info_tbl '||
         'where emplid = cosd_vp_telecommute.personnum and '||
    'eff_dt between ''01-aug-2005'' and ''30-aug-2005'') thisyreffdt, '||
                   '(select elig_config7 from cosd_telecommute_info_tbl '||
                   'where emplid = cosd_vp_telecommute.personnum and '||
    'eff_dt = (select max(eff_dt) from cosd_telecommute_info_tbl '||
                   'where emplid = cosd_vp_telecommute.personnum and '||
    'eff_dt between ''01-aug-2005'' and ''30-aug-2005'')) thisyrmiles,'||
    '(select max(eff_dt) from cosd_telecommute_info_tbl '||
                   'where emplid = cosd_vp_telecommute.personnum and '||
    'eff_dt between trunc(p_from_date) and trunc(p_to_date)) fiscalyreffdt, '||
         '(select elig_config7 from cosd_telecommute_info_tbl '||
                   'where emplid = cosd_vp_telecommute.personnum and '||
    'eff_dt = (select max(eff_dt) from cosd_telecommute_info_tbl '||
                        'where emplid = cosd_vp_telecommute.personnum and '||
    'eff_dt between trunc(p_from_date) and trunc(p_to_date))) fiscalyrmiles '||
    'from cosd_vp_telecommute '||
    'where trunc(applydtm) '||
    'between p_from_date and p_to_date '||
                   'and personnum = ''029791''';
                   open p_rset for p_str;
    end cosd_telecommute_procedure;
    and here is the piece of error am getting
    ERROR at line 1:
    ORA-00904: invalid column name
    ORA-06512: at "TKCSOWNER.COSD_TELECOMMUTE_PROCEDURE", line 40
    ORA-06512: at line 5

    Did you run the query in SQL plus? Check whether all the column are valid in your database. Below is the query which i got from your procedure just run and check it out. It is really hard for us to tell you the problem without knowing the table structure
    select personnum, fullname, personid, hours, applydtm, paycodeid, laborlev2nm, laborlev3nm,
    laborlev2dsc, adjdate, timeshtitemtypeid,
    (select max(eff_dt) from cosd_telecommute_info_tbl
      where emplid = cosd_vp_telecommute.personnum
      and eff_dt between '01-aug-2005' and '30-aug-2005') thisyreffdt,
      (select elig_config7 from cosd_telecommute_info_tbl where emplid = cosd_vp_telecommute.personnum
      and eff_dt = (select max(eff_dt)
                    from cosd_telecommute_info_tbl
                    where emplid = cosd_vp_telecommute.personnum
                    and eff_dt between '01-aug-2005' and '30-aug-2005'
       ) thisyrmiles,
      (select max(eff_dt)
       from cosd_telecommute_info_tbl
       where emplid = cosd_vp_telecommute.personnum
       and eff_dt between trunc(p_from_date) and trunc(p_to_date)
       ) fiscalyreffdt,
       (select elig_config7 from cosd_telecommute_info_tbl where emplid = cosd_vp_telecommute.personnum
       and eff_dt = (select max(eff_dt)
                     from cosd_telecommute_info_tbl
                     where emplid = cosd_vp_telecommute.personnum
                     and eff_dt between trunc(p_from_date) and trunc(p_to_date)
       ) fiscalyrmiles
    from cosd_vp_telecommute
    where trunc(applydtm) between p_from_date and p_to_date
    and personnum = '029791'

  • Using ORDER BY for column that's not in SELECT statement of select list?

    Hi all.
    I have a select list on an APEX page at apex.oracle.com, and I would like to order this by the value of column UnitOrder.
    The SQL is as follows:
    SELECT DISTINCT foodunit.name AS display_value, foodunit.foodunitid AS return_value
    FROM foodunit, food
    WHERE foodunit.foodid = :P18_FOODID
    ORDER BY foodunit.unitorder ASC;Off course, this code won't work. And since it's a select list, I can't just add foodunit.unitorder to the SELECT statement. Also, I can't get rid of the DISTINCT, because then for some reason it tends to display an infinite amount of the same row...
    The point of ordering it by UnitOrder is that all units who begin with gram, ml, mg, kg,... etc, will be shown on top of the select list. All other food units will be shown on the second place and so on.
    The column UnitOrder holds either 1 or 2 as a value. 1 is the value for all rows that should be displayed at the top of the select list, 2 is the value for all the rest.
    So, what I want is that all rows in which the UnitOrder is 1, get displayed on top of the select list. Usually only 2 list items get shown in the select list at a time, depening on which food item a user has selected. The select list then refines to certain rows that match the foodid etc etc..
    If anyone has an idea, I'd be very happy to hear about it.

    Thanks! I didn't think about using a join. Code works now, and is as follows:
    SELECT foodunit.name AS display_value, foodunit.foodunitid AS return_value
    FROM foodunit
    INNER JOIN food
    ON food.foodid = foodunit.foodid 
    WHERE foodunit.foodid = :P18_FOODID
    ORDER BY foodunit.unitorder ASC;

  • Reg: Script Logic - REC Statement Variable usage

    hi friends
    Pl find enclosed the following code:
    *WHEN TIME               
    *IS TMVL(-1,2011.04)               
    *WHEN ACCOUNT               
    *IS "EXP01"               
    *REC(EXPRESSION = [TIME].[2011.04]-%VALUE%,TIME = 2011.04,ACCOUNT = EXP01A)               
    *ENDWHEN               
    *ENDWHEN               
    The above code is working fine and result is extracted but i have hardcoded , ACCOUNT=EXP01A;
    My Query is follows:
    I have used
    *WHEN ACCOUNT               
    *IS "EXP01"
    In REC i want to use concatenation of "A" To account like EXP01&"A"
    i know accunt & i want to concatenate "A" and use in REC statement like assign to variable
    var1="EXP01" & "A" and use var1 in REC
    *REC(EXPRESSION = [TIME].[2011.04]-%VALUE%,TIME = 2011.04,ACCOUNT = var1)
    i am not sure the syntax (Whether we need to put in strings)
    Also if EXP02 then var1="EXP02"&"A" and so on
    In fact i want to make this for all members in Account Dimenstion as generalised.
    Pl. verify and suggest best possibility
    Thanx & Rgds
    Srinath

    Hi Krishna
    *XDIM_MEMBERSET ACCOUNT AS %ACC% = EXP01
    *WHEN ACCOUNT
    *IS %ACC%
    REC(EXPRESSION = %VALUE%2,TIME = 2011.04,ACCOUNT = %ACC%A)
    *ENDWHEN
    Is it required to add EXP01A as below?
    XDIM_MEMBERSET ACCOUNT AS %ACC% = EXP01, EXP01A
    Also In Generalized code you have mentioned:
    Instead of Hard Coding EXP01, EXP02 can i have hierarchy of all EXP , so that if any new account added in dimension, there will be no change in script logic. Pl. can you share how to use the same.
    If above code needs to be generalised, *FOR *NEXT can be used .
    *XDIM_MEMBERSET ACCOUNT AS %ACC_LIST% = EXP01,EXP02,EXP03,EXP04
    *FOR %ACC_MBR% = %ACC_LIST%
    *WHEN ACCOUNT
    *IS %ACC_MBR%
    REC(EXPRESSION = %VALUE%2,TIME = 2011.04,ACCOUNT = %ACC_MBR%A)
    *ENDWHEN
    *NEXT
    Rgds
    Srinath

  • Bug report select statement nested select in FROM Clause on Oracle 10g

    The SELECT statement below does not return the appropriate result; it used to work on Oracle 8, but it does not on 10g (10.2).
    Here is the table
    create table T (
    A numeric(4),
    B numeric(4)
    Some data
    insert into T (A,B) VALUES (1,null);
    insert into T (A,B) VALUES (2,1);
    insert into T (A,B) VALUES (3,1);
    insert into T (A,B) VALUES (3,2);
    The select statement returning the worng result
    select totals.A, totals.totalBbyA
    from (
    select t1.A, sum(t1.B) totalBbyA
    from T t1
    group by A
    ) totals
    where
    totals.totalBbyA >= all
    select sum(nvl(t2.b,0)) from T t2 group by t2.a
    it returns "no rows selected"
    An equivalent select that does return the good result
    select t1.A, sum(t1.B) totalBbyA
    from T t1
    group by A
    having
    sum(t1.B) >= all
    select sum(nvl(t2.b,0)) from T t2 group by t2.a
    It returns
    A TOTALBBYA
    3 3
    Best regards

    910893 wrote:
    but it does not on 10g (10.2).Works fine in:
    SQL> select  *
      2    from  v$version
      3  /
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
    PL/SQL Release 10.2.0.4.0 - Production
    CORE    10.2.0.4.0      Production
    TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    SQL> select  *
      2    from  t
      3  /
             A          B
             1
             2          1
             3          1
             3          2
    SQL> select totals.A, totals.totalBbyA
      2  from (
      3  select t1.A, sum(t1.B) totalBbyA
      4  from T t1
      5  group by A
      6  ) totals
      7  where
      8  totals.totalBbyA >= all
      9  (
    10  select sum(nvl(t2.b,0)) from T t2 group by t2.a
    11  )
    12  ;
             A  TOTALBBYA
             3          3
    SQL> SY.

  • Simple Select Statement Error

    Hello,
    I want to print user from my database, this is the code:
                          System.out.println("user:\n"); user = sc.next(); System.out.println("password:\n"); psw = sc.next();                                                     Statement s = conn.createStatement (); s.executeQuery("SELECT usr, pass FROM log WHERE usr=''"+user+" AND pass=''"+psw);                       ResultSet rs = s.getResultSet ();                       if (s.getMoreResults()){                           System.out.println("works");                       }                       else if (!s.getMoreResults()){                           System.out.println("doesn't");                           System.exit(1);                       }                         while (rs.next ())   {             String nameVal = rs.getString ("user");       String catVal = rs.getString ("pass");       System.out.println (                       "name = " + nameVal               + " pass = " + catVal);       ++count;   }
    the connection is established, but it doesn't print anything when I enter data in it [ admin "1234" which exists in the db ], any idea what could be wrong? I have to mentioned that I'm a little bit fresh in Java databases.

    hey I sorted out! = )
    ResultSet rs = s.getResultSet ();
       if (rs.next()) {
         do {
          String nameVal = rs.getString ("lnum");
           String catVal = rs.getString ("passwd");
           System.out.println (
                    "name = " + nameVal
                   + " password = " + catVal);
         //  System.out.println("Full access granted ");
    JOptionPane.showMessageDialog(frame,
        "Welcome in LYITstorage",
        "Welcome",
        JOptionPane.INFORMATION_MESSAGE);
    Desktop.getDesktop().browse(new java.net.URI("www.google.com"));
            } while (rs.next());
       else{
           JOptionPane.showMessageDialog(frame,
        "Username or password are incorrect\n " +
         "If You don't have an account please\n press the regestration link",
        "Regestration problem",
        JOptionPane.ERROR_MESSAGE);
      }= ), thanks for help right now, but its not a end of my problems = ). I wanted to use it with INSERT, but it doesn' work as good as I want, as a matter of fact it's not working at all :), this is the code, any help would be nice :).
    try
                          System.out.println("try");
                             Statement s = conn.createStatement ();
                             System.out.println("statement");
                             int count =0;
                             boolean temp;
                             String query =   "INSERT INTO log (passwd, name,surname,lnum) VALUES ('"+pa+"', '"+n+"', '"+sn+"','"+nu+"')" ;
                             System.out.println("test");
                          count=  s.executeUpdate(query);
                            System.out.println(query);
                           System.out.println(count);
                             ResultSet rs = s.getResultSet ();
                             if(rs.next()){
                                 JOptionPane.showMessageDialog(frame,
                                "Welcome ",
                                "Welcome",
                                 JOptionPane.INFORMATION_MESSAGE);
                            else   {
           JOptionPane.showMessageDialog(frame,
        "User already exists","error",
        JOptionPane.ERROR_MESSAGE);
       }

  • Urgent , abap select statement error ...

    Hi all ,
    here i attached my code , has anyone can tell me where is the error ???
    when i active this code , it showed :
    "comma without preceding colon(after select?)"
    thanks a lot !
    SELECT LIPSERDAT LIPSVBELN LIPSPOSNR LIPSVGPOS LIPS~LFIMG
    LIPSVRKME LIKPWADAT_IST LIKPKUNAG LIKPKUNNR LIKP~VBELN
    VBAPVBELN VBAPMATNR VBAPNETWR VBAPWAERK VBAPMWSBP VBAPNETPR
    VBAPPOSNR VBUPKOSTA VBUPWBSTA VBUPFKSTA VBUPPOSNR VBUPVBELN
    VBPAPARVW VBPAVBELN VBUKCMGST VBUKVBELN VBAKAUART VBAKVBELN
    INTO (
    WASTATUS-ERDAT , WASTATUS-VBELN , WASTATUS-POSNR ,
    WASTATUS-VGPOS , WASTATUS-LFIMG , WASTATUS-VRKME ,
    WASTATUS-WADAT_IST , WASTATUS-KUNAG ,WASTATUS-KUNNR ,
    WASTATUS-LIKPVBELN , WASTATUS-VBAPVBELN , WASTATUS-MATNR ,
    WASTATUS-NETWR , WASTATUS-WAERK , WASTATUS-MWSBP ,
    WASTATUS-NETPR , WASTATUS-POSNR , WASTATUS-KOSTA , WASTATUS-WBSTA ,
    WASTATUS-FKSTA , WASTATUS-VBUPPOSNR , WASTATUS-VBUPVBELN ,
    WASTATUS-PARVW , WASTATUS-VBPAVBELN , WASTATUS-CMGST ,
    WASTATUS-VBUKVBELN , WASTATUS-AUART , WASTATUS-VBAKVBELN )
        FROM ( LIPS inner join LIKP
               on  LIKPVBELN = LIPSVBELN
               inner join VBAP
               on  VBAPVBELN = LIPSVGBEL
               and VBAPPOSNR = LIPSVGPOS
               inner join VBUP
               on  VBUPPOSNR = LIPSPOSNR
               and VBUPVBELN = LIPSVBELN
               inner join VBPA
               on  VBPAVBELN = LIPSVBELN
               inner join VBUK
               on  VBUKVBELN = LIPSVBELN
               inner join VBAK
               on  VBAKVBELN = VBAPVBELN )
            WHERE
               LIPS~VBELN in P_SVBELN
               and LIPS~ERDAT in P_ERDAT
               and LIKP~KUNAG in P_KUNAG
               and LIKP~KUNNR in P_KUNNR
               and VBAP~VBELN in P_PVBELN
               and VBUP~KOSTA in P_KOSTA
               and VBUP~WBSTA in P_WBSTA
               and VBUP~FKSTA in P_FKSTA
               and VBPA~PARVW in P_PARVW
               and VBUK~CMGST in P_CMGST .

    sorry all ,
       i already removed the space on my code like that :
       but it still displayed the error .
    SELECT LIPS~ERDAT
    <b>*LIPSVBELN LIPSPOSNR LIPSVGPOS LIPSLFIMG
    *LIPSVRKME LIKPWADAT_IST LIKPKUNAG LIKPKUNNR LIKP~VBELN
    *VBAPVBELN VBAPMATNR VBAPNETWR VBAPWAERK VBAPMWSBP VBAPNETPR
    *VBAPPOSNR VBUPKOSTA VBUPWBSTA VBUPFKSTA VBUPPOSNR VBUPVBELN
    *VBPAPARVW VBPAVBELN VBUKCMGST VBUKVBELN VBAKAUART VBAKVBELN</b>    FROM ( LIPS inner join LIKP
               on  LIKPVBELN = LIPSVBELN
               inner join VBAP
               on  VBAPVBELN = LIPSVGBEL
               and VBAPPOSNR = LIPSVGPOS
               inner join VBUP
               on  VBUPPOSNR = LIPSPOSNR
               and VBUPVBELN = LIPSVBELN
               inner join VBPA
               on  VBPAVBELN = LIPSVBELN
               inner join VBUK
               on  VBUKVBELN = LIPSVBELN
               inner join VBAK
               on  VBAKVBELN = VBAPVBELN )
    INTO (WASTATUS-ERDAT)
    <b>*WASTATUS-VBELN, WASTATUS-POSNR, WASTATUS-VGPOS,WASTATUS-LFIMG)
    *WASTATUS-VRKME,
    *WASTATUS-WADAT_IST, WASTATUS-KUNAG,WASTATUS-KUNNR,
    *WASTATUS-LIKPVBELN, WASTATUS-VBAPVBELN, WASTATUS-MATNR,
    *WASTATUS-NETWR, WASTATUS-WAERK, WASTATUS-MWSBP,
    *WASTATUS-NETPR, WASTATUS-POSNR, WASTATUS-KOSTA, WASTATUS-WBSTA,
    *WASTATUS-FKSTA, WASTATUS-VBUPPOSNR, WASTATUS-VBUPVBELN,
    *WASTATUS-PARVW, WASTATUS-VBPAVBELN, WASTATUS-CMGST,
    *WASTATUS-VBUKVBELN, WASTATUS-AUART, WASTATUS-VBAKVBELN )</b>        WHERE
               LIPS~VBELN in P_SVBELN
               and LIPS~ERDAT in P_ERDAT
               and LIKP~KUNAG in P_KUNAG
               and LIKP~KUNNR in P_KUNNR
               and VBAP~VBELN in P_PVBELN
               and VBUP~KOSTA in P_KOSTA
               and VBUP~WBSTA in P_WBSTA
               and VBUP~FKSTA in P_FKSTA
               and VBPA~PARVW in P_PARVW
               and VBUK~CMGST in P_CMGST .

  • Urgent , abap select statement error VBPA ...

    hi gurus,
    please tell me what is the wrong in the following select statment:
    it returns 4 dispite that the data is there in the table VBPA
    like this :
    VBPA
    Cl.                          :     200
    Document                :    0010002449
    Item                         :
    Funct                      :    PE
    Pers.No.  :                    100820
    SELECT SINGLE
      pernr
    INTO  w_pernr
    FROM  vbpa
    WHERE VBELN   EQ '0010002449'
    and   kunnr   EQ 'PE'.

    hi
    good
    wrong one ->
    SELECT SINGLE
    pernr
    INTO w_pernr
    FROM vbpa
    WHERE VBELN EQ '0010002449'
    and kunnr EQ 'PE'.
    SELECT SINGLE
    pernr
    INTO w_pernr
    FROM vbpa
    WHERE VBELN EQ 0010002449
    and kunnr EQ PE.
    change like this and check the difference.
    thanks
    mrutyun^

  • Normal select statement error!??

    Hello All,
    I have a table with primary key (antrag_nr, beladeflag, stempel)
    Desc test88
    Name Null? Type
    ANTRAG_NR NOT NULL NUMBER
    A_PROZESS NUMBER
    STEMPEL NOT NULL DATE
    BELADEFLAG NOT NULL VARCHAR2(1)
    desc test99
    Name Null? Type
    ANTRAG_NR NOT NULL NUMBER
    A_PROZESS NUMBER
    STEMPEL NOT NULL DATE
    BELADEFLAG NOT NULL VARCHAR2(1)
    select * from test99;
    ANTRAG_NR A_PROZESS STEMPEL B
    1 3 04-JAN-05 m
    2 4 04-JAN-05 m
    1     4 05-JAN-05 m
    select * from test88;
    ANTRAG_NR A_PROZESS STEMPEL B
    1 1 01-JAN-05 m
    1 2 02-JAN-05 m
    1 2 03-JAN-05 m
    1 3 04-JAN-05 m
    2 1 01-JAN-05 m
    2 2 02-JAN-05 m
    2     3 04-JAN-05 m
    I am writing this query now and getting the below answer.
    select a.antrag_nr, a.a_prozess, a.stempel, a.beladeflag from test88 a, test99 b where a.antrag_nr = b.antrag_nr and a.a_prozess <> b.a_prozess and a.stempel = (select max(stempel) from test88);
    ANTRAG_NR A_PROZESS STEMPEL B
    2 3 04-JAN-05 m
    1     3 04-JAN-05 m
    according to my query I have ’a a.a_prozess <> b.a_prozess’ but why do I get 1 3 04-jan-05 m
    Please let me know where have I gone wrong!!
    RGds
    Karhtik krishna

    The way your initial query was designed, checks all a_prozess available for each antrag_nr. If I change your query around I can demonstrate.
    select  a.antrag_nr
    ,       b.a_prozess
    ,       a.stempel
    ,       a.beladeflag
    from    test88 a
    ,       test99 b
    where   a.antrag_nr = b.antrag_nr
    and     a.a_prozess <> b.a_prozess
    and     a.stempel = (   select max(stempel)
                            from test88
    ANTRAG_NR     A_PROZESS     STEMPEL          BELADEFLAG
    1          4          4-JAN-2005     m
    2          4          4-JAN-2005     m

  • Urgent, SELECT statement results in error

    hi all, this is very urgent, could you guys have a look at my SELECT statement?
      SELECT vk~kunnr         "customer no
              vk~vbeln         "sales order no
              vk~audat         "date
              vk~vbtyp         "SD DOCUMENT CATEGORY
              vk~knumv         "lwk
              vp~kwmeng        "qty
              vp~matnr         "material no
              vp~posnr         "LINE ITEM
              vd~bstkd         "PURCHASE ORDER NO
    *          kv~kwert         "lwk
              FROM  vbak AS vk
              INNER JOIN vbap AS vp
              ON vk~vbeln = vp~vbeln
              INNER JOIN vbkd AS vd
              ON vk~vbeln = vd~vbeln
    *          INNER JOIN konv AS kv
    *          ON kv~knumv = vk~knumv
              INTO CORRESPONDING FIELDS OF TABLE it_so
              WHERE vk~vkorg IN s_vkorg
              AND vk~audat IN s_date
              AND vk~kunnr IN s_kunnr
              AND vp~matnr IN s_matnr
              AND vd~bstkd IN s_bstkd
              AND vk~vbeln IN s_vbeln
    *          AND kv~kschl = 'ZP00'
              AND vk~vbtyp = 'C'.
    The commented lines are the new additions that i want to add to the SELECT statement. But when i un-comment them, i get an error while activating my program. Error is as follows:
    For pooled tables, cluster tables, and project views, JOIN is not allowed: "KONV".
    Is there a way i can go around it?

    Hi,
    look at this SAP note : 550043
    Symptom
    KEPM: dump 'MESSAGE_TYPE_X' during automatic planning method execution.
    Other terms
    KEPM MESSAGE_TYPE_X transform characteristic value
    Reason and Prerequisites
    This note is related only to cases, if dump 'MESSAGE_TYPE_X' is raising
    during execution of planning method, for which is possible to define
    transformation of characteristics values i.e. Copy, Forecast, Top-Down
    distribution, Ratios and Customer Enhancement.
    Dump is raising in case, if there was defined transformation of char.
    values in parameter set definition for some characteristic. Later on,
    this characteristic was removed from planning level definition but
    characteristic wasn't removed from relevant customizing of transform
    characteristic values before.
    Solution
    Please apply attached program correction.
    Regards,
    GSR.

  • Reference a value of previous year in a Script Logic

    Hi,
    I need to reference a value of previous year to that I have in a Script Logic.
    I've tried it with "%YEAR% (-1)", but "%YEAR%" refers to the current year and doesn't refer to the year that I have in the Script Logic, that is, if I pass "2006.DEC " to Script Logic, the system returns me in "%YEAR%" the value "2010".
    What syntax should I use?
    Regards,
    Miguel.

    Hi
    The  Damien's suggestion is the correct one for BPC 7.0 NW to get the offset of the passed-in Time's member.
    So you have properties in your Time dimension that store the prior year of current member or the next year of current member or next 2 years of current member and etc.
    Then reference them in you logic something right this
    ID : 2008.JAN
    NEXT: 2009.JAN
    PRIOR: 2007.JAN
    *WHEN TIME
    *IS %TIME_SET%
    *REC(FACTOR=1, TIME=TIME.PRIOR)
    *ENDWHEN
    Additional information,
    %YEAR% in BPC NW reflects the time on the server which is different from the BPC MS.
    BPC 7.5 NW has a better function to handle this: TVML.
    Halomoan

Maybe you are looking for