" HOW TO WRITE FORM ROUTINES"

Hi all ,
I have a Query ..  I have Developed a Smart form ( Delivery Challan ) .. My Functional Consultant asked me , If he Execute the T-code ( VL02N ). He should get the Print Preview of the Layout ...
I know it can be done through Form routines ..
Can one Explain me how to write the form routines ...

Hi ,
Copy the print program to custom program . Remove the routine " entry " . Write a selction screen with document number . put the read number to nast-OBJKY , V2 to NAST-KAPPL , sy-langu to nast-SPRAS in start of selection .Copy paste the code under the Entry routine .
hope it helps ...

Similar Messages

  • How to write conversion routine for key figure?

    Our customer has this requirment:
    we need to know the last time of some TV program in BEx report, If a TV program last 500 seconds, we need show the key figure like this:  00:08:20, If a TV program last 100000 seconds, we need show the key figure like 27:46:40 (27 hours and 46 minitues and 27 seconds), If we define a key figure as time,  BW system will report a error that say it is not acceptable time.  If we want to define a integer, but we need display it like hhmmss format.  We know we can write conversion routine for char.  but I don't how to write conversion routine for key figure.   Please give me any hint if any other solutions?
    Edited by: SY DONG on Dec 2, 2010 3:36 AM

    If you want to do in Transformation Layer :
    You can use routine ...break up the seconds into minute hour and seconds
    you will have to handle few cases in this:
    let say your variable lv_seconds holds the number of seconds you want to convert to hour min and seconds
    DATA: lv_seconds type i,
               lv_hrs  type  i,
              lv_sec type i,
              lv_min type i.
    lv_hrs = lv_seconds / 3600
    if lv_hrs >= 1.
    lv_min = (lv_hrs - trunc(lv_hrs))*60
    here again handle seconds if min >60.
    else.
    lv_hrs = '00'.
    lv_min = lv_hrs*60
    It is just hint ..how you can manipulate the seconds to get it...you will have to think about the complete algorithm
    Regards,
    RK

  • How to write Form - Endform in between Function - Endfunction

    Hi Experts,
    I need to write some code in between form & endform in an Include(User-exit)
    This form ---endform doesnot have perform [ Perform is inside a standard Code ] . I tried using Generate pool subroutine. It is also not helping.
    The call for this perform is inside Standard Code.Pls tell how to write Form-Endform between Function -
    Endfunction.
    thanks
    surbhi

    No no no. You're committing after each row! soany
    other session running the same query will see the
    changes you're making. Your session will equallysee
    changes caused by running this query in those
    sessions.Other session, yes, but current session will only see
    the changes once it has completed the current
    statement. Otherwise my "rn" column would not have
    gone up sequentially in the above example. it would
    have gone
    1st row rn = 1 (all rows get updated by 1:-
    2,3,4,5,6,7,8,9,10,11)
    2nd row rn = 3 (all rows get update by 1:-
    3,4,5,6,7,8,9,10,11,12)
    3rd row rn = 5 (all rows get update by 1:-
    4,5,6,7,8,9,10,11,12,13)
    4th row rn = 7 (all rows get update by 1:-
    5,6,7,8,9,10,11,12,13,14)
    5th row rn = 9 (all rows get update by 1:-
    6,7,8,9,10,11,12,13,14,15)
    6th row rn = 11 (all rows get update by 1:-
    7,8,9,10,11,12,13,14,15,16)
    7th row rn = 13 (all rows get update by 1:-
    8,9,10,11,12,13,14,15,16,17)
    8th row rn = 15 (all rows get update by 1:-
    9,10,11,12,13,14,15,16,17,18)
    9th row rn = 17 (all rows get update by 1:-
    10,11,12,13,14,15,16,17,18,19)
    10th row rn = 19 (all rows get update by 1:-
    11,12,13,14,15,16,17,18,19,20)
    So the fact the commit happens each time the rows get
    updated, isn't effecting the currently running select
    statement.
    No, actually you DO see the other session changes. This is because it is AUTONOMOUS transaction, and this a function.
    Test by adding:
    create or replace function incvals return number as
    pragma autonomous_transaction;
    v_val number;
    begin
    update t set rn = rn + 1;
    select max(rn) into v_val from t;
    dbms_lock.sleep(1); --add this line
    commit;
    return v_val;
    end;
    And test in two sessions.
    You will NOT get sequential ascending.
    >
    Think about the effect of two parallel sessionsboth
    running this query at the same time, and ask isthis
    sensible?Gawd, no, of course not. Like I said, I'd never use
    this sort of thing myself. I'm just wondering what
    on earth the OP is trying to achieve.
    :)Glad to hear it.

  • How to Write an Routine in APD to make Records blank i.e. 'X'

    Hai,
    I have created an APD in BW 3.5, I need to write a routine to update records which are having 'X' in R/3 Side. So how to write routine in Transformations? Please help me ASAP.
    Thanks,
    Ramesh

    Hi Ramesh,
    if you are familiar with ABAP, just drag and drop a routine transformation into your analysis process, connect it with the source node, double-click it and see the ABAP template. You just need to set the field of the target field accordingly.
    Cheers,
    Thomas

  • MASS - How to user Form Routines in ProdSystem

    Hi experts,
    before we have done the upgrade from ECC 600 to ECC 605,
    it was possible to enter abap form routines in transaction MASS also in productive system.
    But now, this is function is locked. Therefore I found the note 1495539, which says, that we can't create form routines in productive systems.
    But how can I use form routines now in productive systems?
    Do I have to transport them? If yes
    Thx in advance

    Problem should be solved.
    You can use TA MSTRVAR for transport of variants.

  • Can any one Tell me how i write std routine if i dont authorization in VOFM

    Dear Guru ,
    I Have Encountered An Technical Issue while writing routine RV61A943 and RV64A978.
    Using access key I have unlocked above two routine to write Pricing Procedure's Requirement (in RV61A943)  and Formula for Condition Value (in RV64A978) in se38 .
    But when i am trying to make some changes in routine RV61A943 or in routine RV64A978 using  SE38  I am not able to write any code within it.
    So Sir I want to know in which way i have to write the routine -- Using VOFM or  can write using SE38 itself.
    (Initially I tried using VOFM to write the routine in development server  But I found doesnot have authorization of VOFM in development server)
    Can any one tell me the full technical procedure to writing the routine..
    Pls help.
    Thanks & Regards
    Saifur Rahaman

    Hi,
    You need to ask for authorization of VOFM then only u can make changes to routined.
    Reward if useful.
    Regards
    Susheel

  • How to write a routine in infopack to restrict a date range !!!!

    Hi
    I want to load the data for a speicific date range ,i.e , i want to load the data between created on some date range which is not in between the same range for changed on...so i want to restrict that date range for changed on....Please le tme know the routine logic to restrict a date range....
    regards...

    How to ... Write Infopackage selection Routine
    1.Create an Infopackage 2. Go to selections tab and choose Type: 6 u2013 ABAP Routine.You can see following available options(F4 Help).
    3. Give disruption, and hit enter, now you will move to following screen. 4. Write Code between begin of Routine and End of Routine.
    5. See below sample code to select date range from Previous 6 days to Current date.
    6. L_T_Range table is of Type structure RSSDLRANGE.
    a. RSSDLRANGE contains SIGN, OPTION, LOW, HIGH
    We need to populate these fields to pass range dynamically.
    Sample Code:
    ***$$ begin of routine - insert your code only below this line -
    Data: l_idx like sy-tabix.
    Data: date_low like sy-datum.
    Date_low = sy-datum u2013 6.u201D(To get 6 days back).
    read table l_t_range with key
    fieldname = 'CRDAT'.
    l_idx = sy-tabix.
    Pass Range values to L_T_Range Table.
    Move date_low to L_T_Range -Low.
    Move sy-datum to L_T_Range -High.
    L_T_Range -Sign = u2018Iu2019. *****(Here: I u2013 Include, E u2013 Exclude)
    L_T_Range -Option = u2018BTu2019.****( Here: BT u2013 Between )
    modify l_t_range index l_idx.
    p_subrc = 0.
    **$$ end of routine - insert your code only before this line -
    7. Syntax check and Save.
    Hope it Helps
    Srini

  • Form routines in smartforms

    how to use form routines in smartforms??..there is a option for using it in the global definition..plz explain the proper sequence of using it

    Hi Arun,
    In Form routines tab you enter routines that you want to use in the form via the program lines node. Within these form routines you cannot access any global data unless you explicitly pass them to the form routine interface.
    i hope this will be helpfull to u,
    Regards,
    swapnil

  • How to delete a Form Routine in Table Maintenance?

    Hello,
    Very Good Morning!
    How to delete a Form Routine in Table Maintenance?
    I had created a Form Routine at Environment>Modifcation>Events.
    I want to delete a Form Routine that I had created. Can any one please explain me the way I can delete it.
    Any suggestions are appreciated!
    Thanks & Regards
    Kittu

    Hello Rudra,
    Very Good morning!
    I am in Environment>Modification>Events.
    Here is had created a form routine ie...
    01   From_entry    Editor Icon
    In Editor Icon we will write the code.
    This will create a Include in the Function group.
    I had already comented that Include from the Function group. I can even delete it. But, I want to delete the Form Routine that I had created....
    01   From_entry    Editor Icon
    Can any one hepl me please...
    Thanks & Regards,
    Kittu

  • HOw to write/Develop this Start & Field Routine

    Hi Experts,
    As i am new(Learner) to BW Please advise me on how can i achieve this and update me with Releavent Start Routine and Field Routine....please
    My Requirment is
    Employee is Compounded on Location.
    On Weekly or Monthly basis (dependending on Employee Payroll run)  Employee will be assigned with the Wage Type and Amount for that Wage Type and Payroll Date (When the payroll was run)
    Data Currently i have/Data comming from Source System
    Loc_ID--Emp_IDWage_IDPayroll_Date-Amount
    -1--99900108.08.2008-----100.00
    -1--99908808.08.2008-----560.00
    -1--99934508.08.2008-----437.00
    -1--99900108.07.2008-----654.00
    -1--99908808.07.2008-----389.00
    -1--99934508.07.2008-----893.00
    -1--99926408.06.2008-----600.00
    -1--99934508.08.2008-----365.00
    (Employee may have Different Wage_ID and Amount for each payroll)
    My requirment is to include a new key figure 'Previous_Amount' which will be populated previous Wage_ID Amount.
    Loc_ID--Emp_IDWage_IDPayroll_Date-Amount---Previous_Amount
    -1--99900108.08.2008---100.00-----654.00
    -1--99908808.08.2008---560.00--
    389.00
    -1--99934508.08.2008---437.00--
    893.00
    -1--99900108.07.2008---654.00--
    0
    -1--99908808.07.2008---389.00--
    0
    -1--99934508.07.2008---893.00--
    365.00
    -1--99926408.06.2008-----600.00
    -1--99934508.08.2008-----365.00
    As i am a starter in BW i am struggling to write start routine in transformations (DSO-->CUBE) to transfer the data in DSO Active Table to a internal table and a field routine to update Previous_Amount field by sorting the internal table data and to pick employee's latest record less than the current payroll  for that particular wage_id and populate that amout to Previous_Amount field.
    Please make necessary corrections to the start routine by fixing where i went wrong and update me with the required field routine (which will read data from internal table used in start routine.
    Start Routine
    Data: ITAB_DSOP type table of /BIC/AZDFREW200,
          WA_DSOP type /BIC/AZDFREX200.
    Data: WA_PACKAGE like line of SOURCE_PACKAGE.
    Data: L_TABIX type SY-TABIX.
    If not SOURCE_PACKAGE[] is initial.
    Sort SOURCE_PACKAGE by
    /BIC/ZLOC                          ascending
    /BIC/ZEMP_ID                      ascending
    /BIC/ZPAY_DATE                     ascending
    /BIC/ZWGE_ID                       ascending.
    clear ITAB_DSOP[].
    Select  from /BIC/AZDFREW200 into table ITAB_DSOP
    for all entries in SOURCE_PACKAGE
        Where  /BIC/ZLOC      = SOURCE_PACKAGE-/BIC/ZLOC.
               /BIC/ZEMP_ID  = SOURCE_PACKAGE-/BIC/ZEMP_ID.
               /BIC/ZWGE_ID   = SOURCE_PACKAGE-/BIC/ZWGE_ID.
               /BIC/ZPAY_DATE < SOURCE_PACKAGE-/BIC/ZPAY_DATE.
    If sy-subrc = 0.
    Sort ITAB_DSOP by
    /BIC/ZLOC                          ascending
    /BIC/ZEMP_ID                      ascending
    /BIC/ZPAY_DATE                     descending
    /BIC/ZWGE_ID                       ascending.
    if sy-subrc = 0.
    loop at SOURCE_PACKAGE into wa_package.
    l_tabix = sy-tabix.
    read table ITAB_DSOP into wa_DSOP with key
    /BIC/ZLOC = wa_package-/BIC/ZLOC
    /BIC/ZEMP_ID = wa_package-/BIC/ZEMP_ID
    /BIC/ZWGE_ID  = wa_package-/BIC/ZWGE_ID
    binary search.
    if sy-subrc = 0.
    Please update me with Start Routine and Field Routine required  to achieve my requirment
    Thanks in advance

    hii
        I created small example as ur case, for that I will explain my logic which i used and i will give the code make the necessary mofications and use in ur case
    1) First bring all the input that exist in source_package into a temporary table which we create as that of the output structue.
    2) Sort both input i.e source_package and temporary table by wage id and date ascending
    3) Next compare both of them and get the value of previous price into the temporary table from the source_package..
    4)write a routine at the field level to populate the previous_price by mappign both wage id and payroll date
    5) Between 3 step and 4 step i used one more temporary table to get the values of previous price 0
    GLOBAl PART
      types : begin of itabtype,
               job_no type /bic/oirt_jobno,
               wage_id type /bic/oirt_wgid1,
               date type  /bic/oizfrm_dt,
               prc  type  /bic/oirt_prc,
               previous_price type /bic/oirt_prc1,
            end of itabtype.
    data : itab type standard table of itabtype
                           with key wage_id date,
                wa_itab like line of itab.
    data : itab1 type standard table of itabtype
                           with key wage_id date,
                wa_itab1 like line of itab1.
    \* Create an internal table with all the field types with u want to have in the output */
    LOCAL PART
      data : wa_SOURCE_PACKAGE type tys_SC_1.
      data : tmp(2) type n value 1.
       loop at SOURCE_PACKAGE into wa_SOURCE_PACKAGE.
             move wa_SOURCE_PACKAGE-/bic/rt_jobno to wa_itab-job_no.
             move wa_SOURCE_PACKAGE-/bic/rt_wgid1 to wa_itab-wage_id.
             move wa_SOURCE_PACKAGE-/bic/zfrm_dt to wa_itab-date.
             move wa_SOURCE_PACKAGE-/bic/rt_prc to wa_itab-prc.
             append wa_itab to itab.
        endloop.
      \* The above loop is to get all the values into the internal table*/
        sort itab by wage_id ascending date descending.
        sort SOURCE_PACKAGE by /bic/rt_wgid1 ascending /bic/zfrm_dt
        descending.
        loop at itab into wa_itab.
                tmp = '1' .
                 loop at SOURCE_PACKAGE into wa_SOURCE_PACKAGE from tmp.
                      if  wa_itab-date gt  wa_SOURCE_PACKAGE-/bic/zfrm_dt
                      and  wa_itab-wage_id = wa_SOURCE_PACKAGE-/bic/rt_wgid1
                          wa_itab-previous_price =
                          wa_SOURCE_PACKAGE-/bic/rt_prc.
                          tmp = tmp + 1.
                          exit.
                       endif.
                   endloop.
         modify  itab from wa_itab.
        endloop.
        itab1[] = itab[].
        sort  itab1 by wage_id ascending date ascending.
        delete adjacent duplicates from itab1 comparing wage_id.
        loop at itab1 into wa_itab1.
           wa_itab-previous_price = '0'.
           modify itab1 from wa_itab1.
        endloop.
        loop at itab into wa_itab.
              loop at itab1 into wa_itab1.
                     if wa_itab1-date = wa_itab-date and wa_itab1-wage_id = wa_itab-wage_id.
                             wa_itab-previous_price = wa_itab1-previous_price.
                             exit.
                      endif.
                endloop.
           modify itab from wa_itab.
          endloop.
    This looks big but logic is small....
    get back to me if any queries u have
    regards
    vamsi

  • How to write a start routine in the trasnformations ?

    Hi Experts,
    I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
    *DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
    So Let me know if anyone can help me how to write the ABAP code in the start routine.
    Thanks
    sekhar

    Hi,
                Yopu can write the below lines of code adn try
        SORT source_package BY Receive nr  Type ASCENDING.
        DELETE ADJACENT DUPLICATES FROM source_package COMPARING Receive nr  Type.
    But you should make sure which record of the either rows need to deleted
    i.e in
    F9001;LU;J001;662;
    F9001;LU;J002;662
    You need to decide to eliminate 1st or 2nd one.(depends on your requirement)

  • How to write the start routine in the transformations ?

    Hi Experts,
    I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
    *DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
    So Let me know if anyone can help me how to write the ABAP code in the start routine.
    Thanks
    sekhar

    Hi Experts,
    I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
    *DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
    So Let me know if anyone can help me how to write the ABAP code in the start routine.
    Thanks
    sekhar

  • How to write source code in smart forms?

    hi friends,
    can anyone can help me in writing  sorcecode in smartforms r
    any materail link.
    if it is helpful points can b rewarded.Thanks in advance.

    Hi,
    Check this link for
    how to write source code in smart forms?
    http://****************/Tutorials/Smartforms/GettingStarted/SimpleText.htm
    You can write Source Code in smartforms By Choosing Program Lines.
    Check this link with Screen Shots
    http://****************/Tutorials/Smartforms/PO/page1.htm
    Reward All Helpfull Answers
    Regards
    Fareedas
    Edited by: Fareeda Tabassum S on May 21, 2008 3:09 PM

  • How to write an inverse routine for an info object at field level.

    Hi All,
    Our requirement is as follows:
    Need to populate 0MAT_PLANT in a virtual provider. But during query performance it is like -
    If someone were to add a filter to the BW query on 0MAT_PLANT, it would take the system awhile to search the APO database for that 18 CHAR material number because the data in APO is stored differently (40 CHARs).  The point of the  inverse routine is to convert the 18 CHAR to be 40 CHAR for those times when someone selects on 0MAT_PLANT.  That way, the field types match and finding the data in APO is much quicker.
    Hence if we need selection on the selection scree of the query for 0MAT_PLANT, we are trying for inverse routine which will convert 18 chars to 40 chars in the query level and the performance will be quicker.
    See, 0MAT_PLANT is of 18 Char length. We are mapping it from ZMATNR in source which is of 40 chars. Thus initially in the field routine we will write a code to convert 0MAT_PLANT to 18 from 40.
    Below is the code and the place we now we also need to write inverse routine to convert it to 40 from 18 chars.
    *****Code to convert from 40 chars to 18******
    *In APO if the material contains all integers values the material will
    * come over as a 40 byte field.  It needs to be shortened.
      IF SOURCE_FIELDS-/BIC/ZMATNR CO '0123456789'.
        short_material = SOURCE_FIELDS-/BIC/ZMATNR+22(18).
    *In APO if the material contains any character fields the material will
    * not be zero filled and will be left alligned. Take the 1st 18 bytes.
      ELSE.
        short_material = SOURCE_FIELDS-/BIC/ZMATNR(18).
      ENDIF.
    *add leading zeros to numeric only value
      IF short_material CO '0123456789 '.
         w_num18 = short_material.
         short_material = w_num18.
      ENDIF.
      RESULT = short_material.
    *$*$ end of routine -
    ***********here the iverse routine need to write************
    *       Method invert_0MATERIAL
    *       This subroutine needs to be implemented only for direct access
    *       (for better performance) and for the Report/Report Interface
    *       (drill through).
    *       The inverse routine should transform a projection and
    *       a selection for the target to a projection and a selection
    *       for the source, respectively.
    *       If the implementation remains empty all fields are filled and
    *       all values are selected.
      METHOD invert_0MATERIAL.
    *$*$ begin of inverse routine - insert your code only below this line*-*... "insert your code here
    Here you would write logic in 0MAT_PLANT to do the opposite of the above,
    convert 18 back to 40 characters.
    *$*$ end of inverse routine - insert your code only before this line *-*
      The articulated form above in RED says that the subroutine i.e. the inverse routine is implemented for direct access and report to report interface.
    Could anybody please help me or let me know any idea related to this.

    Hi All,
    Our requirement is as follows:
    Need to populate 0MAT_PLANT in a virtual provider. But during query performance it is like -
    If someone were to add a filter to the BW query on 0MAT_PLANT, it would take the system awhile to search the APO database for that 18 CHAR material number because the data in APO is stored differently (40 CHARs).  The point of the  inverse routine is to convert the 18 CHAR to be 40 CHAR for those times when someone selects on 0MAT_PLANT.  That way, the field types match and finding the data in APO is much quicker.
    Hence if we need selection on the selection scree of the query for 0MAT_PLANT, we are trying for inverse routine which will convert 18 chars to 40 chars in the query level and the performance will be quicker.
    See, 0MAT_PLANT is of 18 Char length. We are mapping it from ZMATNR in source which is of 40 chars. Thus initially in the field routine we will write a code to convert 0MAT_PLANT to 18 from 40.
    Below is the code and the place we now we also need to write inverse routine to convert it to 40 from 18 chars.
    *****Code to convert from 40 chars to 18******
    *In APO if the material contains all integers values the material will
    * come over as a 40 byte field.  It needs to be shortened.
      IF SOURCE_FIELDS-/BIC/ZMATNR CO '0123456789'.
        short_material = SOURCE_FIELDS-/BIC/ZMATNR+22(18).
    *In APO if the material contains any character fields the material will
    * not be zero filled and will be left alligned. Take the 1st 18 bytes.
      ELSE.
        short_material = SOURCE_FIELDS-/BIC/ZMATNR(18).
      ENDIF.
    *add leading zeros to numeric only value
      IF short_material CO '0123456789 '.
         w_num18 = short_material.
         short_material = w_num18.
      ENDIF.
      RESULT = short_material.
    *$*$ end of routine -
    ***********here the iverse routine need to write************
    *       Method invert_0MATERIAL
    *       This subroutine needs to be implemented only for direct access
    *       (for better performance) and for the Report/Report Interface
    *       (drill through).
    *       The inverse routine should transform a projection and
    *       a selection for the target to a projection and a selection
    *       for the source, respectively.
    *       If the implementation remains empty all fields are filled and
    *       all values are selected.
      METHOD invert_0MATERIAL.
    *$*$ begin of inverse routine - insert your code only below this line*-*... "insert your code here
    Here you would write logic in 0MAT_PLANT to do the opposite of the above,
    convert 18 back to 40 characters.
    *$*$ end of inverse routine - insert your code only before this line *-*
      The articulated form above in RED says that the subroutine i.e. the inverse routine is implemented for direct access and report to report interface.
    Could anybody please help me or let me know any idea related to this.

  • Info package Routine - How to write

    Hi ,
    Can any body give me the step step by process on how to write Info package routine. Actually my requirement is to load the current month Data automatically through infopackge . I can write the ABAP code , but i am told to write in Infopackage level.
    Thanks in advance..

    Hi,
    In our case we had a requirement to load the data for the transactions occuring in the last 15 days only, so we have write the routine on the last modified date feild  in the infopackage.so as to select only records modified or created in the last 15 days..
    attached is the sample code....
    data: l_idx like sy-tabix.
      read table l_t_range with key
           fieldname = 'LAST_MODIFIED_DA'.
      l_idx = sy-tabix.
      data : w_cdate type d .
      l_idx = sy-tabix.
      w_cdate = sy-datum.
      w_cdate = w_cdate - 15 .
      L_t_RANGE-LOW  = w_cdate .
      L_t_RANGE-HIGH = sy-datum .
      L_t_RANGE-SIGN = 'I'.
      L_t_RANGE-OPTION = 'BT'.
      append l_t_range.
      modify l_t_range index l_idx.
      p_subrc = 0.
    Hope it helps...
    Regards,
    Umesh.

Maybe you are looking for