Use between in IF statement

How to use between statement in IF statement.
if date is in betweem 12.07.2007  & 31.12.9999.
thanks in advance

Hi,
Try this,
DATA: i1 TYPE i VALUE 5.
IF i1 BETWEEN 1 AND 19 .
  WRITE:/ i1.
ENDIF.
Thanks,
Dharmishta
Message was edited by:
        Dharmishta Suryavanshi

Similar Messages

  • Error while using between operator with sql stmts in obiee 11g analytics

    Hi All,
    when I try to use between operator with two select queries in OBIEE 11g analytics, I'm getting the below error:
    Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
    Location: saw.views.evc.activate, saw.httpserver.processrequest, saw.rpc.server.responder, saw.rpc.server, saw.rpc.server.handleConnection, saw.rpc.server.dispatch, saw.threadpool.socketrpcserver, saw.threads
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 27002] Near <select>: Syntax error [nQSError: 26012] . (HY000)
    can anyone help me out in resolving this issue.

    Hi All,
    Thank u all for ur replies, but I dint the exact solution for what I'm searching for.
    If I use the condition as
    "WHERE "Workforce Budget"."Used Budget Amount" BETWEEN MAX("Workforce Budget"."Total Eligible Salaries") AND MAX("Workforce Budget"."Published Worksheet Budget Amount"",
    all the data will be grouped with the two columns which I'm considering in the condition.
    my actual requirement with this query is to get the required date from a table to generate the report either as daily or weekly or monthly report. If I use repository variables, variables are not getting refreshed until I regenerate the server(which I should not do in my project). Hence I have created a table to hold weekly start and end dates and monthly start and end dates to pass the value to the actual report using between operator.
    please could anyone help me on this, my release date is fast approaching.

  • Use of AT NEW  statement

    Hi,
      In my program have written the code as
        SORT gt_bsik BY lifnr belnr  gjahr buzei.
        DATA : gv_count TYPE i VALUE 0.
        IF sy-subrc = 0.
          LOOP AT gt_bsik.
        AT NEW lifnr .
              READ TABLE gt_lfb1 WITH KEY lifnr = gt_bsik-lifnr BINARY
              SEARCH.
              CLEAR lt_vendors.
              lt_vendors-lifnr = gt_lfb1-lifnr.
            ENDAT.
            AT NEW belnr.
              gv_new_invoice_ind = 'X'.
              gt_bsik_copy-lifnr = gt_bsik-lifnr.
              gt_bsik_copy-belnr = gt_bsik-belnr.
           gt_bsik_copy-gjahr = gt_bsik-gjahr.
              gt_bsik_copy-buzei = gt_bsik-buzei.
              gv_count = gv_count + gt_bsik-buzei .
            ENDAT.
    the value of gt_bsik-buzei is coming as *** after passing tho AT NEW belnr stmt.Before that the value is correct only after passing tho it showing wrong value but the other fields are showing  correct value .Whats the reason for this?

    HI,
    Between AT NEW and endat statements you would have the field contents as **** after the field for which you have used in AT NEW statement. For example if you have used the 3rd field in AT NEW statement then between AT NEW and ENDAT statements you can access the first 3 fields contents only.If you want  to access any field after 3rd field then you have  to take  a Back Up of those fields before you enter in to AT statement. In your case declare a WA_BSIK of type GT_BSIK.
    Data : wa_bsik LIKE gt_bsik.
    Before you enter in to AT NEW statement transfer contents of gt_bsik to wa_bsik.
    WA_BSIK = GT_BSIK.
    Between AT NEW and  ENDAT use the field contents of wa_bsik and not gt_bsik.
    AT NEW belnr.
    gv_new_invoice_ind = 'X'.
    wa_bsik_copy-lifnr = wa_bsik-lifnr.
    wa_bsik_copy-belnr = wa_bsik-belnr.
    wa_bsik_copy-gjahr = wa_bsik-gjahr.
    wa_bsik_copy-buzei = wa_bsik-buzei.
    gv_count = gv_count + wa_bsik-buzei .
    ENDAT.

  • Using BETWEEN in Query in BI Publisher

    I wanna use BETWEEN , to be used between 2 parameters as the following :
    AND TO_CHAR(T8.ATTRIB_13,'DD/MM/YYYY') BETWEEN NVL(:P_DAT,TO_CHAR(T8.ATTRIB_13,'DD/MM/YYYY')) AND NVL(:P_TO,TO_CHAR(T8.ATTRIB_13,'DD/MM/YYYY'))
    this statement does not give me all data
    Any help PLZ
    Thanks

    Try using TO_DATE instead of TO_CHAR

  • Differences in "storage used" between iPad and iTunes

    I have an iPad Mini 2 and there a differences between the stated "storage used" between the iPad and iTunes.
    Looking in the general settings "Storage" it states I have used 113GB and available is 413MB.
    Looking on iTunes, when the iPad is connected, it states I have 67.20GB free.
    Which is correct and what causes the problem?
    How is it fixed if it is because the iPad has a fault?
    Many thanks.

    It is now a couple of weeks and noticed the discrepancy occurring again.  I did not want to go through the above process again because it took about 4 hours to get my iPad up, running again and normal.
    Again, there was a difference in memory by about 20GB.
    This time it tried something different.
    1) Went into General settings on iPad and managed memory.  From here I removed all films and TV episodes.  Now Video memory was zero.
    2) Switched off WiFi.  When I opened the Video app, I noticed a pile of films and TV episodes showing, even though they had the cloud icon.  They could even be watched.  I deleted these films/episodes.
    3) Viewed the iPad memory using iTunes on laptop and compared to iPad general settings usage (video memory negligible).  Both numbers pretty much spot on.
    My musings - I can only assume that the iPad does not properly delete films/episodes that I had previously watched.  It is evidently holding on to the video, even though I had deleted them and they were not showing in general settings.  Though it is a hassle, I at least now how to find where the "lost" memory is and how to reclaim it.

  • Difference between alter table statements to add primary keys

    Hi,
    Can someone explain what the difference between these 2 statements are and if & when one should be used over the other?
    Also, are the brackets around the column name necessary?
    Thanks!
    ALTER TABLE xyz ADD CONSTRAINT id_pk PRIMARY KEY (id);
    ALTER TABLE xyz ADD PRIMARY KEY (id);

    Hi,
    As every one has explained that there is no difference in the actual functioning of the two constraints except that the first statement will create Primary Key constraint with user defined name as id_pk whereas in the second statement Primary key will be created with system generated name like SYS....
    Normally name for the constraints are needed when you are working on constraints like need to enable or disable the constraints or need to drop the constraints.
    We can say that names for primary key are least required when it comes to the usage except better recognization.
    Because we can drop primary key, disable primary key,enable primary key without giving the name for the primary key as there can only be one primary key in the table. So not much an issue with the name.
    But as earlier post say its better than nothing,, i will add to it that its almost same as that with names constrained in case of Primary Keys taking into account the usage of the named primary key.
    Regards

  • Difference in performance (using BETWEEN or IN select_range)

    Hi,
    I need to improve the performance of a report program. The program is a copy of a standard program with some changes. In the custom program I have found a select query on a cluster pcl4.
    The standard program selects on this cluster using a range table providing min and max values.
    The custom program uses between clause passing the min and max values.
    Please suggest which one of these would be better in performance.
    Lokesh

    hi
    <b>USE BETWEEN , IT IS VERY IN THE POINT OF PERFORMNCE</b>
    AND REFER THESE POINTS FOR THE FETURE USE REGARDING PERFORMNCE
    Ways of Performance Tuning
    1.     Selection Criteria
    2.     Select Statements
    •     Select Queries
    •     SQL Interface
    •     Aggregate Functions
    •     For all Entries
    Select Over more than one Internal table
    Selection Criteria
    1.     Restrict the data to the selection criteria itself, rather than filtering it out using the ABAP code using CHECK statement. 
    2.     Select with selection list.
    Points # 1/2
    SELECT * FROM SBOOK INTO SBOOK_WA.
      CHECK: SBOOK_WA-CARRID = 'LH' AND
             SBOOK_WA-CONNID = '0400'.
    ENDSELECT.
    The above code can be much more optimized by the code written below which avoids CHECK, selects with selection list
    SELECT  CARRID CONNID FLDATE BOOKID FROM SBOOK INTO TABLE T_SBOOK
      WHERE SBOOK_WA-CARRID = 'LH' AND
                  SBOOK_WA-CONNID = '0400'.
    Select Statements   Select Queries
    1.     Avoid nested selects
    2.     Select all the records in a single shot using into table clause of select statement rather than to use Append statements.
    3.     When a base table has multiple indices, the where clause should be in the order of the index, either a primary or a secondary index.
    4.     For testing existence , use Select.. Up to 1 rows statement instead of a Select-Endselect-loop with an Exit. 
    5.     Use Select Single if all primary key fields are supplied in the Where condition .
    Point # 1
    SELECT * FROM EKKO INTO EKKO_WA.
      SELECT * FROM EKAN INTO EKAN_WA
          WHERE EBELN = EKKO_WA-EBELN.
      ENDSELECT.
    ENDSELECT.
    The above code can be much more optimized by the code written below.
    SELECT PF1 PF2 FF3 FF4 INTO TABLE ITAB
        FROM EKKO AS P INNER JOIN EKAN AS F
          ON PEBELN = FEBELN.
    Note: A simple SELECT loop is a single database access whose result is passed to the ABAP program line by line. Nested SELECT loops mean that the number of accesses in the inner loop is multiplied by the number of accesses in the outer loop. One should therefore use nested SELECT loops  only if the selection in the outer loop contains very few lines or the outer loop is a SELECT SINGLE statement.
    Point # 2
    SELECT * FROM SBOOK INTO SBOOK_WA.
      CHECK: SBOOK_WA-CARRID = 'LH' AND
             SBOOK_WA-CONNID = '0400'.
    ENDSELECT.
    The above code can be much more optimized by the code written below which avoids CHECK, selects with selection list and puts the data in one shot using into table
    SELECT  CARRID CONNID FLDATE BOOKID FROM SBOOK INTO TABLE T_SBOOK
      WHERE SBOOK_WA-CARRID = 'LH' AND
                  SBOOK_WA-CONNID = '0400'.
    Point # 3
    To choose an index, the optimizer checks the field names specified in the where clause and then uses an index that has the same order of the fields . In certain scenarios, it is advisable to check whether a new index can speed up the performance of a program. This will come handy in programs that access data from the finance tables.
    Point # 4
    SELECT * FROM SBOOK INTO SBOOK_WA
      UP TO 1 ROWS
      WHERE CARRID = 'LH'.
    ENDSELECT.
    The above code is more optimized as compared to the code mentioned below for testing existence of a record.
    SELECT * FROM SBOOK INTO SBOOK_WA
        WHERE CARRID = 'LH'.
      EXIT.
    ENDSELECT.
    Point # 5
    If all primary key fields are supplied in the Where condition you can even use Select Single.
    Select Single requires one communication with the database system, whereas Select-Endselect needs two.
    Select Statements           contd..  SQL Interface
    1.     Use column updates instead of single-row updates
    to update your database tables.
    2.     For all frequently used Select statements, try to use an index.
    3.     Using buffered tables improves the performance considerably.
    Point # 1
    SELECT * FROM SFLIGHT INTO SFLIGHT_WA.
      SFLIGHT_WA-SEATSOCC =
        SFLIGHT_WA-SEATSOCC - 1.
      UPDATE SFLIGHT FROM SFLIGHT_WA.
    ENDSELECT.
    The above mentioned code can be more optimized by using the following code
    UPDATE SFLIGHT
           SET SEATSOCC = SEATSOCC - 1.
    Point # 2
    SELECT * FROM SBOOK CLIENT SPECIFIED INTO SBOOK_WA
      WHERE CARRID = 'LH'
        AND CONNID = '0400'.
    ENDSELECT.
    The above mentioned code can be more optimized by using the following code
    SELECT * FROM SBOOK CLIENT SPECIFIED INTO SBOOK_WA
      WHERE MANDT IN ( SELECT MANDT FROM T000 )
        AND CARRID = 'LH'
        AND CONNID = '0400'.
    ENDSELECT.
    Point # 3
    Bypassing the buffer increases the network considerably
    SELECT SINGLE * FROM T100 INTO T100_WA
      BYPASSING BUFFER
      WHERE     SPRSL = 'D'
            AND ARBGB = '00'
            AND MSGNR = '999'.
    The above mentioned code can be more optimized by using the following code
    SELECT SINGLE * FROM T100  INTO T100_WA
      WHERE     SPRSL = 'D'
            AND ARBGB = '00'
            AND MSGNR = '999'.
    Select Statements       contd…           Aggregate Functions
    •     If you want to find the maximum, minimum, sum and average value or the count of a database column, use a select list with aggregate functions instead of computing the aggregates yourself.
    Some of the Aggregate functions allowed in SAP are  MAX, MIN, AVG, SUM, COUNT, COUNT( * )
    Consider the following extract.
                Maxno = 0.
                Select * from zflight where airln = ‘LF’ and cntry = ‘IN’.
                 Check zflight-fligh > maxno.
                 Maxno = zflight-fligh.
                Endselect.
    The  above mentioned code can be much more optimized by using the following code.
    Select max( fligh ) from zflight into maxno where airln = ‘LF’ and cntry = ‘IN’.
    Select Statements    contd…For All Entries
    •     The for all entries creates a where clause, where all the entries in the driver table are combined with OR. If the number of entries in the driver table is larger than rsdb/max_blocking_factor, several similar SQL statements are executed to limit the length of the WHERE clause.
         The plus
    •     Large amount of data
    •     Mixing processing and reading of data
    •     Fast internal reprocessing of data
    •     Fast
         The Minus
    •     Difficult to program/understand
    •     Memory could be critical (use FREE or PACKAGE size)
    Points to be must considered FOR ALL ENTRIES
    •     Check that data is present in the driver table
    •     Sorting the driver table
    •     Removing duplicates from the driver table
    Consider the following piece of extract
    Loop at int_cntry.
           Select single * from zfligh into int_fligh
    where cntry = int_cntry-cntry.
    Append int_fligh.
    Endloop.
    The above mentioned can be more optimized by using the following code.
    Sort int_cntry by cntry.
    Delete adjacent duplicates from int_cntry.
    If NOT int_cntry[] is INITIAL.
                Select * from zfligh appending table int_fligh
                For all entries in int_cntry
                Where cntry = int_cntry-cntry.
    Endif.
    Select Statements    contd…  Select Over more than one Internal table
    1.     Its better to use a views instead of nested Select statements.
    2.     To read data from several logically connected tables use a join instead of nested Select statements. Joins are preferred only if all the primary key are available in WHERE clause for the tables that are joined. If the primary keys are not provided in join the Joining of tables itself takes time.
    3.     Instead of using nested Select loops it is often better to use subqueries.
    Point # 1
    SELECT * FROM DD01L INTO DD01L_WA
      WHERE DOMNAME LIKE 'CHAR%'
            AND AS4LOCAL = 'A'.
      SELECT SINGLE * FROM DD01T INTO DD01T_WA
        WHERE   DOMNAME    = DD01L_WA-DOMNAME
            AND AS4LOCAL   = 'A'
            AND AS4VERS    = DD01L_WA-AS4VERS
            AND DDLANGUAGE = SY-LANGU.
    ENDSELECT.
    The above code can be more optimized by extracting all the data from view DD01V_WA
    SELECT * FROM DD01V INTO  DD01V_WA
      WHERE DOMNAME LIKE 'CHAR%'
            AND DDLANGUAGE = SY-LANGU.
    ENDSELECT
    Point # 2
    SELECT * FROM EKKO INTO EKKO_WA.
      SELECT * FROM EKAN INTO EKAN_WA
          WHERE EBELN = EKKO_WA-EBELN.
      ENDSELECT.
    ENDSELECT.
    The above code can be much more optimized by the code written below.
    SELECT PF1 PF2 FF3 FF4 INTO TABLE ITAB
        FROM EKKO AS P INNER JOIN EKAN AS F
          ON PEBELN = FEBELN.
    Point # 3
    SELECT * FROM SPFLI
      INTO TABLE T_SPFLI
      WHERE CITYFROM = 'FRANKFURT'
        AND CITYTO = 'NEW YORK'.
    SELECT * FROM SFLIGHT AS F
        INTO SFLIGHT_WA
        FOR ALL ENTRIES IN T_SPFLI
        WHERE SEATSOCC < F~SEATSMAX
          AND CARRID = T_SPFLI-CARRID
          AND CONNID = T_SPFLI-CONNID
          AND FLDATE BETWEEN '19990101' AND '19990331'.
    ENDSELECT.
    The above mentioned code can be even more optimized by using subqueries instead of for all entries.
    SELECT * FROM SFLIGHT AS F INTO SFLIGHT_WA
        WHERE SEATSOCC < F~SEATSMAX
          AND EXISTS ( SELECT * FROM SPFLI
                         WHERE CARRID = F~CARRID
                           AND CONNID = F~CONNID
                           AND CITYFROM = 'FRANKFURT'
                           AND CITYTO = 'NEW YORK' )
          AND FLDATE BETWEEN '19990101' AND '19990331'.
    ENDSELECT.
    1.     Table operations should be done using explicit work areas rather than via header lines.
    2.     Always try to use binary search instead of linear search. But don’t forget to sort your internal table before that.
    3.     A dynamic key access is slower than a static one, since the key specification must be evaluated at runtime.
    4.     A binary search using secondary index takes considerably less time.
    5.     LOOP ... WHERE is faster than LOOP/CHECK because LOOP ... WHERE evaluates the specified condition internally.
    6.     Modifying selected components using “ MODIFY itab …TRANSPORTING f1 f2.. “ accelerates the task of updating  a line of an internal table.
    Point # 2
    READ TABLE ITAB INTO WA WITH KEY K = 'X‘ BINARY SEARCH.
    IS MUCH FASTER THAN USING
    READ TABLE ITAB INTO WA WITH KEY K = 'X'.
    If TAB has n entries, linear search runs in O( n ) time, whereas binary search takes only O( log2( n ) ).
    Point # 3
    READ TABLE ITAB INTO WA WITH KEY K = 'X'. IS FASTER THAN USING
    READ TABLE ITAB INTO WA WITH KEY (NAME) = 'X'.
    Point # 5
    LOOP AT ITAB INTO WA WHERE K = 'X'.
    ENDLOOP.
    The above code is much faster than using
    LOOP AT ITAB INTO WA.
      CHECK WA-K = 'X'.
    ENDLOOP.
    Point # 6
    WA-DATE = SY-DATUM.
    MODIFY ITAB FROM WA INDEX 1 TRANSPORTING DATE.
    The above code is more optimized as compared to
    WA-DATE = SY-DATUM.
    MODIFY ITAB FROM WA INDEX 1.
    7.     Accessing the table entries directly in a "LOOP ... ASSIGNING ..." accelerates the task of updating a set of lines of an internal table considerably
    8.    If collect semantics is required, it is always better to use to COLLECT rather than READ BINARY and then ADD.
    9.    "APPEND LINES OF itab1 TO itab2" accelerates the task of appending a table to another table considerably as compared to “ LOOP-APPEND-ENDLOOP.”
    10.   “DELETE ADJACENT DUPLICATES“ accelerates the task of deleting duplicate entries considerably as compared to “ READ-LOOP-DELETE-ENDLOOP”.
    11.   "DELETE itab FROM ... TO ..." accelerates the task of deleting a sequence of lines considerably as compared to “  DO -DELETE-ENDDO”.
    Point # 7
    Modifying selected components only makes the program faster as compared to Modifying all lines completely.
    e.g,
    LOOP AT ITAB ASSIGNING <WA>.
      I = SY-TABIX MOD 2.
      IF I = 0.
        <WA>-FLAG = 'X'.
      ENDIF.
    ENDLOOP.
    The above code works faster as compared to
    LOOP AT ITAB INTO WA.
      I = SY-TABIX MOD 2.
      IF I = 0.
        WA-FLAG = 'X'.
        MODIFY ITAB FROM WA.
      ENDIF.
    ENDLOOP.
    Point # 8
    LOOP AT ITAB1 INTO WA1.
      READ TABLE ITAB2 INTO WA2 WITH KEY K = WA1-K BINARY SEARCH.
      IF SY-SUBRC = 0.
        ADD: WA1-VAL1 TO WA2-VAL1,
             WA1-VAL2 TO WA2-VAL2.
        MODIFY ITAB2 FROM WA2 INDEX SY-TABIX TRANSPORTING VAL1 VAL2.
      ELSE.
        INSERT WA1 INTO ITAB2 INDEX SY-TABIX.
      ENDIF.
    ENDLOOP.
    The above code uses BINARY SEARCH for collect semantics. READ BINARY runs in O( log2(n) ) time. The above piece of code can be more optimized by
    LOOP AT ITAB1 INTO WA.
      COLLECT WA INTO ITAB2.
    ENDLOOP.
    SORT ITAB2 BY K.
    COLLECT, however, uses a hash algorithm and is therefore independent
    of the number of entries (i.e. O(1)) .
    Point # 9
    APPEND LINES OF ITAB1 TO ITAB2.
    This is more optimized as compared to
    LOOP AT ITAB1 INTO WA.
      APPEND WA TO ITAB2.
    ENDLOOP.
    Point # 10
    DELETE ADJACENT DUPLICATES FROM ITAB COMPARING K.
    This is much more optimized as compared to
    READ TABLE ITAB INDEX 1 INTO PREV_LINE.
    LOOP AT ITAB FROM 2 INTO WA.
      IF WA = PREV_LINE.
        DELETE ITAB.
      ELSE.
        PREV_LINE = WA.
      ENDIF.
    ENDLOOP.
    Point # 11
    DELETE ITAB FROM 450 TO 550.
    This is much more optimized as compared to
    DO 101 TIMES.
      DELETE ITAB INDEX 450.
    ENDDO.
    12.   Copying internal tables by using “ITAB2[ ] = ITAB1[ ]” as compared to “LOOP-APPEND-ENDLOOP”.
    13.   Specify the sort key as restrictively as possible to run the program faster.
    Point # 12
    ITAB2[] = ITAB1[].
    This is much more optimized as compared to
    REFRESH ITAB2.
    LOOP AT ITAB1 INTO WA.
      APPEND WA TO ITAB2.
    ENDLOOP.
    Point # 13
    “SORT ITAB BY K.” makes the program runs faster as compared to “SORT ITAB.”
    Internal Tables         contd…
    Hashed and Sorted tables
    1.     For single read access hashed tables are more optimized as compared to sorted tables.
    2.      For partial sequential access sorted tables are more optimized as compared to hashed tables
    Hashed And Sorted Tables
    Point # 1
    Consider the following example where HTAB is a hashed table and STAB is a sorted table
    DO 250 TIMES.
      N = 4 * SY-INDEX.
      READ TABLE HTAB INTO WA WITH TABLE KEY K = N.
      IF SY-SUBRC = 0.
      ENDIF.
    ENDDO.
    This runs faster for single read access as compared to the following same code for sorted table
    DO 250 TIMES.
      N = 4 * SY-INDEX.
      READ TABLE STAB INTO WA WITH TABLE KEY K = N.
      IF SY-SUBRC = 0.
      ENDIF.
    ENDDO.
    Point # 2
    Similarly for Partial Sequential access the STAB runs faster as compared to HTAB
    LOOP AT STAB INTO WA WHERE K = SUBKEY.
    ENDLOOP.
    This runs faster as compared to
    LOOP AT HTAB INTO WA WHERE K = SUBKEY.
    ENDLOOP.
    <b>REWARD IF USEFULL</b>

  • Use of LINE OF statement

    Hi all,
    what is the use of LINE OF statement?
    DATA:       itab_iv_item TYPE TABLE OF   bapi_incinv_create_item,
                     itab_return TYPE TABLE OF bapiret2.
    DATA:       wa_iv_item LIKE LINE OF itab_iv_item,
                     wa_return LIKE LINE OF itab_return.
    what these statements do
    DATA:       wa_iv_item LIKE LINE OF itab_iv_item,
                     wa_return LIKE LINE OF itab_return.
    Thanks in advance
    krupali.

    Hi KR.,
    1.
    types: begin of st1,
              <fields>
              end of st1.
    data: wa type st1.
    Here we are declaring the wa by using the syntax TYPE. because here we know the structre.
    2.
    data: wa type vbak.
    Here we are declaring the wa wrt Database Table so here we can use TYPE syntax again.
    3.
    data: begin of itab occurs 0,
                <fields>
                end of itab.
        data: wa like line of itab.
    Here we are declaring the wa wrt internal table which is having header line and body, so we can't use TYPE here, we must go for LIKE LINE OF syntax.
    4.
    data: itab like vbak occurs 0 with header line.
        data: wa like line of itab
           (or)
         data: wa type vbak.
    Hope it clear?
    Thanks,
    Naveen.I

  • How can I use an IF ELSE statement and the xdoxslt: get_variable together?

    First of all, I'm a big fan of this forum and I just want to thank the community for helping make the BI Publisher world a better place.
    I'm trying to populate a table with a years worth of data with the column=PRODUCT and row=month of DATE. Here's the catch, not all of the months will have data. So here's where my problem is, I'm not able to use an IF ELSE statement along with a XDOXSLT:GET_VARIABLE expression so that if there's no data for that month the default value will be 0.
    Can someone help me find a solution to either one of the attempts below or a completely new method? Thanks!
    BP4 = numeric month value using DATE (more code to pull only month from DATE not included here)
    JAN1 = PRICE if data exists, else 0
    1) I tried this and it didn't work:
    <?if: xdoxslt:get_variable($_XDOCTX,'BP4'),01 then xdoxslt:set_variable($_XDOCTX, 'JAN1',PRICE) else xdoxslt:set_variable($_XDOCTX, 'JAN1',0) end if?>
    <?xdoxslt:get_variable($_XDOCTX,'JAN1')?>
    <?end if?>
    2) I tried this and it didn't work:
    <?xdoxslt:ifelse(xdoxslt:get_variable($_XDOCTX,'BP4')='01',xdoxslt:set_variable($_XDOCTX, 'JAN1',PRICE),xdoxslt:set_variable($_XDOCTX, 'JAN1',0))?>
    <?xdoxslt:get_variable($_XDOCTX,'JAN1')?>
    <?end if?>
    3) I tried this and it didn't work:
    <?xdofx:if xdoxslt:get_variable($_XDOCTX,'BP4')='01' then xdoxslt:set_variable($_XDOCTX, 'JAN1',PRICE) else xdoxslt:set_variable($_XDOCTX, 'JAN1',0) end if?>
    <?xdoxslt:get_variable($_XDOCTX,'JAN1')?>
    <?end if?>
    sample XML:
    <ROW>
    <Name>Craig Hernandez</NAME>
    <DATE>2013-01-01T00:00:00.000+08:00</DATE>
    <PRICE>31</PRICE>
    <PRODUCT>BPD</PRODUCT>
    </ROW>
    -DrT
    Edited by: 990965 on Feb 28, 2013 8:27 AM

    let me clarify my logic, the template 1) searches for the relevant PRODUCT (in the case below, it searches for BPD which is the column in the table) 2) searches for the relevant month in DATE (which is the row in the table) 3) if data exists, get PRICE else default to 0
    Variable definitions:
    BP4 = numeric month value from DATE (more code to get this value not included here, but it works...)
    JAN1 = set to PRICE if data exists for that month, else 0
    the query is only pulling all of the existing data, so if there's no data for March then there wouldn't be a March entry in the xml. In the sample xml below, we only have data for the first two months (Jan, Feb) so that's the only data in the xml. I can't check if PRICE is null because the xml will not have any data for March.
    I've read through other threads and it seems that BI Publisher can't use an IF THEN ELSE with the XDOXSLT:GET_VARIABLE. I sent the template and xml to you.
    Sample XML:
    <ROW>
    <Name>Craig Hernandez</NAME>
    <DATE>2013-01-01T00:00:00.000+08:00</DATE>
    <PRICE>31</PRICE>
    <PRODUCT>BPD</PRODUCT>
    </ROW>
    <ROW>
    <Name>Craig Hernandez</NAME>
    <DATE>2013-02-01T00:00:00.000+08:00</DATE>
    <PRICE>30</PRICE>
    <PRODUCT>BPD</PRODUCT>
    </ROW>
    Edited by: 990965 on Feb 28, 2013 8:30 AM

  • I want to upgrade to CS6 Production Premium suite from CS5.5.  Can I use CS6 upgrade made for CS5, or do I have to use upgrade that specifically states for CS5.5.

    I want to upgrade to CS6 Production Premium suite from CS5.5.  Can I use CS6 upgrade made for CS5, or do I have to use upgrade that specifically states for CS5.5.
    I am referring to the DVD installation Disks not Cloud.  Disk last release, I believe in 2012.
    Thank you.

    at the link i posted i see an upgrade for cs5 and cs5.5.
    you can contact adobe support if you don't see that.
    contact adobe support by clicking here and, when available, click 'still need help', https://helpx.adobe.com/contact.html

  • M or P master data table  to be used in routine read statement

    Hi
      I update of a DSO i had a requirment for a routine to get the Attribute of a Infoobject.
      So which master data table  M or P table i need to use in my read statement and why
    Thanks

    Use M table as it it the view on time dependent(P table) and time independent(Q table) tables.
    M table is view on time dependent and time independent attributes, you can see characteristic values and all the attributes for the Characteristic.
    The tables that go in the view are the Master Data Table and the Time-Dependent Master Data Table. If the characteristic only has time-dependent attributes, only the time-dependent master data table goes in. If the characteristic has only non-time-dependent attributes, only the master data table goes in.

  • The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements.

    Hello All,
    I am getting below error can you please help me
    Error:-
    The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements.

    Perhaps this thread will help you out
    http://stackoverflow.com/questions/11453066/error-the-transaction-associated-with-the-current-connection-has-completed-but
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • Using procedure in SELECT statement

    I have a select statement that currently uses 4 functions to receive necessary values. All the functions are recursive and returns values from the same row.
    What I would like to do is replace these for function calls with 1 procedure. Does anybody know if it possible to use a procedure in this way inside a select statement?
    If so, do you have the syntax for doing this?
    E.g
    SELECT
    Mdbrd_Pkg.calculate_fixed_charge_fn(in_rc_id, ap.CONFIGSET_ID) AS FIXED_CHARGE,
    Mdbrd_Pkg.calculate_charge_rate_fn(in_rc_id, ap.CONFIGSET_ID) AS CHARGE_RATE,
    Mdbrd_Pkg.tax_liable_fn(in_rc_id, ap.CONFIGSET_ID) AS TAX_LIABLE,
    Mdbrd_Pkg.charge_unit_fn( in_rc_id, ap.CONFIGSET_ID) AS CHARGEUNIT_ID
    FROM .....

    This cannot be done. The part of the function used in the SELECT statement is the return value: procedures don't have return values (that's what makes tham procedures and not functions).
    Obviously I don't know what your code does, but you should consider putting them into a single function that returns a TYPE with four attributes and then using the TABLE() function to cast them into something you could reference in the FROM clause of a correlated sub-query. Sounds a bit messy though.
    Do these functions actually select data? Where does the recursion fit in?
    Cheers, APC

  • Using alias in where statement

    simple sql:
    SELECT EMPLOYEE_ID,
    FIRST_NAME,
    LAST_NAME,
    EMAIL,
    PHONE_NUMBER,
    HIRE_DATE,
    JOB_ID,
    SALARY,
    COMMISSION_PCT,
    MANAGER_ID,
    DEPARTMENT_ID
    FROM EMPLOYEES
    WHERE EMPLOYEE_ID > 1000;
    is it somehow possible to use alias in where statement like
    SELECT EMPLOYEE_ID "ID",
    FIRST_NAME,
    LAST_NAME,
    EMAIL,
    PHONE_NUMBER,
    HIRE_DATE,
    JOB_ID,
    SALARY,
    COMMISSION_PCT,
    MANAGER_ID,
    DEPARTMENT_ID
    FROM EMPLOYEES
    WHERE "ID" > 1000;

    Hi,
    is it somehow possible to use alias in where statement likeWhy do you need it?
    To answer your question "Not directly"
    SQL> select empno eno, sal
      2  from emp
      3  where eno = 7900;
    where eno = 7900
    ERROR at line 3:
    ORA-00904: "ENO": invalid identifierColumn Alias are names given to give meaningful names to columns or the arithmetic operations' column.
    Twinkle

  • Using offset in join statement

    hi,
    i wanted to use offset in join statement. but it is giving error.
    select a~kunnr
              a~vkorg
             from knvv as inner join zcust
             on knvv-kunnr+5(5) = zcust-refid.

    hi neha,
    try this code i tested it.
    types: begin of ty_knvv,
           INCLUDE type knvv,
           kunid type i, " For u type is zcust-refid
           end of ty_knvv.
    data: it_knvv type STANDARD TABLE OF ty_knvv INITIAL SIZE 0,
          wa_knvv type ty_knvv.
    select *
      from knvv
        into table it_knvv.
    loop at it_knvv into wa_knvv.
      kunid = wa_knvv-kunnr+5(5).
      wa_knvv-kunid = kunid.
      MOdify it_knvv TRANSPORTING kunid.
      read table zcust into wa_zcust with key resid = wa_knvv-kunid.
    endloop.

