Date selection in query : logic needed!

Hi,
we have one calendar day depending on which the query result is displayed!
Now the requirement is such that when user enters one date the query has to generate the result for the multiple date ranges including the one which he has entered.
example: if user has entered 15/9/2007 then query should not only display the result of the date 15/9/2007 but also the results of  -5 to +2 ( means 10/9,11/9,12/9,13/9 and 14/9 plus 16/9 and 17/9 )
simlarly other ranges like -8 to + 7 and so on
How to define this in query?
Thanks,
Ravi

Hello ,
I need to make a graph conveying the information of the deliveries by comparing the goods issue date and promised date !
report also requires how many deliveries were on time, how many were late and how many were early!
for this requirement, i had thought of making a date selection field which is promised date and make furthur more date ranges selections by query it self so that late deliveries and early deliveries also covered in these date ranges.
-5 to + 2 is that one range which is on time delivery range
if the delivery is more eally than the -5 days then it is early delivery. even in ealry delivery i want to make how early it is.
and suppose the delivery has crossed the promised date 2 days more then it is late delivery.
all has to be acheived by single date selection and there after the logic which takes care of all the date ranges i had explained.
i am looking for that logic which i am not finding
Hope this is clear now
Thanks,
Ravi

Similar Messages

  • Date selection in query

    Hi All,
                  I am getting error while executing one query in Bex.
    the error message is SYST:Date 11.00.2008 not expected(after that I was thrown out of the system)
    Date selection is handled by a variable on  Fiscal Year / Period called Bespoke Fiscal Period . Not really sure how that variable works - and as far as I'm aware, selects the period by referencing the system date ie: if the system date is within January it will select December as the period (so the user always sees data for  the previous completed month).
    Made a couple of crude tests with pretty basic queries and I found that those using that variable fail, whereas typing in 012.2007, 001.2008 at run time will work.   Any thoughts on why the variable stopped working ?  Conflicts with the 2008 calendar maybe ? 
    Thanks in advance,
    Supriya

    Hi Supriya,
    Logically thinking ur requirement is to select the previous month as per the current system date. For that they may be hard coded like taking the current month number and subtracting one from that value. I mean to say as the current month is 01 and might be hard code says 01 minus 1 which will result in 00. This might be the reason for this. Find out the code and check it . if it is so change the code.
    Fine if it helps.
    Thanks
    k

  • Looping Query logic Needed

    Hi Team
    I have requirement below , can you please help me with sql logic
    My input table is below
    INC_NUM
    FA_ADD
    HZ_ADD
    PARENT_INC_NUM
    ID
    A0001
    A
    A
    A0001-02
    A
    A
    A0001
    1
    A0001-04
    B
    C
    A0001
    1
    A0001-05
    B
    C
    A0001
    1
    A0001-09
    B
    S
    A0001
    1
    A0001-07
    D
    A
    A0001
    1
    B0001
    J
    K
    B0001-03
    L
    M
    B0001
    2
    B0001-04
    J
    K
    B0001
    2
    B0001-05
    A
    B
    B0001
    2
    B0001-06
    A
    B
    B0001
    2
    B0001-07
    A
    B
    B0001
    2
    C0001-02
    A
    B
    C0001-03
    A
    C
    C0001-02
    3
    C0001-05
    A
    B
    C0001-02
    3
    My output
    INC_NUM
    FA_ADD
    HZ_ADD
    PARENT_INC_NUM
    A0001
    A
    A
    A0001-02
    A
    A
    A0001
    A0001-04
    B
    C
    A0001-05
    B
    C
    A0001-09
    B
    S
    A0001-07
    D
    A
    B0001
    J
    K
    B0001-03
    L
    M
    B0001-04
    J
    K
    B0001
    B0001-05
    A
    B
    B0001-06
    A
    B
    B0001-07
    A
    B
    C0001-02
    A
    B
    C0001-03
    A
    C
    C0001-05
    A
    B
    C0001-02
    Here i n considering  null values of parent_inc_num or null values of ID as Parent record  ID
    And i m comparing this record  FA_ADD and HZ_ADD with its child records FA_ADD and HZ_ADD ,If they matches then i m assigning Parent_INC_NUM else null
    Let me take example of record C0001-02, it has null values of PARENT_INC_NUM (or null for ID)
    So C0001-02 is considered as base record ,
    Now i m comparing FA_ADD and HZ_ADD values of C0001-02 with its child records FA_ADD and HZ-ADD (ie C0001-03,C0001-05 )
    C0001-03 doesnt match so i m assigning null in target else i m assigning its base record ie C0001-02
    Below is table sample data
    could you please help
    with t as
    (select 'A0001' as INC_NUM,'A' as FA_ADD,'A' as HZ_ADD ,null as PARENT_INC_NUM ,null as ID from dual
    union all
    select 'A0001-02' as INC_NUM,'A' as FA_ADD,'A' as HZ_ADD ,'A0001' as PARENT_INC_NUM ,1 as ID from dual
    union all
    select 'A0001-04' as INC_NUM,'B' as FA_ADD,'C' as HZ_ADD ,'A0001' as PARENT_INC_NUM ,1 as ID from dual
    union all
    select 'A0001-05' as INC_NUM,'B' as FA_ADD,'C' as HZ_ADD ,'A0001' as PARENT_INC_NUM , 1 as ID from dual
    union all
    select 'A0001-09' as INC_NUM,'B' as FA_ADD,'S' as HZ_ADD ,'A0001' as PARENT_INC_NUM,1 as ID from dual
    union all
    select 'A0001-07' as INC_NUM,'D' as FA_ADD,'A' as HZ_ADD ,'A0001' as PARENT_INC_NUM,1 as ID from dual
    union all
    select 'B0001' as INC_NUM,'J' as FA_ADD,'K' as HZ_ADD ,null as PARENT_INC_NUM , null as ID from dual
    union all
    select 'B0001-03' as INC_NUM,'L' as FA_ADD,'M' as HZ_ADD ,'B0001' as PARENT_INC_NUM,2 as ID from dual
    union all
    select 'B0001-04' as INC_NUM,'J' as FA_ADD,'K' as HZ_ADD ,'B0001' as PARENT_INC_NUM ,2 as ID from dual
    union all
    select 'B0001-05' as INC_NUM,'A' as FA_ADD,'B' as HZ_ADD ,'B0001' as PARENT_INC_NUM,2 as ID from dual
    union all
    select 'B0001-06' as INC_NUM,'A' as FA_ADD,'B' as HZ_ADD ,'B0001' as PARENT_INC_NUM,2 as ID from dual
    union all
    select 'B0001-07' as INC_NUM,'A' as FA_ADD,'B' as HZ_ADD ,'B0001' as PARENT_INC_NUM,2 as ID  from dual
    union all
    select 'C0001-02' ,'A','B',null,null from dual
    union all
    select 'C0001-03','A','C','C0001-02',3 from dual
    union all
    select 'C0001-05','A','B','C0001-02',3 from dual
    select * from t
    I have 100 thousands of records of this  data ,so need to take care of performance as well
    Thank you
    Sumanth

    with t as
    (select 'A0001' INC_NUM,'A' FA_ADD,'A' HZ_ADD ,null as PARENT_INC_NUM ,null as ID from dual union all
    select 'A0001-02','A','A','A0001',1 from dual union all
    select 'A0001-04','B','C','A0001',1 from dual union all
    select 'A0001-05','B','C','A0001',1 from dual  union all
    select 'A0001-09','B','S','A0001',1 from dual union all
    select 'A0001-07','D','A','A0001',1 from dual union all
    select 'B0001','J','K',null,null from dual union all
    select 'B0001-03','L','M','B0001',2 from dual union all
    select 'B0001-04','J','K','B0001',2 from dual union all
    select 'B0001-05','A','B','B0001',2 from dual union all
    select 'B0001-06','A','B','B0001',2 from dual union all
    select 'B0001-07','A','B','B0001',2 from dual union all
    select 'C0001-03' ,'A','B',null,null from dual union all
    select 'C0001-02','A','C','C0001-03',3 from dual union all
    select 'C0001-05','A','B','C0001-03',3 from dual union all
    select 'C0001-06','A','B','C0001-03',3 from dual
    select INC_NUM,FA_ADD,HZ_ADD,
           case when fa_add = connect_by_root fa_add
                 and hz_add = connect_by_root hz_add
                then parent_inc_num
           end parent_inc_num
      from t
    start with parent_inc_num is null
    connect by prior inc_num = parent_inc_num
    INC_NUM
    FA_ADD
    HZ_ADD
    PARENT_INC_NUM
    A0001
    A
    A
    A0001-02
    A
    A
    A0001
    A0001-04
    B
    C
    A0001-05
    B
    C
    A0001-07
    D
    A
    A0001-09
    B
    S
    B0001
    J
    K
    B0001-03
    L
    M
    B0001-04
    J
    K
    B0001
    B0001-05
    A
    B
    B0001-06
    A
    B
    B0001-07
    A
    B
    C0001-03
    A
    B
    C0001-02
    A
    C
    C0001-05
    A
    B
    C0001-03
    C0001-06
    A
    B
    C0001-03
    Regards
    Etbin

  • Can we have a if condition during data selection in Query Report (SQ02)

    Hi all,
    I have a required where in need to create a query report , where in which there are two types of condition exists.
    first i input either functional location into View V_EQUI , when there is a equipment BOM exists(or when there is any entry for Equipment feild exists )  then the selected euipment should be passed to EQST else if equipment doesnot exist then the Functional location should be passed to TPST.
    Now that I created a query report with base table as V_EQUI and joined it with EQST and whenever the equipment feild has a entry , it passes the equipment to EQST and works fine.
    Now for some Functional location there is no equipment feild that exists for these base table is V_EQUI now when there is no entry for equipment , the functional location should be passed to TPST.
    Now I would I achieve that.
    Can I put a if condition to check on if equipment is initial then select X Y Z from tpst where fl = v_equi-fl.
    Regards,
    Raj

    x

  • Date Data Selection in Query Builder using Hyperion JDBC Driver

    Hi,
    I am trying to filter out data prior to a specific request date on Query Builder. I have tried :
    and SALES_ORDER_FACT.REQ_DT < sysdate()
    I have also tried {$SYSDATE()-1$} , {$SYSDATE()$}, SYSDATE and SYSDATE()
    Any assistance will be appreciated.

    Is this related to Oracle BI Publisher?
    You should be able just to edit the query correctly in the text - you ddon't need to use the SQL query builder.
    The query is passed through so in general you should use the syntax of HJyperion.
    {} has a special (I think undocumented) meaning in BI Publisher so {} could potnetially cause problems.
    Klaus

  • Validae date selection

    Hi :
    In my application i generate date picker dynamically based on some condition
    i enter the data using the date picker but there is some validation like End date must not be less then the start date as i select the end date if it is lesser then the start date a pop up message must be diaplay how to do that i tryed to include the javascript in the query but its not working please suggest how to do this
    SELECT
    HTMLDB_ITEM.DATE_POPUP(2,1,rownum,''dd-mon-yyyy'',10) "Baseline Start Date",
    HTMLDB_ITEM.DATE_POPUP(3,rownum,null,''dd-mon-yyyy'',10) "Baseline End Date"
    FROM DUAL
    please suggest how to validate this
    thanks
    sudhir

    Hi :
    The code which you gave me didnt work, i need date comparision to happen with two pickers using html_db colleciton
    select
    HTMLDB_ITEM.DATE_POPUP(2,1,null,''dd-mon-yyyy'',10) "start",
    HTMLDB_ITEM.DATE_POPUP(2,1,null,''dd-mon-yyyy'',10) "end"
    from dual
    if end date is lesser then the start data when we select it must show a alert msg saying date selection is invalide this need to be done using javascript i think or if we can do it by creating a process how to do this can you suggest
    thanks
    sudhir

  • Cube to Cube "Error in data Selection" plz help

    Hi this is Ajay Reddy
    when am sending data from Cube to Cube am getting an error
    "Error in data Selection" plz help

    Hi,
    It needs a Note implementaion. I got similar problem in version BIW 7 and SP 11. We got the solution with on of the note . I am not able to recollect the note number.
    Any way check the notes 920971,155471 may help you or not.
    With rgds,
    Anil Kumar Sharma .P

  • Logic needed in query

    Hi all
    i have a table with columns
    SUN MON TUE WED THU FRI SAT
    Y................ ........Y..................
    i need to selected the column SUN which is Sunday,
    along with this i need to select the columns MON,TUE
    THU is having value so i don't needed that
    if i select WED then i needed THU, FRI, SAT also
    can u pls help on this.
    Edited by: 881121 on Apr 5, 2013 11:13 PM

    user648773 wrote:
    You need to return the name of days? or you need to return the values of the colum?
    You have onley two cases? or could be more? could you describe the logic in general?
    one query always return the same number of colums. So, in your case you should return one column and concatenate the values as you need.
    here is an example with concatenate, and return the correspondig values:
    select out
    from
    select case
    when SUN = 'Y' THEN SUN||MON||TUE
    WHEN WED = 'Y' THEN WED||THU||FRI
    END out
    from table
    here is an example that return the name of days:
    select out
    from
    select case
    when SUN = 'Y' THEN 'SUN,MON,TUE'
    WHEN WED = 'Y' THEN 'WED, THU, FRI'
    END out
    from table
    May be you could do these things to describe us what you need:
    - make a desc of you table to know the structure.
    - describe each case with an imput and it corresponding outpu.Maybe everything would be easy if you would post:
    1) CREATE TABLE and INSERT statement
    2) Expected output.
    You question is vague and not clear. Please read SQL and PL/SQL FAQ
    This will avoid people here trying to guess what you are trying to say.
    Also keep in mind: when you put some code or output please enclose it between two lines starting with {noformat}{noformat}
    i.e.:
    {noformat}{noformat}
    SELECT ...
    {noformat}{noformat}
    Regards.
    Al
    Edited by: Alberto Faenza on Apr 8, 2013 2:09 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Date Range Selection in Query Templates

    Hi,
    Can someone please tell me how to use <b>Date Range Selection</b> Tab details in SQL Query and TAG Query (Using Examples).
    Thanks in advance
    Muzammil P.T

    >>>>>>>>>>
    Re: Date Range Selection in Query Templates   
    Posted: Feb 15, 2007 6:43 AM    in response to: Muzammil Ahamed       Reply      E-mail this post 
    Hi Muzammil,
    In data range section you can have multiple options like setting start datetime and end datetime.. And you can set the shift (or) time period and also the format of the time periods.
    Primarily we use the start date and end date querying to fetch data between two time labels. I can explain this one with example..
    You have batch production table with columns Production Time, Batch Id, Production Qty. Then you want all the details between the 02/02/2007 to 05/02/2007.
    Solution :
    1.Map 02/02/2007 with Start date.
    2.Map 05/02/2007 with end dare.
    Now these two become the variables [SD] and [ED].
    Now you have mentioned the date range, but you need to mention for which column these things to be applied. For that
    3.In Query tab enter Production Time column name in Date column at the bottom.
    Now you have written query like Select * from batch prodcution where production time > 02/02/2007 and production time < 05/02/2007.
    4. Even those values you mapped (SD and ED) you can change from the front page through Java script.
    Like wise you have so many other advantages also.
    If you have any other specific doubt let me know.
    Thanks,
    Rajesh.
    PS : Please ward points if answer is useful. <<<<<<<<
    Message was edited by:
            David Dreyer

  • Logic needed for the following data

    Hi All,
    I have procedure in that I am calling a cursor to fetch the records. This query is returning the following data
    DI
    SZ
    DII
    CWT
    Top
    down
    9 1/2
    9.625
    8.921
    36
    18
    1602
    13 1/2
    13.375
    12.515
    61
    19
    1962
    18 1/2
    18.625
    17.755
    87.5
    20
    503
    26
    26
    24.75
    105
    20
    103
    9 1/2
    9.625
    8.835
    40
    1602
    3858
    7
    7
    6.276
    26
    1683
    6352
    I want to  print just these values ..
    9 1/2
    9.625
    8.921
    36
    18
    1602
    9 1/2
    9.625
    8.835
    40
    1602
    3858
    7
    7
    6.276
    26
    1683
    6352
    As you can see in these values top and down are overlapping.
    I tried several ways to sort the query on the fields and have some logic, but I am always getting one row extra which is not overlapping.
    Can someone please give me the logic to get the desired result through conditions in Procedure/function/package
    Thanks

    BrendanP wrote:
    26    AND t.top
    "AND t.top....."... what?
    Here's another solution, giving the least overlap over the greatest distance...
    SQL> ed
    Wrote file afiedt.buf
      1  with data as (select 1 id , 18 top, 1602 down from dual union all
      2                select 2,19, 1962 from dual union all
      3                select 3,20, 503 from dual union all
      4                select 4,20, 103 from dual union all
      5                select 5,1602, 3858 from dual union all
      6                select 6,1683, 6352 from dual
      7               )
      8  -- -------------------------------------------------------
      9  -- END OF TEST DATA JUST USE QUERY BELOW AGAINST OWN TABLE
    10  -- -------------------------------------------------------
    11      ,idealpath as (
    12         select id, path, idpath
    13         from (
    14               select id, path, idpath, cmlt_diff, min_diff, cvrg, max_cvrg
    15               from  (
    16                      select x.id
    17                           ,x.path
    18                           ,idpath
    19                           ,to_number(y.column_value) as cmlt_diff
    20                           ,min(to_number(y.column_value)) over (partition by cvrg) as min_diff
    21                           ,cvrg
    22                           ,max(cvrg) over () as max_cvrg
    23                     from (
    24                           select connect_by_root(id) as id
    25                                 ,down-connect_by_root(top) as cvrg
    26                                 ,ltrim(sys_connect_by_path(prior down-top,'+'),'+') as cmlt_diff
    27                                 ,ltrim(sys_connect_by_path(top||'-'||down,':'),':') as path
    28                                 ,ltrim(sys_connect_by_path(id,':'),':') as idpath
    29                           from   data
    30                           where connect_by_isleaf = 1
    31                           connect by nocycle top between prior top and prior down
    32                                      and not down between prior top and prior down
    33                          ) x
    34                          ,xmltable(nvl(cmlt_diff,'0')) y
    35                    )
    36               where cvrg = max_cvrg
    37              )
    38         where cmlt_diff = min_diff
    39        )
    40  --
    41  select d.id, d.top, d.down
    42  from   data d
    43        ,(select level l, to_number(regexp_substr(idpath,'[^:]+',1,level)) as id
    44          from   idealpath
    45          connect by regexp_substr(idpath,'[^:]+',1,level) is not null) bp
    46  where  bp.id = d.id
    47* order by bp.l
    SQL> /
            ID        TOP       DOWN
             1         18       1602
             2         19       1962
             6       1683       6352

  • Need a single point of view on date selections for Delta and Full load IP's

    Hi Experts,
    Every year we are facing issues on date selections for data extraction, for example the Delta or Full selections for particular IP is like 2005 to 2008 , in this situation, for the year 2009, this IP is picking 0 records as the selections are upto 2008 only.
    My requirement is, I need to check the selections of all the IP's in the system and want to change on need base if the selections are getting expired instead of going and checking manually to each and every IP as the system is having around 3000 IP's, which is a tedious job.
    Guys, please let us know if there exits a Table/Program or any other way to check it.
    Inputs appreciated.
    Regards
    Nandu

    Hi
    Persistent through module RSSM_SHIP_PSEUDO_DVERSION_WRI
    Primary table RSLDPIOSH
    RSLDPIO Links datasource to infopackages
    RSLDPIOT InfoPackage Text Description
    RSLDPRULE ABAP source code for InfoPackages
    RSLDPSEL Hardcoded selections in InfoPackages
    RSMONICDP Contains the request-id number by data target
    RSPAKPOS List of InfoPackage Groups / InfoPackages
    http://help.sap.com/saphelp_nw70/helpdata/en/2e/20d704d45be7458582cdfcc5487090/frameset.htm
    Hope it helps

  • How to select data in one query ?

    I have a table "My_Table" with the data like below -
    order_seq      |ONE_CODE      |TWO_CODE     | ONE_VAL     | TWO_VAL
    1          |ABC          |DDD          |1100          |1900
    2          |PQR          |TTT          |5000          |3000
    3          |PQR          |JJJ          |5000          |2000
    4          |DEF          |CCC          |500          |4500
    5          |LMN          |CCC          |4000          |4500
    6          |ABC          |CCC          |1100          |4500I want to add 3 more columns along with modifying the ONE_VAL and TWO_VAL columns, which will show the resultset like below -
    ONE_REMINDER will show value 0 if TWO_VAL < ONE_VAL otherwise will show (ONE_VAL - TWO_VAL)
    TWO_REMINDER will show value 0 if TWO_VAL > ONE_VAL otherwise will show ABS(ONE_VAL - TWO_VAL)
    ONE_VAL will show value lag(ONE_REMINDER) order by ONE_CODE, order_seq
    TWO_VAL will show value lag(TWO_REMINDER) order by TWO_CODE, order_seq
    LEAST column will show the least value in between ONE_VAL and TWO_VAL
    order_seq      |ONE_CODE      |TWO_CODE     | ONE_VAL     | TWO_VAL      |LEAST     |ONE_REMINDER |     TWO_REMINDER
    1          |ABC          |DDD          |1100          |1900          |1100          |0          |800
    2          |PQR          |TTT          |5000          |3000          |3000          |2000          |0
    3          |PQR          |JJJ          |5000          |2000          |2000          |0          |0
    4          |DEF          |CCC          |500          |4600          |500          |0          |4100
    5          |LMN          |CCC          |4000          |4100          |4000          |0          |100
    6          |ABC          |CCC          |0          |100          |0          |0          |100Can someone please help ?
    Edited by: userP5 on Jul 19, 2010 7:08 PM

    Not tested, don't have your tables and don't feel like constructing them based on your sample data :)
    SELECT
       order_seq,
       one_code,
       two_code,
       ONE_REMINDER,
       TWO_REMINDER,
       lag(one_reminder) over (order by one_code, order_seq) AS ONE_VAL,
       lag(two_reminder) over (order by one_code, order_seq) AS TWO_VAL,
       LEAST_VAL
    FROM
       SELECT
          order_seq,
          one_code,
          two_code,
          CASE WHEN TWO_VAL < ONE_VAL THEN 0 ELSE ONE_VAL - TWO_VAL END        AS ONE_REMINDER,
          CASE WHEN TWO_VAL > ONE_VAL THEN 0 ELSE ABS(ONE_VAL - TWO_VAL) END   AS TWO_REMINDER,
          LEAST(ONE_VAL, TWO_VAL)                                              AS LEAST_VAL
       FROM
          SOME_MYTHICAL_TABLE
    );Would be the basic idea, adapt as needed.

  • Need help in Data selection in Smartforms

    Hi All,
    this data selection is for displaying data in smartforms.
    I have a internal table passed on to the Smartforms where i have the Main item and its batches.
    posnr text
    10 line text1
    90004
    90005
    20 line text2
    90006
    90007
    And in the coding i have made the posnr for batches as 00000 for someother purpose.
    now i need to display a text after an item and its batches.
    like :
    Item Prodcode description Qty uom Picked Factor
    batchNo batch qty reel size to ship qty
    10 19501 material description 200 M 0 3
    Batch1 200 482448
    Batch2 200 482448
    Special instructions :
    i used the following code in the Smartforms to display the Text.
                                                                                    V_SPL = 'Special Line Instructions:'.
    V_INDEX1 = V_INDEX + 1.
    CLEAR IT_FINAL.
    READ TABLE IT_FINAL INDEX V_INDEX1.
    CLEAR V_INDEX1.
    IF IT_FINAL-POSNR > 0.
       CLEAR IT_FINAL.
       READ TABLE IT_FINAL INDEX V_INDEX.
       V_INDEX1 = '9999'.
                                                                                    V_ITEMTEXT = IT_FINAL-ITEMTEXT.
    V_PACKTEXT = IT_FINAL-PACKTEXT.
    ENDIF.
    V_INDEX = V_INDEX + 1.
    DESCRIBE TABLE IT_FINAL LINES V_LINE.
    IF V_INDEX > V_LINE.
       V_INDEX1 = '9999'.
    its ok now if the data in the internal table is like this without any batches.
    10
    20
    30
    if the data in the internal table is like :
    posnr text
    10 line text1
    0000
    0000
    0000
    20 line text2
    0000
    0000
    30 line text3
    0000
    it is not getting the data for the text.
    Actually in the code i have written to read the next record in the internal table and if it is greater than 0, i will write the TEXT before writing the next item.
    But if the next record is 0000, how to code it.
    and the main this is , the text has to be written only after writing the item and its batches.
    please tell me how to do this.
    Waiting for your replies.
    Vikki.

    Hi,
    Just use the internal table to print the data in main window.
    for first line which has not batchspitted(main line item) put condition as POSNR NE INITIAL.
    and for batch split items, you already made posnr as '0000',
    so put condition as POSNR eq INITIAL.
    I think this will solve your problem.
    Regards,
    S Raju.

  • Trouble in data selection logic

    Hi All,
    I am hitting 4 tables for selecting some data using inner join. There are three user
    input fields which if filled, has to take part in data selection. These three input fields are independent of each other.
    so while writing select query, how can i take care of all the possiblilities(none of them filled -- every one of them filled ) in the
    most efficient way..?
    Thanks
    -pranati

    Hi,
    IN the select-options you can add NO-EXTENSION NO INTERVALS..Which can be used a parameter..And you have to use IN in the select statement to filter the data..
    Check this example
    TABLES: marc.
    <b>SELECT-OPTIONS: so_matnr FOR marc-matnr NO-EXTENSION NO INTERVALS.
    SELECT-OPTIONS: so_werks FOR marc-werks NO-EXTENSION NO INTERVALS.</b>
    DATA: t_marc TYPE STANDARD TABLE OF marc.
    START-OF-SELECTION.
    Get the first 100 rows.
      SELECT mandt matnr werks UP TO 100 ROWS
             INTO TABLE t_marc
             FROM marc
    <b>         WHERE matnr IN so_matnr
             AND   werks IN so_werks</b>.
      IF sy-subrc = 0.
        WRITE: / 'RECORD COUNT - ', sy-dbcnt.
      ELSE.
        WRITE: / 'NO RECORD FOUND'.
      ENDIF.
    Thanks,
    Naren

  • Need help in data selection

    Hi All,
    this data selection is for displaying data in smartforms.
    I have a internal table passed on to the Smartforms where i have the Main item and its batches.
    posnr        text
    10            line text1               
    90004
    90005
    20           line text2
    90006
    90007
    And in the coding i have made the posnr for batches as 00000 for someother purpose.
    now i need to display a text after an item and its batches.
    like :
    Item    Prodcode           description                   Qty  uom     Picked   Factor
                batchNo           batch qty   reel size        to ship              qty
    10         19501            material description            200       M         0          3
                Batch1     200               482448
                Batch2     200               482448
    Special instructions :
    i used the following code in the Smartforms to display the Text.
    V_SPL = 'Special Line Instructions:'.
    V_INDEX1 = V_INDEX + 1.
    CLEAR IT_FINAL.
    READ TABLE IT_FINAL INDEX V_INDEX1.
    CLEAR V_INDEX1.
    IF IT_FINAL-POSNR > 0.
       CLEAR IT_FINAL.
       READ TABLE IT_FINAL INDEX V_INDEX.
       V_INDEX1 = '9999'.
                                                                                    V_ITEMTEXT = IT_FINAL-ITEMTEXT.
    V_PACKTEXT = IT_FINAL-PACKTEXT.
    ENDIF.
    V_INDEX = V_INDEX + 1.
    DESCRIBE TABLE IT_FINAL LINES V_LINE.
    IF V_INDEX > V_LINE.
       V_INDEX1 = '9999'.
    its ok now if the data in the internal table is like this without any batches.
    10
    20
    30
    if the data in the internal table is like :
    posnr         text
    10            line text1
    0000
    0000
    0000
    20            line text2
    0000
    0000
    30            line text3
    0000
    it is not getting the data for the text.
    Actually in the code i have written to read the next record in the internal table and if it is greater than 0, i will write the TEXT before writing the next item.
    But if the next record is 0000, how to code it.
    and the main this is , the text has to be written only after writing the item and its batches.
    please tell me how to do this.
    Waiting for your replies.
    Vikki.

    Hi,
    Just use the internal table to print the data in main window.
    for first line which has not batchspitted(main line item) put condition as POSNR NE INITIAL.
    and for batch split items, you already made posnr as '0000',
    so put condition as POSNR eq INITIAL.
    I think this will solve your problem.
    Regards,
    S Raju.

Maybe you are looking for

  • How do I get the directory to recognize my external hard drve...it used to

    I have my Itunes library on an external hard drive. I would go to Edit, Preferences, Advanced, Browse, My Computer, find the hard drive, and it would appear as F:\My Music\Itunes and it worked great. Now I have a new PC and it only shows F:\My Music

  • Delta record not getting created

    Hello Experts - I'm working with 0mat_plant_attr datasource. In ECC, I made changes to some materials in MM02. I changed the values of MRP Type and Rounding Value in MRP1 tab. The data is saved correctly but a delta record is not getting created. In

  • Minecraft expand window!

    When I expand minecraft window, my computer shut down with a kernel error! I try to update Java but it didn't work! Same problem with my second screen... the only way to "expand" the window is to play in fullscreen (F11). Thanks if you can help me!

  • How can you mute the vocal from a stereo music on garageband 10.0.2

    I need to know ASAP please

  • FR Reports Backup in v9.3.1

    Hi All, How we can take backup of the FR Reports automatically instead of manually exporting The Reports through Worspace and then Importing the Report to restore. Thanks, PVR