Maybe you are looking for

  • Use of Orders05 Interface mapping & XSLT mapping file for Orders03 IDOC

    Hello Experts, In a scenario we are sending Purchase orders and Purhase Order change from SAP to SNC through XI. Currently Orders03 IDoc is used and standard mapping for Orders03 XSLT is used. Now the requirement is to use the same IDOC (Orders03) bu

  • ITunes runs okay after fresh install, but freezes when I go to the store, or automatic download begins

    I posted the other evening about installing iTunes and then using a Library on a drive other than 'C.' I got this to work, used the old library file, iTunes creates a new one, freezes for a bit, and everything in those folders displays fine. Once iTu

  • Page Displays Different in Firefox

    I am new to web site development and new to Dreamweaver.  When I display the webpage in FireFox 3.6.3, the header picture shows below the logo on the left.  It displays fine in IE.  BTW, the font choice is not mine I tried to talk the person out of i

  • Userexit asking for access key in CMOD

    Hi Experts, I am trying to write source code for an user exit in CMOD by creating a project and assigning enhancement to it. When i click on user exit and press change it asks for access key . Can you please tell me if there is any other way to write

  • Compile to exe

    i know that compiling java to native machine code is not in line with the write once, run all over the place philosophy, however, i like to play. has anyone done this? i've looked into GNU gcj, but the installation is too complex. is there an EASY wa